パッケージ 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クラス
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 protected ObjectIddefaultAppIdprotected booleanisActiveTransportオブジェクトがアクティブな状態であることを示す。protected booleanisBaseTransportbase transportかどうかを識別するフラグ。protected Map<ObjectId,TransportListener<D>>listenersByUpperprotected Transport<?>lowerTransprotected Peerpeerprotected PeerIdpeerIdprotected TransportIdtransIdprotected TransportIdPathtransIdPathprotected List<TransportImpl<?>>uppers -
コンストラクタの概要
コンストラクタ 修飾子 コンストラクタ 説明 protectedTransportImpl(Peer peer)RawTransportのように、transport IDを持たないTransportオブジェクトを生成する。protectedTransportImpl(Peer peer, TransportId transId, Transport<?> lowerTrans)指定されたtransport IDを持つTransportオブジェクトを生成する。 -
メソッドの概要
修飾子とタイプ メソッド 説明 protected voidcheckActive()Transportオブジェクトがアクティブな状態であるかどうかをチェックする。voidfin()Finalize the Transport object.Transport<?>getBaseTransport()Returns the lowest Transport object (BaseTransport).ObjectIdgetDefaultAppId()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.List<TransportImpl<?>>getUppers()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.abstract 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.voidsetBaseTransport()voidsetDefaultAppId(ObjectId appId)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.StringtoString()StringtoString0()
-
フィールド詳細
-
peer
-
peerId
-
transId
-
lowerTrans
-
uppers
-
transIdPath
-
defaultAppId
-
isBaseTransport
protected volatile boolean isBaseTransportbase transportかどうかを識別するフラグ。 Peer.newBase(Channel)Transport() メソッドの中でセットされる。 -
listenersByUpper
-
isActive
protected volatile boolean isActiveTransportオブジェクトがアクティブな状態であることを示す。 fin() が呼ばれた場合はfalseとなる。
-
-
コンストラクタの詳細
-
TransportImpl
protected TransportImpl(Peer peer, TransportId transId, Transport<?> lowerTrans) throws IdConflictException指定されたtransport IDを持つTransportオブジェクトを生成する。- パラメータ:
peer- このTransportオブジェクトを保持するpeertransId- transport IDlowerTrans- the transport.- 例外:
IdConflictException- transport IDがすでに存在する場合
-
TransportImpl
RawTransportのように、transport IDを持たないTransportオブジェクトを生成する。- パラメータ:
peer- このTransportオブジェクトを保持するpeer.
-
-
メソッドの詳細
-
setDefaultAppId
-
getDefaultAppId
-
fin
public void fin()インタフェースからコピーされた説明:TransportFinalize 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
-
checkActive
Transportオブジェクトがアクティブな状態であるかどうかをチェックする。 fin() が呼ばれてインアクティブな状態である場合は、IllegalStateExceptionがthrowされる。 サブクラスの場合も含め、fin() の後に呼び出されては困る場合のメソッド呼び出しの際のチェックに用いる。- 例外:
IllegalStateException- Transportオブジェクトがインアクティブな状態である場合
-
getPeer
インタフェースからコピーされた説明:TransportReturns the peer object.- 定義:
getPeerインタフェース内Transport<D extends Destination>- 戻り値:
- The Peer object which the Transport is registered to.
-
getPeerId
インタフェースからコピーされた説明:TransportReturns the peer Id.- 定義:
getPeerIdインタフェース内Transport<D extends Destination>- 戻り値:
- The PeerId of the peer which the Transport is registered to.
-
getTransportId
インタフェースからコピーされた説明:TransportReturns the TransportId of the Transport.- 定義:
getTransportIdインタフェース内Transport<D extends Destination>- 戻り値:
- TransportId
-
getTransportIdPath
インタフェースからコピーされた説明:TransportReturns 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()インタフェースからコピーされた説明:TransportReturns the MTU (Maximum Transmission Unit) of the Transport object.- 定義:
getMTUインタフェース内Transport<D extends Destination>- 戻り値:
- The MTU (Maximum Transmission Unit) of the Transport object.
-
getLowerTransport
インタフェースからコピーされた説明:TransportReturns the lower layer Transport object. If there are multiple Transport objects exist or no Transport object exists,nullis returned.- 定義:
getLowerTransportインタフェース内Transport<D extends Destination>- 戻り値:
- The lower layer Transport object.
-
getLowerTransports
インタフェースからコピーされた説明:TransportReturns 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
インタフェースからコピーされた説明:TransportReturns the lowest Transport object (BaseTransport). If there are multiple Transport objects exist or no Transport object exists,nullis returned.- 定義:
getBaseTransportインタフェース内Transport<D extends Destination>- 戻り値:
- The lowest layer BaseTransport object.
-
isUp
public boolean isUp()インタフェースからコピーされた説明:TransportReturns whether the Transport object is enabled or not.- 定義:
isUpインタフェース内Transport<D extends Destination>- 戻り値:
- true if the Transport is enabled.
-
hasStableLocator
public boolean hasStableLocator()インタフェースからコピーされた説明:TransportReturns whether the Transport has stable (not changed) locator or not.- 定義:
hasStableLocatorインタフェース内Transport<D extends Destination>- 戻り値:
- true if the Transport object has stable locator.
-
setListener
インタフェースからコピーされた説明:TransportSet the TransportListener to receive messages on the Transport.upperis an ObjectId needed to specify the receiver entity. Ifnullis specifided aslistener, the listener is unregistered.- 定義:
setListenerインタフェース内Transport<D extends Destination>- パラメータ:
upper- The ObjectId of the receiver (upper layer) entity.listener- The TransportListener to register.
-
setListener
インタフェースからコピーされた説明:TransportRegister a TransportListener for the default appId.- 定義:
setListenerインタフェース内Transport<D extends Destination>- パラメータ:
listener- the TransportListener for the default appId.
-
getListener
インタフェースからコピーされた説明:TransportReturn the registered TransportListener.upperis an ObjectId specified by the setListener. If TransportListener is not registered,nullis returned.- 定義:
getListenerインタフェース内Transport<D extends Destination>- パラメータ:
upper- The ObjectId of the receiver (upper layer) entity.- 戻り値:
- The TransportListener registered.
-
getListener
インタフェースからコピーされた説明:TransportReturns 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インタフェースからコピーされた説明:TransportSend 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.- 定義:
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インタフェースからコピーされた説明:TransportSend 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.- 定義:
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
インタフェースからコピーされた説明:TransportSend 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.- 定義:
sendインタフェース内Transport<D extends Destination>- パラメータ:
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
public void send(D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException- 定義:
sendインタフェース内Transport<D extends Destination>- 例外:
ProtocolUnsupportedExceptionIOException
-
send
public void send(ObjectId appId, D dst, Object msg) throws ProtocolUnsupportedException, IOExceptionインタフェースからコピーされた説明:TransportSend 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.- 定義:
sendインタフェース内Transport<D extends Destination>- パラメータ:
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
public void send(ObjectId appId, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOException- 定義:
sendインタフェース内Transport<D extends Destination>- 例外:
ProtocolUnsupportedExceptionIOException
-
send
public void send(TransportId upperTrans, D dst, Object msg, TransOptions opts) throws ProtocolUnsupportedException, IOExceptionインタフェースからコピーされた説明:TransportSend 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.- 定義:
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.
-
send
public void send(TransportId upperTrans, D dst, Object msg) throws ProtocolUnsupportedException, IOExceptionインタフェースからコピーされた説明:TransportSend 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.- 定義:
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.
-
toString0
-
toString
-