JSR-043: JTAPI-1.4

javax.telephony.media.provider
Class EventQueue

java.lang.Object
  |
  +--javax.telephony.media.provider.Dispatcher
        |
        +--javax.telephony.media.provider.EventQueue
All Implemented Interfaces:
java.lang.Runnable

public class EventQueue
extends Dispatcher

Establish a rendevous for event delivery and dispatch.

EventQueue extends Dispatcher, allowing one to post done Events to a queue. The Events will be drained from the Queue by the EventQueue thread which notifies the Listeners.

EventQueue extends Dispatcher to include enqueueDoneEvent(). The EventQueue Dispatacher thread calls getNextEvent() which dequeues an Event and returns it to be dispatched by the usual notifyListeners() method.

Base_MediaService queues Async.Events to this EventQueue from onEventDone().

Since:
JTAPI-1.4

Inner classes inherited from class javax.telephony.media.provider.Dispatcher
Dispatcher.DispatchableEvent, Dispatcher.ExceptionHandler
 
Constructor Summary
EventQueue()
           
 
Method Summary
 void enqueueDoneEvent(Base.Event event)
          Queue the given Event to be dispatched by the EventQueue thread.
 void flush()
          Flush all Events from this EventQueue.
 void notifyListeners(Dispatcher.DispatchableEvent event)
          notifyListeners and signal event.done().
 void start(java.lang.String name)
          restart EventQueue.
 void stop()
          Stop Thread, flush doneEvents from queue.
 java.lang.String toString()
           
 
Methods inherited from class javax.telephony.media.provider.Dispatcher
addListener, close, isRunning, objName, printDispatcherException, removeListener, run, setExceptionHandler, start, start
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventQueue

public EventQueue()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class Dispatcher

enqueueDoneEvent

public void enqueueDoneEvent(Base.Event event)
Queue the given Event to be dispatched by the EventQueue thread.

notifyListeners

public void notifyListeners(Dispatcher.DispatchableEvent event)
notifyListeners and signal event.done().
Overrides:
notifyListeners in class Dispatcher

start

public void start(java.lang.String name)
restart EventQueue.
Overrides:
start in class Dispatcher

stop

public void stop()
Stop Thread, flush doneEvents from queue.
Overrides:
stop in class Dispatcher

flush

public void flush()
Flush all Events from this EventQueue.

JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org