Packageorg.spicefactory.parsley.messaging
Classpublic class MessageHandler
InheritanceMessageHandler Inheritance Object

API for defining a message handler.



Public Methods
 MethodDefined By
  
Applies this configuration to the specified definition builder.
MessageHandler
  
forMethod(method:String):MessageHandler
[static] Creates a new builder for a message handler.
MessageHandler
  
Sets the optional list of names of properties of the message that should be used as method parameters instead passing the message itself as a parameter.
MessageHandler
  
Sets the execution order for this handler.
MessageHandler
  
scope(name:String):MessageHandler
Sets the name of the scope this handler should be applied to.
MessageHandler
  
Sets an optional selector value to be used in addition to selecting messages by type.
MessageHandler
  
type(value:Class):MessageHandler
Sets the type of the messages the handler wants to handle.
MessageHandler
Method Detail
apply()method
public function apply(builder:ObjectDefinitionBuilder):void

Applies this configuration to the specified definition builder.

Parameters

builder:ObjectDefinitionBuilder — the builder to apply this configuration to

forMethod()method 
public static function forMethod(method:String):MessageHandler

Creates a new builder for a message handler.

Parameters

method:String — the name of the target method to invoke

Returns
MessageHandler — a new builder for a message handler
messageProperties()method 
public function messageProperties(value:Array):MessageHandler

Sets the optional list of names of properties of the message that should be used as method parameters instead passing the message itself as a parameter.

Parameters

value:Array — list of names of properties of the message that should be used as method parameters

Returns
MessageHandler — this builder for method chaining
order()method 
public function order(value:int):MessageHandler

Sets the execution order for this handler. Will be processed in ascending order. The default is int.MAX_VALUE.

Parameters

value:int — the execution order for this handler

Returns
MessageHandler — this builder instance for method chaining
scope()method 
public function scope(name:String):MessageHandler

Sets the name of the scope this handler should be applied to.

Parameters

name:String — the name of the scope this handler should be applied to

Returns
MessageHandler — this builder instance for method chaining
selector()method 
public function selector(value:*):MessageHandler

Sets an optional selector value to be used in addition to selecting messages by type.

Parameters

value:* — an optional selector value to be used in addition to selecting messages by type

Returns
MessageHandler — this builder instance for method chaining
type()method 
public function type(value:Class):MessageHandler

Sets the type of the messages the handler wants to handle.

Parameters

value:Class — the type of the messages the handler wants to handle

Returns
MessageHandler — this builder instance for method chaining