public abstract class TransportImpl<D extends Destination> extends Object implements Transport<D>
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected ObjectId |
defaultAppId |
protected boolean |
isActive
Transportオブジェクトがアクティブな状態であることを示す。
|
protected boolean |
isBaseTransport
base transportかどうかを識別するフラグ。
|
protected Map<ObjectId,TransportListener<D>> |
listenersByUpper |
protected Transport<?> |
lowerTrans |
protected Peer |
peer |
protected PeerId |
peerId |
protected TransportId |
transId |
protected TransportIdPath |
transIdPath |
protected List<TransportImpl<?>> |
uppers |
DEFAULT_APP_ID| 修飾子 | コンストラクタと説明 |
|---|---|
protected |
TransportImpl(Peer peer)
RawTransportのように、transport IDを持たないTransportオブジェクトを生成する。
|
protected |
TransportImpl(Peer peer,
TransportId transId,
Transport<?> lowerTrans)
指定されたtransport IDを持つTransportオブジェクトを生成する。
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected void |
checkActive()
Transportオブジェクトがアクティブな状態であるかどうかをチェックする。
|
void |
fin()
Finalize the Transport object.
|
Transport<?> |
getBaseTransport()
Returns the lowest Transport object (BaseTransport).
|
ObjectId |
getDefaultAppId() |
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.
|
List<TransportImpl<?>> |
getUppers() |
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,
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 |
setBaseTransport() |
void |
setDefaultAppId(ObjectId appId) |
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.
|
String |
toString() |
String |
toString0() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEndpoint, sendprotected final Peer peer
protected final PeerId peerId
protected final TransportId transId
protected final Transport<?> lowerTrans
protected final List<TransportImpl<?>> uppers
protected final TransportIdPath transIdPath
protected ObjectId defaultAppId
protected volatile boolean isBaseTransport
protected final Map<ObjectId,TransportListener<D extends Destination>> listenersByUpper
protected volatile boolean isActive
protected TransportImpl(Peer peer, TransportId transId, Transport<?> lowerTrans) throws IdConflictException
peer - このTransportオブジェクトを保持するpeertransId - transport IDlowerTrans - the transport.IdConflictException - transport IDがすでに存在する場合protected TransportImpl(Peer peer)
peer - このTransportオブジェクトを保持するpeer.public void setDefaultAppId(ObjectId appId)
public ObjectId getDefaultAppId()
public void fin()
Transportfin インタフェース内 Transport<D extends Destination>public List<TransportImpl<?>> getUppers()
protected void checkActive()
throws IllegalStateException
IllegalStateException - Transportオブジェクトがインアクティブな状態である場合public Peer getPeer()
TransportgetPeer インタフェース内 Transport<D extends Destination>public PeerId getPeerId()
TransportgetPeerId インタフェース内 Transport<D extends Destination>public TransportId getTransportId()
TransportgetTransportId インタフェース内 Transport<D extends Destination>public TransportIdPath getTransportIdPath()
Transport"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>public int getMTU()
TransportgetMTU インタフェース内 Transport<D extends Destination>public Transport<?> getLowerTransport()
Transportnull is returned.getLowerTransport インタフェース内 Transport<D extends Destination>public List<Transport<?>> getLowerTransports()
TransportgetLowerTransports インタフェース内 Transport<D extends Destination>public void setBaseTransport()
public Transport<?> getBaseTransport()
Transportnull is returned.getBaseTransport インタフェース内 Transport<D extends Destination>public boolean isUp()
TransportisUp インタフェース内 Transport<D extends Destination>public boolean hasStableLocator()
TransporthasStableLocator インタフェース内 Transport<D extends Destination>public void setListener(ObjectId upper, TransportListener<D> listener)
Transportupper 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.public void setListener(TransportListener<D> listener)
TransportsetListener インタフェース内 Transport<D extends Destination>listener - the TransportListener for the default appId.public TransportListener<D> getListener(ObjectId upper)
Transportupper 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.public TransportListener<D> getListener()
TransportgetListener インタフェース内 Transport<D extends Destination>public void send(ObjectId sender, ObjectId receiver, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
Transportreceiver 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.public void send(D dst, Object msg) throws ProtocolUnsupportedException, IOException
Transportdst.
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 Destinationmsg - The messageProtocolUnsupportedException - is thrown when the protocol is not supported
for the dstIOException - is thrown when an I/O error occurs.public void send(D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
send インタフェース内 Transport<D extends Destination>ProtocolUnsupportedExceptionIOExceptionpublic void send(ObjectId appId, D dst, Object msg) throws ProtocolUnsupportedException, IOException
Transportdst.
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 Destinationmsg - The messageProtocolUnsupportedException - is thrown when the protocol is not supported
for the dstIOException - is thrown when an I/O error occurs.public void send(ObjectId appId, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
send インタフェース内 Transport<D extends Destination>ProtocolUnsupportedExceptionIOExceptionpublic void send(TransportId upperTrans, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException
Transportdst.
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-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.public void send(TransportId upperTrans, D dst, Object msg) throws ProtocolUnsupportedException, IOException
Transportdst.
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-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.public String toString0()
Copyright © 2017. All rights reserved.