クラス SGMessagingFramework.SGRequestMessage<E extends Endpoint>
- すべての実装されたインタフェース:
Serializable
- 直系の既知のサブクラス:
RQMessage
- 含まれているクラス:
- SGMessagingFramework<E extends Endpoint>
public abstract static class SGMessagingFramework.SGRequestMessage<E extends Endpoint> extends Object implements Serializable
- 作成者:
- k-abe
- 関連項目:
- 直列化された形式
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 SGRequestMessage(SGMessagingFramework.SGRequestMessage<E> msg)create a SGRequestMessage instance.SGRequestMessage(SGMessagingFramework<E> sgmf, boolean isRoot, boolean isDirectReturn, E replyTo, int replyId, int expire)create a SGRequestMessage instance. -
メソッドの概要
修飾子とタイプ メソッド 説明 abstract voidexecute(SkipGraph<E> sg)this method is called when this message is received at the receiver node.booleanisAckTimedOut()returns if we have not received any ACK withinSGMessagingFramework.ACK_TIMEOUT_THRES.booleanmayReceiveReply()abstract booleanonReceivingReply(SkipGraph<E> sg, SGMessagingFramework.SGReplyMessage<E> reply)this method is called when a reply message is received at the sender node.abstract voidonTimeOut(SkipGraph<E> sg)this method is called when the ack for this message is timed out.voidprepareReceivingReply()このメッセージはsendしないが,replyは受信するという場合に,受信に備えておく.voidsend(Link dst)send this message to the specified destination.
-
コンストラクタの詳細
-
SGRequestMessage
public SGRequestMessage(SGMessagingFramework<E> sgmf, boolean isRoot, boolean isDirectReturn, E replyTo, int replyId, int expire)create a SGRequestMessage instance.- パラメータ:
sgmf- the messaging framework.isRoot- indicate whether this message is root.isDirectReturn- true if the reply for this message is directly sent to the root node.replyTo- 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.expire- the expiration time.
-
SGRequestMessage
create a SGRequestMessage instance.- パラメータ:
msg- copy source
-
-
メソッドの詳細
-
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(SkipGraph)is called at the destination node.when we receive a reply message,
onReceivingReply(org.piax.gtrans.ov.sg.SkipGraph<E>, org.piax.gtrans.ov.sg.SGMessagingFramework.SGReplyMessage<E>)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
SGMessagingFramework.ACK_TIMEOUT_THRES,onTimeOut(SkipGraph)is called.Note: the message is stored in SGMessagingFramework#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 withinSGMessagingFramework.ACK_TIMEOUT_THRES.- 戻り値:
- true if ACK is timed-out.
-
prepareReceivingReply
public void prepareReceivingReply()このメッセージはsendしないが,replyは受信するという場合に,受信に備えておく. メッセージをsend(Link)以外の手段によって伝送した場合に使用する. -
mayReceiveReply
public boolean mayReceiveReply() -
execute
this method is called when this message is received at the receiver node.- パラメータ:
sg- an instance of SkipGraph
-
onReceivingReply
public abstract boolean onReceivingReply(SkipGraph<E> sg, SGMessagingFramework.SGReplyMessage<E> reply)this method is called when a reply message is received at the sender node.- パラメータ:
sg- an instance of SkipGraphreply- the reply message- 戻り値:
- true if this instance is no longer required at the sender node.
-
onTimeOut
this method is called when the ack for this message is timed out.- パラメータ:
sg- an instance of SkipGraph
-