java.lang.Object
jakarta.mail.EventQueue
- All Implemented Interfaces:
Runnable
Package 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 ClassesModifier and TypeClassDescription(package private) static class
A "struct" to put on the queue.(package private) static class
A special event that causes the queue processing task to terminate. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static WeakHashMap<ClassLoader,
EventQueue> private Executor
private BlockingQueue<EventQueue.QueueElement>
-
Constructor Summary
ConstructorsConstructorDescriptionEventQueue
(Executor ex) Construct an EventQueue using the specified Executor. -
Method Summary
Modifier and TypeMethodDescription(package private) void
enqueue
(MailEvent event, Vector<? extends EventListener> vector) Enqueue an event.(package private) static EventQueue
Create (if necessary) an application-scoped event queue.void
run()
Pull events off the queue and dispatch them.(package private) void
Terminate the task running the queue, but only if there is a queue.
-
Field Details
-
q
-
executor
-
appq
-
-
Constructor Details
-
EventQueue
EventQueue(Executor ex) Construct an EventQueue using the specified Executor. If the Executor is null, threads will be created as needed.
-
-
Method Details
-
enqueue
Enqueue an event. -
terminateQueue
void terminateQueue()Terminate the task running the queue, but only if there is a queue. -
getApplicationEventQueue
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.
-