class EventQueue
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
(package private) static class |
EventQueue.QueueElement
A "struct" to put on the queue.
|
(package private) static class |
EventQueue.TerminatorEvent
A special event that causes the queue processing task to terminate.
|
Modifier and Type | Field and Description |
---|---|
private static java.util.WeakHashMap<java.lang.ClassLoader,EventQueue> |
appq |
private java.util.concurrent.Executor |
executor |
private java.util.concurrent.BlockingQueue<EventQueue.QueueElement> |
q |
Constructor and Description |
---|
EventQueue(java.util.concurrent.Executor ex)
Construct an EventQueue using the specified Executor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
enqueue(MailEvent event,
java.util.Vector<? extends java.util.EventListener> vector)
Enqueue an event.
|
(package private) static EventQueue |
getApplicationEventQueue(java.util.concurrent.Executor ex)
Create (if necessary) an application-scoped event queue.
|
void |
run()
Pull events off the queue and dispatch them.
|
(package private) void |
terminateQueue()
Terminate the task running the queue, but only if there is a queue.
|
private volatile java.util.concurrent.BlockingQueue<EventQueue.QueueElement> q
private java.util.concurrent.Executor executor
private static java.util.WeakHashMap<java.lang.ClassLoader,EventQueue> appq
EventQueue(java.util.concurrent.Executor ex)
void enqueue(MailEvent event, java.util.Vector<? extends java.util.EventListener> vector)
void terminateQueue()
static EventQueue getApplicationEventQueue(java.util.concurrent.Executor ex)
public void run()
run
in interface java.lang.Runnable