パッケージ org.piax.gtrans.ov.ring
クラス RequestMessage
java.lang.Object
org.piax.gtrans.ov.ring.RequestMessage
- すべての実装されたインタフェース:
Serializable
- 直系の既知のサブクラス:
RQMessage
public abstract class RequestMessage extends Object implements Serializable
a base class for a request message.
- 関連項目:
- 直列化された形式
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 protected booleanackReceivedprotected booleanackSentprotected booleanisRecvdInstancebooleanisRootprotected static org.slf4j.Loggerloggerprotected MessagingFrameworkmsgframeintmsgIdTransOptionsoptsprotected booleanreadyToReceiveprotected LinkreceiverintreplyIdprotected booleanreplySentprotected EndpointreplyToprotected Endpointsenderprotected ScheduledFuture<?>timeoutTaskprotected longtimestamp -
コンストラクタの概要
コンストラクタ コンストラクタ 説明 RequestMessage(MessagingFramework msgframe, boolean isRoot, Endpoint replyTo, int replyId, TransOptions opts)create a RequestMessage instance.RequestMessage(RequestMessage msg)create a RequestMessage instance. -
メソッドの概要
修飾子とタイプ メソッド 説明 voiddispose()abstract voidexecute(RingManager<?> sg)this method is called when this message is received at the receiver node.protected RingManager<?>getManager()booleanisAckTimedOut()returns if we have not received any ACK withinMessagingFramework.ACK_TIMEOUT_THRES.booleanmayReceiveReply()AckMessagenewAckMessage()abstract booleanonReceivingReply(ReplyMessage reply)this method is called when a reply message is received at the sender node.abstract voidonResponseTimeout()this method is called when the response message (ack/reply) for this message is timed-out.protected voidresponseReceived(ResponseMessage resp)ack or reply message is received for this RequestMessage.voidsend(Link dst)send this message to the specified destination.voidsendAck()
-
フィールド詳細
-
logger
protected static final org.slf4j.Logger logger -
sender
-
receiver
-
msgId
public final int msgId -
replyTo
-
replyId
public final int replyId -
opts
-
isRoot
public final transient boolean isRoot -
timeoutTask
-
msgframe
-
timestamp
protected transient long timestamp -
ackReceived
protected transient boolean ackReceived -
isRecvdInstance
protected transient boolean isRecvdInstance -
readyToReceive
protected transient boolean readyToReceive -
ackSent
protected transient boolean ackSent -
replySent
protected transient boolean replySent
-
-
コンストラクタの詳細
-
RequestMessage
public RequestMessage(MessagingFramework msgframe, boolean isRoot, Endpoint replyTo, int replyId, TransOptions opts)create a RequestMessage instance.- パラメータ:
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.
-
RequestMessage
create a RequestMessage instance.- パラメータ:
msg- copy source
-
-
メソッドの詳細
-
getManager
-
send
send this message to the specified destination.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,
onReceivingReplyis 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 node
-
isAckTimedOut
public boolean isAckTimedOut()returns if we have not received any ACK withinMessagingFramework.ACK_TIMEOUT_THRES.- 戻り値:
- true if ACK is timed-out.
-
sendAck
public void sendAck() -
responseReceived
ack or reply message is received for this RequestMessage. stop fast retransmission and dispose if possible. note thatChordSharpRQMessageoverrides this method.- パラメータ:
resp- the response message.
-
mayReceiveReply
public boolean mayReceiveReply() -
dispose
public void dispose() -
execute
this method is called when this message is received at the receiver node.- パラメータ:
sg- an instance of Ring
-
onReceivingReply
this method is called when a reply message is received at the sender node.- パラメータ:
reply- the reply message- 戻り値:
- true if this instance is no longer required at the sender node.
-
onResponseTimeout
public abstract void onResponseTimeout()this method is called when the response message (ack/reply) for this message is timed-out. -
newAckMessage
-