- All Known Implementing Classes:
DCCClientManager, EventDispatcherImpl, EventReceiver, I2Ping, I2PSOCKSIRCTunnel, I2PSOCKSTunnel, I2PTunnel, I2PTunnelClient, I2PTunnelClientBase, I2PTunnelConnectClient, I2PTunnelDCCClient, I2PTunnelDCCServer, I2PTunnelHTTPBidirProxy, I2PTunnelHTTPBidirServer, I2PTunnelHTTPClient, I2PTunnelHTTPClientBase, I2PTunnelHTTPServer, I2PTunnelIRCClient, I2PTunnelIRCServer, I2PTunnelServer, I2PTunnelTask, I2PTunnelUDPClientBase, I2PTunnelUDPServerBase, SOCKSUDPTunnel, StreamrConsumer, StreamrProducer
public interface EventDispatcher
Event dispatching interface. It allows objects to receive and notify data events (basically String->Object associations) and create notification chains. To ease the usage of this interface, you could define an EventDispatcherImpl attribute called
_event (as suggested in EventDispatcherImpl documentation) and cut'n'paste the following default implementation:
public EventDispatcher getEventDispatcher() { return _event; }
public void attachEventDispatcher(IEventDispatcher e) { _event.attachEventDispatcher(e.getEventDispatcher()); }
public void detachEventDispatcher(IEventDispatcher e) { _event.detachEventDispatcher(e.getEventDispatcher()); }
public void notifyEvent(String e, Object a) { _event.notifyEvent(e,a); }
public Object getEventValue(String n) { return _event.getEventValue(n); }
public Set getEvents() { return _event.getEvents(); }
public void ignoreEvents() { _event.ignoreEvents(); }
public void unIgnoreEvents() { _event.unIgnoreEvents(); }
public Object waitEventValue(String n) { return _event.waitEventValue(n); }
Deprecated - Used only by I2PTunnel.
Method 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 event, Object args) Deliver an event.voidAlmost like the method above :-).waitEventValue(String name) Wait until the given event has received a value.
Method Details
getEventDispatcher
EventDispatcher getEventDispatcher()Object to be used to deliver events (usuallythis, but YMMV).- Returns:
- the event dispatcher
attachEventDispatcher
Attach 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! :-).- Parameters:
iev- Event object to be attached
detachEventDispatcher
Detach the specified EventDispatcher object from the events dispatching chain.- Parameters:
iev- Event object to be detached
notifyEvent
getEventValue
getEvents
ignoreEvents
void ignoreEvents()Ignore further event notifications.unIgnoreEvents
void unIgnoreEvents()Almost like the method above :-).waitEventValue