APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.jndi.ldap

pack-priv final Class EventQueue

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
java.util.Vector, .EventObject, java.util.concurrent.locks.Condition, .ReentrantLock, javax.naming.event.NamingEvent, .NamingExceptionEvent, .NamingListener, javax.naming.ldap.UnsolicitedNotificationEvent, .UnsolicitedNotificationListener, jdk.internal.misc.InnocuousThread

Package private class used by EventSupport to dispatch events. This class implements an event queue, and a dispatcher thread that dequeues and dispatches events from the queue.
Authors
Bill Shannon (from javax.mail.event), Rosanna Lee (modified for JNDI-related events)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Condition
private static final boolean
private EventQueue.QueueElement
private final ReentrantLock
private Thread
private EventQueue.QueueElement

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private EventQueue.QueueElement

Returns:

the oldest object on the queue.
dequeue
()

Dequeue the oldest object on the queue.

pack-priv void
enqueue(EventObject
Either a NamingExceptionEvent or a subclass of NamingEvent or UnsolicitedNotificationEvent. If it is a subclass of NamingEvent, all listeners must implement the corresponding subinterface of NamingListener. For example, for an ObjectAddedEvent, all listeners must implement the ObjectAddedListener interface. The current implementation does not check this before dispatching the event. If the event is a NamingExceptionEvent, then all listeners are notified.
event
,
Vector<NamingListener>
List of NamingListeners that will be notified of event.
vector
)

Enqueue an event.

public void
run()

Implements java.lang.Runnable.run.

Pull events off the queue and dispatch them.

pack-priv void
stop()

Stop the dispatcher so we can be destroyed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

conditionback to summary
private final Condition condition
debugback to summary
private static final boolean debug
lockback to summary
private final ReentrantLock lock
qThreadback to summary
private Thread qThread
tailback to summary
private EventQueue.QueueElement tail

Constructor Detail

EventQueueback to summary
pack-priv EventQueue()

Method Detail

dequeueback to summary
private EventQueue.QueueElement dequeue() throws InterruptedException

Dequeue the oldest object on the queue. Used only by the run() method.

Returns:EventQueue.QueueElement

the oldest object on the queue.

Exceptions
InterruptedException:
if any thread has interrupted this thread.
enqueueback to summary
pack-priv void enqueue(EventObject event, Vector<NamingListener> vector)

Enqueue an event.

Parameters
event:EventObject

Either a NamingExceptionEvent or a subclass of NamingEvent or UnsolicitedNotificationEvent. If it is a subclass of NamingEvent, all listeners must implement the corresponding subinterface of NamingListener. For example, for an ObjectAddedEvent, all listeners must implement the ObjectAddedListener interface. The current implementation does not check this before dispatching the event. If the event is a NamingExceptionEvent, then all listeners are notified.

vector:Vector<NamingListener>

List of NamingListeners that will be notified of event.

runback to summary
public void run()

Implements java.lang.Runnable.run.

Pull events off the queue and dispatch them.

Annotations
@Override
stopback to summary
pack-priv void stop()

Stop the dispatcher so we can be destroyed.

com.sun.jndi.ldap back to summary

private Class EventQueue.QueueElement

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv EventObject
pack-priv EventQueue.QueueElement
pack-priv EventQueue.QueueElement
pack-priv Vector<NamingListener>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eventback to summary
pack-priv EventObject event
nextback to summary
pack-priv EventQueue.QueueElement next
prevback to summary
pack-priv EventQueue.QueueElement prev
vectorback to summary
pack-priv Vector<NamingListener> vector

Constructor Detail

QueueElementback to summary
pack-priv QueueElement(EventObject event, Vector<NamingListener> vector)