|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ResultType
- type of the value returned by the Command
.MessageType
- type of the message the Command
can handle.public interface Command<ResultType,MessageType>
A Command
represents and encapsultes the business logic to be executed upon reception of a specific
Event
.
Method Summary | |
---|---|
boolean |
checkPreConditions()
Check that the Command preconditions are fulfilled. |
ResultType |
execute(MessageType message)
Executes the Command 's logic with a given message. |
DataModel |
getApplicationModel()
Gets the data model of the application. |
DataModel |
getBundleModel()
Gets the data model of the bundle. |
String |
getDescription()
Returns the localized Command description. |
String |
getLabel()
Returns the localized Command name. |
CommandLogLevel |
getLogLevel()
Gets the verbosity level at which this command should be logged. |
boolean |
isUndoable()
Checks whether the Command can be undone by the user. |
void |
setModels(DataModel applicationModel,
DataModel bundleModel)
Initializes the models of that the command can access. |
void |
undo()
Undo the Command actions. |
boolean |
validatePostConditions()
Sets all postconditions to true if they have been validated by the Command . |
Methods inherited from interface org.keridwen.core.data.model.progress.Controllable |
---|
addControllableListener, clearControllableListener, getState, interrupt, isInterrupted, isInterruptible, isPausable, pause, removeControllableListener, resume |
Methods inherited from interface org.keridwen.core.data.model.progress.Progressable |
---|
addProgressableListener, clearProgressableListener, getProgress, getState, isDetermined, removeProgressableListener |
Method Detail |
---|
ResultType execute(MessageType message) throws CommandException
Command
's logic with a given message.
message
- the message to use for the execution.
CommandException
- exceptions raised during the execution of the command.void undo()
Command
actions.
boolean isUndoable()
Command
can be undone by the user.
Command
can be undone, false otherwiseCommandLogLevel getLogLevel()
String getLabel()
Command
name.
String getDescription()
Command
description.
boolean checkPreConditions()
Command
preconditions are fulfilled.
boolean validatePostConditions()
Command
.
void setModels(DataModel applicationModel, DataModel bundleModel)
applicationModel
- the model of the applicationbundleModel
- the model of the command bundleDataModel getApplicationModel()
DataModel getBundleModel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |