Package | org.spicefactory.parsley.core.messaging |
Interface | public interface MessageProcessor |
Implementors | DefaultMessageProcessor |
Property | Defined By | ||
---|---|---|---|
message : Message [read-only]
The message instance. | MessageProcessor | ||
state : MessageState [read-only]
The current state of this processor. | MessageProcessor |
Method | Defined 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 |
message | property |
message:Message
[read-only] The message instance.
public function get message():Message
state | property |
state:MessageState
[read-only] The current state of this processor.
public function get state():MessageState
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:
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.
processor.senderContext.scopeManager.dispatchMessage(new MyMessage());
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.