Packageorg.spicefactory.parsley.messaging.processor
Classpublic class MessageReceiverProcessor
InheritanceMessageReceiverProcessor Inheritance Object
Implements StatefulProcessor, SingletonPreProcessor
Subclasses MethodReceiverProcessor, PropertyReceiverProcessor

Processor that registers and unregisters any kind of message receiver.



Protected Properties
 PropertyDefined By
  receiverFactory : Function
The factory to invoke for creating new receiver instances.
MessageReceiverProcessor
  scopeName : String
The name of the scope the receiver should get registered in.
MessageReceiverProcessor
Public Methods
 MethodDefined By
  
MessageReceiverProcessor(factory:Function, scopeName:String)
Creates a new processor factory.
MessageReceiverProcessor
  
Creates a clone of this processor by omitting all internal state that is tied to one particular target instance.
MessageReceiverProcessor
  
destroy(target:ManagedObject):void
Invoked when the target instance gets removed from the Context.
MessageReceiverProcessor
  
Invoked when the Context gets destroyed before the target instance gets initialized.
MessageReceiverProcessor
  
init(target:ManagedObject):void
Invoked during initialization of the target instance.
MessageReceiverProcessor
  
Allows the preprocessing of the specified object definition even before the target instance has been created.
MessageReceiverProcessor
Protected Methods
 MethodDefined By
  
Prepares the receiver, primarily passing the ObjectProvider and potentially the target member information (e.g.
MessageReceiverProcessor
Property Detail
receiverFactoryproperty
protected var receiverFactory:Function

The factory to invoke for creating new receiver instances.

scopeNameproperty 
protected var scopeName:String

The name of the scope the receiver should get registered in.

Constructor Detail
MessageReceiverProcessor()Constructor
public function MessageReceiverProcessor(factory:Function, scopeName:String)

Creates a new processor factory.

Parameters
factory:Function — the factory that produces new MessageReceiver instances for each target object
 
scopeName:String — the name of the scope the receivers listen to
Method Detail
clone()method
public function clone():StatefulProcessor

Creates a clone of this processor by omitting all internal state that is tied to one particular target instance.

Returns
StatefulProcessor — a clone of this processor
destroy()method 
public function destroy(target:ManagedObject):void

Invoked when the target instance gets removed from the Context. Implementations will usually unregister message receivers, unwatch bindings, remove listeners or perform similar disposal tasks.

Parameters

target:ManagedObject — the target instance that is getting removed from the Context

destroyBeforeInit()method 
public function destroyBeforeInit(definition:SingletonObjectDefinition):void

Invoked when the Context gets destroyed before the target instance gets initialized. This hook allows to perform any necessary cleanup that usually happens in the destroy method which will not get invoked in such a case.

Parameters

definition:SingletonObjectDefinition — the definition of the target singleton instance

init()method 
public function init(target:ManagedObject):void

Invoked during initialization of the target instance. Implementations will usually set properties, registers message receivers or performs similar configuration tasks for the target instance managed by this processor.

Parameters

target:ManagedObject — the target instance that is getting initialized

prepareReceiver()method 
protected function prepareReceiver(receiver:MessageReceiver, provider:ObjectProvider):void

Prepares the receiver, primarily passing the ObjectProvider and potentially the target member information (e.g. Property or Method).

Parameters

receiver:MessageReceiver — the new receiver to configure
 
provider:ObjectProvider — the target provider that has been created for the receiver

preProcess()method 
public function preProcess(definition:SingletonObjectDefinition):void

Allows the preprocessing of the specified object definition even before the target instance has been created. This allows to perform tasks like message handler registration early in the Context lifecycle.

Parameters

definition:SingletonObjectDefinition — the definition of the target singleton instance