final class DefaultChannelPipeline.HeadContext extends AbstractChannelHandlerContext implements ChannelOutboundHandler, ChannelInboundHandler
AbstractChannelHandlerContext.AbstractWriteTask, AbstractChannelHandlerContext.WriteAndFlushTask, AbstractChannelHandlerContext.WriteTask
ChannelHandler.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, bind, bind, channel, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, executor, fireChannelActive, fireChannelInactive, fireChannelRead, fireChannelReadComplete, fireChannelRegistered, fireChannelUnregistered, fireChannelWritabilityChanged, fireExceptionCaught, fireUserEventTriggered, flush, invokeChannelActive, invokeChannelInactive, invokeChannelRead, invokeChannelReadComplete, invokeChannelRegistered, invokeChannelUnregistered, invokeChannelWritabilityChanged, invokeExceptionCaught, invokeUserEventTriggered, isRemoved, name, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, setAddComplete, setAddPending, setRemoved, voidPromise, write, write, writeAndFlush, writeAndFlush
attr
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attr
private final Channel.Unsafe unsafe
HeadContext(DefaultChannelPipeline pipeline)
public ChannelHandler handler()
ChannelHandlerContext
ChannelHandler
that is bound this ChannelHandlerContext
.handler
in interface ChannelHandlerContext
public void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandler
ChannelHandler
was added to the actual context and it's ready to handle events.handlerAdded
in interface ChannelHandler
java.lang.Exception
public void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandler
ChannelHandler
was removed from the actual context and it doesn't handle events
anymore.handlerRemoved
in interface ChannelHandler
java.lang.Exception
public void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
bind
in interface ChannelOutboundHandler
ctx
- 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 accourpublic void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
connect
in interface ChannelOutboundHandler
ctx
- 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 accourpublic void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
disconnect
in interface ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the disconnect operation is madepromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error accourpublic void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
close
in interface ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the close operation is madepromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error accourpublic void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
EventLoop
.deregister
in interface ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the close operation is madepromise
- the ChannelPromise
to notify once the operation completesjava.lang.Exception
- thrown if an error accourpublic void read(ChannelHandlerContext ctx)
ChannelOutboundHandler
ChannelHandlerContext.read()
.read
in interface ChannelOutboundHandler
public void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
ChannelPipeline
. Those are then ready to be flushed to the actual Channel
once
Channel.flush()
is calledwrite
in interface ChannelOutboundHandler
ctx
- 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 accourpublic void flush(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandler
flush
in interface ChannelOutboundHandler
ctx
- the ChannelHandlerContext
for which the flush operation is madejava.lang.Exception
- thrown if an error accourpublic void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
ChannelHandler
Throwable
was thrown.exceptionCaught
in interface ChannelHandler
exceptionCaught
in interface ChannelInboundHandler
java.lang.Exception
public void channelRegistered(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandler
channelRegistered
in interface ChannelInboundHandler
java.lang.Exception
public void channelUnregistered(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandler
channelUnregistered
in interface ChannelInboundHandler
java.lang.Exception
public void channelActive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandler
Channel
of the ChannelHandlerContext
is now activechannelActive
in interface ChannelInboundHandler
java.lang.Exception
public void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandler
Channel
of the ChannelHandlerContext
was registered is now inactive and reached its
end of lifetime.channelInactive
in interface ChannelInboundHandler
java.lang.Exception
public void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
ChannelInboundHandler
Channel
has read a message from the peer.channelRead
in interface ChannelInboundHandler
java.lang.Exception
public void channelReadComplete(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandler
ChannelInboundHandler.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 ChannelInboundHandler
java.lang.Exception
private void readIfIsAutoRead()
public void userEventTriggered(ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
ChannelInboundHandler
userEventTriggered
in interface ChannelInboundHandler
java.lang.Exception
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandler
Channel
changed. You can check the state with
Channel.isWritable()
.channelWritabilityChanged
in interface ChannelInboundHandler
java.lang.Exception