Packageorg.spicefactory.parsley.processor.messaging.receiver
Classpublic class MessageHandler
InheritanceMessageHandler Inheritance AbstractMessageHandler Inheritance AbstractMethodReceiver Inheritance AbstractObjectProviderReceiver Inheritance AbstractMessageReceiver Inheritance Object
Implements MessageTarget

A regular message handler where the message is simply passed to a method on the target instance.



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
 InheritedtargetMethod : Method
[read-only] The method to invoke for matching messages.
AbstractMethodReceiver
Public Methods
 MethodDefined By
  
MessageHandler(provider:ObjectProvider, methodName:String, selector:*, messageType:ClassInfo = null, messageProperties:Array = null, order:int)
Creates a new instance.
MessageHandler
  
Handles a message for this target.
MessageHandler
  
newFactory(methodName:String, selector:*, messageType:ClassInfo = null, messageProperties:Array = null, order:int):MessageReceiverFactory
[static] Creates a new factory that creates MessageHandler instances.
MessageHandler
Protected Methods
 MethodDefined By
 Inherited
getMessageTypeFromParameter(method:Method, paramIndex:uint, explicitType:ClassInfo = null):Class
Returns the Class to use as the message type.
AbstractMethodReceiver
 Inherited
AbstractMessageHandler
Constructor Detail
MessageHandler()Constructor
public function MessageHandler(provider:ObjectProvider, methodName:String, selector:*, messageType:ClassInfo = null, messageProperties:Array = null, order:int)

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
 
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
 
messageProperties:Array (default = null) — the list of names of properties of the message that should be used as method parameters
 
order:int (default = NaN) — the execution order for this receiver
Method Detail
handleMessage()method
public function handleMessage(processor:MessageProcessor):void

Handles a message for this target. The specified processor may be used to control the message processing, like canceling or suspending a message.

Parameters

processor:MessageProcessor — the processor for the message

newFactory()method 
public static function newFactory(methodName:String, selector:*, messageType:ClassInfo = null, messageProperties:Array = null, order:int):MessageReceiverFactory

Creates a new factory that creates MessageHandler 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
 
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
 
messageProperties:Array (default = null) — the list of names of properties of the message that should be used as method parameters
 
order:int (default = NaN) — the execution order for this receiver

Returns
MessageReceiverFactory — a new factory that creates MessageHandler instance