java.lang.Object
net.i2p.util.EventDispatcherImpl
- All Implemented Interfaces:
EventDispatcher
- Direct Known Subclasses:
I2PTunnel, I2PTunnelTask
An implementation of the EventDispatcher interface. Since Java doesn't support multiple inheritance, you could follow the Log.java style: this class should be instantiated and kept as a variable by each object it is used by, ala:
private final EventDispatcher _event = new EventDispatcher();Deprecated - Used only by I2PTunnel
If there is anything in here that doesn't make sense, turn off your computer and go fly a kite - (c) 2004 by jrandom.
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidAttach an EventDispatcher object to the events dispatching chain.voidDetach the specified EventDispatcher object from the events dispatching chain.Object to be used to deliver events (usuallythis, but YMMV).Retrieve the names of all the events that have been received.getEventValue(String name) Retrieve the value currently associated with the specified event value.voidIgnore further event notifications.voidnotifyEvent(String eventName, Object args) Deliver an event.voidAlmost like the method above :-).waitEventValue(String name) Wait until the given event has received a value.
Field Details
_ignore
private boolean _ignoreTrue while events are dropped, not dispatched._events
_attached
Dispatchers that also receive these events.
Constructor Details
EventDispatcherImpl
public EventDispatcherImpl()Create a new EventDispatcherImpl.
Method Details
getEventDispatcher
Description copied from interface:EventDispatcherObject to be used to deliver events (usuallythis, but YMMV).- Specified by:
getEventDispatcherin interfaceEventDispatcher- Returns:
- the event dispatcher
attachEventDispatcher
Description copied from interface:EventDispatcherAttach an EventDispatcher object to the events dispatching chain. Note that notification is not bidirectional (i.e. events notified toevwon't reach the object calling this method). Good luck, and beware of notification loops! :-).- Specified by:
attachEventDispatcherin interfaceEventDispatcher- Parameters:
ev- Event object to be attached
detachEventDispatcher
Description copied from interface:EventDispatcherDetach the specified EventDispatcher object from the events dispatching chain.- Specified by:
detachEventDispatcherin interfaceEventDispatcher- Parameters:
ev- Event object to be detached
notifyEvent
Description copied from interface:EventDispatcherDeliver an event.- Specified by:
notifyEventin interfaceEventDispatcher- Parameters:
eventName- name of the eventargs- data being stored for that event
getEventValue
Description copied from interface:EventDispatcherRetrieve the value currently associated with the specified event value.- Specified by:
getEventValuein interfaceEventDispatcher- Parameters:
name- name of the event to query for- Returns:
- the event value
getEvents
Description copied from interface:EventDispatcherRetrieve the names of all the events that have been received.- Specified by:
getEventsin interfaceEventDispatcher- Returns:
- A set of event names
ignoreEvents
public void ignoreEvents()Description copied from interface:EventDispatcherIgnore further event notifications.- Specified by:
ignoreEventsin interfaceEventDispatcher
unIgnoreEvents
public void unIgnoreEvents()Description copied from interface:EventDispatcherAlmost like the method above :-).- Specified by:
unIgnoreEventsin interfaceEventDispatcher
waitEventValue
Description copied from interface:EventDispatcherWait until the given event has received a value.- Specified by:
waitEventValuein interfaceEventDispatcher- Parameters:
name- name of the event to wait for- Returns:
- value specified for that event