|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventDispatcher<E extends Event,R extends ListenerRegistry>
This interface abstracts the function of dispatching an event to one or many Listeners. ListenerRegistry is injected as a dependency, the registry is to be used for discovering registered Listeners. Listener modes: Listeners are registered to be invoked in blocking and non-blocking modes. Invoking blocking Listeners must cause the dispatcher to wait until Listener returns. That is, dispatchEvent must not return until blocking Listeners are executed completely. It is generally adviced to execute all blocking Listenrs in the same thread that dispatcher was notified in. Not doing so will have transaction and visibility restrictions, so please use such techniques in well understood cases. All non-blocking Listeners are to be invoked in a non-blokcing fashion, that is dispatchEvent() returns right away. In either case, implementation decides the order of invocation and timeouts (if any). Implementations also decide queuing and what happens to queued Listeners when they are subsequenly unregistered.
Method Summary | |
---|---|
void |
dispatchEvent(E e)
Dispatches the event to regisreted Listeners (See Listener modes for discussion on the intended behavior of this method). |
void |
setRegistry(R reg)
Sets (injects) a ListenerRegistry to be used for discovering Listeners. |
Method Detail |
---|
void dispatchEvent(E e) throws EventException
e
- Event to be dispatched
EventException
- if the dispatchvoid setRegistry(R reg)
reg
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |