パッケージ 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.
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 static ObjectIdDEFAULT_APP_IDThe default application ID. -
メソッドの概要
修飾子とタイプ メソッド 説明 default voidclose()voidfin()Finalize the Transport object.Transport<?>getBaseTransport()Returns the lowest Transport object (BaseTransport).EndpointgetEndpoint()Returns the local endpoint of the Transport.TransportListener<D>getListener()Returns the TransportListener for the default appId.TransportListener<D>getListener(ObjectId upper)Return the registered TransportListener.Transport<?>getLowerTransport()Returns the lower layer Transport object.List<Transport<?>>getLowerTransports()Returns all lower layer Transport objects as a List.intgetMTU()Returns the MTU (Maximum Transmission Unit) of the Transport object.PeergetPeer()Returns the peer object.PeerIdgetPeerId()Returns the peer Id.TransportIdgetTransportId()Returns the TransportId of the Transport.TransportIdPathgetTransportIdPath()Returns the TransportIdPath object of the Transport.booleanhasStableLocator()Returns whether the Transport has stable (not changed) locator or not.booleanisUp()Returns whether the Transport object is enabled or not.voidsend(D dst, Object msg)Send a message to the dst which have the default ObjectId.voidsend(D dst, Object msg, TransOptions opts)voidsend(ObjectId appId, D dst, Object msg)Send a message to the dst which have same ObjectId as an application Id.voidsend(ObjectId appId, D dst, Object msg, TransOptions opts)voidsend(ObjectId sender, ObjectId receiver, D dst, Object msg)Send a message from a local object to a remote object.voidsend(ObjectId sender, ObjectId receiver, D dst, Object msg, TransOptions opts)Send a message from a local object to a remote object with options.voidsend(TransportId upperTrans, D dst, Object msg)Send and receive a message from/to the upper-layer-Transport.voidsend(TransportId upperTrans, D dst, Object msg, TransOptions opts)Send and receive a message from/to the upper-layer-Transport with options.default CompletableFuture<Void>sendAsync(D dst, Object msg)default CompletableFuture<Void>sendAsync(D dst, Object msg, TransOptions opts)default CompletableFuture<Void>sendAsync(ObjectId receiver, D dst, Object msg, TransOptions opts)default CompletableFuture<Void>sendAsync(ObjectId sender, ObjectId receiver, D dst, Object msg, TransOptions opts)default CompletableFuture<Void>sendAsync(TransportId upperTrans, D dst, Object msg)default CompletableFuture<Void>sendAsync(TransportId upperTrans, D dst, Object msg, TransOptions opts)voidsetListener(ObjectId upper, TransportListener<D> listener)Set the TransportListener to receive messages on the Transport.voidsetListener(TransportListener<D> listener)Register a TransportListener for the default appId.
-
フィールド詳細
-
DEFAULT_APP_ID
The default application ID.
-
-
メソッドの詳細
-
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,nullis returned.- 戻り値:
- The lower layer Transport object.
-
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,nullis 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
Set the TransportListener to receive messages on the Transport.upperis an ObjectId needed to specify the receiver entity. Ifnullis specifided aslistener, the listener is unregistered.- パラメータ:
upper- The ObjectId of the receiver (upper layer) entity.listener- The TransportListener to register.
-
setListener
Register a TransportListener for the default appId.- パラメータ:
listener- the TransportListener for the default appId.
-
getListener
Return the registered TransportListener.upperis an ObjectId specified by the setListener. If TransportListener is not registered,nullis 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, IOExceptionSend a message from a local object to a remote object. The message is delivered to a object with ObjectIdreceiveron the peer with destinationdst. 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, IOExceptionSend a message from a local object to a remote object with options. The message is delivered to a object with ObjectIdreceiveron the peer with destinationdst. 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
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 thedst. 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 Destinationmsg- The message- 例外:
ProtocolUnsupportedException- is thrown when the protocol is not supported for thedstIOException- is thrown when an I/O error occurs.
-
send
void send(ObjectId appId, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException -
send
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 thedst. This type of send can be applicable for the cases where the application have the default application Id.- パラメータ:
dst- The Destinationmsg- The message- 例外:
ProtocolUnsupportedException- is thrown when the protocol is not supported for thedstIOException- is thrown when an I/O error occurs.
-
send
-
send
void send(TransportId upperTrans, D dst, Object msg) throws ProtocolUnsupportedException, IOExceptionSend and receive a message from/to the upper-layer-Transport. The message is delivered to a Transport with TransportId on the peer with destinationdst. 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-Transportdst- 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, IOExceptionSend 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 destinationdst. 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-Transportdst- 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
-
sendAsync
default CompletableFuture<Void> sendAsync(TransportId upperTrans, D dst, Object msg, TransOptions opts) -
sendAsync
-
sendAsync
-
sendAsync
-
close
default void close()- 定義:
closeインタフェース内AutoCloseable- 定義:
closeインタフェース内Closeable
-