net.sf.fmj.ejmf.toolkit.media
Class ControllerEventQueue

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.fmj.ejmf.toolkit.media.ControllerEventQueue
All Implemented Interfaces:
java.lang.Runnable

public class ControllerEventQueue
extends java.lang.Thread

This class provides a dispatching mechanism for ControllerEvents. All events posted to this queue are dispatched to a Vector of ControllerListeners given when the queue is constructed. Note that ControllerListeners may be added or removed from this Vector from outside of this class, and these changes will be reflected in the dispatching mechanism. From the book: Essential JMF, Gordon, Talley (ISBN 0130801046). Used with permission.

Author:
Steve Talley & Rob Gordon

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ControllerEventQueue(java.util.Vector listeners, java.lang.String threadName)
          Construct a ControllerEventQueue for the given list of ControllerListeners.
 
Method Summary
 void postEvent(ControllerEvent event)
          Post a ControllerEvent to the queue.
 void run()
          Endlessly monitor the event queue.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControllerEventQueue

public ControllerEventQueue(java.util.Vector listeners,
                            java.lang.String threadName)
Construct a ControllerEventQueue for the given list of ControllerListeners.

Parameters:
listeners - The list of ControllerListeners to notify whenever a ControllerEvents is posted.
Method Detail

postEvent

public void postEvent(ControllerEvent event)
Post a ControllerEvent to the queue. All listeners will be notified ASAP.


run

public void run()
Endlessly monitor the event queue. This method should not be called directly.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread