Packageorg.spicefactory.parsley.processor.messaging.receiver
Classpublic class DefaultCommandObserver
InheritanceDefaultCommandObserver Inheritance AbstractMethodReceiver Inheritance AbstractObjectProviderReceiver Inheritance AbstractMessageReceiver Inheritance Object
Implements CommandObserver

Default implementation of the CommandObserver interface.



Public Properties
 PropertyDefined By
 InheritedmessageType : Class
[read-only] The class or interface of the message.
AbstractMessageReceiver
 Inheritedorder : int
[read-only] The execution order for this receiver.
AbstractMessageReceiver
 Inheritedprovider : ObjectProvider
[read-only] The provider for the actual instance handling the message.
AbstractObjectProviderReceiver
 Inheritedselector : *
[read-only] An optional selector value to be used for selecting matching messages.
AbstractMessageReceiver
  status : CommandStatus
[read-only] The status this observer is interested in.
DefaultCommandObserver
 InheritedtargetMethod : Method
[read-only] The method to invoke for matching messages.
AbstractMethodReceiver
Public Methods
 MethodDefined By
  
DefaultCommandObserver(provider:ObjectProvider, methodName:String, status:CommandStatus, selector:*, messageType:ClassInfo = null, order:int, supportsResult:Boolean = true)
Creates a new instance.
DefaultCommandObserver
  
newFactory(methodName:String, status:CommandStatus, selector:*, messageType:ClassInfo = null, order:int, supportsResult:Boolean = true):MessageReceiverFactory
[static] Creates a new factory that creates DefaultCommandObserver instances.
DefaultCommandObserver
  
Invoked when a matching command starts or finishes its execution.
DefaultCommandObserver
Protected Methods
 MethodDefined By
 Inherited
getMessageTypeFromParameter(method:Method, paramIndex:uint, explicitType:ClassInfo = null):Class
Returns the Class to use as the message type.
AbstractMethodReceiver
Property Detail
statusproperty
status:CommandStatus  [read-only]

The status this observer is interested in.


Implementation
    public function get status():CommandStatus
Constructor Detail
DefaultCommandObserver()Constructor
public function DefaultCommandObserver(provider:ObjectProvider, methodName:String, status:CommandStatus, selector:*, messageType:ClassInfo = null, order:int, supportsResult:Boolean = true)

Creates a new instance.

Parameters
provider:ObjectProvider — the provider for the instance that contains the target method
 
methodName:String — the name of the target method that should be invoked
 
status:CommandStatus — the command status this object is interested in
 
selector:* (default = NaN) — an optional selector value to be used for selecting matching message targets
 
messageType:ClassInfo (default = null) — the type of the message or null if it should be autodetected by the parameter of the target method
 
order:int (default = NaN) — the execution order for this receiver
 
supportsResult:Boolean (default = true) — whether a result parameter is supported in the handler method
Method Detail
newFactory()method
public static function newFactory(methodName:String, status:CommandStatus, selector:*, messageType:ClassInfo = null, order:int, supportsResult:Boolean = true):MessageReceiverFactory

Creates a new factory that creates DefaultCommandObserver instances. Such a factory can be used for convenient registration of a MessageReceiverProcessorFactory with a target ObjectDefinition.

Parameters

methodName:String — the name of the target method that should be invoked
 
status:CommandStatus — the command status this object is interested in
 
selector:* (default = NaN) — an optional selector value to be used for selecting matching message targets
 
messageType:ClassInfo (default = null) — the type of the message or null if it should be autodetected by the parameter of the target method
 
order:int (default = NaN) — the execution order for this receiver
 
supportsResult:Boolean (default = true) — whether a result parameter is supported in the handler method

Returns
MessageReceiverFactory — a new factory that creates DefaultCommandObserver instance
observeCommand()method 
public function observeCommand(processor:CommandObserverProcessor):void

Invoked when a matching command starts or finishes its execution. The specified processor may be used to control the processing of remaining observers, like canceling or suspending the processor.

Parameters

processor:CommandObserverProcessor — the processor for the command observer