Package | org.spicefactory.parsley.command |
Class | public class ManagedCommandBuilder |
Inheritance | ManagedCommandBuilder Object |
Method | Defined By | ||
---|---|---|---|
Builds the target command without executing it, applying all configurations specified
through this builder instance and associating it with the specified
Context. | ManagedCommandBuilder | ||
cancel(callback:Function):ManagedCommandBuilder
Adds a callback to invoke when the command gets cancelled. | ManagedCommandBuilder | ||
data(value:Object):ManagedCommandBuilder
Adds a value that can get passed to the command
executed by the proxy this builder creates. | ManagedCommandBuilder | ||
error(callback:Function):ManagedCommandBuilder
Adds a callback to invoke when the command produced an error. | ManagedCommandBuilder | ||
Builds and executes the target command. | ManagedCommandBuilder | ||
id(value:String):ManagedCommandBuilder
The identifier of the managed command. | ManagedCommandBuilder | ||
result(callback:Function):ManagedCommandBuilder
Adds a callback to invoke when the command completes successfully. | ManagedCommandBuilder | ||
timeout(milliseconds:uint):ManagedCommandBuilder
Sets the timeout for the command execution. | ManagedCommandBuilder |
build | () | method |
public function build(context:Context):ManagedCommandProxy
Builds the target command without executing it, applying all configurations specified through this builder instance and associating it with the specified Context.
Parameters
context:Context — Context that is responsible for managing the command created by this builder
|
ManagedCommandProxy — the command proxy will all configuration of this builder applied
|
cancel | () | method |
public function cancel(callback:Function):ManagedCommandBuilder
Adds a callback to invoke when the command gets cancelled. The callback should not expect any parameters.
Parameters
callback:Function — the callback to invoke when the command gets cancelled
|
ManagedCommandBuilder — this builder instance for method chaining
|
data | () | method |
public function data(value:Object):ManagedCommandBuilder
Adds a value that can get passed to the command executed by the proxy this builder creates.
Parameters
value:Object — the value to pass to the command
|
ManagedCommandBuilder — this builder instance for method chaining
|
error | () | method |
public function error(callback:Function):ManagedCommandBuilder
Adds a callback to invoke when the command produced an error. The cause of the error will get passed to the callback.
Parameters
callback:Function — the callback to invoke when the command produced an error
|
ManagedCommandBuilder — this builder instance for method chaining
|
execute | () | method |
public function execute(context:Context):ManagedCommandProxy
Builds and executes the target command.
A shortcut for calling build().execute()
.
In case of asynchronous commands the returned proxy
will still be active. In case of synchronous commands
it will already be completed, so that adding event
listeners won't have any effect.
Parameters
context:Context — Context that is responsible for managing the command created by this builder
|
ManagedCommandProxy — the command that was built and executed by this builder
|
id | () | method |
public function id(value:String):ManagedCommandBuilder
The identifier of the managed command. The id is optional and can be used for identifying matching command observers.
Parameters
value:String — identifier of the managed command
|
ManagedCommandBuilder — this builder instance for method chaining
|
result | () | method |
public function result(callback:Function):ManagedCommandBuilder
Adds a callback to invoke when the command completes successfully. The result produced by the command will get passed to the callback.
Parameters
callback:Function — the callback to invoke when the command completes successfully
|
ManagedCommandBuilder — this builder instance for method chaining
|
timeout | () | method |
public function timeout(milliseconds:uint):ManagedCommandBuilder
Sets the timeout for the command execution. When the specified amount of time is elapsed the command will abort with an error.
Parameters
milliseconds:uint — the timeout for the command execution in milliseconds
|
ManagedCommandBuilder — this builder instance for method chaining
|