Apama API Reference for .NET  9.10.0.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Apama.Services.Event.IEventServiceChannel Interface Reference

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...
 

Detailed Description

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).

See also
EventServiceChannelConstants

Member Function Documentation

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).

Parameters
eventListenerthe object implementing the callback interface - only the single-event IEventListener.HandleEvent(Apama.Event.Event) method will be called.
See also
Apama.Event.EventListenerAdapter
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).

Parameters
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.

Parameters
eventListenerthe object implementing the callback interface - only the single-event IEventListener.HandleEvent(Apama.Event.Event) method will be called.
eventTypethe single EventType filter.
See also
Apama.Event.EventListenerAdapter
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.

Parameters
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.

Parameters
responseListenerthe object implementing the callback interface.
requestEventthe request Event to be sent to the Correlator.
responseEventTypethe expected EventType of the response Event from the Correlator.
Exceptions
Apama.EngineExceptionThrown if there was a problem sending the request.
EventServiceExceptionThrown 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.

Parameters
responseListenerthe object implementing the callback interface.
requestEventthe request Event to be sent to the Correlator.
responseEventTypethe expected EventType of the response Event from the Correlator.
timeoutthe maximum time (in milliseconds) to wait for a response.
Exceptions
Apama.EngineExceptionThrown if there was a problem sending the request.
EventServiceExceptionThrown 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.

Parameters
eventTypea 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.

Parameters
eventListenerthe 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.

Parameters
eventListenerthe object implementing the callback interface that is to be removed.
eventTypethe single EventType filter.
void Apama.Services.Event.IEventServiceChannel.RemoveEventListener ( HandleEventCallback  eventListener)

Remove a previously registered HandleEventCallback that was listening to all events received.

Parameters
eventListenerthe 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.

Parameters
eventListenerthe object implementing the callback that is to be removed.
eventTypethe 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.

Parameters
requestEventthe request Event to be sent to the Correlator.
responseEventTypethe expected EventType of the response Event from the Correlator.
Returns

the response Event from the Correlator, inside the wrapper that is used for locking when response sequencing is enforced.

Exceptions
ResponseTimeoutExceptionIf the default timeout is exceeded without receiving the response.
EngineExceptionIf there was a problem sending the request.
EventServiceExceptionIf 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.

Parameters
requestEventthe request Event to be sent to the Correlator.
responseEventTypethe expected EventType of the response Event from the Correlator.
timeoutthe maximum time (in milliseconds) to wait for a response.
Returns

the response Event from the Correlator, inside the wrapper that is used for locking when response sequencing is enforced.

Exceptions
ResponseTimeoutExceptionIf the timeout is exceeded without receiving the response.
EngineExceptionIf there was a problem sending the request.
EventServiceExceptionIf 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.

Parameters
eventTypea single EventType to be unregistered.

Property Documentation

IDictionary<string, object> Apama.Services.Event.IEventServiceChannel.Config
get

Get the channel configuration that define the requested operating semantics of this instance.

This is a read-only property.

Returns
an unmodifiable view of the channelConfig Map that was specified at construction.
bool Apama.Services.Event.IEventServiceChannel.Destroyed
get

Determine if this EventServiceChannel channel (not the Correlator) is destroyed.

Returns
true if already destroyed, false otherwise.
IEventListener Apama.Services.Event.IEventServiceChannel.LateResponseListener
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.

See also
Apama.Event.EventListenerAdapter
See also
LateResponseReceived
string Apama.Services.Event.IEventServiceChannel.Name
get

Get the name of the channel(s) that this instance is consuming events from.

This is a read-only property.

Returns
A single string containing the channel name, or a single string containin a comma separated list of channel names.

Event Documentation

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.

Submit a bug or feature
Copyright (c) 2013-2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.