Package org.apache.catalina.tribes.group
Class RpcChannel
- java.lang.Object
- 
- org.apache.catalina.tribes.group.RpcChannel
 
- 
- All Implemented Interfaces:
- ChannelListener
 
 public class RpcChannel extends java.lang.Object implements ChannelListener A channel to handle RPC messaging
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classRpcChannel.RpcCollectorClass that holds all response.static classRpcChannel.RpcCollectorKey
 - 
Field SummaryFields Modifier and Type Field Description static intALL_REPLYstatic intFIRST_REPLYstatic intMAJORITY_REPLYstatic intNO_REPLYprotected static StringManagersm
 - 
Constructor SummaryConstructors Constructor Description RpcChannel(byte[] rpcId, Channel channel, RpcCallback callback)Create an RPC channel.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(java.io.Serializable msg, Member sender)Invoked by the channel to determine if the listener will process this message or not.voidbreakdown()RpcCallbackgetCallback()ChannelgetChannel()intgetReplyMessageOptions()byte[]getRpcId()voidmessageReceived(java.io.Serializable msg, Member sender)Receive a message from the channelResponse[]send(Member[] destination, java.io.Serializable message, int rpcOptions, int channelOptions, long timeout)Send a message and wait for the response.voidsetCallback(RpcCallback callback)voidsetChannel(Channel channel)voidsetReplyMessageOptions(int replyMessageOptions)voidsetRpcId(byte[] rpcId)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.catalina.tribes.ChannelListenerequals, hashCode
 
- 
 
- 
- 
- 
Field Detail- 
smprotected static final StringManager sm 
 - 
FIRST_REPLYpublic static final int FIRST_REPLY - See Also:
- Constant Field Values
 
 - 
MAJORITY_REPLYpublic static final int MAJORITY_REPLY - See Also:
- Constant Field Values
 
 - 
ALL_REPLYpublic static final int ALL_REPLY - See Also:
- Constant Field Values
 
 - 
NO_REPLYpublic static final int NO_REPLY - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
RpcChannelpublic RpcChannel(byte[] rpcId, Channel channel, RpcCallback callback)Create an RPC channel. You can have several RPC channels attached to a group all separated out by the uniqueness- Parameters:
- rpcId- - the unique Id for this RPC group
- channel- Channel
- callback- RpcCallback
 
 
- 
 - 
Method Detail- 
sendpublic Response[] send(Member[] destination, java.io.Serializable message, int rpcOptions, int channelOptions, long timeout) throws ChannelException Send a message and wait for the response.- Parameters:
- destination- Member[] - the destination for the message, and the members you request a reply from
- message- Serializable - the message you are sending out
- rpcOptions- int - FIRST_REPLY, MAJORITY_REPLY or ALL_REPLY
- channelOptions- channel sender options
- timeout- long - timeout in milliseconds, if no reply is received within this time null is returned
- Returns:
- Response[] - an array of response objects.
- Throws:
- ChannelException- Error sending message
 
 - 
messageReceivedpublic void messageReceived(java.io.Serializable msg, Member sender)Description copied from interface:ChannelListenerReceive a message from the channel- Specified by:
- messageReceivedin interface- ChannelListener
- Parameters:
- msg- Serializable
- sender- - the source of the message
 
 - 
breakdownpublic void breakdown() 
 - 
acceptpublic boolean accept(java.io.Serializable msg, Member sender)Description copied from interface:ChannelListenerInvoked by the channel to determine if the listener will process this message or not.- Specified by:
- acceptin interface- ChannelListener
- Parameters:
- msg- Serializable
- sender- Member
- Returns:
- boolean
 
 - 
getChannelpublic Channel getChannel() 
 - 
getCallbackpublic RpcCallback getCallback() 
 - 
getRpcIdpublic byte[] getRpcId() 
 - 
setChannelpublic void setChannel(Channel channel) 
 - 
setCallbackpublic void setCallback(RpcCallback callback) 
 - 
setRpcIdpublic void setRpcId(byte[] rpcId) 
 - 
getReplyMessageOptionspublic int getReplyMessageOptions() 
 - 
setReplyMessageOptionspublic void setReplyMessageOptions(int replyMessageOptions) 
 
- 
 
-