public abstract class RequestMessage extends Object implements Serializable
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected boolean |
ackReceived |
protected boolean |
ackSent |
protected boolean |
isRecvdInstance |
boolean |
isRoot |
protected static org.slf4j.Logger |
logger |
protected MessagingFramework |
msgframe |
int |
msgId |
TransOptions |
opts |
protected boolean |
readyToReceive |
protected Link |
receiver |
int |
replyId |
protected boolean |
replySent |
protected Endpoint |
replyTo |
protected Endpoint |
sender |
protected ScheduledFuture<?> |
timeoutTask |
protected long |
timestamp |
| コンストラクタと説明 |
|---|
RequestMessage(MessagingFramework msgframe,
boolean isRoot,
Endpoint replyTo,
int replyId,
TransOptions opts)
create a RequestMessage instance.
|
RequestMessage(RequestMessage msg)
create a RequestMessage instance.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
dispose() |
abstract void |
execute(RingManager<?> sg)
this method is called when this message is received at the receiver
node.
|
protected RingManager<?> |
getManager() |
boolean |
isAckTimedOut()
returns if we have not received any ACK within
MessagingFramework.ACK_TIMEOUT_THRES. |
boolean |
mayReceiveReply() |
AckMessage |
newAckMessage() |
abstract boolean |
onReceivingReply(ReplyMessage reply)
this method is called when a reply message is received at the sender
node.
|
abstract void |
onResponseTimeout()
this method is called when the response message (ack/reply) for this
message is timed-out.
|
protected void |
responseReceived(ResponseMessage resp)
ack or reply message is received for this RequestMessage.
|
void |
send(Link dst)
send this message to the specified destination.
|
void |
sendAck() |
protected static final org.slf4j.Logger logger
protected final Endpoint sender
protected Link receiver
public final int msgId
protected final Endpoint replyTo
public final int replyId
public final TransOptions opts
public final transient boolean isRoot
protected transient ScheduledFuture<?> timeoutTask
protected transient MessagingFramework msgframe
protected transient long timestamp
protected transient boolean ackReceived
protected transient boolean isRecvdInstance
protected transient boolean readyToReceive
protected transient boolean ackSent
protected transient boolean replySent
public RequestMessage(MessagingFramework msgframe, boolean isRoot, Endpoint replyTo, int replyId, TransOptions opts)
msgframe - the messaging framework.isRoot - indicate whether this message isreplyTo - if non-null, reply is sent to this node. otherwise, reply
is sent to the sender node.replyId - used only when replyTo != null and specify the replyId at
the root node.opts - specifies transmission parameters.public RequestMessage(RequestMessage msg)
msg - copy sourceprotected RingManager<?> getManager()
public void send(Link dst)
when this message is arrived at the destination node,
an ACK message is automatically sent to the sender node and
execute(RingManager) is called at the destination node.
when we receive a reply message, onReceivingReply is called.
(note that when isDirectReturn
== true, we do not receive any reply message in non-root nodes).
if we do not receive an ACK message
within MessagingFramework.ACK_TIMEOUT_THRES,
onResponseTimeout() is called.
Note: the message is stored in MessagingFramework#msgStore for handling ACK and reply messages.
the message is removed when (1) ACK is received (if isDirectReturn==true), or (2) a reply message is received (otherwise).
dst - destination nodepublic boolean isAckTimedOut()
MessagingFramework.ACK_TIMEOUT_THRES.public void sendAck()
protected void responseReceived(ResponseMessage resp)
ChordSharpRQMessage
overrides this method.resp - the response message.public boolean mayReceiveReply()
public void dispose()
public abstract void execute(RingManager<?> sg)
sg - an instance of Ringpublic abstract boolean onReceivingReply(ReplyMessage reply)
reply - the reply messagepublic abstract void onResponseTimeout()
public AckMessage newAckMessage()
Copyright © 2017. All rights reserved.