クラス IdChannelTransport
java.lang.Object
org.piax.gtrans.impl.TransportImpl<E>
org.piax.gtrans.impl.ChannelTransportImpl<PrimaryKey>
org.piax.gtrans.netty.idtrans.IdChannelTransport
- すべての実装されたインタフェース:
Closeable,AutoCloseable,ChannelTransport<PrimaryKey>,Transport<PrimaryKey>
public class IdChannelTransport extends ChannelTransportImpl<PrimaryKey> implements ChannelTransport<PrimaryKey>
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 protected io.netty.channel.EventLoopGroupbossGroupprotected io.netty.channel.group.ChannelGroupcchannelsprotected io.netty.channel.EventLoopGroupclientGroupprotected PrimaryKeyepprotected static intFORWARD_HOPS_LIMITintforwardCountprotected ConcurrentHashMap<String,IdChannel>ichannelsprotected static intID_CHANNEL_REMOVE_CLOSED_THRESHOLDprotected booleanisRunningio.netty.util.AttributeKey<org.piax.gtrans.netty.idtrans.IdChannelTransport.LocatorChannelEntry>LCE_KEYprotected static org.slf4j.Loggerloggerprotected PeerIdpeerIdprotected Randomrandstatic Option.IntegerOptionRAW_POOL_SIZEio.netty.util.AttributeKey<String>rawChannelKeyprotected io.netty.channel.group.ChannelGroupschannelsprotected io.netty.channel.EventLoopGroupserverGroupクラスから継承されたフィールド org.piax.gtrans.impl.TransportImpl
defaultAppId, isActive, isBaseTransport, listenersByUpper, lowerTrans, peer, transId, transIdPath, uppers -
コンストラクタの概要
コンストラクタ コンストラクタ 説明 IdChannelTransport(Peer peer, TransportId transId, PeerId peerId)IdChannelTransport(Peer peer, TransportId transId, PeerId peerId, PrimaryKey key)IdChannelTransport(Peer peer, TransportId transId, PeerId peerId, NettyLocator peerLocator) -
メソッドの概要
修飾子とタイプ メソッド 説明 voidfin()Finalize the Transport object.CompletableFuture<IdChannel>getChannelCreate(int channelNo, PrimaryKey dst, ObjectId sender, ObjectId receiver, TransOptions opts)PrimaryKeygetEndpoint()Returns the local endpoint of the Transport.CompletableFuture<LocatorChannel>getRawCreate(PrimaryKey key, NettyLocator dst, TransOptions opts)protected voidinboundActive(io.netty.channel.ChannelHandlerContext ctx)protected voidinboundInactive(io.netty.channel.ChannelHandlerContext ctx)protected voidinboundReceive(io.netty.channel.ChannelHandlerContext ctx, Object msg)booleanisUp()Returns whether the Transport object is enabled or not.Channel<PrimaryKey>newChannel(ObjectId sender, ObjectId receiver, PrimaryKey dst, boolean isDuplex, int timeout)Create a new channel with isDuplex and timeout.protected voidoutboundInactive(io.netty.channel.ChannelHandlerContext ctx)voidsend(ObjectId sender, ObjectId receiver, PrimaryKey dst, Object msg, TransOptions opts)Send a message from a local object to a remote object with options.CompletableFuture<Void>sendAsync(ObjectId sender, ObjectId receiver, PrimaryKey dst, Object msg, TransOptions opts)voidwaitForFin()クラスから継承されたメソッド org.piax.gtrans.impl.ChannelTransportImpl
getChannelListener, getChannelListener, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, setChannelListener, setChannelListener, supportsDuplex, toString0クラスから継承されたメソッド org.piax.gtrans.impl.TransportImpl
checkActive, getBaseTransport, getDefaultAppId, getListener, getListener, getLowerTransport, getLowerTransports, getMTU, getPeer, getPeerId, getTransportId, getTransportIdPath, getUppers, hasStableLocator, send, send, send, send, send, send, send, setBaseTransport, setDefaultAppId, setListener, setListener, toStringクラスから継承されたメソッド java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitインタフェースから継承されたメソッド org.piax.gtrans.ChannelTransport
getChannelListener, getChannelListener, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, newChannel, setChannelListener, setChannelListener, supportsDuplexインタフェースから継承されたメソッド org.piax.gtrans.Transport
close, getBaseTransport, getListener, getListener, getLowerTransport, getLowerTransports, getMTU, getPeer, getPeerId, getTransportId, getTransportIdPath, hasStableLocator, send, send, send, send, send, send, send, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, setListener, setListener
-
フィールド詳細
-
logger
protected static final org.slf4j.Logger logger -
ichannels
-
bossGroup
protected io.netty.channel.EventLoopGroup bossGroup -
serverGroup
protected io.netty.channel.EventLoopGroup serverGroup -
clientGroup
protected io.netty.channel.EventLoopGroup clientGroup -
ep
-
peerId
-
rand
-
isRunning
protected boolean isRunning -
schannels
protected final io.netty.channel.group.ChannelGroup schannels -
cchannels
protected final io.netty.channel.group.ChannelGroup cchannels -
RAW_POOL_SIZE
-
rawChannelKey
-
LCE_KEY
public io.netty.util.AttributeKey<org.piax.gtrans.netty.idtrans.IdChannelTransport.LocatorChannelEntry> LCE_KEY -
FORWARD_HOPS_LIMIT
protected static final int FORWARD_HOPS_LIMIT- 関連項目:
- 定数フィールド値
-
forwardCount
public int forwardCount -
ID_CHANNEL_REMOVE_CLOSED_THRESHOLD
protected static final int ID_CHANNEL_REMOVE_CLOSED_THRESHOLD- 関連項目:
- 定数フィールド値
-
-
コンストラクタの詳細
-
IdChannelTransport
public IdChannelTransport(Peer peer, TransportId transId, PeerId peerId, NettyLocator peerLocator) throws IdConflictException, IOException -
IdChannelTransport
public IdChannelTransport(Peer peer, TransportId transId, PeerId peerId, PrimaryKey key) throws IdConflictException, IOException -
IdChannelTransport
public IdChannelTransport(Peer peer, TransportId transId, PeerId peerId) throws IdConflictException, IOException
-
-
メソッドの詳細
-
inboundActive
protected void inboundActive(io.netty.channel.ChannelHandlerContext ctx) -
inboundReceive
-
inboundInactive
protected void inboundInactive(io.netty.channel.ChannelHandlerContext ctx) -
outboundInactive
protected void outboundInactive(io.netty.channel.ChannelHandlerContext ctx) -
waitForFin
public void waitForFin() -
isUp
public boolean isUp()インタフェースからコピーされた説明:TransportReturns whether the Transport object is enabled or not.- 定義:
isUpインタフェース内Transport<PrimaryKey>- オーバーライド:
isUpクラス内TransportImpl<PrimaryKey>- 戻り値:
- true if the Transport is enabled.
-
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<PrimaryKey>- オーバーライド:
finクラス内ChannelTransportImpl<PrimaryKey>
-
getRawCreate
public CompletableFuture<LocatorChannel> getRawCreate(PrimaryKey key, NettyLocator dst, TransOptions opts) -
getChannelCreate
public CompletableFuture<IdChannel> getChannelCreate(int channelNo, PrimaryKey dst, ObjectId sender, ObjectId receiver, TransOptions opts) -
newChannel
public Channel<PrimaryKey> newChannel(ObjectId sender, ObjectId receiver, PrimaryKey dst, boolean isDuplex, int timeout) throws ProtocolUnsupportedException, IOExceptionインタフェースからコピーされた説明:ChannelTransportCreate a new channel with isDuplex and timeout.- 定義:
newChannelインタフェース内ChannelTransport<PrimaryKey>- 定義:
newChannelクラス内ChannelTransportImpl<PrimaryKey>- パラメータ:
sender- object ID of the sender.receiver- object ID of the receiver.dst- the endpoint of the destination to create channel.isDuplex- whether the connection is duplex or not.timeout- the timeout length.- 戻り値:
- a new instance of channel.
- 例外:
ProtocolUnsupportedException- an exception thrown when the protocol is not supported.IOException- an exception when thrown when an I/O error occurred.
-
send
public void send(ObjectId sender, ObjectId receiver, PrimaryKey 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<PrimaryKey>- 定義:
sendクラス内TransportImpl<PrimaryKey>- パラメータ:
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.
-
sendAsync
public CompletableFuture<Void> sendAsync(ObjectId sender, ObjectId receiver, PrimaryKey dst, Object msg, TransOptions opts)- 定義:
sendAsyncインタフェース内Transport<PrimaryKey>
-
getEndpoint
インタフェースからコピーされた説明:TransportReturns 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.- 定義:
getEndpointインタフェース内ChannelTransport<PrimaryKey>- 定義:
getEndpointインタフェース内Transport<PrimaryKey>- 戻り値:
- The Endpoint which the Transport treats.
-