55 lines
1.9 KiB
ObjectPascal
55 lines
1.9 KiB
ObjectPascal
unit uRODiscoveryService_Impl;
|
|
|
|
{----------------------------------------------------------------------------}
|
|
{ This unit was automatically generated by the RemObjects SDK after reading }
|
|
{ the RODL file associated with this project . }
|
|
{ }
|
|
{ This is where you are supposed to code the implementation of your objects. }
|
|
{----------------------------------------------------------------------------}
|
|
|
|
{$I RemObjects.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
{vcl:} Classes, SysUtils,
|
|
{RemObjects:} uROClientIntf, uROTypes, uROServer, //uROServerIntf,
|
|
{Generated:} uRODiscovery_Intf;
|
|
|
|
type
|
|
TRODiscoveryService = class(TRORemotable, IRODiscoveryService)
|
|
private
|
|
protected
|
|
function FindService(const iName:Ansistring; var ioDiscoveryOptions:TRODiscoveryOptions):Ansistring;
|
|
end;
|
|
|
|
procedure RegisterDiscoveryService();
|
|
|
|
implementation
|
|
|
|
uses
|
|
{Generated:} uRODiscovery_Invk, uROClassFactories, uRODiscovery, uROClasses;
|
|
|
|
procedure Create_TRODiscoveryService(out anInstance:IUnknown);
|
|
begin
|
|
anInstance := TRODiscoveryService.Create;
|
|
end;
|
|
|
|
procedure RegisterDiscoveryService();
|
|
begin
|
|
//ToDo: prevent class factory from being registered multiple times.
|
|
if not IsClassFactoryRegistered('IRODiscoveryService') then
|
|
TROSingletonClassFactory.Create('IRODiscoveryService', Create_TRODiscoveryService, TIRODiscoveryService_Invoker);
|
|
end;
|
|
|
|
function TRODiscoveryService.FindService(const iName:Ansistring; var ioDiscoveryOptions:TRODiscoveryOptions):Ansistring;
|
|
var
|
|
lHandled:boolean;
|
|
begin
|
|
lHandled := false;
|
|
result := {$IFDEF UNICODE}WideStringToAnsiString{$ENDIF} (DiscoveryServerManager.FindService({$IFDEF UNICODE}AnsiStringToWideString{$ENDIF}(iName), ioDiscoveryOptions, lHandled));
|
|
if not lHandled then ROSendNoResponse();
|
|
end;
|
|
|
|
end.
|