|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.eventmgr.ListenerQueue
public class ListenerQueue
The ListenerQueue is used to snapshot the list of listeners at the time the event is fired. The snapshot list is then used to dispatch events to those listeners. A ListenerQueue object is associated with a specific EventManager object. ListenerQueue objects constructed with the same EventManager object will get in-order delivery of events when using asynchronous delivery. No delivery order is guaranteed for synchronous delivery to avoid any potential deadly embraces.
ListenerQueue objects are created as necessary to build a list of listeners that should receive a specific event or events. Once the list is created, the event can then be synchronously or asynchronously delivered to the list of listeners. After the event has been dispatched for delivery, the ListenerQueue object should be discarded as it is likely the list of listeners is stale. A new ListenerQueue object should be created when it is time to deliver another event. The Sets used to build the list of listeners must not change after being added to the list.
Field Summary | |
---|---|
protected EventManager |
manager
EventManager with which this queue is associated. |
Constructor Summary | |
---|---|
ListenerQueue(EventManager manager)
ListenerQueue constructor. |
Method Summary | |
---|---|
void |
dispatchEventAsynchronous(int eventAction,
Object eventObject)
Asynchronously dispatch an event to the snapshot list. |
void |
dispatchEventSynchronous(int eventAction,
Object eventObject)
Synchronously dispatch an event to the snapshot list. |
void |
queueListeners(EventListeners listeners,
EventDispatcher dispatcher)
Deprecated. As of 3.5. Replaced by queueListeners(Set, EventDispatcher) . |
void |
queueListeners(Set listeners,
EventDispatcher dispatcher)
Add a set of listeners to the snapshot list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final EventManager manager
Constructor Detail |
---|
public ListenerQueue(EventManager manager)
manager
- The EventManager this queue is associated with.
IllegalArgumentException
- If manager is null.Method Detail |
---|
public void queueListeners(EventListeners listeners, EventDispatcher dispatcher)
queueListeners(Set, EventDispatcher)
.
listeners
- An EventListeners object to add to the queue. The current listeners
in the EventListeners object will be called when an event is dispatched.dispatcher
- An EventDispatcher object to use when dispatching an event
to the listeners on the specified EventListeners.
IllegalStateException
- If called after one of the dispatch methods has been called.public void queueListeners(Set listeners, EventDispatcher dispatcher)
listeners
- A Set of Map.Entries to add to the queue. This is typically the entrySet
from a CopyOnWriteIdentityMap object. This set must not change after being added to this
snapshot list.dispatcher
- An EventDispatcher object to use when dispatching an event
to the specified listeners.
IllegalStateException
- If called after one of the dispatch methods has been called.public void dispatchEventAsynchronous(int eventAction, Object eventObject)
eventAction
- This value is passed to the EventDispatcher.eventObject
- This object is passed to the EventDispatcher.public void dispatchEventSynchronous(int eventAction, Object eventObject)
eventAction
- This value is passed to the EventDispatcher.eventObject
- This object is passed to the EventDispatcher.
|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.