com.genesyslab.omsdk.qil.applicationblocks.monitoring.listeners
Class QueueListeners

java.lang.Object
  extended bycom.genesyslab.omsdk.qil.applicationblocks.monitoring.listeners.QueueListeners

public class QueueListeners
extends java.lang.Object

Illustrates how to use the QIL QueueListeners feature, and how to add to (or remove from) a queue's queue listener list, used for subscribing to queue events.
Note that this feature is distinct from QIL's InteractionListeners feature.
This class assumes that QIL factory has already been successfully initialized.


Constructor Summary
QueueListeners()
          Creates a QueueListeners instance with a listener built in.
QueueListeners(QILQueueListener singleListener)
          Creates a QueueListeners instance with a listener for use with subscribing to queue events.
 
Method Summary
 void attachListener(java.lang.String queueName)
          Adds the listener for this instance to the queue listeners list of the given queue.
This method uses the listener instance provided or created in constructor.
 void dettachListener(java.lang.String queueName)
          Removes the listener for this instance from the queue listeners list of the given queue.
 void startListening(java.lang.String queueName, QILQueueListener listener)
          Adds the listener for this instance to the queue listeners list of the given queue.
 void stopListening(java.lang.String queueName, QILQueueListener listener)
          Removes the listener for this instance from the queue listeners list of the given queue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueListeners

public QueueListeners(QILQueueListener singleListener)
Creates a QueueListeners instance with a listener for use with subscribing to queue events.

Parameters:
singleListener - listener.

QueueListeners

public QueueListeners()
Creates a QueueListeners instance with a listener built in.

See Also:
MyQILQueueListener
Method Detail

startListening

public void startListening(java.lang.String queueName,
                           QILQueueListener listener)
                    throws QILRequestFailedException
Adds the listener for this instance to the queue listeners list of the given queue.

To start getting events, call the StartMonitoringQueue.startMonitoring(String) method.

Parameters:
queueName - queue name.
listener - listener to be used for events dispatching.
Throws:
QILRequestFailedException - various exceptions could be thrown from here, the most interesting one is QILObjectNotFoundException which indicates that a queue was not found.

stopListening

public void stopListening(java.lang.String queueName,
                          QILQueueListener listener)
                   throws QILRequestFailedException
Removes the listener for this instance from the queue listeners list of the given queue.

To stop getting events, call the StartMonitoringQueue.stopMonitoring(String) method.

Parameters:
queueName - queue name.
listener - listener to be removed from the listener list.
Throws:
QILRequestFailedException

attachListener

public void attachListener(java.lang.String queueName)
                    throws QILRequestFailedException
Adds the listener for this instance to the queue listeners list of the given queue.
This method uses the listener instance provided or created in constructor.

To start getting events, call the StartMonitoringQueue.startMonitoring(String) method.

Parameters:
queueName - queue name.
Throws:
QILRequestFailedException

dettachListener

public void dettachListener(java.lang.String queueName)
                     throws QILRequestFailedException
Removes the listener for this instance from the queue listeners list of the given queue.

This method uses the listener instance provided or created in constructor.

To stop getting events, call the StartMonitoringQueue.stopMonitoring(String) method.

Parameters:
queueName - queue name.
Throws:
QILRequestFailedException