Package net.i2p.i2ptunnel.irc
Class EventReceiver
- java.lang.Object
-
- net.i2p.i2ptunnel.irc.EventReceiver
-
- All Implemented Interfaces:
EventDispatcher
- Direct Known Subclasses:
DCCClientManager
public abstract class EventReceiver extends Object implements EventDispatcher
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.- Since:
- 0.8.9
-
-
Constructor Summary
Constructors Constructor Description EventReceiver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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 (usuallythis
, but YMMV).Set<String>
getEvents()
Retrieve the names of all the events that have been receivedObject
getEventValue(String name)
Retrieve the value currently associated with the specified event valuevoid
ignoreEvents()
Ignore further event notificationsabstract void
notifyEvent(String eventName, Object args)
Deliver an eventvoid
unIgnoreEvents()
Almost like the method above :-)Object
waitEventValue(String name)
Wait until the given event has received a value
-
-
-
Method Detail
-
getEventDispatcher
public EventDispatcher getEventDispatcher()
Description copied from interface:EventDispatcher
Get an object to be used to deliver events (usuallythis
, but YMMV).- Specified by:
getEventDispatcher
in interfaceEventDispatcher
-
attachEventDispatcher
public void attachEventDispatcher(EventDispatcher ev)
Description copied from interface:EventDispatcher
Attach an EventDispatcher object to the events dispatching chain. Note that notification is not bidirectional (i.e. events notified toev
won't reach the object calling this method). Good luck, and beware of notification loops! :-)- Specified by:
attachEventDispatcher
in interfaceEventDispatcher
- Parameters:
ev
- Event object to be attached- Throws:
UnsupportedOperationException
- always
-
detachEventDispatcher
public void detachEventDispatcher(EventDispatcher ev)
Description copied from interface:EventDispatcher
Detach the specified EventDispatcher object from the events dispatching chain.- Specified by:
detachEventDispatcher
in interfaceEventDispatcher
- Parameters:
ev
- Event object to be detached- Throws:
UnsupportedOperationException
- always
-
notifyEvent
public abstract void notifyEvent(String eventName, Object args)
Description copied from interface:EventDispatcher
Deliver an event- Specified by:
notifyEvent
in interfaceEventDispatcher
- Parameters:
eventName
- name of the eventargs
- data being stored for that event
-
getEventValue
public Object getEventValue(String name)
Description copied from interface:EventDispatcher
Retrieve the value currently associated with the specified event value- Specified by:
getEventValue
in interfaceEventDispatcher
- Parameters:
name
- name of the event to query for- Returns:
- value (or null if none are available)
- Throws:
UnsupportedOperationException
- always
-
getEvents
public Set<String> getEvents()
Description copied from interface:EventDispatcher
Retrieve the names of all the events that have been received- Specified by:
getEvents
in interfaceEventDispatcher
- Returns:
- A set of event names
- Throws:
UnsupportedOperationException
- always
-
ignoreEvents
public void ignoreEvents()
Description copied from interface:EventDispatcher
Ignore further event notifications- Specified by:
ignoreEvents
in interfaceEventDispatcher
- Throws:
UnsupportedOperationException
- always
-
unIgnoreEvents
public void unIgnoreEvents()
Description copied from interface:EventDispatcher
Almost like the method above :-)- Specified by:
unIgnoreEvents
in interfaceEventDispatcher
-
waitEventValue
public Object waitEventValue(String name)
Description copied from interface:EventDispatcher
Wait until the given event has received a value- Specified by:
waitEventValue
in interfaceEventDispatcher
- Parameters:
name
- name of the event to wait for- Returns:
- value specified for that event
- Throws:
UnsupportedOperationException
- always
-
-