L - class type of event listenerE - class type of event objectpublic class EventDispatcher<L extends EventListener,E extends EventObject> extends Thread
dispatchEvent(EventObject), which schedules the event
to be propagated to the registered listeners in a separate thread.
The mechanism of actual event notification is specified using an
implementation of EventNotifier.
The EventListener list provided on creation should ideally
be an instance of CopyOnWriteArrayList, which allows safe iteration
without making a copy. If this type is not used, a copy of of the listeners
is taken each time an event dispatch is performed, synchronizing on the list
instance during the copy.
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
EventDispatcher(List<L> listeners,
EventNotifier<L,E> notifier) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispatchEvent(E event)
Schedules the specified event for listener notification.
|
void |
halt()
Halts this thread (use instead of
Thread.stop()). |
void |
run() |
void |
start() |
activeCount, checkAccess, clone, 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, stop, stop, suspend, toString, yieldpublic EventDispatcher(List<L> listeners, EventNotifier<L,E> notifier)
public void halt()
Thread.stop()).public void dispatchEvent(E event)
event - event to dispatchCopyright © 2013. All Rights Reserved.