パッケージ org.piax.gtrans

インタフェース Transport<D extends Destination>

すべてのスーパーインタフェース:
AutoCloseable, Closeable
既知のサブインタフェースのリスト:
ChannelTransport<E>, Overlay<D,​K>, RequestTransport<D>
既知の実装クラスのリスト:
ChannelTransportImpl, IdChannelTransport, LocatorChannelTransport, NettyChannelTransport, OverlayImpl, RequestTransportImpl, TransportImpl, UdpChannelTransport

public interface Transport<D extends Destination>
extends Closeable
The common interface of the Transport object. The Transport interface defines the common API for the GTRANS.
  • フィールド詳細

  • メソッドの詳細

    • fin

      void fin()
      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.)
    • getPeer

      Peer getPeer()
      Returns the peer object.
      戻り値:
      The Peer object which the Transport is registered to.
    • getPeerId

      PeerId getPeerId()
      Returns the peer Id.
      戻り値:
      The PeerId of the peer which the Transport is registered to.
    • getEndpoint

      Endpoint getEndpoint()
      Returns the local endpoint of the Transport. If the Transport is BaseTransport (or the successor of the BaseTransport), PeerLocator is returned. The transports that are defined as upper layers return PeerId.
      戻り値:
      The Endpoint which the Transport treats.
    • getTransportId

      TransportId getTransportId()
      Returns the TransportId of the Transport.
      戻り値:
      TransportId
    • getTransportIdPath

      TransportIdPath getTransportIdPath()
      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.

      戻り値:
      TransportIdPath
    • getLowerTransport

      Transport<?> getLowerTransport()
      Returns the lower layer Transport object. If there are multiple Transport objects exist or no Transport object exists, null is returned.
      戻り値:
      The lower layer Transport object.
    • getLowerTransports

      List<Transport<?>> getLowerTransports()
      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.
      戻り値:
      a List of the all lower Transport objects.
    • getBaseTransport

      Transport<?> getBaseTransport()
      Returns the lowest Transport object (BaseTransport). If there are multiple Transport objects exist or no Transport object exists, null is returned.
      戻り値:
      The lowest layer BaseTransport object.
    • getMTU

      int getMTU()
      Returns the MTU (Maximum Transmission Unit) of the Transport object.
      戻り値:
      The MTU (Maximum Transmission Unit) of the Transport object.
    • isUp

      boolean isUp()
      Returns whether the Transport object is enabled or not.
      戻り値:
      true if the Transport is enabled.
    • hasStableLocator

      boolean hasStableLocator()
      Returns whether the Transport has stable (not changed) locator or not.
      戻り値:
      true if the Transport object has stable locator.
    • setListener

      void setListener​(ObjectId upper, TransportListener<D> listener)
      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.
      パラメータ:
      upper - The ObjectId of the receiver (upper layer) entity.
      listener - The TransportListener to register.
    • setListener

      void setListener​(TransportListener<D> listener)
      Register a TransportListener for the default appId.
      パラメータ:
      listener - the TransportListener for the default appId.
    • getListener

      TransportListener<D> getListener​(ObjectId upper)
      Return the registered TransportListener. upper is an ObjectId specified by the setListener. If TransportListener is not registered, null is returned.
      パラメータ:
      upper - The ObjectId of the receiver (upper layer) entity.
      戻り値:
      The TransportListener registered.
    • getListener

      TransportListener<D> getListener()
      Returns the TransportListener for the default appId.
      戻り値:
      TransportListener registered for the default appId.
    • send

      void send​(ObjectId sender, ObjectId receiver, D dst, Object msg) throws ProtocolUnsupportedException, IOException
      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.
      パラメータ:
      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

      void send​(ObjectId sender, ObjectId receiver, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      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.
      パラメータ:
      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

      void send​(ObjectId appId, D dst, Object msg) throws ProtocolUnsupportedException, IOException
      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.
      パラメータ:
      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

      void send​(ObjectId appId, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      例外:
      ProtocolUnsupportedException
      IOException
    • send

      void send​(D dst, Object msg) throws ProtocolUnsupportedException, IOException
      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.
      パラメータ:
      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

      void send​(D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      例外:
      ProtocolUnsupportedException
      IOException
    • send

      void send​(TransportId upperTrans, D dst, Object msg) throws ProtocolUnsupportedException, IOException
      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.
      パラメータ:
      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.
    • send

      void send​(TransportId upperTrans, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
      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.
      パラメータ:
      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.
    • sendAsync

      default CompletableFuture<Void> sendAsync​(ObjectId sender, ObjectId receiver, D dst, Object msg, TransOptions opts)
    • sendAsync

      default CompletableFuture<Void> sendAsync​(ObjectId receiver, D dst, Object msg, TransOptions opts)
    • sendAsync

      default CompletableFuture<Void> sendAsync​(TransportId upperTrans, D dst, Object msg, TransOptions opts)
    • sendAsync

      default CompletableFuture<Void> sendAsync​(TransportId upperTrans, D dst, Object msg)
    • sendAsync

      default CompletableFuture<Void> sendAsync​(D dst, Object msg, TransOptions opts)
    • sendAsync

      default CompletableFuture<Void> sendAsync​(D dst, Object msg)
    • close

      default void close()
      定義:
      close インタフェース内 AutoCloseable
      定義:
      close インタフェース内 Closeable