com.orderlysoftware.orderlycalls.examples
Class ExampleManagerEventListener

java.lang.Object
  extended by com.orderlysoftware.orderlycalls.examples.ExampleManagerEventListener
All Implemented Interfaces:
ManagerEventListener, java.lang.Runnable, java.util.EventListener

public class ExampleManagerEventListener
extends java.lang.Object
implements ManagerEventListener, java.lang.Runnable

Example implementation of the ManagerEventListener interface.

Deployed alone, this listener will print all events to the log.

Deployed in conjunction with ExampleProcessor, this listener only responds to events from the ExampleProcessor callback.

Author:
Matt King M.A. Oxon.

Constructor Summary
ExampleManagerEventListener()
           
 
Method Summary
 void clean()
          Reset all non-static member fields, unregister from the ManagerClient, and return to ObjectPool.
 void handleManagerEvent(ManagerEvent e)
          The example prints out the event, and the source client.
 void init(ManagerClient client, java.lang.String channel, java.lang.String context, java.lang.String extension, java.lang.String priority)
          Initialise member fields.
 void run()
          Waits for 10 seconds, then initiates a callback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleManagerEventListener

public ExampleManagerEventListener()
Method Detail

handleManagerEvent

public void handleManagerEvent(ManagerEvent e)
The example prints out the event, and the source client.
By default this event listener does not access member fields, it does not require synchronisation.

Specified by:
handleManagerEvent in interface ManagerEventListener
Parameters:
e - the ManagerEvent received.

clean

public void clean()
Reset all non-static member fields, unregister from the ManagerClient, and return to ObjectPool.


run

public void run()
Waits for 10 seconds, then initiates a callback.

Specified by:
run in interface java.lang.Runnable

init

public void init(ManagerClient client,
                 java.lang.String channel,
                 java.lang.String context,
                 java.lang.String extension,
                 java.lang.String priority)
Initialise member fields.

Parameters:
client - The ManagerClient with which to work.
channel - The channel to ring.
context - The context to connect it to.
extension - The extension to connect it to.
priority - The extension priority to connect it to.