public abstract static class SGMessagingFramework.SGRequestMessage<E extends Endpoint> extends Object implements Serializable
| コンストラクタと説明 |
|---|
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 void |
execute(SkipGraph<E> sg)
this method is called when this message is received at the receiver
node.
|
boolean |
isAckTimedOut()
returns if we have not received any ACK within
SGMessagingFramework.ACK_TIMEOUT_THRES. |
boolean |
mayReceiveReply() |
abstract boolean |
onReceivingReply(SkipGraph<E> sg,
SGMessagingFramework.SGReplyMessage<E> reply)
this method is called when a reply message is received at the sender
node.
|
abstract void |
onTimeOut(SkipGraph<E> sg)
this method is called when the ack for this message is timed out.
|
void |
prepareReceivingReply()
このメッセージはsendしないが,replyは受信するという場合に,受信に備えておく.
|
void |
send(Link dst)
send this message to the specified destination.
|
public SGRequestMessage(SGMessagingFramework<E> sgmf, boolean isRoot, boolean isDirectReturn, E replyTo, int replyId, int expire)
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.public SGRequestMessage(SGMessagingFramework.SGRequestMessage<E> msg)
msg - copy sourcepublic 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(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 nodepublic boolean isAckTimedOut()
SGMessagingFramework.ACK_TIMEOUT_THRES.public void prepareReceivingReply()
send(Link)以外の手段によって伝送した場合に使用する.public boolean mayReceiveReply()
public abstract void execute(SkipGraph<E> sg)
sg - an instance of SkipGraphpublic abstract boolean onReceivingReply(SkipGraph<E> sg, SGMessagingFramework.SGReplyMessage<E> reply)
sg - an instance of SkipGraphreply - the reply messageCopyright © 2017. All rights reserved.