クラス NettyChannelTransport<E extends NettyEndpoint>
java.lang.Object
org.piax.gtrans.impl.TransportImpl<E>
org.piax.gtrans.impl.ChannelTransportImpl<E>
org.piax.gtrans.netty.loctrans.NettyChannelTransport<E>
- すべての実装されたインタフェース:
Closeable,AutoCloseable,ChannelTransport<E>,Transport<E>
- 直系の既知のサブクラス:
LocatorChannelTransport
public abstract class NettyChannelTransport<E extends NettyEndpoint> extends ChannelTransportImpl<E> implements ChannelTransport<E>
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 protected io.netty.channel.EventLoopGroupbossGroupprotected NettyBootstrap<E>bsprotected io.netty.channel.group.ChannelGroupcchannelsprotected static intCHANNEL_ESTABLISH_TIMEOUTprotected ConcurrentHashMap<String,NettyChannel<E>>channelsprotected io.netty.channel.EventLoopGroupclientGroupprotected Eepprotected booleanisRunningprotected static org.slf4j.Loggerloggerprotected PeerIdpeerIdprotected Randomrandstatic intRAW_POOL_SIZEio.netty.util.AttributeKey<String>rawChannelKeyprotected ConcurrentHashMap<E,NettyRawChannel<E>>rawsprotected io.netty.channel.group.ChannelGroupschannelsprotected AtomicIntegerseqprotected io.netty.channel.EventLoopGroupserverGroupクラスから継承されたフィールド org.piax.gtrans.impl.TransportImpl
defaultAppId, isActive, isBaseTransport, listenersByUpper, lowerTrans, peer, transId, transIdPath, uppers -
コンストラクタの概要
コンストラクタ コンストラクタ 説明 NettyChannelTransport(Peer peer, TransportId transId, PeerId peerId)NettyChannelTransport(Peer peer, TransportId transId, PeerId peerId, NettyLocator peerLocator) -
メソッドの概要
修飾子とタイプ メソッド 説明 protected voidchannelSendHook(E src, E dst)protected abstract EcreateEndpoint(String host, int port)protected abstract NettyLocatordirectLocator(E ep)protected abstract booleanfilterMessage(NettyMessage<E> msg)voidfin()Finalize the Transport object.protected NettyChannel<E>getChannel(int channelNo, E channelInitiator)List<NettyRawChannel<E>>getCreatedRawChannels()EgetEndpoint()Returns the local endpoint of the Transport.protected NettyRawChannel<E>getRaw(E ep)List<NettyEndpoint>getRawChannelLocators()protected abstract NettyRawChannel<E>getRawCreateAsClient(E dst, NettyMessage<E> msg)protected NettyRawChannel<E>getRawCreateAsClient0(E dst)protected abstract NettyRawChannel<E>getResolvedRawChannel(E ep)protected voidhandleControlMessage(ControlMessage<E> cmsg)protected voidinboundActive(io.netty.channel.ChannelHandlerContext ctx)protected voidinboundInactive(io.netty.channel.ChannelHandlerContext ctx)protected voidinboundReceive(io.netty.channel.ChannelHandlerContext ctx, Object msg)Channel<E>newChannel(ObjectId sender, ObjectId receiver, E dst, boolean isDuplex, int timeout)Create a new channel with isDuplex and timeout.protected voidoutboundActive(NettyRawChannel<E> raw, io.netty.channel.ChannelHandlerContext ctx)protected voidoutboundInactive(io.netty.channel.ChannelHandlerContext ctx)voidsend(ObjectId sender, ObjectId receiver, E dst, Object msg, TransOptions opts)Send a message from a local object to a remote object with options.クラスから継承されたメソッド 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, isUp, 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, isUp, send, send, send, send, send, send, send, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, setListener, setListener
-
フィールド詳細
-
logger
protected static final org.slf4j.Logger logger -
bossGroup
protected io.netty.channel.EventLoopGroup bossGroup -
serverGroup
protected io.netty.channel.EventLoopGroup serverGroup -
clientGroup
protected io.netty.channel.EventLoopGroup clientGroup -
ep
-
peerId
-
raws
protected final ConcurrentHashMap<E extends NettyEndpoint,NettyRawChannel<E extends NettyEndpoint>> raws -
channels
-
rand
-
isRunning
protected boolean isRunning -
schannels
protected final io.netty.channel.group.ChannelGroup schannels -
cchannels
protected final io.netty.channel.group.ChannelGroup cchannels -
bs
-
seq
-
RAW_POOL_SIZE
public static int RAW_POOL_SIZE -
rawChannelKey
-
CHANNEL_ESTABLISH_TIMEOUT
protected static final int CHANNEL_ESTABLISH_TIMEOUT- 関連項目:
- 定数フィールド値
-
-
コンストラクタの詳細
-
NettyChannelTransport
public NettyChannelTransport(Peer peer, TransportId transId, PeerId peerId, NettyLocator peerLocator) throws IdConflictException, IOException -
NettyChannelTransport
public NettyChannelTransport(Peer peer, TransportId transId, PeerId peerId) throws IdConflictException, IOException
-
-
メソッドの詳細
-
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<E extends NettyEndpoint>- オーバーライド:
finクラス内ChannelTransportImpl<E extends NettyEndpoint>
-
send
public void send(ObjectId sender, ObjectId receiver, E 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<E extends NettyEndpoint>- 定義:
sendクラス内TransportImpl<E extends NettyEndpoint>- パラメータ:
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.
-
getChannel
-
getRaw
-
getCreatedRawChannels
-
getRawChannelLocators
-
getRawCreateAsClient
protected abstract NettyRawChannel<E> getRawCreateAsClient(E dst, NettyMessage<E> msg) throws IOException- 例外:
IOException
-
filterMessage
-
getResolvedRawChannel
- 例外:
IOException
-
directLocator
-
channelSendHook
-
getRawCreateAsClient0
- 例外:
IOException
-
createEndpoint
-
outboundActive
-
outboundInactive
protected void outboundInactive(io.netty.channel.ChannelHandlerContext ctx) -
inboundActive
protected void inboundActive(io.netty.channel.ChannelHandlerContext ctx) -
inboundInactive
protected void inboundInactive(io.netty.channel.ChannelHandlerContext ctx) -
handleControlMessage
-
inboundReceive
-
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<E extends NettyEndpoint>- 定義:
getEndpointインタフェース内Transport<E extends NettyEndpoint>- 戻り値:
- The Endpoint which the Transport treats.
-
newChannel
public Channel<E> newChannel(ObjectId sender, ObjectId receiver, E dst, boolean isDuplex, int timeout) throws ProtocolUnsupportedException, IOExceptionインタフェースからコピーされた説明:ChannelTransportCreate a new channel with isDuplex and timeout.- 定義:
newChannelインタフェース内ChannelTransport<E extends NettyEndpoint>- 定義:
newChannelクラス内ChannelTransportImpl<E extends NettyEndpoint>- パラメータ:
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.
-