Apama API Reference for .NET  9.10.0.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Apama.Engine.Client.IConsumerOperations Interface Reference

IConsumerOperations is an interface that specifies the standard operations to enable a client to receive events on specific channels from a remote Correlator. More...

Public Member Functions

void AddEventListener (IEventListener listener)
 Add an old-style IEventListener (see also EventReceived). More...
 
void AddPropertyChangeListener (PropertyChangedEventHandler listener)
 Add a property change listener. Use this method to be informed whenever the a property value is changed. More...
 
void AddPropertyChangeListener (string propertyName, PropertyChangedEventHandler listener)
 Add a property change listener for a specific named property. More...
 
void AddPropertyChangeListenerSync (PropertyChangedEventHandler listener)
 Add a property change listener. Use this method to be informed whenever the a property value is changed. More...
 
void AddPropertyChangeListenerSync (string propertyName, PropertyChangedEventHandler listener)
 Add a property change listener for a specific named property. More...
 
IEventListener[] GetEventListeners ()
 Get a list of subscribed listeners (as an array). More...
 
void RemoveAllEventListeners ()
 Remove all IEventListeners and EventReceived subscribers that are listening to this consumer. More...
 
void RemoveEventListener (IEventListener listener)
 Remove a previously added old-style IEventListener. More...
 
void RemovePropertyChangeListener (PropertyChangedEventHandler listener)
 Remove a property change listener. More...
 
void RemovePropertyChangeListener (string propertyName, PropertyChangedEventHandler listener)
 Remove a property change listener for a specific named property. More...
 
void RemovePropertyChangeListenerSync (PropertyChangedEventHandler listener)
 Remove a property change listener registered with AddPropertyChangeListenerSync(). More...
 
void RemovePropertyChangeListenerSync (string propertyName, PropertyChangedEventHandler listener)
 Remove a property change listener for a specific named property registered with AddPropertyChangeListenerSync(). More...
 
void SetChannels (params string[] newChannels)
 Set the list of channel names to which this consumer is subscribed. More...
 

Properties

ReadOnlyCollection< string > Channels [get]
 Get the list of channel names to which this consumer is subscribed. More...
 
bool ConsumerConnected [get]
 Determine if this consumer is really connected to the remote Correlator. (This is a read-only property.) More...
 
string Name [get]
 Get the name of this consumer. (This is a read-only property.) More...
 

Events

HandleEventCallback EventReceived
 Notifies subscribers when an Apama event is received on any of the channels on which this consumer is listening. More...
 

Detailed Description

IConsumerOperations is an interface that specifies the standard operations to enable a client to receive events on specific channels from a remote Correlator.

See Apama.Engine.Client.EngineClientConstants for constants used by this interface.

Member Function Documentation

void Apama.Engine.Client.IConsumerOperations.AddEventListener ( IEventListener  listener)

Add an old-style IEventListener (see also EventReceived).

Threading note: unless this was created as an asynchronous consumer, it is essential that the specified event listener does not lock the consumer or client, and does not call any methods on the consumer or client, to avoid the possibility of deadlock. If the handler does need to call methods on the client (e.g. to send events) then an asynchronous named consumer must be used instead.

Note that only the plural HandleEvents(Event[]) method of the listener will be called. Clients should consider subscribing to the EventReceived .NET event member for a simpler interface to handle received events.

Parameters
listenerthe listener to be added.
void Apama.Engine.Client.IConsumerOperations.AddPropertyChangeListener ( PropertyChangedEventHandler  listener)

Add a property change listener. Use this method to be informed whenever the a property value is changed.

Since Apama 5.2, listeners registered with this method will be called back asynchronously on a dedicated thread, which means it is permissible to call any engine client method from the listener - though be aware that the property value could have changed since the property change notification was fired, so may be different to the specified 'new value'. Applications that need the previous synchronous notification behaviour can use AddPropertyChangeListenerSync to help with migration.

Parameters
listenerthe listener to be added.
void Apama.Engine.Client.IConsumerOperations.AddPropertyChangeListener ( string  propertyName,
PropertyChangedEventHandler  listener 
)

Add a property change listener for a specific named property.

Since Apama 5.2, listeners registered with this method will be called back asynchronously on a dedicated thread, which means it is permissible to call any engine client method from the listener - though be aware that the property value could have changed since the property change notification was fired, so may be different to the specified 'new value'. Applications that need the previous synchronous notification behaviour can use AddPropertyChangeListenerSync to help with migration.

Parameters
propertyNamethe name of the property to listen on.
listenerthe listener to be added.
void Apama.Engine.Client.IConsumerOperations.AddPropertyChangeListenerSync ( PropertyChangedEventHandler  listener)

Add a property change listener. Use this method to be informed whenever the a property value is changed.

Deprecated - The synchronous property change listener methods are a temporary migration aid only, and will be removed in a future release. Use AddPropertyChangeListener() instead.

This method is deprecated and applications should use AddPropertyChangeListener() instead wherever possible, however this method is provided to simplify migration from pre-5.2 Apama releases which provided synchronous listener behaviour by default. To avoid the possibility of deadlock, it is essential that listeners registered using this method do not attempt to make calls back into the engine client (or any other service that uses it).

Parameters
listenerthe listener to be added.
void Apama.Engine.Client.IConsumerOperations.AddPropertyChangeListenerSync ( string  propertyName,
PropertyChangedEventHandler  listener 
)

Add a property change listener for a specific named property.

Deprecated - The synchronous property change listener methods are a temporary migration aid only, and will be removed in a future release. Use AddPropertyChangeListener() instead.

This method is deprecated and applications should use AddPropertyChangeListener() instead wherever possible, however this method is provided to simplify migration from pre-5.2 Apama releases which provided synchronous listener behaviour by default. To avoid the possibility of deadlock, it is essential that listeners registered using this method do not attempt to make calls back into the engine client (or any other service that uses it).

Parameters
propertyNamethe name of the property to listen on.
listenerthe listener to be added.
IEventListener [] Apama.Engine.Client.IConsumerOperations.GetEventListeners ( )

Get a list of subscribed listeners (as an array).

There is rarely any reason to call this method and it may be removed in a future release.

Returns
the list of event listeners.
void Apama.Engine.Client.IConsumerOperations.RemoveAllEventListeners ( )

Remove all IEventListeners and EventReceived subscribers that are listening to this consumer.

void Apama.Engine.Client.IConsumerOperations.RemoveEventListener ( IEventListener  listener)

Remove a previously added old-style IEventListener.

Parameters
listenerthe listener to be removed.
void Apama.Engine.Client.IConsumerOperations.RemovePropertyChangeListener ( PropertyChangedEventHandler  listener)

Remove a property change listener.

Parameters
listenerthe listener to be removed.
void Apama.Engine.Client.IConsumerOperations.RemovePropertyChangeListener ( string  propertyName,
PropertyChangedEventHandler  listener 
)

Remove a property change listener for a specific named property.

Parameters
propertyNamethe name of the property that was listened on.
listenerthe listener to be removed.
void Apama.Engine.Client.IConsumerOperations.RemovePropertyChangeListenerSync ( PropertyChangedEventHandler  listener)

Remove a property change listener registered with AddPropertyChangeListenerSync().

Deprecated - The synchronous property change listener methods are a temporary migration aid only, and will be removed in a future release. Use RemovePropertyChangeListener() instead.

Parameters
listenerthe listener to be removed.
void Apama.Engine.Client.IConsumerOperations.RemovePropertyChangeListenerSync ( string  propertyName,
PropertyChangedEventHandler  listener 
)

Remove a property change listener for a specific named property registered with AddPropertyChangeListenerSync().

Deprecated - The synchronous property change listener methods are a temporary migration aid only, and will be removed in a future release. Use RemovePropertyChangeListener() instead.

Parameters
propertyNamethe name of the property that was listened on.
listenerthe listener to be removed.
void Apama.Engine.Client.IConsumerOperations.SetChannels ( params string[]  newChannels)

Set the list of channel names to which this consumer is subscribed.

The array of channels to which to subscribe. Must be non-null, and contain no null elements.

Parameters
newChannelsAn array of string representing the channels to listen on
Exceptions
Apama.EngineExceptionThrown if any exceptions occur in the Client SDK, or if the parameter is invalid.

Property Documentation

ReadOnlyCollection<string> Apama.Engine.Client.IConsumerOperations.Channels
get

Get the list of channel names to which this consumer is subscribed.

Returns
the list of channels.
bool Apama.Engine.Client.IConsumerOperations.ConsumerConnected
get

Determine if this consumer is really connected to the remote Correlator. (This is a read-only property.)

Returns
true if connected, false otherwise.
string Apama.Engine.Client.IConsumerOperations.Name
get

Get the name of this consumer. (This is a read-only property.)

Returns
the name of this consumer.

Event Documentation

HandleEventCallback Apama.Engine.Client.IConsumerOperations.EventReceived

Notifies subscribers when an Apama event is received on any of the channels on which this consumer is listening.

Threading note: unless this was created as an asynchronous consumer, it is essential that subscribed callbacks do not lock the consumer or client, and do not call any methods on the consumer or client, to avoid the possibility of deadlock. If the handler does need to call methods on the client (e.g. to send events) then an asynchronous named consumer must be used instead.

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.