Top Description Inners Fields Constructors Methods
io.netty.channel.local

public Class LocalChannel

extends AbstractChannel
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.channel.AbstractChannel, .Channel, .ChannelConfig, .ChannelMetadata, .ChannelOutboundBuffer, .ChannelPipeline, .ChannelPromise, .DefaultChannelConfig, .EventLoop, .PreferHeapByteBufAllocator, .RecvByteBufAllocator, .SingleThreadEventLoop, io.netty.util.ReferenceCountUtil, io.netty.util.concurrent.Future, .SingleThreadEventExecutor, io.netty.util.internal.InternalThreadLocalMap, .PlatformDependent, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.net.ConnectException, .SocketAddress, java.nio.channels.AlreadyConnectedException, .ClosedChannelException, .ConnectionPendingException, .NotYetConnectedException, java.util.Queue, java.util.concurrent.atomic.AtomicReferenceFieldUpdater

A Channel for the local transport.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static enum

Field Summary

Modifier and TypeField and Description
private final ChannelConfig
private volatile ChannelPromise
private static final AtomicReferenceFieldUpdater<LocalChannel, Future<V>>
private volatile Future<?>
pack-priv final Queue<Object>
private volatile LocalAddress
private static final InternalLogger
private static final int
private static final ChannelMetadata
private volatile LocalChannel
private volatile boolean
private final Runnable
private volatile LocalAddress
private final Runnable
private volatile LocalChannel.State
private volatile boolean

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and Description
public ChannelConfig
config()

Implements io.netty.channel.Channel.config.

Returns the configuration of this channel.
protected void
doBeginRead()

Implements abstract io.netty.channel.AbstractChannel.doBeginRead.

Schedule a read operation.
protected void
doBind(SocketAddress localAddress)

Implements abstract io.netty.channel.AbstractChannel.doBind.

Bind the Channel to the SocketAddress
protected void
protected void
protected void
doDisconnect()

Implements abstract io.netty.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer
protected void
doRegister()

Overrides io.netty.channel.AbstractChannel.doRegister.

Is called after the Channel is registered with its EventLoop as part of the register process.
protected void
doWrite(ChannelOutboundBuffer in)

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.
private void
private void
public boolean
isActive()

Implements io.netty.channel.Channel.isActive.

Return true if the Channel is active and so connected.
protected boolean
isCompatible(EventLoop loop)

Implements abstract io.netty.channel.AbstractChannel.isCompatible.

Return true if the given EventLoop is compatible with this instance.
public boolean
isOpen()

Implements io.netty.channel.Channel.isOpen.

Returns true if the Channel is open and may get active later
public LocalAddress
localAddress()

Overrides io.netty.channel.AbstractChannel.localAddress.

Implements io.netty.channel.Channel.localAddress.

Returns the local address where this channel is bound to.
protected SocketAddress
localAddress0()

Implements abstract io.netty.channel.AbstractChannel.localAddress0.

Returns the SocketAddress which is bound locally.
public ChannelMetadata
metadata()

Implements io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.
protected AbstractChannel.AbstractUnsafe
newUnsafe()

Implements abstract io.netty.channel.AbstractChannel.newUnsafe.

Create a new AbstractUnsafe instance which will be used for the life-time of the Channel
public LocalServerChannel
parent()

Overrides io.netty.channel.AbstractChannel.parent.

Implements io.netty.channel.Channel.parent.

Returns the parent of this channel.
private void
private void
public LocalAddress
remoteAddress()

Overrides io.netty.channel.AbstractChannel.remoteAddress.

Implements io.netty.channel.Channel.remoteAddress.

Returns the remote address where this channel is connected to.
protected SocketAddress
remoteAddress0()

Implements abstract io.netty.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.
private void
private void
tryClose(boolean isActive)

Inherited from io.netty.channel.AbstractChannel:
allocbindbindbytesBeforeUnwritablebytesBeforeWritablecloseclosecloseFuturecompareToconnectconnectconnectconnectderegisterderegisterdisconnectdisconnectdoShutdownOutputequalseventLoopfilterOutboundMessageflushhashCodeidinvalidateLocalAddressinvalidateRemoteAddressisRegisteredisWritablemaxMessagesPerWritenewChannelPipelinenewFailedFuturenewIdnewProgressivePromisenewPromisenewSucceededFuturepipelinereadtoStringunsafevalidateFileRegionvoidPromisewritewritewriteAndFlushwriteAndFlush

Field Detail

configback to summary
private final ChannelConfig config
connectPromiseback to summary
private volatile ChannelPromise connectPromise
FINISH_READ_FUTURE_UPDATERback to summary
private static final AtomicReferenceFieldUpdater<LocalChannel, Future<V>> FINISH_READ_FUTURE_UPDATER
Annotations
@SuppressWarnings:rawtypes
finishReadFutureback to summary
private volatile Future<?> finishReadFuture
inboundBufferback to summary
pack-priv final Queue<Object> inboundBuffer
localAddressback to summary
private volatile LocalAddress localAddress

Hides io.netty.channel.AbstractChannel.localAddress.

loggerback to summary
private static final InternalLogger logger

Hides io.netty.channel.AbstractChannel.logger.

MAX_READER_STACK_DEPTHback to summary
private static final int MAX_READER_STACK_DEPTH
METADATAback to summary
private static final ChannelMetadata METADATA
peerback to summary
private volatile LocalChannel peer
readInProgressback to summary
private volatile boolean readInProgress
readTaskback to summary
private final Runnable readTask
remoteAddressback to summary
private volatile LocalAddress remoteAddress

Hides io.netty.channel.AbstractChannel.remoteAddress.

shutdownHookback to summary
private final Runnable shutdownHook
stateback to summary
private volatile LocalChannel.State state
writeInProgressback to summary
private volatile boolean writeInProgress

Constructor Detail

LocalChannelback to summary
public LocalChannel()
LocalChannelback to summary
protected LocalChannel(LocalServerChannel parent, LocalChannel peer)

Method Detail

configback to summary
public ChannelConfig config()

Implements io.netty.channel.Channel.config.

Doc from io.netty.channel.Channel.config.

Returns the configuration of this channel.

Annotations
@Override
doBeginReadback to summary
protected void doBeginRead() throws Exception

Implements abstract io.netty.channel.AbstractChannel.doBeginRead.

Doc from io.netty.channel.AbstractChannel.doBeginRead.

Schedule a read operation.

Annotations
@Override
doBindback to summary
protected void doBind(SocketAddress localAddress) throws Exception

Implements abstract io.netty.channel.AbstractChannel.doBind.

Doc from io.netty.channel.AbstractChannel.doBind.

Bind the Channel to the SocketAddress

Annotations
@Override
doCloseback to summary
protected void doClose() throws Exception

Implements abstract io.netty.channel.AbstractChannel.doClose.

Doc from io.netty.channel.AbstractChannel.doClose.

Close the Channel

Annotations
@Override
doDeregisterback to summary
protected void doDeregister() throws Exception

Overrides io.netty.channel.AbstractChannel.doDeregister.

Doc from io.netty.channel.AbstractChannel.doDeregister.

Deregister the Channel from its EventLoop. Sub-classes may override this method

Annotations
@Override
doDisconnectback to summary
protected void doDisconnect() throws Exception

Implements abstract io.netty.channel.AbstractChannel.doDisconnect.

Doc from io.netty.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer

Annotations
@Override
doRegisterback to summary
protected void doRegister() throws Exception

Overrides io.netty.channel.AbstractChannel.doRegister.

Doc from io.netty.channel.AbstractChannel.doRegister.

Is called after the Channel is registered with its EventLoop as part of the register process. Sub-classes may override this method

Annotations
@Override
doWriteback to summary
protected void doWrite(ChannelOutboundBuffer in) throws Exception

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Doc from io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.

Annotations
@Override
finishPeerReadback to summary
private void finishPeerRead(final LocalChannel peer)
finishPeerRead0back to summary
private void finishPeerRead0(LocalChannel peer)
isActiveback to summary
public boolean isActive()

Implements io.netty.channel.Channel.isActive.

Doc from io.netty.channel.Channel.isActive.

Return true if the Channel is active and so connected.

Annotations
@Override
isCompatibleback to summary
protected boolean isCompatible(EventLoop loop)

Implements abstract io.netty.channel.AbstractChannel.isCompatible.

Doc from io.netty.channel.AbstractChannel.isCompatible.

Return true if the given EventLoop is compatible with this instance.

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements io.netty.channel.Channel.isOpen.

Doc from io.netty.channel.Channel.isOpen.

Returns true if the Channel is open and may get active later

Annotations
@Override
localAddressback to summary
public LocalAddress localAddress()

Overrides io.netty.channel.AbstractChannel.localAddress.

Implements io.netty.channel.Channel.localAddress.

Doc from io.netty.channel.Channel.localAddress.

Returns the local address where this channel is bound to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.

Returns:LocalAddress

the local address of this channel. null if this channel is not bound.

Annotations
@Override
localAddress0back to summary
protected SocketAddress localAddress0()

Implements abstract io.netty.channel.AbstractChannel.localAddress0.

Doc from io.netty.channel.AbstractChannel.localAddress0.

Returns the SocketAddress which is bound locally.

Annotations
@Override
metadataback to summary
public ChannelMetadata metadata()

Implements io.netty.channel.Channel.metadata.

Doc from io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.

Annotations
@Override
newUnsafeback to summary
protected AbstractChannel.AbstractUnsafe newUnsafe()

Implements abstract io.netty.channel.AbstractChannel.newUnsafe.

Doc from io.netty.channel.AbstractChannel.newUnsafe.

Create a new AbstractUnsafe instance which will be used for the life-time of the Channel

Annotations
@Override
parentback to summary
public LocalServerChannel parent()

Overrides io.netty.channel.AbstractChannel.parent.

Implements io.netty.channel.Channel.parent.

Doc from io.netty.channel.Channel.parent.

Returns the parent of this channel.

Returns:LocalServerChannel

the parent channel. null if this channel does not have a parent channel.

Annotations
@Override
readInboundback to summary
private void readInbound()
releaseInboundBuffersback to summary
private void releaseInboundBuffers()
remoteAddressback to summary
public LocalAddress remoteAddress()

Overrides io.netty.channel.AbstractChannel.remoteAddress.

Implements io.netty.channel.Channel.remoteAddress.

Doc from io.netty.channel.Channel.remoteAddress.

Returns the remote address where this channel is connected to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.

Returns:LocalAddress

the remote address of this channel. null if this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g. DatagramChannel, use DatagramPacket#recipient() to determine the origination of the received message as this method will return null.

Annotations
@Override
remoteAddress0back to summary
protected SocketAddress remoteAddress0()

Implements abstract io.netty.channel.AbstractChannel.remoteAddress0.

Doc from io.netty.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.

Annotations
@Override
runFinishPeerReadTaskback to summary
private void runFinishPeerReadTask(final LocalChannel peer)
tryCloseback to summary
private void tryClose(boolean isActive)
io.netty.channel.local back to summary

private Class LocalChannel.LocalUnsafe

extends AbstractUnsafe
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
connect(final SocketAddress remoteAddress, SocketAddress localAddress, final ChannelPromise promise)

Implements io.netty.channel.Channel.Unsafe.connect.

Connect the Channel of the given ChannelFuture with the given remote SocketAddress.
Inherited from io.netty.channel.AbstractChannel.AbstractUnsafe:
annotateConnectExceptionbeginReadbindclosecloseForciblycloseIfClosedderegisterdisconnectensureOpenflushflush0handleWriteErrorlocalAddressoutboundBufferprepareToCloserecvBufAllocHandleregisterremoteAddresssafeSetFailuresafeSetSuccessshutdownOutputvoidPromisewrite

Constructor Detail

LocalUnsafeback to summary
private LocalUnsafe()

Method Detail

connectback to summary
public void connect(final SocketAddress remoteAddress, SocketAddress localAddress, final ChannelPromise promise)

Implements io.netty.channel.Channel.Unsafe.connect.

Doc from io.netty.channel.Channel.Unsafe.connect.

Connect the Channel of the given ChannelFuture with the given remote SocketAddress. If a specific local SocketAddress should be used it need to be given as argument. Otherwise just pass null to it. The ChannelPromise will get notified once the connect operation was complete.

Annotations
@Override
io.netty.channel.local back to summary

private final Enum LocalChannel.State

extends Enum<LocalChannel.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final LocalChannel.State
public static final LocalChannel.State
public static final LocalChannel.State
public static final LocalChannel.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static LocalChannel.State
public static LocalChannel.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOUNDback to summary
public static final LocalChannel.State BOUND
CLOSEDback to summary
public static final LocalChannel.State CLOSED
CONNECTEDback to summary
public static final LocalChannel.State CONNECTED
OPENback to summary
public static final LocalChannel.State OPEN

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static LocalChannel.State valueOf(String name)
valuesback to summary
public static LocalChannel.State[] values()