|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.i2ptunnel.irc.EventReceiver
public abstract class EventReceiver
An implementation of the EventDispatcher interface for receiving events via in-line notifyEvent() only. Does not support chaining to additional dispatchers. Does not support waitEventValue(). Does not support ignoring.
Constructor Summary | |
---|---|
EventReceiver()
|
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 |
abstract 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 EventReceiver()
Method Detail |
---|
public EventDispatcher getEventDispatcher()
EventDispatcher
this
, but YMMV).
getEventDispatcher
in interface EventDispatcher
public void attachEventDispatcher(EventDispatcher ev)
EventDispatcher
ev
won't reach the object calling this method).
Good luck, and beware of notification loops! :-)
attachEventDispatcher
in interface EventDispatcher
ev
- Event object to be attached
UnsupportedOperationException
- alwayspublic void detachEventDispatcher(EventDispatcher ev)
EventDispatcher
detachEventDispatcher
in interface EventDispatcher
ev
- Event object to be detached
UnsupportedOperationException
- alwayspublic abstract void notifyEvent(String eventName, Object args)
EventDispatcher
notifyEvent
in interface EventDispatcher
eventName
- name of the eventargs
- data being stored for that eventpublic Object getEventValue(String name)
EventDispatcher
getEventValue
in interface EventDispatcher
name
- name of the event to query for
UnsupportedOperationException
- alwayspublic Set<String> getEvents()
EventDispatcher
getEvents
in interface EventDispatcher
UnsupportedOperationException
- alwayspublic void ignoreEvents()
EventDispatcher
ignoreEvents
in interface EventDispatcher
UnsupportedOperationException
- alwayspublic void unIgnoreEvents()
EventDispatcher
unIgnoreEvents
in interface EventDispatcher
public Object waitEventValue(String name)
EventDispatcher
waitEventValue
in interface EventDispatcher
name
- name of the event to wait for
UnsupportedOperationException
- always
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |