com.apama.engine.beans.interfaces
Interface ConsumerOperationsInterface


public interface ConsumerOperationsInterface

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


Field Summary
static java.lang.String PROPERTY_CONSUMER_CHANNELS
          The string name of the bound property that is used for "consumerChannels" updates (typically "consumerChannels", but this constant should be used to be sure).
static java.lang.String PROPERTY_CONSUMER_CONNECTED
          The string name of the bound property that is used for "consumerConnected" updates (typically "consumerConnected", but this constant should be used to be sure).
 
Method Summary
 void addEventListener(IEventListener listener)
          Add a listener that will be notified whenever events are received on any of the channels on which this consumer is listening.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a property change listener.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Add a property change listener for a specific named property.
 java.lang.String[] getChannels()
          Get the list of channel names to which this consumer is subscribed.
 IEventListener[] getEventListeners()
          Get a list of all subscribed listeners (as an array).
 java.lang.String getName()
          Get the name of this consumer.
 boolean isConsumerConnected()
          Determine if this consumer is really connected to the remote Correlator.
 void removeAllEventListeners()
          Remove all event listeners that are listening to this consumer.
 void removeEventListener(IEventListener listener)
          Remove a previously added event listener.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a property change listener.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Remove a property change listener for a specific named property.
 void setChannels(java.lang.String[] channels)
          Set the list of channel names to which this consumer is subscribed.
 

Field Detail

PROPERTY_CONSUMER_CONNECTED

static final java.lang.String PROPERTY_CONSUMER_CONNECTED
The string name of the bound property that is used for "consumerConnected" updates (typically "consumerConnected", but this constant should be used to be sure).

See Also:
Constant Field Values

PROPERTY_CONSUMER_CHANNELS

static final java.lang.String PROPERTY_CONSUMER_CHANNELS
The string name of the bound property that is used for "consumerChannels" updates (typically "consumerChannels", but this constant should be used to be sure).

See Also:
Constant Field Values
Method Detail

getName

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

Returns:
the name of this consumer.

setChannels

void setChannels(java.lang.String[] channels)
                 throws EngineException
Set the list of channel names to which this consumer is subscribed.

Parameters:
channels - The set of channels to which to subscribe. Must be non-null, and contain no null elements.
Throws:
EngineException - Thrown if any exceptions occur in the Client SDK, or if the channels parameter is invalid.

getChannels

java.lang.String[] getChannels()
Get the list of channel names to which this consumer is subscribed.

Returns:
the list of channels.

isConsumerConnected

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

Returns:
true if connected, false otherwise.

addEventListener

void addEventListener(IEventListener listener)
Add a listener that will be notified whenever events are 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 the specified event listener does not lock the consumer or bean, and does not call any methods on the consumer or bean, to avoid the possibility of deadlock. If the handler does need to call bean methods (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 using the EventListenerAdapter adapter class so that events can be handled one at a time by implementing only the EventListenerAdapter.handleEvent(com.apama.event.Event) method.

Parameters:
listener - the listener to be added.

removeEventListener

void removeEventListener(IEventListener listener)
Remove a previously added event listener.

Parameters:
listener - the listener to be removed.

getEventListeners

IEventListener[] getEventListeners()
Get a list of all subscribed listeners (as an array).

Returns:
the list of event listeners.

removeAllEventListeners

void removeAllEventListeners()
Remove all event listeners that are listening to this consumer.


addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener. Use this method to be informed whenever the a property value is changed.

Parameters:
listener - the listener to be added.

addPropertyChangeListener

void addPropertyChangeListener(java.lang.String propertyName,
                               java.beans.PropertyChangeListener listener)
Add a property change listener for a specific named property.

Parameters:
propertyName - the name of the property to listen on.
listener - the listener to be added.

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener.

Parameters:
listener - the listener to be removed.

removePropertyChangeListener

void removePropertyChangeListener(java.lang.String propertyName,
                                  java.beans.PropertyChangeListener listener)
Remove a property change listener for a specific named property.

Parameters:
propertyName - the name of the property that was listened on.
listener - the listener to be removed.


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG