de.phleisch.app.itsucks.event.impl
Class AsynchronEventDispatcherImpl

java.lang.Object
  extended by de.phleisch.app.itsucks.event.impl.AsynchronEventDispatcherImpl
All Implemented Interfaces:
EventDispatcher

public class AsynchronEventDispatcherImpl
extends java.lang.Object
implements EventDispatcher

The event dispatcher dispatches fired events to all registered observers. Check the CoreEvents class for a list of possible events fired by the framework. The EventDispatcher is started and stopped by the methods init/shutdown.

Author:
olli

Field Summary
static int EVENT_CATEGORY_SYSTEM_CMD
          This category is used for special internal commands, like start/stop/pause/resume the event manager.
 
Constructor Summary
AsynchronEventDispatcherImpl()
           
 
Method Summary
 void fireEvent(Event pEvent)
          Fires an event and dispatches it to all registered observers.
 void init()
          Initializes the Event dispatcher and starts the dispatch thread
 void registerObserver(EventObserver pObserver)
          Registers an new observer.
 void registerObserver(EventObserver pObserver, EventFilter pFilter)
          Registers an new observer.
 void shutdown()
          Shutdown the Event dispatcher.
 void unregisterObserver(EventObserver pObserver)
          Unregisters the given observer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_CATEGORY_SYSTEM_CMD

public static final int EVENT_CATEGORY_SYSTEM_CMD
This category is used for special internal commands, like start/stop/pause/resume the event manager. These events will not be dispatched to the event observer.

See Also:
Constant Field Values
Constructor Detail

AsynchronEventDispatcherImpl

public AsynchronEventDispatcherImpl()
Method Detail

init

public void init()
Description copied from interface: EventDispatcher
Initializes the Event dispatcher and starts the dispatch thread

Specified by:
init in interface EventDispatcher

shutdown

public void shutdown()
Description copied from interface: EventDispatcher
Shutdown the Event dispatcher.

Specified by:
shutdown in interface EventDispatcher

fireEvent

public void fireEvent(Event pEvent)
Description copied from interface: EventDispatcher
Fires an event and dispatches it to all registered observers.

Specified by:
fireEvent in interface EventDispatcher

registerObserver

public void registerObserver(EventObserver pObserver)
Description copied from interface: EventDispatcher
Registers an new observer. All events are dispatched to this observer.

Specified by:
registerObserver in interface EventDispatcher

registerObserver

public void registerObserver(EventObserver pObserver,
                             EventFilter pFilter)
Description copied from interface: EventDispatcher
Registers an new observer. All events are filtered by the given event filter.

Specified by:
registerObserver in interface EventDispatcher

unregisterObserver

public void unregisterObserver(EventObserver pObserver)
Description copied from interface: EventDispatcher
Unregisters the given observer.

Specified by:
unregisterObserver in interface EventDispatcher


Copyright © 2010. All Rights Reserved.