TROEventInvoker

Overview

The TROEventInvoker class is used to invoke events that came from the client to the server. This is the base class for custom EventInvoker classes created in the _Intf source files auto-generated from your RODL Library.

You will not usually deal with this class (or its descendants) directly, but the Remoting SDK invocation framework will use them to execute procedures that are related with the server events.

For example, if you want to see the TROEventInvoker work, you can add a new event sink in the |service builder and then rebuild the project group. In the Intf file you will see the Invoke<new event sink name> procedure, which belongs to the descendant of the TROEventInvoker class and invokes the new event sink.

Location


 

constructor Create (TROEventReceiver, IROMessage, Boolean)  reintroduce

Creates a new instance.

constructor Create(anEventReceiver: TROEventReceiver; const aMessage: IROMessage; aCloneMessage: Boolean)

Parameters:

  • anEventReceiver:
  • aMessage:
  • aCloneMessage:

constructor Create (IROMessage, Boolean)    (declared in TROEventProxy)

Creates a new TROEventProxy object with the specified message aMessage. If the CloneMessage is true, the constructor creates a copy of the aMessage and saves it in the private variable fMessage. If the CloneMessage is false, the fMessage saves a reference of the aMessage.

constructor Create(const aMessage: IROMessage; aCloneMessage: Boolean)

Parameters:

  • aMessage: Specified message
  • aCloneMessage: When true, a copy of the aMessage will be saved, otherwise a reference to the aMessage will be saved.

CloneMessage    (declared in TROEventProxy)

Controls which message instance will be used for remote requests. The value of this property affects TROBaseProxy.__GetMessage behavior, when set to true it will clone the message instance every time before making a remote request. Cloning the message helps to avoid conflicts in multithreaded environment (e.g. when TROEventReceiver is used).

property CloneMessage: Boolean read write

Execute  protected

Calls the method of the aTarget object that processes the current event. The aTarget always contains the event method. The EventData defines the current event data. The Execute procedure defines the method with the name "Invoke_+__Message.MessageName" and then calls this method via the aTarget object.

procedure Execute(const aTarget: TObject; EventData: TStream)

Parameters:

  • aTarget: Object that processes the current event
  • EventData: The data that is associated with the current event

NewInstance  override    (declared in TROInterfacedObject)

Creates and returns a new instance of the interfaced object, initializing its reference counter with 1.

class function NewInstance: TObject

RefCount    (declared in TROInterfacedObject)

Provides read-only access to the reference counter. When this value reaches zero, the object is freed.

property RefCount: Integer read

 

CloneMessage    (declared in TROEventProxy)

Controls which message instance will be used for remote requests. The value of this property affects TROBaseProxy.__GetMessage behavior, when set to true it will clone the message instance every time before making a remote request. Cloning the message helps to avoid conflicts in multithreaded environment (e.g. when TROEventReceiver is used).

property CloneMessage: Boolean read write

RefCount    (declared in TROInterfacedObject)

Provides read-only access to the reference counter. When this value reaches zero, the object is freed.

property RefCount: Integer read

 

NewInstance  override    (declared in TROInterfacedObject)

Creates and returns a new instance of the interfaced object, initializing its reference counter with 1.

class function NewInstance: TObject

 

constructor Create (TROEventReceiver, IROMessage, Boolean)  reintroduce

Creates a new instance.

constructor Create(anEventReceiver: TROEventReceiver; const aMessage: IROMessage; aCloneMessage: Boolean)

Parameters:

  • anEventReceiver:
  • aMessage:
  • aCloneMessage:

constructor Create (IROMessage, Boolean)    (declared in TROEventProxy)

Creates a new TROEventProxy object with the specified message aMessage. If the CloneMessage is true, the constructor creates a copy of the aMessage and saves it in the private variable fMessage. If the CloneMessage is false, the fMessage saves a reference of the aMessage.

constructor Create(const aMessage: IROMessage; aCloneMessage: Boolean)

Parameters:

  • aMessage: Specified message
  • aCloneMessage: When true, a copy of the aMessage will be saved, otherwise a reference to the aMessage will be saved.

Execute  protected

Calls the method of the aTarget object that processes the current event. The aTarget always contains the event method. The EventData defines the current event data. The Execute procedure defines the method with the name "Invoke_+__Message.MessageName" and then calls this method via the aTarget object.

procedure Execute(const aTarget: TObject; EventData: TStream)

Parameters:

  • aTarget: Object that processes the current event
  • EventData: The data that is associated with the current event