Packageorg.spicefactory.parsley.processor.messaging.receiver
Classpublic class DefaultMessageErrorHandler
InheritanceDefaultMessageErrorHandler Inheritance AbstractMethodReceiver Inheritance AbstractObjectProviderReceiver Inheritance AbstractMessageReceiver Inheritance Object
Implements MessageErrorHandler

Default implementation of the MessageErrorHandler interface.



Public Properties
 PropertyDefined By
  errorType : Class
[read-only] The type of Error this handler is interested in.
DefaultMessageErrorHandler
 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
  
DefaultMessageErrorHandler(provider:ObjectProvider, methodName:String, messageType:Class, selector:*, errorType:ClassInfo = null, order:int)
Creates a new instance.
DefaultMessageErrorHandler
  
handleError(processor:MessageProcessor, error:Error):void
Handles an error thrown by a regular message target or interceptor.
DefaultMessageErrorHandler
  
newFactory(methodName:String, messageType:Class, selector:*, errorType:ClassInfo = null, order:int):MessageReceiverFactory
[static] Creates a new factory that creates MessageHandler instances.
DefaultMessageErrorHandler
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
errorTypeproperty
errorType:Class  [read-only]

The type of Error this handler is interested in. Like with matching message classes this works in a polymorphic way. Specifying the base Error class creates an ErrorHandler that handles all errors for a particular message type.


Implementation
    public function get errorType():Class
Constructor Detail
DefaultMessageErrorHandler()Constructor
public function DefaultMessageErrorHandler(provider:ObjectProvider, methodName:String, messageType:Class, selector:*, errorType:ClassInfo = null, order:int)

Creates a new instance. The target method must have a parameter of type org.spicefactory.parsley.messaging.MessageProcessor and a second parameter of type Error (or a subtype).

Parameters
provider:ObjectProvider — the provider for the actual instance handling the message
 
methodName:String — the name of the method to invoke for matching messages
 
messageType:Class — the type of the message this error handler is interested in
 
selector:* (default = NaN) — an additional selector value to be used to determine matching messages
 
errorType:ClassInfo (default = null) — the type of Error this handler is interested in
 
order:int (default = NaN) — the execution order for this receiver
Method Detail
handleError()method
public function handleError(processor:MessageProcessor, error:Error):void

Handles an error thrown by a regular message target or interceptor. Processing further error handlers and targets will only happen if proceed is called on the specified processor.

Parameters

processor:MessageProcessor — the processor for the message
 
error:Error — the error thrown by a message target

newFactory()method 
public static function newFactory(methodName:String, messageType:Class, selector:*, errorType:ClassInfo = 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
 
messageType:Class — an optional selector value to be used for selecting matching message targets
 
selector:* (default = NaN) — the type of the message or null if it should be autodetected by the parameter of the target method
 
errorType:ClassInfo (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