55 lines
1.7 KiB
ObjectPascal
55 lines
1.7 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:string; var ioDiscoveryOptions:TRODiscoveryOptions):string;
|
|
end;
|
|
|
|
procedure RegisterDiscoveryService();
|
|
|
|
implementation
|
|
|
|
uses
|
|
{Generated:} uRODiscovery_Invk, uROClassFactories, uRODiscovery;
|
|
|
|
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:string; var ioDiscoveryOptions:TRODiscoveryOptions):string;
|
|
var
|
|
lHandled:boolean;
|
|
begin
|
|
lHandled := false;
|
|
result := DiscoveryServerManager.FindService(iName, ioDiscoveryOptions, lHandled);
|
|
if not lHandled then ROSendNoResponse();
|
|
end;
|
|
|
|
end.
|