パッケージ org.piax.gtrans.impl

クラス TransportImpl<D extends Destination>

java.lang.Object
org.piax.gtrans.impl.TransportImpl<D>
すべての実装されたインタフェース:
Closeable, AutoCloseable, Transport<D>
直系の既知のサブクラス:
ChannelTransportImpl, RequestTransportImpl

public abstract class TransportImpl<D extends Destination>
extends Object
implements Transport<D>
Transportオブジェクトを実装するための部品として使用するabstractクラス
  • フィールド詳細

  • コンストラクタの詳細

    • TransportImpl

      protected TransportImpl​(Peer peer, TransportId transId, Transport<?> lowerTrans) throws IdConflictException
      指定されたtransport IDを持つTransportオブジェクトを生成する。
      パラメータ:
      peer - このTransportオブジェクトを保持するpeer
      transId - transport ID
      lowerTrans - the transport.
      例外:
      IdConflictException - transport IDがすでに存在する場合
    • TransportImpl

      protected TransportImpl​(Peer peer)
      RawTransportのように、transport IDを持たないTransportオブジェクトを生成する。
      パラメータ:
      peer - このTransportオブジェクトを保持するpeer.
  • メソッドの詳細

    • setDefaultAppId

      public void setDefaultAppId​(ObjectId appId)
    • getDefaultAppId

      public ObjectId getDefaultAppId()
    • fin

      public void fin()
      インタフェースからコピーされた説明: Transport
      Finalize the Transport object. If the Transport object is already finalized, nothing happens. Normally, this method is not called by toplevel application. (Called by Peer#fin in turn.)
      定義:
      fin インタフェース内 Transport<D extends Destination>
    • getUppers

      public List<TransportImpl<?>> getUppers()
    • checkActive

      protected void checkActive() throws IllegalStateException
      Transportオブジェクトがアクティブな状態であるかどうかをチェックする。 fin() が呼ばれてインアクティブな状態である場合は、IllegalStateExceptionがthrowされる。 サブクラスの場合も含め、fin() の後に呼び出されては困る場合のメソッド呼び出しの際のチェックに用いる。
      例外:
      IllegalStateException - Transportオブジェクトがインアクティブな状態である場合
    • getPeer

      public Peer getPeer()
      インタフェースからコピーされた説明: Transport
      Returns the peer object.
      定義:
      getPeer インタフェース内 Transport<D extends Destination>
      戻り値:
      The Peer object which the Transport is registered to.
    • getPeerId

      public PeerId getPeerId()
      インタフェースからコピーされた説明: Transport
      Returns the peer Id.
      定義:
      getPeerId インタフェース内 Transport<D extends Destination>
      戻り値:
      The PeerId of the peer which the Transport is registered to.
    • getTransportId

      public TransportId getTransportId()
      インタフェースからコピーされた説明: Transport
      Returns the TransportId of the Transport.
      定義:
      getTransportId インタフェース内 Transport<D extends Destination>
      戻り値:
      TransportId
    • getTransportIdPath

      public TransportIdPath getTransportIdPath()
      インタフェースからコピーされた説明: Transport
      Returns the TransportIdPath object of the Transport. TransportIdPath is kind of a linked list which has following structure:

      "udp:sg:llnet"

      If there are multiple Transport objects exist or no Transport object exists, the TransportIdPath is terminated. For example, HandoverTransport has multiple BaseTransports. If 'sg' uses the HandoverTransport as a lower layer, The TransportIdPath of the 'llnet' on 'sg' becomes following.

      "handover:sg:llnet"

      The TransportId of the RPCInvoker is not included to TransportIdPath.

      定義:
      getTransportIdPath インタフェース内 Transport<D extends Destination>
      戻り値:
      TransportIdPath
    • getMTU

      public int getMTU()
      インタフェースからコピーされた説明: Transport
      Returns the MTU (Maximum Transmission Unit) of the Transport object.
      定義:
      getMTU インタフェース内 Transport<D extends Destination>
      戻り値:
      The MTU (Maximum Transmission Unit) of the Transport object.
    • getLowerTransport

      public Transport<?> getLowerTransport()
      インタフェースからコピーされた説明: Transport
      Returns the lower layer Transport object. If there are multiple Transport objects exist or no Transport object exists, null is returned.
      定義:
      getLowerTransport インタフェース内 Transport<D extends Destination>
      戻り値:
      The lower layer Transport object.
    • getLowerTransports

      public List<Transport<?>> getLowerTransports()
      インタフェースからコピーされた説明: Transport
      Returns all lower layer Transport objects as a List. The List is ordered from lower layer to the upper layer. If there is no lower Transport object, a zero-length List is returned.
      定義:
      getLowerTransports インタフェース内 Transport<D extends Destination>
      戻り値:
      a List of the all lower Transport objects.
    • setBaseTransport

      public void setBaseTransport()
    • getBaseTransport

      public Transport<?> getBaseTransport()
      インタフェースからコピーされた説明: Transport
      Returns the lowest Transport object (BaseTransport). If there are multiple Transport objects exist or no Transport object exists, null is returned.
      定義:
      getBaseTransport インタフェース内 Transport<D extends Destination>
      戻り値:
      The lowest layer BaseTransport object.
    • isUp

      public boolean isUp()
      インタフェースからコピーされた説明: Transport
      Returns whether the Transport object is enabled or not.
      定義:
      isUp インタフェース内 Transport<D extends Destination>
      戻り値:
      true if the Transport is enabled.
    • hasStableLocator

      public boolean hasStableLocator()
      インタフェースからコピーされた説明: Transport
      Returns whether the Transport has stable (not changed) locator or not.
      定義:
      hasStableLocator インタフェース内 Transport<D extends Destination>
      戻り値:
      true if the Transport object has stable locator.
    • setListener

      public void setListener​(ObjectId upper, TransportListener<D> listener)
      インタフェースからコピーされた説明: Transport
      Set the TransportListener to receive messages on the Transport. upper is an ObjectId needed to specify the receiver entity. If null is specifided as listener, the listener is unregistered.
      定義:
      setListener インタフェース内 Transport<D extends Destination>
      パラメータ:
      upper - The ObjectId of the receiver (upper layer) entity.
      listener - The TransportListener to register.
    • setListener

      public void setListener​(TransportListener<D> listener)
      インタフェースからコピーされた説明: Transport
      Register a TransportListener for the default appId.
      定義:
      setListener インタフェース内 Transport<D extends Destination>
      パラメータ:
      listener - the TransportListener for the default appId.
    • getListener

      public TransportListener<D> getListener​(ObjectId upper)
      インタフェースからコピーされた説明: Transport
      Return the registered TransportListener. upper is an ObjectId specified by the setListener. If TransportListener is not registered, null is returned.
      定義:
      getListener インタフェース内 Transport<D extends Destination>
      パラメータ:
      upper - The ObjectId of the receiver (upper layer) entity.
      戻り値:
      The TransportListener registered.
    • getListener

      public TransportListener<D> getListener()
      インタフェースからコピーされた説明: Transport
      Returns the TransportListener for the default appId.
      定義:
      getListener インタフェース内 Transport<D extends Destination>
      戻り値:
      TransportListener registered for the default appId.
    • send

      public abstract void send​(ObjectId sender, ObjectId receiver, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      インタフェースからコピーされた説明: Transport
      Send a message from a local object to a remote object with options. The message is delivered to a object with ObjectId receiver on the peer with destination dst. This type of send is used when the sender and the receiver have different ObjectId, which means upper layer exchanges the message using Transport.
      定義:
      send インタフェース内 Transport<D extends Destination>
      パラメータ:
      sender - The ObjectId of the sender.
      receiver - The ObjectId of the receiver.
      dst - The Destination of the peer.
      msg - The message itself.
      opts - The options for the message transmission.
      例外:
      ProtocolUnsupportedException - Raises if the 'dst' peer does not handle the protocol.
      IOException - Raises if I/O-related exceptions occured.
    • send

      public void send​(ObjectId sender, ObjectId receiver, D dst, Object msg) throws ProtocolUnsupportedException, IOException
      インタフェースからコピーされた説明: Transport
      Send a message from a local object to a remote object. The message is delivered to a object with ObjectId receiver on the peer with destination dst. This type of send is used when the sender and the receiver have different ObjectId, which means upper layer exchanges the message using Transport.
      定義:
      send インタフェース内 Transport<D extends Destination>
      パラメータ:
      sender - The ObjectId of the sender.
      receiver - The ObjectId of the receiver.
      dst - The Destination of the peer.
      msg - The message itself.
      例外:
      ProtocolUnsupportedException - Raises if the 'dst' peer does not handle the protocol.
      IOException - Raises if I/O-related exceptions occured.
    • send

      public void send​(D dst, Object msg) throws ProtocolUnsupportedException, IOException
      インタフェースからコピーされた説明: Transport
      Send a message to the dst which have the default ObjectId. The message is delivered to the entities which have default appId and on the peers which match to the dst. This type of send can be applicable for the cases where the application have the default application Id.
      定義:
      send インタフェース内 Transport<D extends Destination>
      パラメータ:
      dst - The Destination
      msg - The message
      例外:
      ProtocolUnsupportedException - is thrown when the protocol is not supported for the dst
      IOException - is thrown when an I/O error occurs.
    • send

      public void send​(D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      定義:
      send インタフェース内 Transport<D extends Destination>
      例外:
      ProtocolUnsupportedException
      IOException
    • send

      public void send​(ObjectId appId, D dst, Object msg) throws ProtocolUnsupportedException, IOException
      インタフェースからコピーされた説明: Transport
      Send a message to the dst which have same ObjectId as an application Id. The message is delivered to the entities which have same appId and on the peers which match to the dst. This type of send can be applicable for the cases where the application have a common application Id.
      定義:
      send インタフェース内 Transport<D extends Destination>
      パラメータ:
      appId - The ObjectId of the application.
      dst - The Destination
      msg - The message
      例外:
      ProtocolUnsupportedException - is thrown when the protocol is not supported for the dst
      IOException - is thrown when an I/O error occurs.
    • send

      public void send​(ObjectId appId, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      定義:
      send インタフェース内 Transport<D extends Destination>
      例外:
      ProtocolUnsupportedException
      IOException
    • send

      public void send​(TransportId upperTrans, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      インタフェースからコピーされた説明: Transport
      Send and receive a message from/to the upper-layer-Transport with options. The message is delivered to a Transport with TransportId on the peer with destination dst. This type of send is used when the sender and the receiver have different ObjectId, which means upper layer exchanges the message using Transport.
      定義:
      send インタフェース内 Transport<D extends Destination>
      パラメータ:
      upperTrans - The TransportId of the upper-layer-Transport
      dst - The Destination of the peer.
      msg - The message itself.
      opts - The options for the message transmission.
      例外:
      ProtocolUnsupportedException - Raises if the 'dst' peer does not handle the protocol.
      IOException - Raises if I/O-related exceptions occured.
    • send

      public void send​(TransportId upperTrans, D dst, Object msg) throws ProtocolUnsupportedException, IOException
      インタフェースからコピーされた説明: Transport
      Send and receive a message from/to the upper-layer-Transport. The message is delivered to a Transport with TransportId on the peer with destination dst. This type of send is used when the sender and the receiver have different ObjectId, which means upper layer exchanges the message using Transport.
      定義:
      send インタフェース内 Transport<D extends Destination>
      パラメータ:
      upperTrans - The TransportId of the upper-layer-Transport
      dst - The Destination of the peer.
      msg - The message itself.
      例外:
      ProtocolUnsupportedException - Raises if the 'dst' peer does not handle the protocol.
      IOException - Raises if I/O-related exceptions occured.
    • toString0

      public String toString0()
    • toString

      public String toString()
      オーバーライド:
      toString クラス内 Object