| Package | org.spicefactory.lib.command.lifecycle |
| Class | public class DefaultCommandLifecycle |
| Inheritance | DefaultCommandLifecycle Object |
| Implements | CommandLifecycle |
| Subclasses | ManagedCommandLifecycle |
This implementation uses the specified CommandData to peform constructor
injection when creating a new command instance. The beforeExecution
and afterCompletion hooks in this implementation do nothing.
| Method | Defined By | ||
|---|---|---|---|
DefaultCommandLifecycle(domain:ApplicationDomain = null)
Creates a new instance. | DefaultCommandLifecycle | ||
afterCompletion(command:Object, result:CommandResult):void
Lifecycle hook to be invoked after the command finished execution. | DefaultCommandLifecycle | ||
beforeExecution(command:Object, data:CommandData):void
Lifecycle hook to be invoked immediately before the command gets executed. | DefaultCommandLifecycle | ||
createInstance(type:Class, data:CommandData):Object
Creates a new command instance of the specified type. | DefaultCommandLifecycle | ||
| DefaultCommandLifecycle | () | Constructor |
public function DefaultCommandLifecycle(domain:ApplicationDomain = null)Creates a new instance.
Parametersdomain:ApplicationDomain (default = null) — the domain to use for reflecting on command classes
|
| afterCompletion | () | method |
public function afterCompletion(command:Object, result:CommandResult):voidLifecycle 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):voidLifecycle 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):ObjectCreates 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
|