source: cprs/branches/tmg-cprs/BDK32/SharedBrokerDebugger/RPCSharedBrokerSessionMgr1_TLB.pas@ 683

Last change on this file since 683 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 41.5 KB
RevLine 
[453]1unit 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.
38interface
39
40uses 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// *********************************************************************//
49const
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
64type
65 ISharedBrokerErrorCode = TOleEnum;
66const
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
80type
81 IRegistryRootEnum = TOleEnum;
82const
83 HKCR = $00000000;
84 HKCU = $00000001;
85 HKLM = $00000002;
86 HKU = $00000003;
87 HKCC = $00000004;
88 HKDD = $00000005;
89
90// Constants for enum ISharedBrokerConnection
91type
92 ISharedBrokerConnection = TOleEnum;
93const
94 Failed = $00000000;
95 New = $00000001;
96 Shared = $00000002;
97 Debug = $00000003;
98
99// Constants for enum ISharedBrokerClient
100type
101 ISharedBrokerClient = TOleEnum;
102const
103 BrokerClient = $00000000;
104 DebuggerClient = $00000001;
105
106// Constants for enum ISharedBrokerShowErrorMsgs
107type
108 ISharedBrokerShowErrorMsgs = TOleEnum;
109const
110 isemRaise = $00000000;
111 isemQuiet = $00000001;
112
113type
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
460implementation
461
462uses ComObj;
463
464class function CoSharedBroker.Create: ISharedBroker;
465begin
466 Result := CreateComObject(CLASS_SharedBroker) as ISharedBroker;
467end;
468
469class function CoSharedBroker.CreateRemote(const MachineName: string): ISharedBroker;
470begin
471 Result := CreateRemoteComObject(MachineName, CLASS_SharedBroker) as ISharedBroker;
472end;
473
474procedure TSharedBroker.InitServerData;
475const
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);
482begin
483 ServerData := @CServerData;
484end;
485
486procedure TSharedBroker.Connect;
487var
488 punk: IUnknown;
489begin
490 if FIntf = nil then
491 begin
492 punk := GetServer;
493 ConnectEvents(punk);
494 Fintf:= punk as ISharedBroker;
495 end;
496end;
497
498procedure TSharedBroker.ConnectTo(svrIntf: ISharedBroker);
499begin
500 Disconnect;
501 FIntf := svrIntf;
502 ConnectEvents(FIntf);
503end;
504
505procedure TSharedBroker.DisConnect;
506begin
507 if Fintf <> nil then
508 begin
509 DisconnectEvents(FIntf);
510 FIntf := nil;
511 end;
512end;
513
514function TSharedBroker.GetDefaultInterface: ISharedBroker;
515begin
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;
520end;
521
522constructor TSharedBroker.Create(AOwner: TComponent);
523begin
524 inherited Create(AOwner);
525{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
526 FProps := TSharedBrokerProperties.Create(Self);
527{$ENDIF}
528end;
529
530destructor TSharedBroker.Destroy;
531begin
532{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
533 FProps.Free;
534{$ENDIF}
535 inherited Destroy;
536end;
537
538{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
539function TSharedBroker.GetServerProperties: TSharedBrokerProperties;
540begin
541 Result := FProps;
542end;
543{$ENDIF}
544
545procedure TSharedBroker.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
546begin
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}
566end;
567
568function TSharedBroker.Get_RpcVersion: WideString;
569begin
570 Result := DefaultInterface.Get_RpcVersion;
571end;
572
573procedure TSharedBroker.Set_RpcVersion(const version: WideString);
574begin
575 DefaultInterface.Set_RpcVersion(version);
576end;
577
578function TSharedBroker.Get_RpcHistoryEnabled: WordBool;
579begin
580 Result := DefaultInterface.Get_RpcHistoryEnabled;
581end;
582
583procedure TSharedBroker.Set_RpcHistoryEnabled(enabled: WordBool);
584begin
585 DefaultInterface.Set_RpcHistoryEnabled(enabled);
586end;
587
588function TSharedBroker.Get_PerClientRpcHistoryLimit: Integer;
589begin
590 Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
591end;
592
593procedure TSharedBroker.Set_PerClientRpcHistoryLimit(limit: Integer);
594begin
595 DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
596end;
597
598function TSharedBroker.Get_CurrentContext: WideString;
599begin
600 Result := DefaultInterface.Get_CurrentContext;
601end;
602
603function TSharedBroker.Get_User: WideString;
604begin
605 Result := DefaultInterface.Get_User;
606end;
607
608function TSharedBroker.Get_Login: WideString;
609begin
610 Result := DefaultInterface.Get_Login;
611end;
612
613procedure TSharedBroker.Set_Login(const Value: WideString);
614begin
615 DefaultInterface.Set_Login(Value);
616end;
617
618function TSharedBroker.Get_RpcbError: WideString;
619begin
620 Result := DefaultInterface.Get_RpcbError;
621end;
622
623function TSharedBroker.Get_Socket: Integer;
624begin
625 Result := DefaultInterface.Get_Socket;
626end;
627
628function TSharedBroker.Get_KernelLogin: WordBool;
629begin
630 Result := DefaultInterface.Get_KernelLogin;
631end;
632
633procedure TSharedBroker.Set_KernelLogin(Value: WordBool);
634begin
635 DefaultInterface.Set_KernelLogin(Value);
636end;
637
638function TSharedBroker.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
639begin
640 Result := DefaultInterface.Get_ShowErrorMsgs;
641end;
642
643procedure TSharedBroker.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
644begin
645 DefaultInterface.Set_ShowErrorMsgs(Value);
646end;
647
648function 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;
655begin
656 Result := DefaultInterface.BrokerConnect(ClientName, ConnectionType, ServerPort, WantDebug,
657 AllowShared, KernelLogin, ShowErrMsgs, RpcTimeLim,
658 LoginStr, UniqueClientIId, ErrorMsg);
659end;
660
661function TSharedBroker.BrokerDisconnect: ISharedBrokerErrorCode;
662begin
663 Result := DefaultInterface.BrokerDisconnect;
664end;
665
666function TSharedBroker.BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
667begin
668 Result := DefaultInterface.BrokerSetContext(OptionName);
669end;
670
671function TSharedBroker.BrokerCall(const RpcName: WideString; const RpcParams: WideString;
672 RpcTimeLimit: Integer; out RpcResults: WideString;
673 out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
674begin
675 Result := DefaultInterface.BrokerCall(RpcName, RpcParams, RpcTimeLimit, RpcResults,
676 UniqueRpcCallId);
677end;
678
679function TSharedBroker.ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
680 const Name: WideString; const Default: WideString;
681 out RegResult: WideString): ISharedBrokerErrorCode;
682begin
683 Result := DefaultInterface.ReadRegDataDefault(Root, Key, Name, Default, RegResult);
684end;
685
686function TSharedBroker.GetRpcHistoryCountForClient(UniqueClientId: Integer;
687 out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
688begin
689 Result := DefaultInterface.GetRpcHistoryCountForClient(UniqueClientId, rpcHistoryCount);
690end;
691
692function TSharedBroker.GetClientIdAndNameFromIndex(clientIndex: Integer;
693 out UniqueClientId: Integer;
694 out ClientName: WideString): ISharedBrokerErrorCode;
695begin
696 Result := DefaultInterface.GetClientIdAndNameFromIndex(clientIndex, UniqueClientId, ClientName);
697end;
698
699function TSharedBroker.LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
700begin
701 Result := DefaultInterface.LogoutConnectedClients(logoutTimeLimit);
702end;
703
704function TSharedBroker.GetClientNameFromUniqueClientId(UniqueClientId: Integer;
705 out ClientName: WideString): ISharedBrokerErrorCode;
706begin
707 Result := DefaultInterface.GetClientNameFromUniqueClientId(UniqueClientId, ClientName);
708end;
709
710function TSharedBroker.GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
711begin
712 Result := DefaultInterface.GetActiveBrokerConnectionIndexCount(connectionIndexCount);
713end;
714
715function TSharedBroker.GetActiveBrokerConnectionInfo(connectionIndex: Integer;
716 out connectedServerIp: WideString;
717 out connectedServerPort: Integer;
718 out lastContext: WideString): ISharedBrokerErrorCode;
719begin
720 Result := DefaultInterface.GetActiveBrokerConnectionInfo(connectionIndex, connectedServerIp,
721 connectedServerPort, lastContext);
722end;
723
724function TSharedBroker.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
725 out connectionIndex: Integer): ISharedBrokerErrorCode;
726begin
727 Result := DefaultInterface.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId,
728 connectionIndex);
729end;
730
731function 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;
736begin
737 Result := DefaultInterface.GetRpcCallFromHistory(uniqueRpcId, UniqueClientId, brokerContext,
738 RpcName, RpcParams, rpcResult, rpcStartDateTime,
739 rpcDuration);
740end;
741
742function 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;
750begin
751 Result := DefaultInterface.GetRpcCallFromHistoryIndex(UniqueClientId, rpcCallIndex, uniqueRpcId,
752 brokerContext, RpcName, RpcParams,
753 rpcResult, rpcStartDateTime, rpcDuration);
754end;
755
756function TSharedBroker.GetRpcClientIdFromHistory(uniqueRpcId: Integer;
757 out UniqueClientId: Integer;
758 out ClientName: WideString): ISharedBrokerErrorCode;
759begin
760 Result := DefaultInterface.GetRpcClientIdFromHistory(uniqueRpcId, UniqueClientId, ClientName);
761end;
762
763function TSharedBroker.GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
764begin
765 Result := DefaultInterface.GetConnectedClientCount(connectedClientCount);
766end;
767
768{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
769constructor TSharedBrokerProperties.Create(AServer: TSharedBroker);
770begin
771 inherited Create;
772 FServer := AServer;
773end;
774
775function TSharedBrokerProperties.GetDefaultInterface: ISharedBroker;
776begin
777 Result := FServer.DefaultInterface;
778end;
779
780function TSharedBrokerProperties.Get_RpcVersion: WideString;
781begin
782 Result := DefaultInterface.Get_RpcVersion;
783end;
784
785procedure TSharedBrokerProperties.Set_RpcVersion(const version: WideString);
786begin
787 DefaultInterface.Set_RpcVersion(version);
788end;
789
790function TSharedBrokerProperties.Get_RpcHistoryEnabled: WordBool;
791begin
792 Result := DefaultInterface.Get_RpcHistoryEnabled;
793end;
794
795procedure TSharedBrokerProperties.Set_RpcHistoryEnabled(enabled: WordBool);
796begin
797 DefaultInterface.Set_RpcHistoryEnabled(enabled);
798end;
799
800function TSharedBrokerProperties.Get_PerClientRpcHistoryLimit: Integer;
801begin
802 Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
803end;
804
805procedure TSharedBrokerProperties.Set_PerClientRpcHistoryLimit(limit: Integer);
806begin
807 DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
808end;
809
810function TSharedBrokerProperties.Get_CurrentContext: WideString;
811begin
812 Result := DefaultInterface.Get_CurrentContext;
813end;
814
815function TSharedBrokerProperties.Get_User: WideString;
816begin
817 Result := DefaultInterface.Get_User;
818end;
819
820function TSharedBrokerProperties.Get_Login: WideString;
821begin
822 Result := DefaultInterface.Get_Login;
823end;
824
825procedure TSharedBrokerProperties.Set_Login(const Value: WideString);
826begin
827 DefaultInterface.Set_Login(Value);
828end;
829
830function TSharedBrokerProperties.Get_RpcbError: WideString;
831begin
832 Result := DefaultInterface.Get_RpcbError;
833end;
834
835function TSharedBrokerProperties.Get_Socket: Integer;
836begin
837 Result := DefaultInterface.Get_Socket;
838end;
839
840function TSharedBrokerProperties.Get_KernelLogin: WordBool;
841begin
842 Result := DefaultInterface.Get_KernelLogin;
843end;
844
845procedure TSharedBrokerProperties.Set_KernelLogin(Value: WordBool);
846begin
847 DefaultInterface.Set_KernelLogin(Value);
848end;
849
850function TSharedBrokerProperties.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
851begin
852 Result := DefaultInterface.Get_ShowErrorMsgs;
853end;
854
855procedure TSharedBrokerProperties.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
856begin
857 DefaultInterface.Set_ShowErrorMsgs(Value);
858end;
859
860{$ENDIF}
861{
862procedure Register;
863begin
864 RegisterComponents('Kernel',[TSharedBroker]);
865end;
866}
867end.
Note: See TracBrowser for help on using the repository browser.