Package javax.mail
Class EventQueue
- java.lang.Object
-
- javax.mail.EventQueue
-
- All Implemented Interfaces:
java.lang.Runnable
class EventQueue extends java.lang.Object implements java.lang.RunnablePackage private class used by Store & Folder to dispatch events. This class implements an event queue, and a dispatcher thread that dequeues and dispatches events from the queue.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classEventQueue.QueueElementA "struct" to put on the queue.(package private) static classEventQueue.TerminatorEventA special event that causes the queue processing task to terminate.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.WeakHashMap<java.lang.ClassLoader,EventQueue>appqprivate java.util.concurrent.Executorexecutorprivate java.util.concurrent.BlockingQueue<EventQueue.QueueElement>q
-
Constructor Summary
Constructors Constructor Description EventQueue(java.util.concurrent.Executor ex)Construct an EventQueue using the specified Executor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidenqueue(MailEvent event, java.util.Vector<? extends java.util.EventListener> vector)Enqueue an event.(package private) static EventQueuegetApplicationEventQueue(java.util.concurrent.Executor ex)Create (if necessary) an application-scoped event queue.voidrun()Pull events off the queue and dispatch them.(package private) voidterminateQueue()Terminate the task running the queue, but only if there is a queue.
-
-
-
Field Detail
-
q
private volatile java.util.concurrent.BlockingQueue<EventQueue.QueueElement> q
-
executor
private java.util.concurrent.Executor executor
-
appq
private static java.util.WeakHashMap<java.lang.ClassLoader,EventQueue> appq
-
-
Method Detail
-
enqueue
void enqueue(MailEvent event, java.util.Vector<? extends java.util.EventListener> vector)
Enqueue an event.
-
terminateQueue
void terminateQueue()
Terminate the task running the queue, but only if there is a queue.
-
getApplicationEventQueue
static EventQueue getApplicationEventQueue(java.util.concurrent.Executor ex)
Create (if necessary) an application-scoped event queue. Application scoping is based on the thread's context class loader.
-
run
public void run()
Pull events off the queue and dispatch them.- Specified by:
runin interfacejava.lang.Runnable
-
-