public class RpcChannel extends Object implements ChannelListener
| Modifier and Type | Class and Description | 
|---|---|
| static class  | RpcChannel.RpcCollectorClass that holds all response. | 
| static class  | RpcChannel.RpcCollectorKey | 
| Modifier and Type | Field and Description | 
|---|---|
| static int | ALL_REPLY | 
| static int | FIRST_REPLY | 
| static int | MAJORITY_REPLY | 
| static int | NO_REPLY | 
| Constructor and Description | 
|---|
| RpcChannel(byte[] rpcId,
          Channel channel,
          RpcCallback callback)Create an RPC channel. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | accept(Serializable msg,
      Member sender)Invoked by the channel to determine if the listener will process this message or not. | 
| void | breakdown() | 
| protected static String | bToS(byte[] data)Deprecated. 
 Unused - will be removed in Tomcat 8.0.x | 
| void | finalize() | 
| RpcCallback | getCallback() | 
| Channel | getChannel() | 
| int | getReplyMessageOptions() | 
| byte[] | getRpcId() | 
| void | messageReceived(Serializable msg,
               Member sender)Receive a message from the channel | 
| Response[] | send(Member[] destination,
    Serializable message,
    int rpcOptions,
    int channelOptions,
    long timeout)Send a message and wait for the response. | 
| void | setCallback(RpcCallback callback) | 
| void | setChannel(Channel channel) | 
| void | setReplyMessageOptions(int replyMessageOptions) | 
| void | setRpcId(byte[] rpcId) | 
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCodepublic static final int FIRST_REPLY
public static final int MAJORITY_REPLY
public static final int ALL_REPLY
public static final int NO_REPLY
public RpcChannel(byte[] rpcId,
          Channel channel,
          RpcCallback callback)
rpcId - - the unique Id for this RPC groupchannel - Channelcallback - RpcCallbackpublic Response[] send(Member[] destination, Serializable message, int rpcOptions, int channelOptions, long timeout) throws ChannelException
destination - Member[] - the destination for the message, and the members you request a reply frommessage - Serializable - the message you are sending outrpcOptions - int - FIRST_REPLY, MAJORITY_REPLY or ALL_REPLYchannelOptions - channel sender optionstimeout - long - timeout in milliseconds, if no reply is received within this time null is returnedChannelException - Error sending messagepublic void messageReceived(Serializable msg, Member sender)
ChannelListenermessageReceived in interface ChannelListenermsg - Serializablesender - - the source of the messagepublic void breakdown()
public void finalize()
              throws Throwable
public boolean accept(Serializable msg, Member sender)
ChannelListeneraccept in interface ChannelListenermsg - Serializablesender - Memberpublic Channel getChannel()
public RpcCallback getCallback()
public byte[] getRpcId()
public void setChannel(Channel channel)
public void setCallback(RpcCallback callback)
public void setRpcId(byte[] rpcId)
public int getReplyMessageOptions()
public void setReplyMessageOptions(int replyMessageOptions)
@Deprecated protected static String bToS(byte[] data)
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.