public interface Transport<D extends Destination>
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static ObjectId |
DEFAULT_APP_ID
The default application ID.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
fin()
Finalize the Transport object.
|
Transport<?> |
getBaseTransport()
Returns the lowest Transport object (BaseTransport).
|
Endpoint |
getEndpoint()
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.
|
int |
getMTU()
Returns the MTU (Maximum Transmission Unit) of the Transport object.
|
Peer |
getPeer()
Returns the peer object.
|
PeerId |
getPeerId()
Returns the peer Id.
|
TransportId |
getTransportId()
Returns the TransportId of the Transport.
|
TransportIdPath |
getTransportIdPath()
Returns the TransportIdPath object of the Transport.
|
boolean |
hasStableLocator()
Returns whether the Transport has stable (not changed) locator or not.
|
boolean |
isUp()
Returns whether the Transport object is enabled or not.
|
void |
send(D dst,
Object msg)
Send a message to the dst which have the default ObjectId.
|
void |
send(D dst,
Object msg,
TransOptions opts) |
void |
send(ObjectId appId,
D dst,
Object msg)
Send a message to the dst which have same ObjectId as an application Id.
|
void |
send(ObjectId appId,
D dst,
Object msg,
TransOptions opts) |
void |
send(ObjectId sender,
ObjectId receiver,
D dst,
Object msg)
Send a message from a local object to a remote object.
|
void |
send(ObjectId sender,
ObjectId receiver,
D dst,
Object msg,
TransOptions opts)
Send a message from a local object to a remote object with options.
|
void |
send(TransportId upperTrans,
D dst,
Object msg)
Send and receive a message from/to the upper-layer-Transport.
|
void |
send(TransportId upperTrans,
D dst,
Object msg,
TransOptions opts)
Send and receive a message from/to the upper-layer-Transport with options.
|
void |
setListener(ObjectId upper,
TransportListener<D> listener)
Set the TransportListener to receive messages on the Transport.
|
void |
setListener(TransportListener<D> listener)
Register a TransportListener for the default appId.
|
static final ObjectId DEFAULT_APP_ID
void fin()
Peer getPeer()
PeerId getPeerId()
Endpoint getEndpoint()
TransportId getTransportId()
TransportIdPath getTransportIdPath()
"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.
Transport<?> getLowerTransport()
null is returned.List<Transport<?>> getLowerTransports()
Transport<?> getBaseTransport()
null is returned.int getMTU()
boolean isUp()
boolean hasStableLocator()
void setListener(ObjectId upper, TransportListener<D> listener)
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.void setListener(TransportListener<D> listener)
listener - the TransportListener for the default appId.TransportListener<D> getListener(ObjectId upper)
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.TransportListener<D> getListener()
void send(ObjectId sender, ObjectId receiver, D dst, Object msg) throws ProtocolUnsupportedException, IOException
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.void send(ObjectId sender, ObjectId receiver, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
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.void send(ObjectId appId, D dst, Object msg) throws ProtocolUnsupportedException, IOException
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 Destinationmsg - The messageProtocolUnsupportedException - is thrown when the protocol is not supported
for the dstIOException - is thrown when an I/O error occurs.void send(ObjectId appId, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
void send(D dst, Object msg) throws ProtocolUnsupportedException, IOException
dst.
This type of send can be applicable for the cases where the application have
the default application Id.dst - The Destinationmsg - The messageProtocolUnsupportedException - is thrown when the protocol is not supported
for the dstIOException - is thrown when an I/O error occurs.void send(D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
void send(TransportId upperTrans, D dst, Object msg) throws ProtocolUnsupportedException, IOException
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-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.void send(TransportId upperTrans, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
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-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.Copyright © 2017. All rights reserved.