ChannelListenerpublic class RpcChannel extends java.lang.Object implements ChannelListener
| Modifier and Type | Class | Description |
|---|---|---|
static class |
RpcChannel.RpcCollector |
Class that holds all response.
|
static class |
RpcChannel.RpcCollectorKey |
| Modifier and Type | Field | Description |
|---|---|---|
static int |
ALL_REPLY |
|
static int |
FIRST_REPLY |
|
static int |
MAJORITY_REPLY |
|
static int |
NO_REPLY |
|
protected static StringManager |
sm |
| Constructor | Description |
|---|---|
RpcChannel(byte[] rpcId,
Channel channel,
RpcCallback callback) |
Create an RPC channel.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
accept(java.io.Serializable msg,
Member sender) |
Invoked by the channel to determine if the listener will process this message or not.
|
void |
breakdown() |
|
void |
finalize() |
|
RpcCallback |
getCallback() |
|
Channel |
getChannel() |
|
int |
getReplyMessageOptions() |
|
byte[] |
getRpcId() |
|
void |
messageReceived(java.io.Serializable msg,
Member sender) |
Receive a message from the channel
|
Response[] |
send(Member[] destination,
java.io.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) |
equals, hashCodeprotected static final StringManager sm
public 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, java.io.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(java.io.Serializable msg,
Member sender)
ChannelListenermessageReceived in interface ChannelListenermsg - Serializablesender - - the source of the messagepublic void breakdown()
public void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic boolean accept(java.io.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)
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.