com.fatwire.cs.core.event
Class SimpleDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>
java.lang.Object
com.fatwire.cs.core.event.SimpleDispatcher<E,R>
- All Implemented Interfaces:
- EventDispatcher<E,R>
public class SimpleDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>
- extends java.lang.Object
- implements EventDispatcher<E,R>
This is a 'general purpose' EventDispatcher.
Blocking Listeners are invoked in the same order they are returned from ListenerRegistry.
All non-blocking Listeners are executed in parallel. Threads are pooled temporarily,
after a period of inactivity idle threads are automatically reclaimed.
Override dispatchBlocking() and dispatchNonBlocking() to override dispatching mechods
Method Summary |
protected void |
dispatchBlocking(E e)
|
void |
dispatchEvent(E e)
Dispatches the event to regisreted Listeners (See Listener modes for discussion on the intended behavior
of this method). |
protected void |
dispatchNonBlocking(E e)
|
void |
setRegistry(R reg)
Sets (injects) a ListenerRegistry to be used for discovering Listeners. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleDispatcher
public SimpleDispatcher()
dispatchEvent
public void dispatchEvent(E e)
throws EventException
- Description copied from interface:
EventDispatcher
- Dispatches the event to regisreted Listeners (See Listener modes for discussion on the intended behavior
of this method).
- Specified by:
dispatchEvent
in interface EventDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>
- Parameters:
e
- Event to be dispatched
- Throws:
EventException
- if the dispatch
dispatchBlocking
protected void dispatchBlocking(E e)
throws EventException
- Throws:
EventException
dispatchNonBlocking
protected void dispatchNonBlocking(E e)
throws EventException
- Throws:
EventException
setRegistry
public void setRegistry(R reg)
- Description copied from interface:
EventDispatcher
- Sets (injects) a ListenerRegistry to be used for discovering Listeners.
- Specified by:
setRegistry
in interface EventDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>
Copyright (c) 2003 - 2011 FatWire Corporation All Rights Reserved.