Packageorg.spicefactory.parsley.core.messaging
Interfacepublic interface MessageProcessor
Implementors DefaultMessageProcessor

Responsible for processing a single message. Will be passed to registered message interceptors and error handlers which may chose to cancel or suspend and later resume the message processing.



Public Properties
 PropertyDefined By
  message : Message
[read-only] The message instance.
MessageProcessor
  state : MessageState
[read-only] The current state of this processor.
MessageProcessor
Public Methods
 MethodDefined By
  
cancel():void
Cancels processing of this message.
MessageProcessor
  
resume():void
Resumes with message processing, invoking the next receiver.
MessageProcessor
  
rewind():void
Rewinds the processor so it will start with the first interceptor or handler again the next time the proceed method gets invoked.
MessageProcessor
  
sendResponse(msg:Object, selector:* = null):void
Sends the response to the Context the message originated from.
MessageProcessor
  
suspend():void
Suspends processing of the message.
MessageProcessor
Property Detail
messageproperty
message:Message  [read-only]

The message instance.


Implementation
    public function get message():Message
stateproperty 
state:MessageState  [read-only]

The current state of this processor.


Implementation
    public function get state():MessageState
Method Detail
cancel()method
public function cancel():void

Cancels processing of this message. No further handlers will be invoked and all resources associated with this message are disposed.

resume()method 
public function resume():void

Resumes with message processing, invoking the next receiver. May only be called after suspend has been called on this processor

rewind()method 
public function rewind():void

Rewinds the processor so it will start with the first interceptor or handler again the next time the proceed method gets invoked. Calling this method also causes all receivers to be refetched from the registry and thus takes into account any new receivers registered after processing this message started.

sendResponse()method 
public function sendResponse(msg:Object, selector:* = null):void

Sends the response to the Context the message originated from. It does not send this message to the sending object instance only, as this would not be very helpful in most cases. Essentially this method is just a short cut for calling:

processor.senderContext.scopeManager.dispatchMessage(new MyMessage());
Note that the response is dispatched through all scopes of the Context of the sending instance, including the global scope. Therefor for point-to-point messaging the receiver of the response should listen to the local scope (or a custom scope) instead.

Parameters

msg:Object — the message to dispatch
 
selector:* (default = null) — the selector to use if it cannot be determined from the message instance itself

suspend()method 
public function suspend():void

Suspends processing of the message. No further handlers will be invoked before resume gets called on this processor. To permanently discard this message call cancel to free all resources associated with this message.