E - The type of event.public final class JAEventQueue<E> extends Object implements EventQueue<E>
| Constructor and Description |
|---|
JAEventQueue(ThreadManager threadManager,
boolean autonomous)
Creates a JAEventQueue.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireControl(EventQueue<E> eventQueue)
Gain control of the queue.
|
boolean |
dispatchEvents()
The dispatchEvents method processes any events in the queue.
|
EventQueue<E> |
getController()
Returns the controlling queue.
|
boolean |
isEmpty()
The isEmpty method returns true when there are no pending events,
though the results may not always be correct due to concurrency issues.
|
void |
putEvent(E event)
The putEvent method adds an events to the queue of events to be processed
and if idle, start the task.
|
void |
relinquishControl()
Relinquish foreign control over the queue.
|
void |
setActiveEventProcessor(EventProcessor<E> eventProcessor)
Specifies the object which will process the dispatched events.
|
public JAEventQueue(ThreadManager threadManager, boolean autonomous)
threadManager - Provides a thread for processing dispatched events.autonomous - Inhibits the acquireControl operation when true.public boolean acquireControl(EventQueue<E> eventQueue)
acquireControl in interface EventQueue<E>eventQueue - A queue.public void relinquishControl()
relinquishControl in interface EventQueue<E>public EventQueue<E> getController()
getController in interface EventQueue<E>public void setActiveEventProcessor(EventProcessor<E> eventProcessor)
setActiveEventProcessor in interface EventDispatcher<E>eventProcessor - Processes the dispatched events.public boolean isEmpty()
isEmpty in interface EventDispatcher<E>public void putEvent(E event)
putEvent in interface EventDestination<E>event - The events to be processed.public boolean dispatchEvents()
dispatchEvents in interface EventDispatcher<E>Copyright © 2012. All Rights Reserved.