TROInvoker

Overview

The TROInvoker class is the base class for all remote method invoker classes. Invoker classes work on the server side and are necessary to invoke service methods: they read the message object's parameters, call the method code and read the results back to the message. Concrete invoker classes are created during the code generation process based on the RODL information.
As a rule, users should not use invoker classes directly and should never make changes to the generated classes code.

Location

  • Unit: uROServer.pas
  • Ancestry: TInterfacedObject | TROInvoker


Instance Methods


constructor Create  virtual

Creates a new instance.

constructor Create

AfterInvoke  protected virtual

This method is called after the service method invocation has completed.

procedure AfterInvoke(aMethodPtr: TMessageInvokeMethod; const anInstance: IInterface; const aFactory: IROClassFactory; const aMessage: IROMessage; const aTransport: IROTransport; anException: Exception)

Parameters:

  • aMethodPtr: Procedure type pointer to the invoked method
  • anInstance: Points to the service instance
  • aFactory: Points to the service class factory object
  • aMessage: Message object containing the method parameters and the result
  • aTransport: Points to the transport object containing connection-specific information
  • anException: Contains the exception object if one was raised during invocation

BeforeInvoke  protected virtual

This method is called before the service method invocation is performed.

procedure BeforeInvoke(aMethodPtr: TMessageInvokeMethod; const anInstance: IInterface; const aFactory: IROClassFactory; const aMessage: IROMessage; const aTransport: IROTransport)

Parameters:

  • aMethodPtr: Procedure type pointer to the method about to be invoked
  • anInstance: Points to the service instance
  • aFactory: Points to the service class factory object
  • aMessage: Message object containing the method parameters
  • aTransport: Points to the transport object containing connection-specific information

CheckRoles  protected

Validates roles

procedure CheckRoles(anInstance: IInterface; aRoles: array of string)

Parameters:

  • anInstance: Points to the service instance
  • aRoles: Roles

CustomHandleMessage  protected virtual

The main message handling method, called every time a new message comes to the server.

function CustomHandleMessage(const aFactory: IROClassFactory; const aMessage: IROMessage; const aTransport: IROTransport; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • aFactory: Points to the service class factory object
  • aMessage: Message that needs to be processed.
  • aTransport: Points to the transport object containing connection-specific information
  • oResponseOptions: Set of option flags such as 'no answer required', 'must not encrypt the answer', etc.

GetDefaultServiceRoles  protected virtual

Returns default service roles. default value = no roles

function GetDefaultServiceRoles: TStringArray

GetInvokeMethodName  protected virtual

function GetInvokeMethodName(aMessage: IROMessage): string

Parameters:

  • aMessage:

HandleMessage

Non-virtual public method to handle the message; this method actually calls the virtual method above.

function HandleMessage(const aFactory: IROClassFactory; const aMessage: IROMessage; const aTransport: IROTransport; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • aFactory: Points to the service class factory object
  • aMessage: Message that needs to be processed
  • aTransport: Points to the transport object containing connection-specific information
  • oResponseOptions: Set of option flags such as 'no answer required', 'must not encrypt the answer', etc.

Invoke_GetEventsData

Predefined invoker method to invoke the base service method that is responsible for sending events data to the client. Used in Legacy Events mode only.

procedure Invoke_GetEventsData(const __Instance: IInterface; const __Message: IROMessage; const __Transport: IROTransport; out __oResponseOptions: TROResponseOptions)

Parameters:

  • __Instance: Points to the service instance
  • __Message: Message that needs to be processed
  • __Transport: Points to the transport object containing connection-specific information
  • __oResponseOptions: Set of option flags such as 'no answer required', 'must not encrypt the answer', etc.

Invoke_RegisterClient

Predefined invoker method to invoke the base service method that is responsible for subscribing the client to receive events. Used in Legacy Events mode only, will otherwise be ignored by the service.

procedure Invoke_RegisterClient(const __Instance: IInterface; const __Message: IROMessage; const __Transport: IROTransport; out __oResponseOptions: TROResponseOptions)

Parameters:

  • __Instance: Points to the service instance
  • __Message: Message that needs to be processed
  • __Transport: Points to the transport object containing connection-specific information
  • __oResponseOptions: Set of option flags such as 'no answer required', 'must not encrypt the answer', etc.

Invoke_RegisterEventClient

Different name for the method above.

procedure Invoke_RegisterEventClient(const __Instance: IInterface; const __Message: IROMessage; const __Transport: IROTransport; out __oResponseOptions: TROResponseOptions)

Parameters:

  • __Instance: Points to the service instance
  • __Message: Message that needs to be processed
  • __Transport: Points to the transport object containing connection-specific information
  • __oResponseOptions: Set of option flags such as 'no answer required', 'must not encrypt the answer', etc.

Invoke_UnregisterClient

Predefined invoker method to invoke the base service method that is responsible for unsubscribing the client from events. Used in Legacy Events mode only, will otherwise be ignored by the service.

procedure Invoke_UnregisterClient(const __Instance: IInterface; const __Message: IROMessage; const __Transport: IROTransport; out __oResponseOptions: TROResponseOptions)

Parameters:

  • __Instance: Points to the service instance
  • __Message: Message that needs to be processed
  • __Transport: Points to the transport object containing connection-specific information
  • __oResponseOptions: Set of option flags such as 'no answer required', 'must not encrypt the answer', etc.

Invoke_UnregisterEventClient

Different name for the method above.

procedure Invoke_UnregisterEventClient(const __Instance: IInterface; const __Message: IROMessage; const __Transport: IROTransport; out __oResponseOptions: TROResponseOptions)

Parameters:

  • __Instance: Points to the service instance
  • __Message: Message that needs to be processed
  • __Transport: Points to the transport object containing connection-specific information
  • __oResponseOptions: Set of option flags such as 'no answer required', 'must not encrypt the answer', etc.