|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.keridwen.core.messaging.EventBuilder
public final class EventBuilder
An EventBuilder
is a helper class used to create and trigger Event
s.
Method Summary | ||
---|---|---|
static
|
event(Event event)
Initializes the builder with the given event. |
|
static
|
event(EventKey key,
MessageType message)
Builds an Event with the given key and message. |
|
static
|
event(String keyId,
MessageType message)
|
|
static EventBuilder |
getInstance()
Gets the unique instance of the class. |
|
boolean |
isEventRegistered()
|
|
void |
setDispatcher(EventDispatcher aDispatcher)
Method used to set a different event dispatcher than the default one. |
|
|
triggerCallEvent()
Triggers the event synchronously. |
|
|
triggerChangeEvent(Condition condition)
Triggers the event as soon as the change Condition becomes true. |
|
|
triggerSignalEvent()
Triggers the event asynchronously. |
|
|
triggerSignalEvent(int i)
|
|
|
triggerTimeEvent(long delay,
TimeUnit unit)
Triggers the event after the given delay. |
|
|
triggerTimeEventAtFixedDelay(long initialDelay,
long delay,
TimeUnit unit)
Triggers the event after the given delay with the given delay between two executions. |
|
|
triggerTimeEventAtFixedRate(long initialDelay,
long period,
TimeUnit unit)
Triggers the event after the given delay and at a given period. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static EventBuilder getInstance()
public void setDispatcher(EventDispatcher aDispatcher)
aDispatcher
- the dispatcher to set.public static <ReturnType,MessageType> EventBuilder event(EventKey key, MessageType message)
Event
with the given key and message.
ReturnType
- the type of the result returned by the commandMessageType
- the type of the message sent by the eventkey
- the key of the event to triggermessage
- the message to transmit
public static <ReturnType,MessageType> EventBuilder event(String keyId, MessageType message)
public static <ReturnType,MessageType> EventBuilder event(Event event)
event
- the event to set
public <ReturnType> ReturnType triggerCallEvent()
ReturnType
- the type of the result returned by the command
public <ReturnType> Supervisor<ReturnType> triggerChangeEvent(Condition condition)
Condition
becomes true.
ReturnType
- type of the data returned by the command triggered by the event.condition
- the Condition
to watch
public <ReturnType> Supervisor<ReturnType> triggerSignalEvent()
ReturnType
- type of the data returned by the command triggered by the event.
public <ReturnType> Supervisor<ReturnType> triggerSignalEvent(int i)
public <ReturnType> Supervisor<ReturnType> triggerTimeEvent(long delay, TimeUnit unit)
ReturnType
- type of the data returned by the command triggered by the event.delay
- the time from now to delay executionunit
- the time unit of the delay parameter
public <ReturnType> Supervisor<ReturnType> triggerTimeEventAtFixedDelay(long initialDelay, long delay, TimeUnit unit)
ReturnType
- type of the data returned by the command triggered by the event.initialDelay
- 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
public <ReturnType> Supervisor<ReturnType> triggerTimeEventAtFixedRate(long initialDelay, long period, TimeUnit unit)
ReturnType
- type of the data returned by the command triggered by the event.initialDelay
- the time from now to delay the first executionperiod
- the period between two consecutive executionsunit
- the time unit of the parameters
public boolean isEventRegistered()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |