パッケージ 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.
関連項目:
直列化された形式
  • フィールド詳細

  • コンストラクタの詳細

    • 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 is
      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.
      opts - specifies transmission parameters.
    • RequestMessage

      public RequestMessage​(RequestMessage msg)
      create a RequestMessage instance.
      パラメータ:
      msg - copy source
  • メソッドの詳細

    • getManager

      protected RingManager<?> getManager()
    • send

      public void send​(Link dst)
      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, 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 node
    • isAckTimedOut

      public boolean isAckTimedOut()
      returns if we have not received any ACK within MessagingFramework.ACK_TIMEOUT_THRES.
      戻り値:
      true if ACK is timed-out.
    • sendAck

      public void sendAck()
    • responseReceived

      protected void responseReceived​(ResponseMessage resp)
      ack or reply message is received for this RequestMessage. stop fast retransmission and dispose if possible. note that ChordSharpRQMessage overrides this method.
      パラメータ:
      resp - the response message.
    • mayReceiveReply

      public boolean mayReceiveReply()
    • dispose

      public void dispose()
    • execute

      public abstract void execute​(RingManager<?> sg)
      this method is called when this message is received at the receiver node.
      パラメータ:
      sg - an instance of Ring
    • onReceivingReply

      public abstract boolean onReceivingReply​(ReplyMessage reply)
      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

      public AckMessage newAckMessage()