| 1 | unit RPCSharedBrokerSessionMgr1_TLB;
 | 
|---|
| 2 | 
 | 
|---|
| 3 | // ************************************************************************ //
 | 
|---|
| 4 | // WARNING                                                                    
 | 
|---|
| 5 | // -------                                                                    
 | 
|---|
| 6 | // The types declared in this file were generated from data read from a       
 | 
|---|
| 7 | // Type Library. If this type library is explicitly or indirectly (via        
 | 
|---|
| 8 | // another type library referring to this type library) re-imported, or the   
 | 
|---|
| 9 | // 'Refresh' command of the Type Library Editor activated while editing the   
 | 
|---|
| 10 | // Type Library, the contents of this file will be regenerated and all        
 | 
|---|
| 11 | // manual modifications will be lost.                                         
 | 
|---|
| 12 | // ************************************************************************ //
 | 
|---|
| 13 | 
 | 
|---|
| 14 | // PASTLWTR : $Revision:   1.88.1.0.1.0  $
 | 
|---|
| 15 | // File generated on 1/25/2002 11:58:49 AM from Type Library described below.
 | 
|---|
| 16 | 
 | 
|---|
| 17 | // *************************************************************************//
 | 
|---|
| 18 | // NOTE:                                                                      
 | 
|---|
| 19 | // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  
 | 
|---|
| 20 | // which return objects that may need to be explicitly created via a function 
 | 
|---|
| 21 | // call prior to any access via the property. These items have been disabled  
 | 
|---|
| 22 | // in order to prevent accidental use from within the object inspector. You   
 | 
|---|
| 23 | // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively   
 | 
|---|
| 24 | // removing them from the $IFDEF blocks. However, such items must still be    
 | 
|---|
| 25 | // programmatically created via a method of the appropriate CoClass before    
 | 
|---|
| 26 | // they can be used.                                                          
 | 
|---|
| 27 | // ************************************************************************ //
 | 
|---|
| 28 | // Type Lib: D:\Development\RPCSharedBroker\Exe1\RPCSharedBrokerSessionMgr1.exe (1)
 | 
|---|
| 29 | // IID\LCID: {1F7D1EB0-E54F-46F0-B485-2D56743EBB70}\0
 | 
|---|
| 30 | // Helpfile: 
 | 
|---|
| 31 | // DepndLst: 
 | 
|---|
| 32 | //   (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
 | 
|---|
| 33 | //   (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
 | 
|---|
| 34 | // Errors:
 | 
|---|
| 35 | //   Error creating palette bitmap of (TSharedBroker) : Invalid GUID format
 | 
|---|
| 36 | // ************************************************************************ //
 | 
|---|
| 37 | {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
 | 
|---|
| 38 | interface
 | 
|---|
| 39 | 
 | 
|---|
| 40 | uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
 | 
|---|
| 41 | 
 | 
|---|
| 42 | // *********************************************************************//
 | 
|---|
| 43 | // GUIDS declared in the TypeLibrary. Following prefixes are used:        
 | 
|---|
| 44 | //   Type Libraries     : LIBID_xxxx                                      
 | 
|---|
| 45 | //   CoClasses          : CLASS_xxxx                                      
 | 
|---|
| 46 | //   DISPInterfaces     : DIID_xxxx                                       
 | 
|---|
| 47 | //   Non-DISP interfaces: IID_xxxx                                        
 | 
|---|
| 48 | // *********************************************************************//
 | 
|---|
| 49 | const
 | 
|---|
| 50 |   // TypeLibrary Major and minor versions
 | 
|---|
| 51 |   RPCSharedBrokerSessionMgr1MajorVersion = 1;
 | 
|---|
| 52 |   RPCSharedBrokerSessionMgr1MinorVersion = 0;
 | 
|---|
| 53 | 
 | 
|---|
| 54 |   LIBID_RPCSharedBrokerSessionMgr1: TGUID = '{1F7D1EB0-E54F-46F0-B485-2D56743EBB70}';
 | 
|---|
| 55 | 
 | 
|---|
| 56 |   IID_ISharedBroker: TGUID = '{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}';
 | 
|---|
| 57 |   DIID_ISharedBrokerEvents: TGUID = '{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}';
 | 
|---|
| 58 |   CLASS_SharedBroker: TGUID = '{EB44A5CD-1871-429F-A5BC-19C71B722182}';
 | 
|---|
| 59 | 
 | 
|---|
| 60 | // *********************************************************************//
 | 
|---|
| 61 | // Declaration of Enumerations defined in Type Library                    
 | 
|---|
| 62 | // *********************************************************************//
 | 
|---|
| 63 | // Constants for enum ISharedBrokerErrorCode
 | 
|---|
| 64 | type
 | 
|---|
| 65 |   ISharedBrokerErrorCode = TOleEnum;
 | 
|---|
| 66 | const
 | 
|---|
| 67 |   GeneralFailure = $00000000;
 | 
|---|
| 68 |   Success = $00000001;
 | 
|---|
| 69 |   UniqueRpcIdDoesNotExist = $00000002;
 | 
|---|
| 70 |   UniqueClientIdDoesNotExist = $00000003;
 | 
|---|
| 71 |   RpcHistoryIndexOutOfRange = $00000004;
 | 
|---|
| 72 |   RpcHistoryNotEnabled = $00000005;
 | 
|---|
| 73 |   CouldNotSetContext = $00000006;
 | 
|---|
| 74 |   CouldNotConnect = $00000007;
 | 
|---|
| 75 |   ClientIndexOutOfRange = $00000008;
 | 
|---|
| 76 |   NilClientPointer = $00000009;
 | 
|---|
| 77 |   ConnectionIndexOutOfRange = $0000000A;
 | 
|---|
| 78 | 
 | 
|---|
| 79 | // Constants for enum IRegistryRootEnum
 | 
|---|
| 80 | type
 | 
|---|
| 81 |   IRegistryRootEnum = TOleEnum;
 | 
|---|
| 82 | const
 | 
|---|
| 83 |   HKCR = $00000000;
 | 
|---|
| 84 |   HKCU = $00000001;
 | 
|---|
| 85 |   HKLM = $00000002;
 | 
|---|
| 86 |   HKU = $00000003;
 | 
|---|
| 87 |   HKCC = $00000004;
 | 
|---|
| 88 |   HKDD = $00000005;
 | 
|---|
| 89 | 
 | 
|---|
| 90 | // Constants for enum ISharedBrokerConnection
 | 
|---|
| 91 | type
 | 
|---|
| 92 |   ISharedBrokerConnection = TOleEnum;
 | 
|---|
| 93 | const
 | 
|---|
| 94 |   Failed = $00000000;
 | 
|---|
| 95 |   New = $00000001;
 | 
|---|
| 96 |   Shared = $00000002;
 | 
|---|
| 97 |   Debug = $00000003;
 | 
|---|
| 98 | 
 | 
|---|
| 99 | // Constants for enum ISharedBrokerClient
 | 
|---|
| 100 | type
 | 
|---|
| 101 |   ISharedBrokerClient = TOleEnum;
 | 
|---|
| 102 | const
 | 
|---|
| 103 |   BrokerClient = $00000000;
 | 
|---|
| 104 |   DebuggerClient = $00000001;
 | 
|---|
| 105 | 
 | 
|---|
| 106 | // Constants for enum ISharedBrokerShowErrorMsgs
 | 
|---|
| 107 | type
 | 
|---|
| 108 |   ISharedBrokerShowErrorMsgs = TOleEnum;
 | 
|---|
| 109 | const
 | 
|---|
| 110 |   isemRaise = $00000000;
 | 
|---|
| 111 |   isemQuiet = $00000001;
 | 
|---|
| 112 | 
 | 
|---|
| 113 | type
 | 
|---|
| 114 | 
 | 
|---|
| 115 | // *********************************************************************//
 | 
|---|
| 116 | // Forward declaration of types defined in TypeLibrary                    
 | 
|---|
| 117 | // *********************************************************************//
 | 
|---|
| 118 |   ISharedBroker = interface;
 | 
|---|
| 119 |   ISharedBrokerDisp = dispinterface;
 | 
|---|
| 120 |   ISharedBrokerEvents = dispinterface;
 | 
|---|
| 121 | 
 | 
|---|
| 122 | // *********************************************************************//
 | 
|---|
| 123 | // Declaration of CoClasses defined in Type Library                       
 | 
|---|
| 124 | // (NOTE: Here we map each CoClass to its Default Interface)              
 | 
|---|
| 125 | // *********************************************************************//
 | 
|---|
| 126 |   SharedBroker = ISharedBroker;
 | 
|---|
| 127 | 
 | 
|---|
| 128 | 
 | 
|---|
| 129 | // *********************************************************************//
 | 
|---|
| 130 | // Interface: ISharedBroker
 | 
|---|
| 131 | // Flags:     (4416) Dual OleAutomation Dispatchable
 | 
|---|
| 132 | // GUID:      {E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}
 | 
|---|
| 133 | // *********************************************************************//
 | 
|---|
| 134 |   ISharedBroker = interface(IDispatch)
 | 
|---|
| 135 |     ['{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}']
 | 
|---|
| 136 |     function  BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient; 
 | 
|---|
| 137 |                             const ServerPort: WideString; WantDebug: WordBool; 
 | 
|---|
| 138 |                             AllowShared: WordBool; KernelLogin: WordBool; 
 | 
|---|
| 139 |                             ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT; 
 | 
|---|
| 140 |                             var LoginStr: WideString; out UniqueClientIId: SYSINT; 
 | 
|---|
| 141 |                             out ErrorMsg: WideString): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 142 |     function  BrokerDisconnect: ISharedBrokerErrorCode; safecall;
 | 
|---|
| 143 |     function  BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 144 |     function  BrokerCall(const RpcName: WideString; const RpcParams: WideString; 
 | 
|---|
| 145 |                          RpcTimeLimit: Integer; out RpcResults: WideString; 
 | 
|---|
| 146 |                          out UniqueRpcCallId: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 147 |     function  ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString; 
 | 
|---|
| 148 |                                  const Name: WideString; const Default: WideString; 
 | 
|---|
| 149 |                                  out RegResult: WideString): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 150 |     function  Get_RpcVersion: WideString; safecall;
 | 
|---|
| 151 |     procedure Set_RpcVersion(const version: WideString); safecall;
 | 
|---|
| 152 |     function  Get_RpcHistoryEnabled: WordBool; safecall;
 | 
|---|
| 153 |     procedure Set_RpcHistoryEnabled(enabled: WordBool); safecall;
 | 
|---|
| 154 |     function  Get_PerClientRpcHistoryLimit: Integer; safecall;
 | 
|---|
| 155 |     procedure Set_PerClientRpcHistoryLimit(limit: Integer); safecall;
 | 
|---|
| 156 |     function  GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 157 |     function  GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 158 |                                           out ClientName: WideString): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 159 |     function  LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 160 |     function  GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 161 |     function  GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 162 |     function  GetActiveBrokerConnectionInfo(connectionIndex: Integer; 
 | 
|---|
| 163 |                                             out connectedServerIp: WideString; 
 | 
|---|
| 164 |                                             out connectedServerPort: Integer; 
 | 
|---|
| 165 |                                             out lastContext: WideString): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 166 |     function  GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer; 
 | 
|---|
| 167 |                                                                out connectionIndex: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 168 |     function  GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 169 |                                     out brokerContext: WideString; out RpcName: WideString; 
 | 
|---|
| 170 |                                     out RpcParams: WideString; out rpcResult: WideString; 
 | 
|---|
| 171 |                                     out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 172 |     function  GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer; 
 | 
|---|
| 173 |                                          out uniqueRpcId: Integer; out brokerContext: WideString; 
 | 
|---|
| 174 |                                          out RpcName: WideString; out RpcParams: WideString; 
 | 
|---|
| 175 |                                          out rpcResult: WideString; out rpcStartDateTime: Double; 
 | 
|---|
| 176 |                                          out rpcDuration: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 177 |     function  GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 178 |                                         out ClientName: WideString): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 179 |     function  GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode; safecall;
 | 
|---|
| 180 |     function  Get_CurrentContext: WideString; safecall;
 | 
|---|
| 181 |     function  Get_User: WideString; safecall;
 | 
|---|
| 182 |     function  Get_Login: WideString; safecall;
 | 
|---|
| 183 |     procedure Set_Login(const Value: WideString); safecall;
 | 
|---|
| 184 |     function  Get_RpcbError: WideString; safecall;
 | 
|---|
| 185 |     function  Get_Socket: Integer; safecall;
 | 
|---|
| 186 |     function  Get_KernelLogin: WordBool; safecall;
 | 
|---|
| 187 |     procedure Set_KernelLogin(Value: WordBool); safecall;
 | 
|---|
| 188 |     function  Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs; safecall;
 | 
|---|
| 189 |     procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs); safecall;
 | 
|---|
| 190 |     property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
 | 
|---|
| 191 |     property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
 | 
|---|
| 192 |     property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
 | 
|---|
| 193 |     property CurrentContext: WideString read Get_CurrentContext;
 | 
|---|
| 194 |     property User: WideString read Get_User;
 | 
|---|
| 195 |     property Login: WideString read Get_Login write Set_Login;
 | 
|---|
| 196 |     property RpcbError: WideString read Get_RpcbError;
 | 
|---|
| 197 |     property Socket: Integer read Get_Socket;
 | 
|---|
| 198 |     property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
 | 
|---|
| 199 |     property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
 | 
|---|
| 200 |   end;
 | 
|---|
| 201 | 
 | 
|---|
| 202 | // *********************************************************************//
 | 
|---|
| 203 | // DispIntf:  ISharedBrokerDisp
 | 
|---|
| 204 | // Flags:     (4416) Dual OleAutomation Dispatchable
 | 
|---|
| 205 | // GUID:      {E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}
 | 
|---|
| 206 | // *********************************************************************//
 | 
|---|
| 207 |   ISharedBrokerDisp = dispinterface
 | 
|---|
| 208 |     ['{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}']
 | 
|---|
| 209 |     function  BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient; 
 | 
|---|
| 210 |                             const ServerPort: WideString; WantDebug: WordBool; 
 | 
|---|
| 211 |                             AllowShared: WordBool; KernelLogin: WordBool; 
 | 
|---|
| 212 |                             ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT; 
 | 
|---|
| 213 |                             var LoginStr: WideString; out UniqueClientIId: SYSINT; 
 | 
|---|
| 214 |                             out ErrorMsg: WideString): ISharedBrokerErrorCode; dispid 1;
 | 
|---|
| 215 |     function  BrokerDisconnect: ISharedBrokerErrorCode; dispid 2;
 | 
|---|
| 216 |     function  BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode; dispid 3;
 | 
|---|
| 217 |     function  BrokerCall(const RpcName: WideString; const RpcParams: WideString; 
 | 
|---|
| 218 |                          RpcTimeLimit: Integer; out RpcResults: WideString; 
 | 
|---|
| 219 |                          out UniqueRpcCallId: Integer): ISharedBrokerErrorCode; dispid 4;
 | 
|---|
| 220 |     function  ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString; 
 | 
|---|
| 221 |                                  const Name: WideString; const Default: WideString; 
 | 
|---|
| 222 |                                  out RegResult: WideString): ISharedBrokerErrorCode; dispid 5;
 | 
|---|
| 223 |     property RpcVersion: WideString dispid 7;
 | 
|---|
| 224 |     property RpcHistoryEnabled: WordBool dispid 6;
 | 
|---|
| 225 |     property PerClientRpcHistoryLimit: Integer dispid 8;
 | 
|---|
| 226 |     function  GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode; dispid 10;
 | 
|---|
| 227 |     function  GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 228 |                                           out ClientName: WideString): ISharedBrokerErrorCode; dispid 11;
 | 
|---|
| 229 |     function  LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode; dispid 12;
 | 
|---|
| 230 |     function  GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode; dispid 13;
 | 
|---|
| 231 |     function  GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode; dispid 14;
 | 
|---|
| 232 |     function  GetActiveBrokerConnectionInfo(connectionIndex: Integer; 
 | 
|---|
| 233 |                                             out connectedServerIp: WideString; 
 | 
|---|
| 234 |                                             out connectedServerPort: Integer; 
 | 
|---|
| 235 |                                             out lastContext: WideString): ISharedBrokerErrorCode; dispid 15;
 | 
|---|
| 236 |     function  GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer; 
 | 
|---|
| 237 |                                                                out connectionIndex: Integer): ISharedBrokerErrorCode; dispid 16;
 | 
|---|
| 238 |     function  GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 239 |                                     out brokerContext: WideString; out RpcName: WideString; 
 | 
|---|
| 240 |                                     out RpcParams: WideString; out rpcResult: WideString; 
 | 
|---|
| 241 |                                     out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode; dispid 17;
 | 
|---|
| 242 |     function  GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer; 
 | 
|---|
| 243 |                                          out uniqueRpcId: Integer; out brokerContext: WideString; 
 | 
|---|
| 244 |                                          out RpcName: WideString; out RpcParams: WideString; 
 | 
|---|
| 245 |                                          out rpcResult: WideString; out rpcStartDateTime: Double; 
 | 
|---|
| 246 |                                          out rpcDuration: Integer): ISharedBrokerErrorCode; dispid 18;
 | 
|---|
| 247 |     function  GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 248 |                                         out ClientName: WideString): ISharedBrokerErrorCode; dispid 19;
 | 
|---|
| 249 |     function  GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode; dispid 20;
 | 
|---|
| 250 |     property CurrentContext: WideString readonly dispid 9;
 | 
|---|
| 251 |     property User: WideString readonly dispid 22;
 | 
|---|
| 252 |     property Login: WideString dispid 23;
 | 
|---|
| 253 |     property RpcbError: WideString readonly dispid 24;
 | 
|---|
| 254 |     property Socket: Integer readonly dispid 25;
 | 
|---|
| 255 |     property KernelLogin: WordBool dispid 26;
 | 
|---|
| 256 |     property ShowErrorMsgs: ISharedBrokerShowErrorMsgs dispid 27;
 | 
|---|
| 257 |   end;
 | 
|---|
| 258 | 
 | 
|---|
| 259 | // *********************************************************************//
 | 
|---|
| 260 | // DispIntf:  ISharedBrokerEvents
 | 
|---|
| 261 | // Flags:     (4096) Dispatchable
 | 
|---|
| 262 | // GUID:      {CBEA7167-4F9B-465A-B82E-4CEBDF933C35}
 | 
|---|
| 263 | // *********************************************************************//
 | 
|---|
| 264 |   ISharedBrokerEvents = dispinterface
 | 
|---|
| 265 |     ['{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}']
 | 
|---|
| 266 |     procedure OnLogout; dispid 1;
 | 
|---|
| 267 |     procedure OnRpcCallRecorded(uniqueRpcId: SYSINT); dispid 2;
 | 
|---|
| 268 |     procedure OnClientConnect(UniqueClientId: SYSINT; Connection: ISharedBrokerConnection); dispid 3;
 | 
|---|
| 269 |     procedure OnClientDisconnect(UniqueClientId: SYSINT); dispid 4;
 | 
|---|
| 270 |     procedure OnContextChanged(connectionIndex: SYSINT; const NewContext: WideString); dispid 5;
 | 
|---|
| 271 |     procedure OnRPCBFailure(const ErrorText: WideString); dispid 6;
 | 
|---|
| 272 |     procedure OnLoginError(const ErrorText: WideString); dispid 7;
 | 
|---|
| 273 |     procedure OnConnectionDropped(connectionIndex: SYSINT; const ErrorText: WideString); dispid 8;
 | 
|---|
| 274 |   end;
 | 
|---|
| 275 | 
 | 
|---|
| 276 | // *********************************************************************//
 | 
|---|
| 277 | // The Class CoSharedBroker provides a Create and CreateRemote method to          
 | 
|---|
| 278 | // create instances of the default interface ISharedBroker exposed by              
 | 
|---|
| 279 | // the CoClass SharedBroker. The functions are intended to be used by             
 | 
|---|
| 280 | // clients wishing to automate the CoClass objects exposed by the         
 | 
|---|
| 281 | // server of this typelibrary.                                            
 | 
|---|
| 282 | // *********************************************************************//
 | 
|---|
| 283 |   CoSharedBroker = class
 | 
|---|
| 284 |     class function Create: ISharedBroker;
 | 
|---|
| 285 |     class function CreateRemote(const MachineName: string): ISharedBroker;
 | 
|---|
| 286 |   end;
 | 
|---|
| 287 | 
 | 
|---|
| 288 |   TSharedBrokerOnRpcCallRecorded = procedure(Sender: TObject; uniqueRpcId: SYSINT) of object;
 | 
|---|
| 289 |   TSharedBrokerOnClientConnect = procedure(Sender: TObject; UniqueClientId: SYSINT; 
 | 
|---|
| 290 |                                                             Connection: ISharedBrokerConnection) of object;
 | 
|---|
| 291 |   TSharedBrokerOnClientDisconnect = procedure(Sender: TObject; UniqueClientId: SYSINT) of object;
 | 
|---|
| 292 |   TSharedBrokerOnContextChanged = procedure(Sender: TObject; connectionIndex: SYSINT; 
 | 
|---|
| 293 |                                                              var NewContext: OleVariant) of object;
 | 
|---|
| 294 |   TSharedBrokerOnRPCBFailure = procedure(Sender: TObject; var ErrorText: OleVariant) of object;
 | 
|---|
| 295 |   TSharedBrokerOnLoginError = procedure(Sender: TObject; var ErrorText: OleVariant) of object;
 | 
|---|
| 296 |   TSharedBrokerOnConnectionDropped = procedure(Sender: TObject; connectionIndex: SYSINT; 
 | 
|---|
| 297 |                                                                 var ErrorText: OleVariant) of object;
 | 
|---|
| 298 | 
 | 
|---|
| 299 | 
 | 
|---|
| 300 | // *********************************************************************//
 | 
|---|
| 301 | // OLE Server Proxy class declaration
 | 
|---|
| 302 | // Server Object    : TSharedBroker
 | 
|---|
| 303 | // Help String      : SharedBroker Object
 | 
|---|
| 304 | // Default Interface: ISharedBroker
 | 
|---|
| 305 | // Def. Intf. DISP? : No
 | 
|---|
| 306 | // Event   Interface: ISharedBrokerEvents
 | 
|---|
| 307 | // TypeFlags        : (2) CanCreate
 | 
|---|
| 308 | // *********************************************************************//
 | 
|---|
| 309 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 310 |   TSharedBrokerProperties= class;
 | 
|---|
| 311 | {$ENDIF}
 | 
|---|
| 312 |   TSharedBroker = class(TOleServer)
 | 
|---|
| 313 |   private
 | 
|---|
| 314 |     FOnLogout: TNotifyEvent;
 | 
|---|
| 315 |     FOnRpcCallRecorded: TSharedBrokerOnRpcCallRecorded;
 | 
|---|
| 316 |     FOnClientConnect: TSharedBrokerOnClientConnect;
 | 
|---|
| 317 |     FOnClientDisconnect: TSharedBrokerOnClientDisconnect;
 | 
|---|
| 318 |     FOnContextChanged: TSharedBrokerOnContextChanged;
 | 
|---|
| 319 |     FOnRPCBFailure: TSharedBrokerOnRPCBFailure;
 | 
|---|
| 320 |     FOnLoginError: TSharedBrokerOnLoginError;
 | 
|---|
| 321 |     FOnConnectionDropped: TSharedBrokerOnConnectionDropped;
 | 
|---|
| 322 |     FIntf:        ISharedBroker;
 | 
|---|
| 323 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 324 |     FProps:       TSharedBrokerProperties;
 | 
|---|
| 325 |     function      GetServerProperties: TSharedBrokerProperties;
 | 
|---|
| 326 | {$ENDIF}
 | 
|---|
| 327 |     function      GetDefaultInterface: ISharedBroker;
 | 
|---|
| 328 |   protected
 | 
|---|
| 329 |     procedure InitServerData; override;
 | 
|---|
| 330 |     procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
 | 
|---|
| 331 |     function  Get_RpcVersion: WideString;
 | 
|---|
| 332 |     procedure Set_RpcVersion(const version: WideString);
 | 
|---|
| 333 |     function  Get_RpcHistoryEnabled: WordBool;
 | 
|---|
| 334 |     procedure Set_RpcHistoryEnabled(enabled: WordBool);
 | 
|---|
| 335 |     function  Get_PerClientRpcHistoryLimit: Integer;
 | 
|---|
| 336 |     procedure Set_PerClientRpcHistoryLimit(limit: Integer);
 | 
|---|
| 337 |     function  Get_CurrentContext: WideString;
 | 
|---|
| 338 |     function  Get_User: WideString;
 | 
|---|
| 339 |     function  Get_Login: WideString;
 | 
|---|
| 340 |     procedure Set_Login(const Value: WideString);
 | 
|---|
| 341 |     function  Get_RpcbError: WideString;
 | 
|---|
| 342 |     function  Get_Socket: Integer;
 | 
|---|
| 343 |     function  Get_KernelLogin: WordBool;
 | 
|---|
| 344 |     procedure Set_KernelLogin(Value: WordBool);
 | 
|---|
| 345 |     function  Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
 | 
|---|
| 346 |     procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
 | 
|---|
| 347 |   public
 | 
|---|
| 348 |     constructor Create(AOwner: TComponent); override;
 | 
|---|
| 349 |     destructor  Destroy; override;
 | 
|---|
| 350 |     procedure Connect; override;
 | 
|---|
| 351 |     procedure ConnectTo(svrIntf: ISharedBroker);
 | 
|---|
| 352 |     procedure Disconnect; override;
 | 
|---|
| 353 |     function  BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient; 
 | 
|---|
| 354 |                             const ServerPort: WideString; WantDebug: WordBool; 
 | 
|---|
| 355 |                             AllowShared: WordBool; KernelLogin: WordBool; 
 | 
|---|
| 356 |                             ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT; 
 | 
|---|
| 357 |                             var LoginStr: WideString; out UniqueClientIId: SYSINT; 
 | 
|---|
| 358 |                             out ErrorMsg: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 359 |     function  BrokerDisconnect: ISharedBrokerErrorCode;
 | 
|---|
| 360 |     function  BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 361 |     function  BrokerCall(const RpcName: WideString; const RpcParams: WideString; 
 | 
|---|
| 362 |                          RpcTimeLimit: Integer; out RpcResults: WideString; 
 | 
|---|
| 363 |                          out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 364 |     function  ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString; 
 | 
|---|
| 365 |                                  const Name: WideString; const Default: WideString; 
 | 
|---|
| 366 |                                  out RegResult: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 367 |     function  GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 368 |     function  GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 369 |                                           out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 370 |     function  LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 371 |     function  GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 372 |     function  GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 373 |     function  GetActiveBrokerConnectionInfo(connectionIndex: Integer; 
 | 
|---|
| 374 |                                             out connectedServerIp: WideString; 
 | 
|---|
| 375 |                                             out connectedServerPort: Integer; 
 | 
|---|
| 376 |                                             out lastContext: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 377 |     function  GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer; 
 | 
|---|
| 378 |                                                                out connectionIndex: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 379 |     function  GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 380 |                                     out brokerContext: WideString; out RpcName: WideString; 
 | 
|---|
| 381 |                                     out RpcParams: WideString; out rpcResult: WideString; 
 | 
|---|
| 382 |                                     out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 383 |     function  GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer; 
 | 
|---|
| 384 |                                          out uniqueRpcId: Integer; out brokerContext: WideString; 
 | 
|---|
| 385 |                                          out RpcName: WideString; out RpcParams: WideString; 
 | 
|---|
| 386 |                                          out rpcResult: WideString; out rpcStartDateTime: Double; 
 | 
|---|
| 387 |                                          out rpcDuration: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 388 |     function  GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 389 |                                         out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 390 |     function  GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 391 |     property  DefaultInterface: ISharedBroker read GetDefaultInterface;
 | 
|---|
| 392 |     property CurrentContext: WideString read Get_CurrentContext;
 | 
|---|
| 393 |     property User: WideString read Get_User;
 | 
|---|
| 394 |     property RpcbError: WideString read Get_RpcbError;
 | 
|---|
| 395 |     property Socket: Integer read Get_Socket;
 | 
|---|
| 396 |     property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
 | 
|---|
| 397 |     property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
 | 
|---|
| 398 |     property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
 | 
|---|
| 399 |     property Login: WideString read Get_Login write Set_Login;
 | 
|---|
| 400 |     property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
 | 
|---|
| 401 |     property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
 | 
|---|
| 402 |   published
 | 
|---|
| 403 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 404 |     property Server: TSharedBrokerProperties read GetServerProperties;
 | 
|---|
| 405 | {$ENDIF}
 | 
|---|
| 406 |     property OnLogout: TNotifyEvent read FOnLogout write FOnLogout;
 | 
|---|
| 407 |     property OnRpcCallRecorded: TSharedBrokerOnRpcCallRecorded read FOnRpcCallRecorded write FOnRpcCallRecorded;
 | 
|---|
| 408 |     property OnClientConnect: TSharedBrokerOnClientConnect read FOnClientConnect write FOnClientConnect;
 | 
|---|
| 409 |     property OnClientDisconnect: TSharedBrokerOnClientDisconnect read FOnClientDisconnect write FOnClientDisconnect;
 | 
|---|
| 410 |     property OnContextChanged: TSharedBrokerOnContextChanged read FOnContextChanged write FOnContextChanged;
 | 
|---|
| 411 |     property OnRPCBFailure: TSharedBrokerOnRPCBFailure read FOnRPCBFailure write FOnRPCBFailure;
 | 
|---|
| 412 |     property OnLoginError: TSharedBrokerOnLoginError read FOnLoginError write FOnLoginError;
 | 
|---|
| 413 |     property OnConnectionDropped: TSharedBrokerOnConnectionDropped read FOnConnectionDropped write FOnConnectionDropped;
 | 
|---|
| 414 |   end;
 | 
|---|
| 415 | 
 | 
|---|
| 416 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 417 | // *********************************************************************//
 | 
|---|
| 418 | // OLE Server Properties Proxy Class
 | 
|---|
| 419 | // Server Object    : TSharedBroker
 | 
|---|
| 420 | // (This object is used by the IDE's Property Inspector to allow editing
 | 
|---|
| 421 | //  of the properties of this server)
 | 
|---|
| 422 | // *********************************************************************//
 | 
|---|
| 423 |  TSharedBrokerProperties = class(TPersistent)
 | 
|---|
| 424 |   private
 | 
|---|
| 425 |     FServer:    TSharedBroker;
 | 
|---|
| 426 |     function    GetDefaultInterface: ISharedBroker;
 | 
|---|
| 427 |     constructor Create(AServer: TSharedBroker);
 | 
|---|
| 428 |   protected
 | 
|---|
| 429 |     function  Get_RpcVersion: WideString;
 | 
|---|
| 430 |     procedure Set_RpcVersion(const version: WideString);
 | 
|---|
| 431 |     function  Get_RpcHistoryEnabled: WordBool;
 | 
|---|
| 432 |     procedure Set_RpcHistoryEnabled(enabled: WordBool);
 | 
|---|
| 433 |     function  Get_PerClientRpcHistoryLimit: Integer;
 | 
|---|
| 434 |     procedure Set_PerClientRpcHistoryLimit(limit: Integer);
 | 
|---|
| 435 |     function  Get_CurrentContext: WideString;
 | 
|---|
| 436 |     function  Get_User: WideString;
 | 
|---|
| 437 |     function  Get_Login: WideString;
 | 
|---|
| 438 |     procedure Set_Login(const Value: WideString);
 | 
|---|
| 439 |     function  Get_RpcbError: WideString;
 | 
|---|
| 440 |     function  Get_Socket: Integer;
 | 
|---|
| 441 |     function  Get_KernelLogin: WordBool;
 | 
|---|
| 442 |     procedure Set_KernelLogin(Value: WordBool);
 | 
|---|
| 443 |     function  Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
 | 
|---|
| 444 |     procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
 | 
|---|
| 445 |   public
 | 
|---|
| 446 |     property DefaultInterface: ISharedBroker read GetDefaultInterface;
 | 
|---|
| 447 |   published
 | 
|---|
| 448 |     property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
 | 
|---|
| 449 |     property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
 | 
|---|
| 450 |     property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
 | 
|---|
| 451 |     property Login: WideString read Get_Login write Set_Login;
 | 
|---|
| 452 |     property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
 | 
|---|
| 453 |     property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
 | 
|---|
| 454 |   end;
 | 
|---|
| 455 | {$ENDIF}
 | 
|---|
| 456 | 
 | 
|---|
| 457 | 
 | 
|---|
| 458 | // procedure Register;
 | 
|---|
| 459 | 
 | 
|---|
| 460 | implementation
 | 
|---|
| 461 | 
 | 
|---|
| 462 | uses ComObj;
 | 
|---|
| 463 | 
 | 
|---|
| 464 | class function CoSharedBroker.Create: ISharedBroker;
 | 
|---|
| 465 | begin
 | 
|---|
| 466 |   Result := CreateComObject(CLASS_SharedBroker) as ISharedBroker;
 | 
|---|
| 467 | end;
 | 
|---|
| 468 | 
 | 
|---|
| 469 | class function CoSharedBroker.CreateRemote(const MachineName: string): ISharedBroker;
 | 
|---|
| 470 | begin
 | 
|---|
| 471 |   Result := CreateRemoteComObject(MachineName, CLASS_SharedBroker) as ISharedBroker;
 | 
|---|
| 472 | end;
 | 
|---|
| 473 | 
 | 
|---|
| 474 | procedure TSharedBroker.InitServerData;
 | 
|---|
| 475 | const
 | 
|---|
| 476 |   CServerData: TServerData = (
 | 
|---|
| 477 |     ClassID:   '{EB44A5CD-1871-429F-A5BC-19C71B722182}';
 | 
|---|
| 478 |     IntfIID:   '{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}';
 | 
|---|
| 479 |     EventIID:  '{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}';
 | 
|---|
| 480 |     LicenseKey: nil;
 | 
|---|
| 481 |     Version: 500);
 | 
|---|
| 482 | begin
 | 
|---|
| 483 |   ServerData := @CServerData;
 | 
|---|
| 484 | end;
 | 
|---|
| 485 | 
 | 
|---|
| 486 | procedure TSharedBroker.Connect;
 | 
|---|
| 487 | var
 | 
|---|
| 488 |   punk: IUnknown;
 | 
|---|
| 489 | begin
 | 
|---|
| 490 |   if FIntf = nil then
 | 
|---|
| 491 |   begin
 | 
|---|
| 492 |     punk := GetServer;
 | 
|---|
| 493 |     ConnectEvents(punk);
 | 
|---|
| 494 |     Fintf:= punk as ISharedBroker;
 | 
|---|
| 495 |   end;
 | 
|---|
| 496 | end;
 | 
|---|
| 497 | 
 | 
|---|
| 498 | procedure TSharedBroker.ConnectTo(svrIntf: ISharedBroker);
 | 
|---|
| 499 | begin
 | 
|---|
| 500 |   Disconnect;
 | 
|---|
| 501 |   FIntf := svrIntf;
 | 
|---|
| 502 |   ConnectEvents(FIntf);
 | 
|---|
| 503 | end;
 | 
|---|
| 504 | 
 | 
|---|
| 505 | procedure TSharedBroker.DisConnect;
 | 
|---|
| 506 | begin
 | 
|---|
| 507 |   if Fintf <> nil then
 | 
|---|
| 508 |   begin
 | 
|---|
| 509 |     DisconnectEvents(FIntf);
 | 
|---|
| 510 |     FIntf := nil;
 | 
|---|
| 511 |   end;
 | 
|---|
| 512 | end;
 | 
|---|
| 513 | 
 | 
|---|
| 514 | function TSharedBroker.GetDefaultInterface: ISharedBroker;
 | 
|---|
| 515 | begin
 | 
|---|
| 516 |   if FIntf = nil then
 | 
|---|
| 517 |     Connect;
 | 
|---|
| 518 |   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
 | 
|---|
| 519 |   Result := FIntf;
 | 
|---|
| 520 | end;
 | 
|---|
| 521 | 
 | 
|---|
| 522 | constructor TSharedBroker.Create(AOwner: TComponent);
 | 
|---|
| 523 | begin
 | 
|---|
| 524 |   inherited Create(AOwner);
 | 
|---|
| 525 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 526 |   FProps := TSharedBrokerProperties.Create(Self);
 | 
|---|
| 527 | {$ENDIF}
 | 
|---|
| 528 | end;
 | 
|---|
| 529 | 
 | 
|---|
| 530 | destructor TSharedBroker.Destroy;
 | 
|---|
| 531 | begin
 | 
|---|
| 532 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 533 |   FProps.Free;
 | 
|---|
| 534 | {$ENDIF}
 | 
|---|
| 535 |   inherited Destroy;
 | 
|---|
| 536 | end;
 | 
|---|
| 537 | 
 | 
|---|
| 538 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 539 | function TSharedBroker.GetServerProperties: TSharedBrokerProperties;
 | 
|---|
| 540 | begin
 | 
|---|
| 541 |   Result := FProps;
 | 
|---|
| 542 | end;
 | 
|---|
| 543 | {$ENDIF}
 | 
|---|
| 544 | 
 | 
|---|
| 545 | procedure TSharedBroker.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
 | 
|---|
| 546 | begin
 | 
|---|
| 547 |   case DispID of
 | 
|---|
| 548 |     -1: Exit;  // DISPID_UNKNOWN
 | 
|---|
| 549 |    1: if Assigned(FOnLogout) then
 | 
|---|
| 550 |             FOnLogout(Self);
 | 
|---|
| 551 |    2: if Assigned(FOnRpcCallRecorded) then
 | 
|---|
| 552 |             FOnRpcCallRecorded(Self, Params[0] {SYSINT});
 | 
|---|
| 553 |    3: if Assigned(FOnClientConnect) then
 | 
|---|
| 554 |             FOnClientConnect(Self, Params[0] {SYSINT}, Params[1] {ISharedBrokerConnection});
 | 
|---|
| 555 |    4: if Assigned(FOnClientDisconnect) then
 | 
|---|
| 556 |             FOnClientDisconnect(Self, Params[0] {SYSINT});
 | 
|---|
| 557 |    5: if Assigned(FOnContextChanged) then
 | 
|---|
| 558 |             FOnContextChanged(Self, Params[0] {SYSINT}, Params[1] {const WideString});
 | 
|---|
| 559 |    6: if Assigned(FOnRPCBFailure) then
 | 
|---|
| 560 |             FOnRPCBFailure(Self, Params[0] {const WideString});
 | 
|---|
| 561 |    7: if Assigned(FOnLoginError) then
 | 
|---|
| 562 |             FOnLoginError(Self, Params[0] {const WideString});
 | 
|---|
| 563 |    8: if Assigned(FOnConnectionDropped) then
 | 
|---|
| 564 |             FOnConnectionDropped(Self, Params[0] {SYSINT}, Params[1] {const WideString});
 | 
|---|
| 565 |   end; {case DispID}
 | 
|---|
| 566 | end;
 | 
|---|
| 567 | 
 | 
|---|
| 568 | function  TSharedBroker.Get_RpcVersion: WideString;
 | 
|---|
| 569 | begin
 | 
|---|
| 570 |   Result := DefaultInterface.Get_RpcVersion;
 | 
|---|
| 571 | end;
 | 
|---|
| 572 | 
 | 
|---|
| 573 | procedure TSharedBroker.Set_RpcVersion(const version: WideString);
 | 
|---|
| 574 | begin
 | 
|---|
| 575 |   DefaultInterface.Set_RpcVersion(version);
 | 
|---|
| 576 | end;
 | 
|---|
| 577 | 
 | 
|---|
| 578 | function  TSharedBroker.Get_RpcHistoryEnabled: WordBool;
 | 
|---|
| 579 | begin
 | 
|---|
| 580 |   Result := DefaultInterface.Get_RpcHistoryEnabled;
 | 
|---|
| 581 | end;
 | 
|---|
| 582 | 
 | 
|---|
| 583 | procedure TSharedBroker.Set_RpcHistoryEnabled(enabled: WordBool);
 | 
|---|
| 584 | begin
 | 
|---|
| 585 |   DefaultInterface.Set_RpcHistoryEnabled(enabled);
 | 
|---|
| 586 | end;
 | 
|---|
| 587 | 
 | 
|---|
| 588 | function  TSharedBroker.Get_PerClientRpcHistoryLimit: Integer;
 | 
|---|
| 589 | begin
 | 
|---|
| 590 |   Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
 | 
|---|
| 591 | end;
 | 
|---|
| 592 | 
 | 
|---|
| 593 | procedure TSharedBroker.Set_PerClientRpcHistoryLimit(limit: Integer);
 | 
|---|
| 594 | begin
 | 
|---|
| 595 |   DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
 | 
|---|
| 596 | end;
 | 
|---|
| 597 | 
 | 
|---|
| 598 | function  TSharedBroker.Get_CurrentContext: WideString;
 | 
|---|
| 599 | begin
 | 
|---|
| 600 |   Result := DefaultInterface.Get_CurrentContext;
 | 
|---|
| 601 | end;
 | 
|---|
| 602 | 
 | 
|---|
| 603 | function  TSharedBroker.Get_User: WideString;
 | 
|---|
| 604 | begin
 | 
|---|
| 605 |   Result := DefaultInterface.Get_User;
 | 
|---|
| 606 | end;
 | 
|---|
| 607 | 
 | 
|---|
| 608 | function  TSharedBroker.Get_Login: WideString;
 | 
|---|
| 609 | begin
 | 
|---|
| 610 |   Result := DefaultInterface.Get_Login;
 | 
|---|
| 611 | end;
 | 
|---|
| 612 | 
 | 
|---|
| 613 | procedure TSharedBroker.Set_Login(const Value: WideString);
 | 
|---|
| 614 | begin
 | 
|---|
| 615 |   DefaultInterface.Set_Login(Value);
 | 
|---|
| 616 | end;
 | 
|---|
| 617 | 
 | 
|---|
| 618 | function  TSharedBroker.Get_RpcbError: WideString;
 | 
|---|
| 619 | begin
 | 
|---|
| 620 |   Result := DefaultInterface.Get_RpcbError;
 | 
|---|
| 621 | end;
 | 
|---|
| 622 | 
 | 
|---|
| 623 | function  TSharedBroker.Get_Socket: Integer;
 | 
|---|
| 624 | begin
 | 
|---|
| 625 |   Result := DefaultInterface.Get_Socket;
 | 
|---|
| 626 | end;
 | 
|---|
| 627 | 
 | 
|---|
| 628 | function  TSharedBroker.Get_KernelLogin: WordBool;
 | 
|---|
| 629 | begin
 | 
|---|
| 630 |   Result := DefaultInterface.Get_KernelLogin;
 | 
|---|
| 631 | end;
 | 
|---|
| 632 | 
 | 
|---|
| 633 | procedure TSharedBroker.Set_KernelLogin(Value: WordBool);
 | 
|---|
| 634 | begin
 | 
|---|
| 635 |   DefaultInterface.Set_KernelLogin(Value);
 | 
|---|
| 636 | end;
 | 
|---|
| 637 | 
 | 
|---|
| 638 | function  TSharedBroker.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
 | 
|---|
| 639 | begin
 | 
|---|
| 640 |   Result := DefaultInterface.Get_ShowErrorMsgs;
 | 
|---|
| 641 | end;
 | 
|---|
| 642 | 
 | 
|---|
| 643 | procedure TSharedBroker.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
 | 
|---|
| 644 | begin
 | 
|---|
| 645 |   DefaultInterface.Set_ShowErrorMsgs(Value);
 | 
|---|
| 646 | end;
 | 
|---|
| 647 | 
 | 
|---|
| 648 | function  TSharedBroker.BrokerConnect(const ClientName: WideString; 
 | 
|---|
| 649 |                                       ConnectionType: ISharedBrokerClient; 
 | 
|---|
| 650 |                                       const ServerPort: WideString; WantDebug: WordBool; 
 | 
|---|
| 651 |                                       AllowShared: WordBool; KernelLogin: WordBool; 
 | 
|---|
| 652 |                                       ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT; 
 | 
|---|
| 653 |                                       var LoginStr: WideString; out UniqueClientIId: SYSINT; 
 | 
|---|
| 654 |                                       out ErrorMsg: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 655 | begin
 | 
|---|
| 656 |   Result := DefaultInterface.BrokerConnect(ClientName, ConnectionType, ServerPort, WantDebug, 
 | 
|---|
| 657 |                                            AllowShared, KernelLogin, ShowErrMsgs, RpcTimeLim, 
 | 
|---|
| 658 |                                            LoginStr, UniqueClientIId, ErrorMsg);
 | 
|---|
| 659 | end;
 | 
|---|
| 660 | 
 | 
|---|
| 661 | function  TSharedBroker.BrokerDisconnect: ISharedBrokerErrorCode;
 | 
|---|
| 662 | begin
 | 
|---|
| 663 |   Result := DefaultInterface.BrokerDisconnect;
 | 
|---|
| 664 | end;
 | 
|---|
| 665 | 
 | 
|---|
| 666 | function  TSharedBroker.BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 667 | begin
 | 
|---|
| 668 |   Result := DefaultInterface.BrokerSetContext(OptionName);
 | 
|---|
| 669 | end;
 | 
|---|
| 670 | 
 | 
|---|
| 671 | function  TSharedBroker.BrokerCall(const RpcName: WideString; const RpcParams: WideString; 
 | 
|---|
| 672 |                                    RpcTimeLimit: Integer; out RpcResults: WideString; 
 | 
|---|
| 673 |                                    out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 674 | begin
 | 
|---|
| 675 |   Result := DefaultInterface.BrokerCall(RpcName, RpcParams, RpcTimeLimit, RpcResults, 
 | 
|---|
| 676 |                                         UniqueRpcCallId);
 | 
|---|
| 677 | end;
 | 
|---|
| 678 | 
 | 
|---|
| 679 | function  TSharedBroker.ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString; 
 | 
|---|
| 680 |                                            const Name: WideString; const Default: WideString; 
 | 
|---|
| 681 |                                            out RegResult: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 682 | begin
 | 
|---|
| 683 |   Result := DefaultInterface.ReadRegDataDefault(Root, Key, Name, Default, RegResult);
 | 
|---|
| 684 | end;
 | 
|---|
| 685 | 
 | 
|---|
| 686 | function  TSharedBroker.GetRpcHistoryCountForClient(UniqueClientId: Integer; 
 | 
|---|
| 687 |                                                     out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 688 | begin
 | 
|---|
| 689 |   Result := DefaultInterface.GetRpcHistoryCountForClient(UniqueClientId, rpcHistoryCount);
 | 
|---|
| 690 | end;
 | 
|---|
| 691 | 
 | 
|---|
| 692 | function  TSharedBroker.GetClientIdAndNameFromIndex(clientIndex: Integer; 
 | 
|---|
| 693 |                                                     out UniqueClientId: Integer; 
 | 
|---|
| 694 |                                                     out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 695 | begin
 | 
|---|
| 696 |   Result := DefaultInterface.GetClientIdAndNameFromIndex(clientIndex, UniqueClientId, ClientName);
 | 
|---|
| 697 | end;
 | 
|---|
| 698 | 
 | 
|---|
| 699 | function  TSharedBroker.LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 700 | begin
 | 
|---|
| 701 |   Result := DefaultInterface.LogoutConnectedClients(logoutTimeLimit);
 | 
|---|
| 702 | end;
 | 
|---|
| 703 | 
 | 
|---|
| 704 | function  TSharedBroker.GetClientNameFromUniqueClientId(UniqueClientId: Integer; 
 | 
|---|
| 705 |                                                         out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 706 | begin
 | 
|---|
| 707 |   Result := DefaultInterface.GetClientNameFromUniqueClientId(UniqueClientId, ClientName);
 | 
|---|
| 708 | end;
 | 
|---|
| 709 | 
 | 
|---|
| 710 | function  TSharedBroker.GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 711 | begin
 | 
|---|
| 712 |   Result := DefaultInterface.GetActiveBrokerConnectionIndexCount(connectionIndexCount);
 | 
|---|
| 713 | end;
 | 
|---|
| 714 | 
 | 
|---|
| 715 | function  TSharedBroker.GetActiveBrokerConnectionInfo(connectionIndex: Integer; 
 | 
|---|
| 716 |                                                       out connectedServerIp: WideString; 
 | 
|---|
| 717 |                                                       out connectedServerPort: Integer; 
 | 
|---|
| 718 |                                                       out lastContext: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 719 | begin
 | 
|---|
| 720 |   Result := DefaultInterface.GetActiveBrokerConnectionInfo(connectionIndex, connectedServerIp, 
 | 
|---|
| 721 |                                                            connectedServerPort, lastContext);
 | 
|---|
| 722 | end;
 | 
|---|
| 723 | 
 | 
|---|
| 724 | function  TSharedBroker.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer; 
 | 
|---|
| 725 |                                                                          out connectionIndex: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 726 | begin
 | 
|---|
| 727 |   Result := DefaultInterface.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId, 
 | 
|---|
| 728 |                                                                               connectionIndex);
 | 
|---|
| 729 | end;
 | 
|---|
| 730 | 
 | 
|---|
| 731 | function  TSharedBroker.GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer; 
 | 
|---|
| 732 |                                               out brokerContext: WideString; 
 | 
|---|
| 733 |                                               out RpcName: WideString; out RpcParams: WideString; 
 | 
|---|
| 734 |                                               out rpcResult: WideString; 
 | 
|---|
| 735 |                                               out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 736 | begin
 | 
|---|
| 737 |   Result := DefaultInterface.GetRpcCallFromHistory(uniqueRpcId, UniqueClientId, brokerContext, 
 | 
|---|
| 738 |                                                    RpcName, RpcParams, rpcResult, rpcStartDateTime, 
 | 
|---|
| 739 |                                                    rpcDuration);
 | 
|---|
| 740 | end;
 | 
|---|
| 741 | 
 | 
|---|
| 742 | function  TSharedBroker.GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer; 
 | 
|---|
| 743 |                                                    out uniqueRpcId: Integer; 
 | 
|---|
| 744 |                                                    out brokerContext: WideString; 
 | 
|---|
| 745 |                                                    out RpcName: WideString; 
 | 
|---|
| 746 |                                                    out RpcParams: WideString; 
 | 
|---|
| 747 |                                                    out rpcResult: WideString; 
 | 
|---|
| 748 |                                                    out rpcStartDateTime: Double; 
 | 
|---|
| 749 |                                                    out rpcDuration: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 750 | begin
 | 
|---|
| 751 |   Result := DefaultInterface.GetRpcCallFromHistoryIndex(UniqueClientId, rpcCallIndex, uniqueRpcId, 
 | 
|---|
| 752 |                                                         brokerContext, RpcName, RpcParams, 
 | 
|---|
| 753 |                                                         rpcResult, rpcStartDateTime, rpcDuration);
 | 
|---|
| 754 | end;
 | 
|---|
| 755 | 
 | 
|---|
| 756 | function  TSharedBroker.GetRpcClientIdFromHistory(uniqueRpcId: Integer; 
 | 
|---|
| 757 |                                                   out UniqueClientId: Integer; 
 | 
|---|
| 758 |                                                   out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 759 | begin
 | 
|---|
| 760 |   Result := DefaultInterface.GetRpcClientIdFromHistory(uniqueRpcId, UniqueClientId, ClientName);
 | 
|---|
| 761 | end;
 | 
|---|
| 762 | 
 | 
|---|
| 763 | function  TSharedBroker.GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 764 | begin
 | 
|---|
| 765 |   Result := DefaultInterface.GetConnectedClientCount(connectedClientCount);
 | 
|---|
| 766 | end;
 | 
|---|
| 767 | 
 | 
|---|
| 768 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 769 | constructor TSharedBrokerProperties.Create(AServer: TSharedBroker);
 | 
|---|
| 770 | begin
 | 
|---|
| 771 |   inherited Create;
 | 
|---|
| 772 |   FServer := AServer;
 | 
|---|
| 773 | end;
 | 
|---|
| 774 | 
 | 
|---|
| 775 | function TSharedBrokerProperties.GetDefaultInterface: ISharedBroker;
 | 
|---|
| 776 | begin
 | 
|---|
| 777 |   Result := FServer.DefaultInterface;
 | 
|---|
| 778 | end;
 | 
|---|
| 779 | 
 | 
|---|
| 780 | function  TSharedBrokerProperties.Get_RpcVersion: WideString;
 | 
|---|
| 781 | begin
 | 
|---|
| 782 |   Result := DefaultInterface.Get_RpcVersion;
 | 
|---|
| 783 | end;
 | 
|---|
| 784 | 
 | 
|---|
| 785 | procedure TSharedBrokerProperties.Set_RpcVersion(const version: WideString);
 | 
|---|
| 786 | begin
 | 
|---|
| 787 |   DefaultInterface.Set_RpcVersion(version);
 | 
|---|
| 788 | end;
 | 
|---|
| 789 | 
 | 
|---|
| 790 | function  TSharedBrokerProperties.Get_RpcHistoryEnabled: WordBool;
 | 
|---|
| 791 | begin
 | 
|---|
| 792 |   Result := DefaultInterface.Get_RpcHistoryEnabled;
 | 
|---|
| 793 | end;
 | 
|---|
| 794 | 
 | 
|---|
| 795 | procedure TSharedBrokerProperties.Set_RpcHistoryEnabled(enabled: WordBool);
 | 
|---|
| 796 | begin
 | 
|---|
| 797 |   DefaultInterface.Set_RpcHistoryEnabled(enabled);
 | 
|---|
| 798 | end;
 | 
|---|
| 799 | 
 | 
|---|
| 800 | function  TSharedBrokerProperties.Get_PerClientRpcHistoryLimit: Integer;
 | 
|---|
| 801 | begin
 | 
|---|
| 802 |   Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
 | 
|---|
| 803 | end;
 | 
|---|
| 804 | 
 | 
|---|
| 805 | procedure TSharedBrokerProperties.Set_PerClientRpcHistoryLimit(limit: Integer);
 | 
|---|
| 806 | begin
 | 
|---|
| 807 |   DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
 | 
|---|
| 808 | end;
 | 
|---|
| 809 | 
 | 
|---|
| 810 | function  TSharedBrokerProperties.Get_CurrentContext: WideString;
 | 
|---|
| 811 | begin
 | 
|---|
| 812 |   Result := DefaultInterface.Get_CurrentContext;
 | 
|---|
| 813 | end;
 | 
|---|
| 814 | 
 | 
|---|
| 815 | function  TSharedBrokerProperties.Get_User: WideString;
 | 
|---|
| 816 | begin
 | 
|---|
| 817 |   Result := DefaultInterface.Get_User;
 | 
|---|
| 818 | end;
 | 
|---|
| 819 | 
 | 
|---|
| 820 | function  TSharedBrokerProperties.Get_Login: WideString;
 | 
|---|
| 821 | begin
 | 
|---|
| 822 |   Result := DefaultInterface.Get_Login;
 | 
|---|
| 823 | end;
 | 
|---|
| 824 | 
 | 
|---|
| 825 | procedure TSharedBrokerProperties.Set_Login(const Value: WideString);
 | 
|---|
| 826 | begin
 | 
|---|
| 827 |   DefaultInterface.Set_Login(Value);
 | 
|---|
| 828 | end;
 | 
|---|
| 829 | 
 | 
|---|
| 830 | function  TSharedBrokerProperties.Get_RpcbError: WideString;
 | 
|---|
| 831 | begin
 | 
|---|
| 832 |   Result := DefaultInterface.Get_RpcbError;
 | 
|---|
| 833 | end;
 | 
|---|
| 834 | 
 | 
|---|
| 835 | function  TSharedBrokerProperties.Get_Socket: Integer;
 | 
|---|
| 836 | begin
 | 
|---|
| 837 |   Result := DefaultInterface.Get_Socket;
 | 
|---|
| 838 | end;
 | 
|---|
| 839 | 
 | 
|---|
| 840 | function  TSharedBrokerProperties.Get_KernelLogin: WordBool;
 | 
|---|
| 841 | begin
 | 
|---|
| 842 |   Result := DefaultInterface.Get_KernelLogin;
 | 
|---|
| 843 | end;
 | 
|---|
| 844 | 
 | 
|---|
| 845 | procedure TSharedBrokerProperties.Set_KernelLogin(Value: WordBool);
 | 
|---|
| 846 | begin
 | 
|---|
| 847 |   DefaultInterface.Set_KernelLogin(Value);
 | 
|---|
| 848 | end;
 | 
|---|
| 849 | 
 | 
|---|
| 850 | function  TSharedBrokerProperties.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
 | 
|---|
| 851 | begin
 | 
|---|
| 852 |   Result := DefaultInterface.Get_ShowErrorMsgs;
 | 
|---|
| 853 | end;
 | 
|---|
| 854 | 
 | 
|---|
| 855 | procedure TSharedBrokerProperties.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
 | 
|---|
| 856 | begin
 | 
|---|
| 857 |   DefaultInterface.Set_ShowErrorMsgs(Value);
 | 
|---|
| 858 | end;
 | 
|---|
| 859 | 
 | 
|---|
| 860 | {$ENDIF}
 | 
|---|
| 861 | {
 | 
|---|
| 862 | procedure Register;
 | 
|---|
| 863 | begin
 | 
|---|
| 864 |   RegisterComponents('Kernel',[TSharedBroker]);
 | 
|---|
| 865 | end;
 | 
|---|
| 866 | }
 | 
|---|
| 867 | end.
 | 
|---|