|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventDispatcher
An EventDispatcher
is a class that dispatches the Event
s raised by the application modules
to the registred BundleController
s.
Method Summary | ||
---|---|---|
void |
clean()
Removes all registered BundleController s and EventDispatcher s. |
|
boolean |
isEventRegistered(Event<?,?> event)
|
|
void |
registerBundle(BundleController controller)
Registers the given BundleController to be called on Event dispatch. |
|
void |
registerEventDispatcher(EventDispatcher dispatcher)
Registers the given EventDispatcher to be called on Event dispatch. |
|
void |
terminate()
Terminates all threads running in the registred controllers. |
|
|
triggerChangeEvent(Event<ReturnType,?> event,
Condition condition)
Triggers the given Event that will trigger the command execution as soon as the change
Condition becomes true. |
|
|
triggerEvent(Event<ReturnType,?> event)
Triggers the given Event asynchronously. |
|
|
triggerEvent(Event<ReturnType,?> event,
int nbThreads)
|
|
|
triggerTimeEvent(Event<ReturnType,?> event,
long delay,
TimeUnit unit)
Triggers the given Event after the given delay. |
|
|
triggerTimeEventAtFixedRate(Event<ReturnType,?> event,
long initialDelay,
long period,
TimeUnit unit)
Triggers the given Event after the given delay and at a given period. |
|
|
triggerTimeEventWithFixedDelay(Event<ReturnType,?> event,
long initialDelay,
long delay,
TimeUnit unit)
Triggers the given Event after the given delay with the given delay between two executions. |
|
void |
unregisterBundle(BundleController controller)
Unregisters the given BundleController . |
|
void |
unregisterEventDispatcher(EventDispatcher dispatcher)
Unregisters the given EventDispatcher . |
Method Detail |
---|
<ReturnType> Supervisor<ReturnType> triggerEvent(Event<ReturnType,?> event)
Event
asynchronously.
ReturnType
- type of the data returned by the command triggered by the event.event
- the event to trigger
<ReturnType> Supervisor<ReturnType> triggerEvent(Event<ReturnType,?> event, int nbThreads)
<ReturnType> Supervisor<ReturnType> triggerChangeEvent(Event<ReturnType,?> event, Condition condition)
Event
that will trigger the command execution as soon as the change
Condition
becomes true.
ReturnType
- type of the data returned by the command triggered by the event.event
- the event to triggercondition
- the Condition
to watch
<ReturnType> Supervisor<ReturnType> triggerTimeEvent(Event<ReturnType,?> event, long delay, TimeUnit unit)
Event
after the given delay.
ReturnType
- type of the data returned by the command triggered by the event.event
- the event to triggerdelay
- the time from now to delay executionunit
- the time unit of the delay parameter
<ReturnType> Supervisor<ReturnType> triggerTimeEventWithFixedDelay(Event<ReturnType,?> event, long initialDelay, long delay, TimeUnit unit)
Event
after the given delay with the given delay between two executions.
ReturnType
- type of the data returned by the command triggered by the event.event
- the event to triggerinitialDelay
- the time from now to delay the first executiondelay
- the delay between termination of one execution and the commencement of the nextunit
- the time unit of the parameters
<ReturnType> Supervisor<ReturnType> triggerTimeEventAtFixedRate(Event<ReturnType,?> event, long initialDelay, long period, TimeUnit unit)
Event
after the given delay and at a given period.
ReturnType
- type of the data returned by the command triggered by the event.event
- the event to triggerinitialDelay
- the time from now to delay the first executionperiod
- the period between two consecutive executionsunit
- the time unit of the parameters
boolean isEventRegistered(Event<?,?> event)
void registerEventDispatcher(EventDispatcher dispatcher)
EventDispatcher
to be called on Event
dispatch.
dispatcher
- the EventDispatcher
to registervoid unregisterEventDispatcher(EventDispatcher dispatcher)
EventDispatcher
.
dispatcher
- the EventDispatcher
to unregistervoid registerBundle(BundleController controller)
BundleController
to be called on Event
dispatch.
controller
- the BundleController
to registervoid unregisterBundle(BundleController controller)
BundleController
.
controller
- the BundleController
to unregistervoid clean()
BundleController
s and EventDispatcher
s.
void terminate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |