org.iqual.chaplin.msg
Class MessageReceiversChain
java.lang.Object
org.iqual.chaplin.msg.MessageReceiversChain
public class MessageReceiversChain
- extends Object
This class passes the message to all receivers. The receivers get this instance as an argument and it is assumed
that the receivers call back the chain's process method.
- Since:
- Jun 4, 2009 10:34:42 PM
- Author:
- Zbynek Slajchrt
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageReceiversChain
public MessageReceiversChain(MessageReceiver owner,
MessageReceiver[] receivers)
MessageReceiversChain
public MessageReceiversChain(MessageReceiver... receivers)
MessageReceiversChain
public MessageReceiversChain(Iterator<MessageReceiver> receivers)
MessageReceiversChain
public MessageReceiversChain(MessageReceiver owner,
Iterator<MessageReceiver> receivers)
getChainOwner
public MessageReceiver getChainOwner()
process
public void process(Message message,
MessageReplies replies)
throws Throwable
- Throws:
Throwable
stop
public void stop()
- Stop chain processing.
isFinished
public boolean isFinished()
processInContext
public static void processInContext(Message message,
MessageReplies replies)
throws Throwable
- Throws:
Throwable
processInContext
public static void processInContext(MessageReplies replies,
Object... arguments)
throws Throwable
- Throws:
Throwable
processInContext
public static <T> T processInContext(Object... arguments)
throws Throwable
- Invoke the context message chain and hence process the clone of the context message which carries
the arguments passed to this method.
- Parameters:
arguments - the arguments for the clone of the context message
- Returns:
- the result of processing the message
- Throws:
Throwable
NoReplyException - after processing the context message the replies container does not contain any
reply which could be returned.
TooManyRepliesException - after processing the context message the replies container contains more than 1 reply
so that it is impossible to decide which should be returned.
NoContextChainException - there is no context message chain bound to the current thread.
Copyright © 2009 iquality.org. All Rights Reserved.