Apama API Reference for .NET
9.10.0.4
|
The Interface for an EventServiceChannel More...
Public Member Functions | |
void | AddEventListener (IEventListener eventListener) |
Add an old-style IEventListener that will be notified of every event (of a pre-registered type) that is received by this EventServiceChannel instance. More... | |
void | AddEventListener (HandleEventCallback callback) |
Notify the given callback method of every event (of a pre-registered type) that is received by this EventServiceChannel instance. More... | |
void | AddEventListener (IEventListener eventListener, EventType eventType) |
Add an old-style IEventListener that will be notified of every event, of the specified EventType, that is received by this EventServiceChannel instance. More... | |
void | AddEventListener (HandleEventCallback callback, EventType eventType) |
Notify the given callback method of every event, of the specified type, that is received by this EventServiceChannel instance. More... | |
void | AsyncRequestResponse (IResponseListener responseListener, Apama.Event.Event requestEvent, EventType responseEventType) |
Emulate an asynchronous RPC call to the Correlator by sending an event, and then invoking a callback when a matching response event is received (non-blocking call). More... | |
void | AsyncRequestResponse (IResponseListener responseListener, Apama.Event.Event requestEvent, EventType responseEventType, long timeout) |
Emulate an asynchronous RPC call to the Correlator by sending an event, and then invoking a callback when a matching response event is received (non-blocking call, with timeout). More... | |
void | ClearProcessingQueue () |
Immediately remove (discard) all events from the internal processing queue. More... | |
void | RegisterEventType (EventType eventType) |
Register an arbitrary EventType with this EventServiceChannel. More... | |
void | RemoveEventListener (IEventListener eventListener) |
Remove a previously registered old-style IEventListener that was listening to all events received. More... | |
void | RemoveEventListener (IEventListener eventListener, EventType eventType) |
Remove a previously registered old-style IEventListener that was listening to all events received of the specified EventType. More... | |
void | RemoveEventListener (HandleEventCallback eventListener) |
Remove a previously registered HandleEventCallback that was listening to all events received. More... | |
void | RemoveEventListener (HandleEventCallback eventListener, EventType eventType) |
Remove a previously registered HandleEventCallback that was listening to all events received of the specified EventType. More... | |
IResponseWrapper | RequestResponse (Apama.Event.Event requestEvent, EventType responseEventType) |
Emulate a synchronous RPC call to the Correlator by sending an event and awaiting a matching response event (blocking call). More... | |
IResponseWrapper | RequestResponse (Apama.Event.Event requestEvent, EventType responseEventType, long timeout) |
Emulate a synchronous RPC call to the Correlator by sending an event and awaiting a matching response event (blocking call with timeout). More... | |
void | UnregisterEventType (EventType eventType) |
Unregister an arbitrary EventType from this EventServiceChannel. More... | |
Properties | |
IDictionary< string, object > | Config [get] |
Get the channel configuration that define the requested operating semantics of this instance. More... | |
bool | Destroyed [get] |
Determine if this EventServiceChannel channel (not the Correlator) is destroyed. More... | |
IEventListener | LateResponseListener [set] |
Register the old-style IEventListener that will be notified of any "late" responses to either synchronous or asynchronous request-response calls. More... | |
string | Name [get] |
Get the name of the channel(s) that this instance is consuming events from. More... | |
Events | |
HandleEventCallback | LateResponseReceived |
Subscribes to notifications of any "late" responses to either synchronous or asynchronous request-response calls. More... | |
The Interface for an EventServiceChannel
To create an IEventServiceChannel, use the IEventService.AddChannel(string, IDictionary<string, object>) method. If the channel is no longer required, it can be removed using IEventService.RemoveChannel(string).
void Apama.Services.Event.IEventServiceChannel.AddEventListener | ( | IEventListener | eventListener | ) |
Add an old-style IEventListener that will be notified of every event (of a pre-registered type) that is received by this EventServiceChannel instance.
Note The listener will only be notified about events that are of a type registered with the parser. Clients must first use RegisterEventType(EventType) to register the event types in which they are interested. All other event types will be ignored (parse errors will be logged).
eventListener | the object implementing the callback interface - only the single-event IEventListener.HandleEvent(Apama.Event.Event) method will be called. |
void Apama.Services.Event.IEventServiceChannel.AddEventListener | ( | HandleEventCallback | callback | ) |
Notify the given callback method of every event (of a pre-registered type) that is received by this EventServiceChannel instance.
Note The listener will only be notified about events that are of a type registered with the parser. Clients must first use RegisterEventType(EventType) to register the event types in which they are interested. All other event types will be ignored (parse errors will be logged).
callback |
void Apama.Services.Event.IEventServiceChannel.AddEventListener | ( | IEventListener | eventListener, |
EventType | eventType | ||
) |
Add an old-style IEventListener that will be notified of every event, of the specified EventType, that is received by this EventServiceChannel instance.
The specified EventType will be automatically added to the types understood by the EventParser used by this EventServiceChannel. Any existing EventType definition will be overwritten.
eventListener | the object implementing the callback interface - only the single-event IEventListener.HandleEvent(Apama.Event.Event) method will be called. |
eventType | the single EventType filter. |
void Apama.Services.Event.IEventServiceChannel.AddEventListener | ( | HandleEventCallback | callback, |
EventType | eventType | ||
) |
Notify the given callback method of every event, of the specified type, that is received by this EventServiceChannel instance.
The specified EventType will be automatically added to the types understood by the EventParser used by this EventServiceChannel. Any existing EventType definition will be overwritten.
callback | |
eventType |
void Apama.Services.Event.IEventServiceChannel.AsyncRequestResponse | ( | IResponseListener | responseListener, |
Apama.Event.Event | requestEvent, | ||
EventType | responseEventType | ||
) |
Emulate an asynchronous RPC call to the Correlator by sending an event, and then invoking a callback when a matching response event is received (non-blocking call).
Both the request event, and the response event must contain an integer field called messageId. This service will allocate a value to that field in the request event, and will await a response event of the specified type that contains a messageId field of the same value.
The responseListener will be notified of any exceptions thrown during the asynchronous call. The possible exceptions are: ResponseTimeoutException if the timeout is exceeded without receiving the response. EngineException if there was a problem sending the request. EventServiceException if the event type of either the request of the repsonse did not contain a messageId field.
The specified EventType will be automatically added to the types understood by the EventParser used by this EventServiceChannel. Any existing EventType definition will be overwritten.
Note: this is a non-blocking call. The method will return as soon as the request is sent, and then at a later time when the response is received it will be passed to the supplied callback method.
The request is sent on the client thread (whichever thread calls this method).
The client callback handleResponse() method will be called on a background thread.
The client callback handleException() method will be called on a background thread.
responseListener | the object implementing the callback interface. |
requestEvent | the request Event to be sent to the Correlator. |
responseEventType | the expected EventType of the response Event from the Correlator. |
Apama.EngineException | Thrown if there was a problem sending the request. |
EventServiceException | Thrown if the event type of either the request of the repsonse did not contain a messageId field. |
void Apama.Services.Event.IEventServiceChannel.AsyncRequestResponse | ( | IResponseListener | responseListener, |
Apama.Event.Event | requestEvent, | ||
EventType | responseEventType, | ||
long | timeout | ||
) |
Emulate an asynchronous RPC call to the Correlator by sending an event, and then invoking a callback when a matching response event is received (non-blocking call, with timeout).
Both the request event, and the response event must contain an integer field called messageId. This service will allocate a value to that field in the request event, and will await a response event of the specified type that contains a messageId field of the same value.
The responseListener will be notified of any exceptions thrown during the asynchronous call. The possible exceptions are: ResponseTimeoutException if the timeout is exceeded without receiving the response. EngineException if there was a problem sending the request. EventServiceException if the event type of either the request of the repsonse did not contain a messageId field.
The specified EventType will be automatically added to the types understood by the EventParser used by this EventServiceChannel. Any existing EventType definition will be overwritten.
Note: this is a non-blocking call. The method will return as soon as the request is sent, and then at a later time when the response is received it will be passed to the supplied callback method. If a response is not received within the specified timeout period, the callback will be "unregistered".
The request is sent on the client thread (whichever thread calls this method).
The client callback handleResponse() method will be called on a background thread.
The client callback handleException() method will be called on a background thread.
responseListener | the object implementing the callback interface. |
requestEvent | the request Event to be sent to the Correlator. |
responseEventType | the expected EventType of the response Event from the Correlator. |
timeout | the maximum time (in milliseconds) to wait for a response. |
Apama.EngineException | Thrown if there was a problem sending the request. |
EventServiceException | Thrown if the event type of either the request of the repsonse did not contain a messageId field. |
void Apama.Services.Event.IEventServiceChannel.ClearProcessingQueue | ( | ) |
Immediately remove (discard) all events from the internal processing queue.
void Apama.Services.Event.IEventServiceChannel.RegisterEventType | ( | EventType | eventType | ) |
Register an arbitrary EventType with this EventServiceChannel.
This method can be used in conjunction with a listener that is listening to all (unfiltered) events received.
The specified EventType will be added to the types understood by the EventParser used by this EventServiceChannel. Any existing EventType definition will be overwritten.
eventType | a single EventType to be registered. |
void Apama.Services.Event.IEventServiceChannel.RemoveEventListener | ( | IEventListener | eventListener | ) |
Remove a previously registered old-style IEventListener that was listening to all events received.
eventListener | the object implementing the callback interface that is to be removed. |
void Apama.Services.Event.IEventServiceChannel.RemoveEventListener | ( | IEventListener | eventListener, |
EventType | eventType | ||
) |
Remove a previously registered old-style IEventListener that was listening to all events received of the specified EventType.
The specified EventType will NOT be removed from the types understood by the EventParser used by this EventServiceChannel.
eventListener | the object implementing the callback interface that is to be removed. |
eventType | the single EventType filter. |
void Apama.Services.Event.IEventServiceChannel.RemoveEventListener | ( | HandleEventCallback | eventListener | ) |
Remove a previously registered HandleEventCallback that was listening to all events received.
eventListener | the object implementing the callback that is to be removed. |
void Apama.Services.Event.IEventServiceChannel.RemoveEventListener | ( | HandleEventCallback | eventListener, |
EventType | eventType | ||
) |
Remove a previously registered HandleEventCallback that was listening to all events received of the specified EventType.
The specified EventType will NOT be removed from the types understood by the EventParser used by this EventServiceChannel.
eventListener | the object implementing the callback that is to be removed. |
eventType | the single EventType filter. |
IResponseWrapper Apama.Services.Event.IEventServiceChannel.RequestResponse | ( | Apama.Event.Event | requestEvent, |
EventType | responseEventType | ||
) |
Emulate a synchronous RPC call to the Correlator by sending an event and awaiting a matching response event (blocking call).
Both the request event, and the response event must contain an integer field called messageId. This service will allocate a value to that field in the request event, and will await a response event of the specified type that contains a messageId field of the same value.
The specified EventType will be automatically added to the types understood by the EventParser used by this EventServiceChannel. Any existing EventType definition will be overwritten.
Note: this is a blocking call.
requestEvent | the request Event to be sent to the Correlator. |
responseEventType | the expected EventType of the response Event from the Correlator. |
the response Event from the Correlator, inside the wrapper that is used for locking when response sequencing is enforced.
ResponseTimeoutException | If the default timeout is exceeded without receiving the response. |
EngineException | If there was a problem sending the request. |
EventServiceException | If the event type of either the request of the repsonse did not contain a messageId field. |
IResponseWrapper Apama.Services.Event.IEventServiceChannel.RequestResponse | ( | Apama.Event.Event | requestEvent, |
EventType | responseEventType, | ||
long | timeout | ||
) |
Emulate a synchronous RPC call to the Correlator by sending an event and awaiting a matching response event (blocking call with timeout).
Both the request event, and the response event must contain an integer field called messageId. This service will allocate a value to that field in the request event, and will await a response event of the specified type that contains a messageId field of the same value.
The specified EventType will be automatically added to the types understood by the EventParser used by this EventServiceChannel. Any existing EventType definition will be overwritten.
Note: this is a blocking call, but with a timeout.
requestEvent | the request Event to be sent to the Correlator. |
responseEventType | the expected EventType of the response Event from the Correlator. |
timeout | the maximum time (in milliseconds) to wait for a response. |
the response Event from the Correlator, inside the wrapper that is used for locking when response sequencing is enforced.
ResponseTimeoutException | If the timeout is exceeded without receiving the response. |
EngineException | If there was a problem sending the request. |
EventServiceException | If the event type of either the request of the repsonse did not contain a messageId field. |
void Apama.Services.Event.IEventServiceChannel.UnregisterEventType | ( | EventType | eventType | ) |
Unregister an arbitrary EventType from this EventServiceChannel.
The specified EventType will be removed from the types understood by the EventParser used by this EventServiceChannel.
eventType | a single EventType to be unregistered. |
|
get |
Get the channel configuration that define the requested operating semantics of this instance.
This is a read-only property.
|
get |
Determine if this EventServiceChannel channel (not the Correlator) is destroyed.
|
set |
Register the old-style IEventListener that will be notified of any "late" responses to either synchronous or asynchronous request-response calls.
New applications should use the LateResponseReceived event instead of this property (also note, that the two cannot be used together).
This callback will be invoked if a call had been made to one of the timeout versions of the request-response methods, but the response was received after the timeout period had elapsed.
the object implementing the callback interface - only the single-event IEventListener.HandleEvent(Apama.Event.Event) method will be called.
|
get |
Get the name of the channel(s) that this instance is consuming events from.
This is a read-only property.
HandleEventCallback Apama.Services.Event.IEventServiceChannel.LateResponseReceived |
Subscribes to notifications of any "late" responses to either synchronous or asynchronous request-response calls.
Registered callbacks will be invoked if a call has been made to one of the timeout versions of the request-response methods, but the response was received after the timeout period had elapsed. It is an error to add more than one LateResponseReceived subscriber.