|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BundleController
This interface defines the methods to be implemented by an BundleController
. An event controller
receives the Event
s raised by the application modules and executes the associated Command
(s).
Method Summary | ||
---|---|---|
void |
clean()
Removes all registered Event s/Command s associations. |
|
boolean |
containsEventKey(EventKey key)
Checks whether the given key is registered in the controller. |
|
DataModel |
getApplicationModel()
Gets the data model of the application. |
|
DataModel |
getBundleModel()
Gets the data model of the bundle. |
|
|
getCommandForEvent(Event<ReturnType,MessageType> event)
Gets the Command (if any) associated with the given Event . |
|
void |
registerEvent(DefaultEventKey<?,?>... keyArray)
Registers the given EventKey array. |
|
void |
registerEvent(String keyId,
Class<? extends Command<?,?>> commandClass)
|
|
|
runAfterDelay(Command<ReturnType,MessageType> command,
MessageType message,
long delay,
TimeUnit unit)
Runs the given Command after the given delay. |
|
|
runAsynchronously(Command<ReturnType,MessageType> command,
MessageType message)
Runs the given Command asynchronously. |
|
|
runAsynchronously(Command<ReturnType,MessageType> command,
MessageType message,
int nbThreads)
|
|
|
runAtFixedRate(Command<ReturnType,MessageType> command,
MessageType message,
long initialDelay,
long period,
TimeUnit unit)
Runs the gievn Command after the given delay and at a given period. |
|
|
runOnCondition(Command<ReturnType,MessageType> command,
MessageType message,
Condition condition)
Runs the given Command as soon as the Condition becomes valid. |
|
|
runWithFixedDelay(Command<ReturnType,MessageType> command,
MessageType message,
long initialDelay,
long delay,
TimeUnit unit)
Runs the given Command after the given delay with the given delay between two executions. |
|
void |
terminate()
Terminates all threads running in the controller. |
|
void |
unregisterEvent(EventKey... keyArray)
Unregisters the Command associated to the given EventKey s. |
Method Detail |
---|
<ReturnType,MessageType> Future<ReturnType> runAsynchronously(Command<ReturnType,MessageType> command, MessageType message)
Command
asynchronously.
ReturnType
- type of the data returned by the command.MessageType
- type of the message to handlecommand
- the command to executemessage
- the message to be handled by the command
<ReturnType,MessageType> Future<ReturnType> runAsynchronously(Command<ReturnType,MessageType> command, MessageType message, int nbThreads)
<ReturnType,MessageType> Future<ReturnType> runOnCondition(Command<ReturnType,MessageType> command, MessageType message, Condition condition)
Command
as soon as the Condition
becomes valid.
ReturnType
- type of the data returned by the command.MessageType
- type of the message to handlecommand
- the command to executecondition
- the Condition
to watchmessage
- the message to be handled by the command
<ReturnType,MessageType> ScheduledFuture<?> runAfterDelay(Command<ReturnType,MessageType> command, MessageType message, long delay, TimeUnit unit)
Command
after the given delay.
ReturnType
- type of the data returned by the command.MessageType
- type of the message to handlecommand
- the command to executemessage
- the message to be handled by the commanddelay
- the time from now to delay executionunit
- the time unit of the delay parameter
<ReturnType,MessageType> ScheduledFuture<?> runWithFixedDelay(Command<ReturnType,MessageType> command, MessageType message, long initialDelay, long delay, TimeUnit unit)
Command
after the given delay with the given delay between two executions.
ReturnType
- type of the data returned by the command.MessageType
- type of the message to handlecommand
- the command to executemessage
- the message to be handled by the commandinitialDelay
- 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,MessageType> ScheduledFuture<?> runAtFixedRate(Command<ReturnType,MessageType> command, MessageType message, long initialDelay, long period, TimeUnit unit)
Command
after the given delay and at a given period.
ReturnType
- type of the data returned by the command.MessageType
- type of the message to handlecommand
- the command to executemessage
- the message to be handled by the commandinitialDelay
- the time from now to delay the first executionperiod
- the period between two consecutive executionsunit
- the time unit of the parameters
void registerEvent(DefaultEventKey<?,?>... keyArray)
EventKey
array.
keyArray
- the array of unique keys of the Event
s triggering an associated Command
svoid registerEvent(String keyId, Class<? extends Command<?,?>> commandClass)
void unregisterEvent(EventKey... keyArray)
Command
associated to the given EventKey
s.
keyArray
- the unique keys of the Event
s triggering the associated Command
svoid clean()
Event
s/Command
s associations.
<ReturnType,MessageType> Command<ReturnType,MessageType> getCommandForEvent(Event<ReturnType,MessageType> event)
Command
(if any) associated with the given Event
.
ReturnType
- the return type of the commandMessageType
- the type of the message transported by the Event
event
- the event
Command
(if any)boolean containsEventKey(EventKey key)
key
- the event key to check
void terminate()
DataModel getApplicationModel()
DataModel getBundleModel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |