Top Fields Constructors Methods
io.netty5.channel.internal

public abstract Class DelegatingChannelHandlerContext

extends Object
implements ChannelHandlerContext
Class Inheritance
All Implemented Interfaces
io.netty5.channel.ChannelHandlerContext, io.netty5.channel.ChannelOutboundInvoker, io.netty5.util.concurrent.FuturePromiseFactory, io.netty5.channel.ChannelInboundInvoker
Known Direct Subclasses
io.netty5.channel.CombinedChannelDuplexHandler.CombinedChannelHandlerContext
Imports
io.netty5.buffer.BufferAllocator, io.netty5.channel.Channel, .ChannelHandler, .ChannelHandlerContext, .ChannelPipeline, .ChannelShutdownDirection, .ReadBufferAllocator, io.netty5.util.concurrent.EventExecutor, .Future, .Promise, java.net.SocketAddress, java.util.Objects

Field Summary

Modifier and TypeField and Description
private final ChannelHandlerContext

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public Future<Void>
bind(SocketAddress localAddress)

Implements io.netty5.channel.ChannelOutboundInvoker.bind.

Request to bind to the given SocketAddress and notify the Future once the operation completes, either because the operation was successful or because of an error.
public BufferAllocator
bufferAllocator()

Overrides default io.netty5.channel.ChannelHandlerContext.bufferAllocator.

Return the assigned BufferAllocator which will be used to allocate Buffers.
public Channel
channel()

Overrides default io.netty5.channel.ChannelHandlerContext.channel.

Return the Channel which is bound to the ChannelHandlerContext.
public Future<Void>
close()

Implements io.netty5.channel.ChannelOutboundInvoker.close.

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

Implements io.netty5.channel.ChannelOutboundInvoker.connect.

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

Implements io.netty5.channel.ChannelOutboundInvoker.connect.

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

Implements io.netty5.channel.ChannelOutboundInvoker.deregister.

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

Implements io.netty5.channel.ChannelOutboundInvoker.disconnect.

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

Implements io.netty5.channel.ChannelOutboundInvoker.executor.

Returns the EventExecutor that is used to execute the operations of this ChannelOutboundInvoker.
public ChannelHandlerContext
fireChannelActive()

Implements io.netty5.channel.ChannelHandlerContext.fireChannelActive.

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

Implements io.netty5.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
public ChannelHandlerContext
public ChannelHandlerContext
flush()

Implements io.netty5.channel.ChannelHandlerContext.flush.

Request to flush all pending messages via this ChannelOutboundInvoker.
public ChannelHandler
public boolean
isRemoved()

Implements io.netty5.channel.ChannelHandlerContext.isRemoved.

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

Implements io.netty5.channel.ChannelHandlerContext.name.

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

Overrides default io.netty5.channel.ChannelOutboundInvoker.newFailedFuture.

Create a new Future which is marked as failed already.
public <V> Promise<V>
public Future<Void>
newSucceededFuture()

Overrides default io.netty5.channel.ChannelOutboundInvoker.newSucceededFuture.

Create a new Future which is marked as succeeded already.
public <V> Future<V>
newSucceededFuture(V value)

Overrides default io.netty5.channel.ChannelOutboundInvoker.newSucceededFuture.

Create a new Future which is marked as succeeded already.
public ChannelPipeline
public ChannelHandlerContext
read(ReadBufferAllocator
The ReadBufferAllocator that should be used to allocate a Buffer if needed (for reading the data).
readBufferAllocator
)

Implements io.netty5.channel.ChannelHandlerContext.read.

Request to read data from the Channel, triggers an ChannelHandler#channelRead(ChannelHandlerContext, Object) event if data was read, and triggers a channelReadComplete event so the handler can decide to continue reading.
public ChannelHandlerContext
public Future<Void>
register()

Implements io.netty5.channel.ChannelOutboundInvoker.register.

Request to register on the EventExecutor for I/O processing.
public Future<Void>
public Future<Void>
shutdown(ChannelShutdownDirection direction)

Implements io.netty5.channel.ChannelOutboundInvoker.shutdown.

Request shutdown one direction of the Channel and notify the Future once the operation completes, either because the operation was successful or because of an error.
public Future<Void>
write(Object msg)

Implements io.netty5.channel.ChannelOutboundInvoker.write.

Request to write a message via this ChannelHandlerContext through the ChannelPipeline.
public Future<Void>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ctxback to summary
private final ChannelHandlerContext ctx

Constructor Detail

DelegatingChannelHandlerContextback to summary
protected DelegatingChannelHandlerContext(ChannelHandlerContext ctx)

Method Detail

bindback to summary
public Future<Void> bind(SocketAddress localAddress)

Implements io.netty5.channel.ChannelOutboundInvoker.bind.

Doc from io.netty5.channel.ChannelOutboundInvoker.bind.

Request to bind to the given SocketAddress and notify the Future once the operation completes, either because the operation was successful or because of an error.

This will result in having the ChannelHandler#bind(ChannelHandlerContext, SocketAddress) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
bufferAllocatorback to summary
public BufferAllocator bufferAllocator()

Overrides default io.netty5.channel.ChannelHandlerContext.bufferAllocator.

Doc from io.netty5.channel.ChannelHandlerContext.bufferAllocator.

Return the assigned BufferAllocator which will be used to allocate Buffers.

Annotations
@Override
channelback to summary
public Channel channel()

Overrides default io.netty5.channel.ChannelHandlerContext.channel.

Doc from io.netty5.channel.ChannelHandlerContext.channel.

Return the Channel which is bound to the ChannelHandlerContext.

Annotations
@Override
closeback to summary
public Future<Void> close()

Implements io.netty5.channel.ChannelOutboundInvoker.close.

Doc from io.netty5.channel.ChannelOutboundInvoker.close.

Request to close the Channel and notify the Future once the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again.

This will result in having the ChannelHandler#close(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
connectback to summary
public Future<Void> connect(SocketAddress remoteAddress)

Implements io.netty5.channel.ChannelOutboundInvoker.connect.

Doc from io.netty5.channel.ChannelOutboundInvoker.connect.

Request to connect to the given SocketAddress and notify the Future once the operation completes, either because the operation was successful or because of an error.

If the connection fails because of a connection timeout, the Future will get failed with a ConnectTimeoutException. If it fails because of connection refused a ConnectException will be used.

This will result in having the ChannelHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
connectback to summary
public Future<Void> connect(SocketAddress remoteAddress, SocketAddress localAddress)

Implements io.netty5.channel.ChannelOutboundInvoker.connect.

Doc from io.netty5.channel.ChannelOutboundInvoker.connect.

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

This will result in having the ChannelHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
delegatingCtxback to summary
public final ChannelHandlerContext delegatingCtx()
deregisterback to summary
public Future<Void> deregister()

Implements io.netty5.channel.ChannelOutboundInvoker.deregister.

Doc from io.netty5.channel.ChannelOutboundInvoker.deregister.

Request to deregister from the previous assigned EventExecutor and notify the Future once the operation completes, either because the operation was successful or because of an error.

This will result in having the ChannelHandler#deregister(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
disconnectback to summary
public Future<Void> disconnect()

Implements io.netty5.channel.ChannelOutboundInvoker.disconnect.

Doc from io.netty5.channel.ChannelOutboundInvoker.disconnect.

Request to disconnect from the remote peer and notify the Future once the operation completes, either because the operation was successful or because of an error.

This will result in having the ChannelHandler#disconnect(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
executorback to summary
public EventExecutor executor()

Implements io.netty5.channel.ChannelOutboundInvoker.executor.

Doc from io.netty5.channel.ChannelOutboundInvoker.executor.

Returns the EventExecutor that is used to execute the operations of this ChannelOutboundInvoker.

Returns:EventExecutor

the executor.

Annotations
@Override
fireChannelActiveback to summary
public ChannelHandlerContext fireChannelActive()

Implements io.netty5.channel.ChannelHandlerContext.fireChannelActive.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelActive.

A Channel is active now, which means it is connected. This will result in having the ChannelHandler#channelActive(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelExceptionCaughtback to summary
public ChannelHandlerContext fireChannelExceptionCaught(Throwable cause)

Implements io.netty5.channel.ChannelHandlerContext.fireChannelExceptionCaught.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelExceptionCaught.

A Channel received an Throwable in one of its inbound operations. This will result in having the ChannelHandler#channelExceptionCaught(ChannelHandlerContext, Throwable) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelInactiveback to summary
public ChannelHandlerContext fireChannelInactive()

Implements io.netty5.channel.ChannelHandlerContext.fireChannelInactive.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelInactive.

A Channel is inactive now, which means it is closed. This will result in having the ChannelHandler#channelInactive(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelInboundEventback to summary
public ChannelHandlerContext fireChannelInboundEvent(Object evt)

Implements io.netty5.channel.ChannelHandlerContext.fireChannelInboundEvent.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelInboundEvent.

A Channel received a custom defined inbound event. This will result in having the ChannelHandler#channelInboundEvent(ChannelHandlerContext, Object) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelReadback to summary
public ChannelHandlerContext fireChannelRead(Object msg)

Implements io.netty5.channel.ChannelHandlerContext.fireChannelRead.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelRead.

A Channel received a message. This will result in having the ChannelHandler#channelRead(ChannelHandlerContext, Object) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelReadCompleteback to summary
public ChannelHandlerContext fireChannelReadComplete()

Implements io.netty5.channel.ChannelHandlerContext.fireChannelReadComplete.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelReadComplete.

Triggers an ChannelHandler#channelReadComplete(ChannelHandlerContext) event to the next ChannelHandler in the ChannelPipeline.

Annotations
@Override
fireChannelRegisteredback to summary
public ChannelHandlerContext fireChannelRegistered()

Implements io.netty5.channel.ChannelHandlerContext.fireChannelRegistered.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelRegistered.

A Channel was registered to its EventLoop. This will result in having the ChannelHandler#channelRegistered(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelShutdownback to summary
public ChannelHandlerContext fireChannelShutdown(ChannelShutdownDirection direction)

Implements io.netty5.channel.ChannelHandlerContext.fireChannelShutdown.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelShutdown.

A Channel was shutdown in a specific direction. This will result in having the ChannelHandler#channelShutdown(ChannelHandlerContext, ChannelShutdownDirection) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelUnregisteredback to summary
public ChannelHandlerContext fireChannelUnregistered()

Implements io.netty5.channel.ChannelHandlerContext.fireChannelUnregistered.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelUnregistered.

A Channel was unregistered from its EventLoop. This will result in having the ChannelHandler#channelUnregistered(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
fireChannelWritabilityChangedback to summary
public ChannelHandlerContext fireChannelWritabilityChanged()

Implements io.netty5.channel.ChannelHandlerContext.fireChannelWritabilityChanged.

Doc from io.netty5.channel.ChannelInboundInvoker.fireChannelWritabilityChanged.

Triggers an ChannelHandler#channelWritabilityChanged(ChannelHandlerContext) event to the next ChannelHandler in the ChannelPipeline.

Annotations
@Override
flushback to summary
public ChannelHandlerContext flush()

Implements io.netty5.channel.ChannelHandlerContext.flush.

Doc from io.netty5.channel.ChannelOutboundInvoker.flush.

Request to flush all pending messages via this ChannelOutboundInvoker.

Annotations
@Override
handlerback to summary
public ChannelHandler handler()

Implements io.netty5.channel.ChannelHandlerContext.handler.

Doc from io.netty5.channel.ChannelHandlerContext.handler.

The ChannelHandler that is bound this ChannelHandlerContext.

Annotations
@Override
isRemovedback to summary
public boolean isRemoved()

Implements io.netty5.channel.ChannelHandlerContext.isRemoved.

Doc from io.netty5.channel.ChannelHandlerContext.isRemoved.

Return true if the ChannelHandler which belongs to this context was removed from the ChannelPipeline.

Annotations
@Override
nameback to summary
public String name()

Implements io.netty5.channel.ChannelHandlerContext.name.

Doc from io.netty5.channel.ChannelHandlerContext.name.

The unique name of the ChannelHandlerContext.The name was used when then ChannelHandler was added to the ChannelPipeline. This name can also be used to access the registered ChannelHandler from the ChannelPipeline.

Annotations
@Override
newFailedFutureback to summary
public <V> Future<V> newFailedFuture(Throwable cause)

Overrides default io.netty5.channel.ChannelOutboundInvoker.newFailedFuture.

Doc from io.netty5.util.concurrent.FuturePromiseFactory.newFailedFuture.

Create a new Future which is marked as failed already. So Future#isSuccess() will return false. All FutureListener added to it will be notified directly. Also every call of blocking methods will just return without blocking.

Annotations
@Override
newPromiseback to summary
public <V> Promise<V> newPromise()

Overrides default io.netty5.channel.ChannelOutboundInvoker.newPromise.

Doc from io.netty5.util.concurrent.FuturePromiseFactory.newPromise.

Return a new Promise.

Annotations
@Override
newSucceededFutureback to summary
public Future<Void> newSucceededFuture()

Overrides default io.netty5.channel.ChannelOutboundInvoker.newSucceededFuture.

Doc from io.netty5.util.concurrent.FuturePromiseFactory.newSucceededFuture.

Create a new Future which is marked as succeeded already. So Future#isSuccess() will return true. All FutureListener added to it will be notified directly. Also every call of blocking methods will just return without blocking.

Annotations
@Override
newSucceededFutureback to summary
public <V> Future<V> newSucceededFuture(V value)

Overrides default io.netty5.channel.ChannelOutboundInvoker.newSucceededFuture.

Doc from io.netty5.util.concurrent.FuturePromiseFactory.newSucceededFuture.

Create a new Future which is marked as succeeded already. So Future#isSuccess() will return true. All FutureListener added to it will be notified directly. Also every call of blocking methods will just return without blocking.

Annotations
@Override
pipelineback to summary
public ChannelPipeline pipeline()

Implements io.netty5.channel.ChannelHandlerContext.pipeline.

Doc from io.netty5.channel.ChannelHandlerContext.pipeline.

Return the assigned ChannelPipeline

Annotations
@Override
readback to summary
public ChannelHandlerContext read(ReadBufferAllocator readBufferAllocator)

Implements io.netty5.channel.ChannelHandlerContext.read.

Doc from io.netty5.channel.ChannelOutboundInvoker.read.

Request to read data from the Channel, triggers an ChannelHandler#channelRead(ChannelHandlerContext, Object) event if data was read, and triggers a channelReadComplete event so the handler can decide to continue reading. If there's a pending read operation already, this method does nothing.

This will result in having the ChannelHandler#read(ChannelHandlerContext, ReadBufferAllocator) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Parameters
readBufferAllocator:ReadBufferAllocator

The ReadBufferAllocator that should be used to allocate a Buffer if needed (for reading the data).

Annotations
@Override
readback to summary
public ChannelHandlerContext read()

Implements io.netty5.channel.ChannelHandlerContext.read.

Annotations
@Override
registerback to summary
public Future<Void> register()

Implements io.netty5.channel.ChannelOutboundInvoker.register.

Doc from io.netty5.channel.ChannelOutboundInvoker.register.

Request to register on the EventExecutor for I/O processing. Future once the operation completes, either because the operation was successful or because of an error.

This will result in having the ChannelHandler#register(ChannelHandlerContext) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
sendOutboundEventback to summary
public Future<Void> sendOutboundEvent(Object event)

Implements io.netty5.channel.ChannelOutboundInvoker.sendOutboundEvent.

Doc from io.netty5.channel.ChannelOutboundInvoker.sendOutboundEvent.

Send a custom outbound event via this ChannelOutboundInvoker through the ChannelPipeline.

This will result in having the ChannelHandler#sendOutboundEvent(ChannelHandlerContext, Object) method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
shutdownback to summary
public Future<Void> shutdown(ChannelShutdownDirection direction)

Implements io.netty5.channel.ChannelOutboundInvoker.shutdown.

Doc from io.netty5.channel.ChannelOutboundInvoker.shutdown.

Request shutdown one direction of the Channel and notify the Future once the operation completes, either because the operation was successful or because of an error.

When completed, the channel will either not produce any inbound data anymore, or it will not be possible to write data anymore, depending on the given ChannelShutdownDirection.

Depending on the transport implementation shutting down the ChannelShutdownDirection#Outbound or ChannelShutdownDirection#Inbound might also result in data transferred over the network. Like for example in case of TCP shutting down the ChannelShutdownDirection#Outbound will result in a FIN that is transmitted to the remote peer that will as a result shutdown ChannelShutdownDirection#Inbound.

This will result in having the ChannelHandler#shutdown(ChannelHandlerContext, ChannelShutdownDirection). method called of the next ChannelHandler contained in the ChannelPipeline of the Channel.

Annotations
@Override
writeback to summary
public Future<Void> write(Object msg)

Implements io.netty5.channel.ChannelOutboundInvoker.write.

Doc from io.netty5.channel.ChannelOutboundInvoker.write.

Request to write a message via this ChannelHandlerContext through the ChannelPipeline. This method will not request to actual flush, so be sure to call flush() once you want to request to flush all pending data to the actual transport.

Annotations
@Override
writeAndFlushback to summary
public Future<Void> writeAndFlush(Object msg)

Implements io.netty5.channel.ChannelOutboundInvoker.writeAndFlush.

Doc from io.netty5.channel.ChannelOutboundInvoker.writeAndFlush.

Shortcut for call write(Object) and flush().

Annotations
@Override