Package org.apache.catalina.tribes.group
Class RpcChannel
java.lang.Object
org.apache.catalina.tribes.group.RpcChannel
- All Implemented Interfaces:
- ChannelListener
A channel to handle RPC messaging
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classClass that holds all response.static class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intprotected static final StringManager
- 
Constructor SummaryConstructorsConstructorDescriptionRpcChannel(byte[] rpcId, Channel channel, RpcCallback callback) Create an RPC channel.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaccept(Serializable msg, Member sender) Invoked by the channel to determine if the listener will process this message or not.voidintbyte[]getRpcId()voidmessageReceived(Serializable msg, Member sender) Receive a message from the channelResponse[]send(Member[] destination, 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, waitMethods inherited from interface org.apache.catalina.tribes.ChannelListenerequals, hashCode
- 
Field Details- 
sm
- 
FIRST_REPLYpublic static final int FIRST_REPLY- See Also:
 
- 
MAJORITY_REPLYpublic static final int MAJORITY_REPLY- See Also:
 
- 
ALL_REPLYpublic static final int ALL_REPLY- See Also:
 
- 
NO_REPLYpublic static final int NO_REPLY- See Also:
 
 
- 
- 
Constructor Details- 
RpcChannelCreate 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 Details- 
sendpublic Response[] send(Member[] destination, 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
 
- 
messageReceivedDescription 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()
- 
acceptDescription 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
 
- 
getChannel
- 
getCallback
- 
getRpcIdpublic byte[] getRpcId()
- 
setChannel
- 
setCallback
- 
setRpcIdpublic void setRpcId(byte[] rpcId) 
- 
getReplyMessageOptionspublic int getReplyMessageOptions()
- 
setReplyMessageOptionspublic void setReplyMessageOptions(int replyMessageOptions) 
 
-