Package | org.spicefactory.lib.command.lifecycle |
Interface | public interface CommandLifecycle |
Implementors | DefaultCommandLifecycle |
Method | Defined By | ||
---|---|---|---|
afterCompletion(command:Object, result:CommandResult):void
Lifecycle hook to be invoked after the command finished execution. | CommandLifecycle | ||
beforeExecution(command:Object, data:CommandData):void
Lifecycle hook to be invoked immediately before the command gets executed. | CommandLifecycle | ||
createInstance(type:Class, data:CommandData):Object
Creates a new command instance of the specified type. | CommandLifecycle |
afterCompletion | () | method |
public function afterCompletion(command:Object, result:CommandResult):void
Lifecycle hook to be invoked after the command finished execution. This includes successful completion as well as cancellation and errors.
Parameters
command:Object — the command that finished executing
| |
result:CommandResult — the result produced by the command
|
beforeExecution | () | method |
public function beforeExecution(command:Object, data:CommandData):void
Lifecycle hook to be invoked immediately before the command gets executed.
Parameters
command:Object — the command to be executed
| |
data:CommandData — the data passed to the command by the executor
|
createInstance | () | method |
public function createInstance(type:Class, data:CommandData):Object
Creates a new command instance of the specified type. The data passed to this method may be used to perform constructor injection or similar tasks.
Parameters
type:Class — the type of command to create
| |
data:CommandData — the data passed to the command by the executor
|
Object — a new command instance
|