Top Inners Fields Constructors Methods
io.netty.channel

pack-priv abstract Class AbstractChannelHandlerContext

extends Object
implements ChannelHandlerContext, ResourceLeakHint
Class Inheritance
All Implemented Interfaces
io.netty.util.ResourceLeakHint, io.netty.channel.ChannelHandlerContext, io.netty.channel.ChannelOutboundInvoker, io.netty.channel.ChannelInboundInvoker, io.netty.util.AttributeMap
Known Direct Subclasses
io.netty.channel.DefaultChannelHandlerContext, io.netty.channel.DefaultChannelPipeline.TailContext, io.netty.channel.DefaultChannelPipeline.HeadContext
Imports
io.netty.buffer.ByteBufAllocator, io.netty.util.Attribute, .AttributeKey, .ReferenceCountUtil, .ResourceLeakHint, io.netty.util.concurrent.AbstractEventExecutor, .EventExecutor, .OrderedEventExecutor, io.netty.util.internal.ObjectPool, .ObjectPool.Handle, .ObjectPool.ObjectCreator, .PromiseNotificationUtil, .ThrowableUtil, .ObjectUtil, .StringUtil, .SystemPropertyUtil, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.net.SocketAddress, java.util.concurrent.atomic.AtomicIntegerFieldUpdater

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private final int
pack-priv final EventExecutor
private static final AtomicIntegerFieldUpdater<AbstractChannelHandlerContext>
private volatile int
private static final int
private AbstractChannelHandlerContext.Tasks
private static final InternalLogger
private final String
pack-priv volatile AbstractChannelHandlerContext
private final boolean
private final DefaultChannelPipeline
pack-priv volatile AbstractChannelHandlerContext
private static final int
private ChannelFuture

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ByteBufAllocator
alloc()

Implements io.netty.channel.ChannelHandlerContext.alloc.

Return the assigned ByteBufAllocator which will be used to allocate ByteBufs.
public <T> Attribute<T>
public ChannelFuture
bind(SocketAddress localAddress)

Implements io.netty.channel.ChannelOutboundInvoker.bind.

Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
bind(final SocketAddress localAddress, final ChannelPromise promise)

Implements io.netty.channel.ChannelOutboundInvoker.bind.

Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
pack-priv final void
pack-priv final void
public Channel
public ChannelFuture
close()

Implements io.netty.channel.ChannelOutboundInvoker.close.

Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
close(final ChannelPromise promise)

Implements io.netty.channel.ChannelOutboundInvoker.close.

Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
connect(SocketAddress remoteAddress)

Implements io.netty.channel.ChannelOutboundInvoker.connect.

Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
connect(SocketAddress remoteAddress, SocketAddress localAddress)

Implements io.netty.channel.ChannelOutboundInvoker.connect.

Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
connect(SocketAddress remoteAddress, ChannelPromise promise)

Implements io.netty.channel.ChannelOutboundInvoker.connect.

Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
connect(final SocketAddress remoteAddress, final SocketAddress localAddress, final ChannelPromise promise)

Implements io.netty.channel.ChannelOutboundInvoker.connect.

Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
deregister()

Implements io.netty.channel.ChannelOutboundInvoker.deregister.

Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
deregister(final ChannelPromise promise)

Implements io.netty.channel.ChannelOutboundInvoker.deregister.

Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
disconnect()

Implements io.netty.channel.ChannelOutboundInvoker.disconnect.

Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public ChannelFuture
disconnect(final ChannelPromise promise)

Implements io.netty.channel.ChannelOutboundInvoker.disconnect.

Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.
public EventExecutor
executor()

Implements io.netty.channel.ChannelHandlerContext.executor.

Returns the EventExecutor which is used to execute an arbitrary task.
private AbstractChannelHandlerContext
private AbstractChannelHandlerContext
public ChannelHandlerContext
fireChannelActive()

Implements io.netty.channel.ChannelHandlerContext.fireChannelActive.

A Channel is active now, which means it is connected.
public ChannelHandlerContext
fireChannelInactive()

Implements io.netty.channel.ChannelHandlerContext.fireChannelInactive.

A Channel is inactive now, which means it is closed.
public ChannelHandlerContext
public ChannelHandlerContext
public ChannelHandlerContext
public ChannelHandlerContext
public ChannelHandlerContext
public ChannelHandlerContext
fireExceptionCaught(final Throwable cause)

Implements io.netty.channel.ChannelHandlerContext.fireExceptionCaught.

A Channel received an Throwable in one of its inbound operations.
public ChannelHandlerContext
public ChannelHandlerContext
flush()

Implements io.netty.channel.ChannelHandlerContext.flush.

Request to flush all pending messages via this ChannelOutboundInvoker.
public <T> boolean
hasAttr(AttributeKey<T> key)

Implements io.netty.channel.ChannelHandlerContext.hasAttr.

Returns true if and only if the given Attribute exists in this AttributeMap.
private void
invokeBind(SocketAddress localAddress, ChannelPromise promise)

pack-priv static void
private void
pack-priv static void
private void
pack-priv static void
private void
pack-priv static void
private void
pack-priv static void
private void
pack-priv static void
private void
pack-priv static void
private void
private void
private void
invokeConnect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)

private void
private void
pack-priv static void
private void
private void
private void
private boolean
invokeHandler()

Makes best possible effort to detect if ChannelHandler#handlerAdded(ChannelHandlerContext) was called yet.

private void
pack-priv static void
private void
pack-priv void
private void
pack-priv void
private boolean
isNotValidPromise(ChannelPromise promise, boolean allowVoidPromise)

public boolean
isRemoved()

Implements io.netty.channel.ChannelHandlerContext.isRemoved.

Return true if the ChannelHandler which belongs to this context was removed from the ChannelPipeline.
public String
name()

Implements io.netty.channel.ChannelHandlerContext.name.

The unique name of the ChannelHandlerContext.The name was used when then ChannelHandler was added to the ChannelPipeline.
public ChannelFuture
newFailedFuture(Throwable cause)

Implements io.netty.channel.ChannelOutboundInvoker.newFailedFuture.

Create a new ChannelFuture which is marked as failed already.
public ChannelProgressivePromise
public ChannelPromise
public ChannelFuture
newSucceededFuture()

Implements io.netty.channel.ChannelOutboundInvoker.newSucceededFuture.

Create a new ChannelFuture which is marked as succeeded already.
private static void
public ChannelPipeline
public ChannelHandlerContext
read()

Implements io.netty.channel.ChannelHandlerContext.read.

Request to Read data from the Channel into the first inbound buffer, triggers an ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) event if data was read, and triggers a channelReadComplete event so the handler can decide to continue reading.
private static boolean
safeExecute(EventExecutor executor, Runnable runnable, ChannelPromise promise, Object msg, boolean lazy)

pack-priv final boolean
pack-priv final void
pack-priv final void
private static boolean
skipContext(AbstractChannelHandlerContext ctx, EventExecutor currentExecutor, int mask, int onlyMask)

public String
toHintString()

Implements io.netty.util.ResourceLeakHint.toHintString.

Returns a human-readable message that potentially enables easier resource leak tracking.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public ChannelPromise
voidPromise()

Implements io.netty.channel.ChannelOutboundInvoker.voidPromise.

Return a special ChannelPromise which can be reused for different operations.
public ChannelFuture
write(Object msg)

Implements io.netty.channel.ChannelOutboundInvoker.write.

Request to write a message via this ChannelHandlerContext through the ChannelPipeline.
public ChannelFuture
write(final Object msg, final ChannelPromise promise)

Implements io.netty.channel.ChannelOutboundInvoker.write.

Request to write a message via this ChannelHandlerContext through the ChannelPipeline.
private void
write(Object msg, boolean flush, ChannelPromise promise)

public ChannelFuture
public ChannelFuture
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait