net.i2p.util

## Class EventDispatcherImpl

- java.lang.Object
- - net.i2p.util.EventDispatcherImpl

All Implemented Interfaces:
  EventDispatcher

    public class EventDispatcherImpl
    extends Object
    implements EventDispatcher

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

Author:
  human, jrandom

### Constructor Summary

Constructors
Constructor and Description
`EventDispatcherImpl()`

### Method Summary

Methods
`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` `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

#### EventDispatcherImpl

    public EventDispatcherImpl()

### Method Detail

#### getEventDispatcher

    public EventDispatcher getEventDispatcher()

Description copied from interface: `EventDispatcher`
Get an object to be used to deliver events (usually `this`, but YMMV).

Specified by:
  `getEventDispatcher` in interface `EventDispatcher`

#### 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 to `ev` won't reach the object calling this method). Good luck, and beware of notification loops! :-)

Specified by:
  `attachEventDispatcher` in interface `EventDispatcher`
Parameters:
  `ev` - Event object to be attached

#### 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 interface `EventDispatcher`
Parameters:
  `ev` - Event object to be detached

#### notifyEvent

    public void notifyEvent(String eventName,
                   Object args)

Description copied from interface: `EventDispatcher`
Deliver an event

Specified by:
  `notifyEvent` in interface `EventDispatcher`
Parameters:
  `eventName` - name of the event
  `args` - 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 interface `EventDispatcher`
Parameters:
  `name` - name of the event to query for
Returns:
  value (or null if none are available)

#### getEvents

    public Set getEvents()

Description copied from interface: `EventDispatcher`
Retrieve the names of all the events that have been received

Specified by:
  `getEvents` in interface `EventDispatcher`
Returns:
  A set of event names

#### ignoreEvents

    public void ignoreEvents()

Description copied from interface: `EventDispatcher`
Ignore further event notifications

Specified by:
  `ignoreEvents` in interface `EventDispatcher`

#### unIgnoreEvents

    public void unIgnoreEvents()

Description copied from interface: `EventDispatcher`
Almost like the method above :-)

Specified by:
  `unIgnoreEvents` in interface `EventDispatcher`

#### waitEventValue

    public Object waitEventValue(String name)

Description copied from interface: `EventDispatcher`
Wait until the given event has received a value

Specified by:
  `waitEventValue` in interface `EventDispatcher`
Parameters:
  `name` - name of the event to wait for
Returns:
  value specified for that event