|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.i2p.util.EventDispatcherImpl
public class EventDispatcherImpl
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
| Constructor Summary | |
|---|---|
EventDispatcherImpl()
|
|
| Method Summary | |
|---|---|
void |
attachEventDispatcher(EventDispatcher ev)
Attach an EventDispatcher object to the events dispatching chain. |
void |
detachEventDispatcher(EventDispatcher ev)
Detach the specified EventDispatcher object from the events dispatching chain. |
EventDispatcher |
getEventDispatcher()
Get an object to be used to deliver events (usually this, but YMMV). |
Set<String> |
getEvents()
Retrieve the names of all the events that have been received |
Object |
getEventValue(String name)
Retrieve the value currently associated with the specified event value |
void |
ignoreEvents()
Ignore further event notifications |
void |
notifyEvent(String eventName,
Object args)
Deliver an event |
void |
unIgnoreEvents()
Almost like the method above :-) |
Object |
waitEventValue(String name)
Wait until the given event has received a value |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventDispatcherImpl()
| Method Detail |
|---|
public EventDispatcher getEventDispatcher()
EventDispatcherthis, but YMMV).
getEventDispatcher in interface EventDispatcherpublic void attachEventDispatcher(EventDispatcher ev)
EventDispatcherev won't reach the object calling this method).
Good luck, and beware of notification loops! :-)
attachEventDispatcher in interface EventDispatcherev - Event object to be attachedpublic void detachEventDispatcher(EventDispatcher ev)
EventDispatcher
detachEventDispatcher in interface EventDispatcherev - Event object to be detached
public void notifyEvent(String eventName,
Object args)
EventDispatcher
notifyEvent in interface EventDispatchereventName - name of the eventargs - data being stored for that eventpublic Object getEventValue(String name)
EventDispatcher
getEventValue in interface EventDispatchername - name of the event to query for
public Set<String> getEvents()
EventDispatcher
getEvents in interface EventDispatcherpublic void ignoreEvents()
EventDispatcher
ignoreEvents in interface EventDispatcherpublic void unIgnoreEvents()
EventDispatcher
unIgnoreEvents in interface EventDispatcherpublic Object waitEventValue(String name)
EventDispatcher
waitEventValue in interface EventDispatchername - name of the event to wait for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||