final class DefaultChannelPipeline.HeadContext extends AbstractChannelHandlerContext implements ChannelOutboundHandler, ChannelInboundHandler
AbstractChannelHandlerContext.AbstractWriteTask, AbstractChannelHandlerContext.WriteAndFlushTask, AbstractChannelHandlerContext.WriteTaskChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private Channel.Unsafe |
unsafe |
executor, next, prev| Constructor and Description |
|---|
HeadContext(DefaultChannelPipeline pipeline) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(ChannelHandlerContext ctx,
java.net.SocketAddress localAddress,
ChannelPromise promise)
Called once a bind operation is made.
|
void |
channelActive(ChannelHandlerContext ctx)
The
Channel of the ChannelHandlerContext is now active |
void |
channelInactive(ChannelHandlerContext ctx)
The
Channel of the ChannelHandlerContext was registered is now inactive and reached its
end of lifetime. |
void |
channelRead(ChannelHandlerContext ctx,
java.lang.Object msg)
Invoked when the current
Channel has read a message from the peer. |
void |
channelReadComplete(ChannelHandlerContext ctx)
Invoked when the last message read by the current read operation has been consumed by
ChannelInboundHandler.channelRead(ChannelHandlerContext, Object). |
void |
channelRegistered(ChannelHandlerContext ctx)
|
void |
channelUnregistered(ChannelHandlerContext ctx)
|
void |
channelWritabilityChanged(ChannelHandlerContext ctx)
Gets called once the writable state of a
Channel changed. |
void |
close(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a close operation is made.
|
void |
connect(ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
ChannelPromise promise)
Called once a connect operation is made.
|
void |
deregister(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a deregister operation is made from the current registered
EventLoop. |
void |
disconnect(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a disconnect operation is made.
|
void |
exceptionCaught(ChannelHandlerContext ctx,
java.lang.Throwable cause)
Gets called if a
Throwable was thrown. |
void |
flush(ChannelHandlerContext ctx)
Called once a flush operation is made.
|
ChannelHandler |
handler()
The
ChannelHandler that is bound this ChannelHandlerContext. |
void |
handlerAdded(ChannelHandlerContext ctx)
Gets called after the
ChannelHandler was added to the actual context and it's ready to handle events. |
void |
handlerRemoved(ChannelHandlerContext ctx)
Gets called after the
ChannelHandler was removed from the actual context and it doesn't handle events
anymore. |
void |
read(ChannelHandlerContext ctx)
Intercepts
ChannelHandlerContext.read(). |
private void |
readIfIsAutoRead() |
void |
userEventTriggered(ChannelHandlerContext ctx,
java.lang.Object evt)
Gets called if an user event was triggered.
|
void |
write(ChannelHandlerContext ctx,
java.lang.Object msg,
ChannelPromise promise)
Called once a write operation is made.
|
alloc, attr, bind, bind, channel, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, executor, fireChannelActive, fireChannelInactive, fireChannelRead, fireChannelReadComplete, fireChannelRegistered, fireChannelUnregistered, fireChannelWritabilityChanged, fireExceptionCaught, fireUserEventTriggered, flush, hasAttr, invokeChannelActive, invokeChannelInactive, invokeChannelRead, invokeChannelReadComplete, invokeChannelRegistered, invokeChannelUnregistered, invokeChannelWritabilityChanged, invokeExceptionCaught, invokeUserEventTriggered, isRemoved, name, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, setAddComplete, setAddPending, setRemoved, toHintString, toString, voidPromise, write, write, writeAndFlush, writeAndFlushprivate final Channel.Unsafe unsafe
HeadContext(DefaultChannelPipeline pipeline)
public ChannelHandler handler()
ChannelHandlerContextChannelHandler that is bound this ChannelHandlerContext.handler in interface ChannelHandlerContextpublic void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerChannelHandler was added to the actual context and it's ready to handle events.handlerAdded in interface ChannelHandlerjava.lang.Exceptionpublic void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerChannelHandler was removed from the actual context and it doesn't handle events
anymore.handlerRemoved in interface ChannelHandlerjava.lang.Exceptionpublic void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerbind in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the bind operation is madelocalAddress - the SocketAddress to which it should boundpromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerconnect in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the connect operation is maderemoteAddress - the SocketAddress to which it should connectlocalAddress - the SocketAddress which is used as source on connectpromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerdisconnect in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the disconnect operation is madepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerclose in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the close operation is madepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerEventLoop.deregister in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the close operation is madepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void read(ChannelHandlerContext ctx)
ChannelOutboundHandlerChannelHandlerContext.read().read in interface ChannelOutboundHandlerpublic void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerChannelPipeline. Those are then ready to be flushed to the actual Channel once
Channel.flush() is calledwrite in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the write operation is mademsg - the message to writepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void flush(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandlerflush in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the flush operation is madejava.lang.Exception - thrown if an error occurspublic void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
ChannelHandlerThrowable was thrown.exceptionCaught in interface ChannelHandlerexceptionCaught in interface ChannelInboundHandlerjava.lang.Exceptionpublic void channelRegistered(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerchannelRegistered in interface ChannelInboundHandlerjava.lang.Exceptionpublic void channelUnregistered(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerchannelUnregistered in interface ChannelInboundHandlerjava.lang.Exceptionpublic void channelActive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerChannel of the ChannelHandlerContext is now activechannelActive in interface ChannelInboundHandlerjava.lang.Exceptionpublic void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerChannel of the ChannelHandlerContext was registered is now inactive and reached its
end of lifetime.channelInactive in interface ChannelInboundHandlerjava.lang.Exceptionpublic void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
ChannelInboundHandlerChannel has read a message from the peer.channelRead in interface ChannelInboundHandlerjava.lang.Exceptionpublic void channelReadComplete(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerChannelInboundHandler.channelRead(ChannelHandlerContext, Object). If ChannelOption.AUTO_READ is off, no further
attempt to read an inbound data from the current Channel will be made until
ChannelHandlerContext.read() is called.channelReadComplete in interface ChannelInboundHandlerjava.lang.Exceptionprivate void readIfIsAutoRead()
public void userEventTriggered(ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
ChannelInboundHandleruserEventTriggered in interface ChannelInboundHandlerjava.lang.Exceptionpublic void channelWritabilityChanged(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerChannel changed. You can check the state with
Channel.isWritable().channelWritabilityChanged in interface ChannelInboundHandlerjava.lang.Exception