Top Description Inners Fields Constructors Methods
javax.mail

pack-priv Class EventQueue

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
java.util.EventListener, .Vector, .Queue, .WeakHashMap, java.util.concurrent.BlockingQueue, .LinkedBlockingQueue, .Executor, javax.mail.event.MailEvent

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.
Author
Bill Shannon

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
EventQueue.QueueElement

A "struct" to put on the queue.

pack-priv static class
EventQueue.TerminatorEvent

A special event that causes the queue processing task to terminate.

Field Summary

Modifier and TypeField and Description
private static WeakHashMap<ClassLoader, EventQueue>
private Executor
private volatile BlockingQueue<EventQueue.QueueElement>
q

Constructor Summary

AccessConstructor and Description
pack-priv
EventQueue(Executor ex)

Construct an EventQueue using the specified Executor.

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized void
enqueue(MailEvent event, Vector<? extends EventListener> vector)

Enqueue an event.

pack-priv static synchronized EventQueue
getApplicationEventQueue(Executor ex)

Create (if necessary) an application-scoped event queue.

public void
run()

Implements java.lang.Runnable.run.

Pull events off the queue and dispatch them.
pack-priv synchronized void
terminateQueue()

Terminate the task running the queue, but only if there is a queue.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appqback to summary
private static WeakHashMap<ClassLoader, EventQueue> appq
executorback to summary
private Executor executor
qback to summary
private volatile BlockingQueue<EventQueue.QueueElement> q

Constructor Detail

EventQueueback to summary
pack-priv EventQueue(Executor ex)

Construct an EventQueue using the specified Executor. If the Executor is null, threads will be created as needed.

Method Detail

enqueueback to summary
pack-priv synchronized void enqueue(MailEvent event, Vector<? extends EventListener> vector)

Enqueue an event.

getApplicationEventQueueback to summary
pack-priv static synchronized EventQueue getApplicationEventQueue(Executor ex)

Create (if necessary) an application-scoped event queue. Application scoping is based on the thread's context class loader.

runback to summary
public void run()

Implements java.lang.Runnable.run.

Pull events off the queue and dispatch them.

Annotations
@Override
terminateQueueback to summary
pack-priv synchronized void terminateQueue()

Terminate the task running the queue, but only if there is a queue.

javax.mail back to summary

pack-priv Class EventQueue.QueueElement

extends Object
Class Inheritance

A "struct" to put on the queue.

Field Summary

Modifier and TypeField and Description
pack-priv MailEvent
pack-priv Vector<? extends EventListener>

Constructor Summary

AccessConstructor and Description
pack-priv
QueueElement(MailEvent event, Vector<? extends EventListener> vector)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eventback to summary
pack-priv MailEvent event
vectorback to summary
pack-priv Vector<? extends EventListener> vector

Constructor Detail

QueueElementback to summary
pack-priv QueueElement(MailEvent event, Vector<? extends EventListener> vector)
javax.mail back to summary

pack-priv Class EventQueue.TerminatorEvent

extends MailEvent
Class Inheritance

A special event that causes the queue processing task to terminate.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
dispatch(Object
the listener to invoke on
listener
)

Implements abstract javax.mail.event.MailEvent.dispatch.

This method invokes the appropriate method on a listener for this event.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.mail.event.MailEvent.serialVersionUID.

Constructor Detail

TerminatorEventback to summary
pack-priv TerminatorEvent()

Method Detail

dispatchback to summary
public void dispatch(Object listener)

Implements abstract javax.mail.event.MailEvent.dispatch.

Doc from javax.mail.event.MailEvent.dispatch.

This method invokes the appropriate method on a listener for this event. Subclasses provide the implementation.

Parameters
listener:Object

the listener to invoke on

Annotations
@Override