public class ChannelHandlerAdapter extends Object implements ChannelHandler
ChannelHandler
.ChannelHandler.Sharable, ChannelHandler.Skip
Constructor and Description |
---|
ChannelHandlerAdapter() |
public boolean isSharable()
public void handlerAdded(ChannelHandlerContext ctx) throws Exception
handlerAdded
in interface ChannelHandler
Exception
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception
handlerRemoved
in interface ChannelHandler
Exception
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
ChannelHandlerContext.fireExceptionCaught(Throwable)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.exceptionCaught
in interface ChannelHandler
Exception
public void channelRegistered(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.fireChannelRegistered()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelRegistered
in interface ChannelHandler
Exception
public void channelUnregistered(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.fireChannelUnregistered()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelUnregistered
in interface ChannelHandler
Exception
public void channelActive(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.fireChannelActive()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelActive
in interface ChannelHandler
Exception
public void channelInactive(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.fireChannelInactive()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelInactive
in interface ChannelHandler
Exception
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
ChannelHandlerContext.fireChannelRead(Object)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelRead
in interface ChannelHandler
Exception
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.fireChannelReadComplete()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelReadComplete
in interface ChannelHandler
Exception
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception
ChannelHandlerContext.fireUserEventTriggered(Object)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.userEventTriggered
in interface ChannelHandler
Exception
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.fireChannelWritabilityChanged()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelWritabilityChanged
in interface ChannelHandler
Exception
public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception
ChannelHandlerContext.bind(java.net.SocketAddress, ChannelPromise)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.bind
in interface ChannelHandler
ctx
- the ChannelHandlerContext
for which the bind operation is madelocalAddress
- the SocketAddress
to which it should boundpromise
- the ChannelPromise
to notify once the operation completesException
- thrown if an error accourpublic void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) throws Exception
ChannelHandlerContext.connect(SocketAddress, SocketAddress, ChannelPromise)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.connect
in interface ChannelHandler
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 completesException
- thrown if an error accourpublic void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
ChannelHandlerContext.disconnect(ChannelPromise)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.disconnect
in interface ChannelHandler
ctx
- the ChannelHandlerContext
for which the disconnect operation is madepromise
- the ChannelPromise
to notify once the operation completesException
- thrown if an error accourpublic void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
ChannelHandlerContext.close(ChannelPromise)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.close
in interface ChannelHandler
ctx
- the ChannelHandlerContext
for which the close operation is madepromise
- the ChannelPromise
to notify once the operation completesException
- thrown if an error accourpublic void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
ChannelHandlerContext.deregister(ChannelPromise)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.deregister
in interface ChannelHandler
ctx
- the ChannelHandlerContext
for which the close operation is madepromise
- the ChannelPromise
to notify once the operation completesException
- thrown if an error accourpublic void read(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.read()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.read
in interface ChannelHandler
Exception
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
ChannelHandlerContext.write(Object)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.write
in interface ChannelHandler
ctx
- the ChannelHandlerContext
for which the write operation is mademsg
- the message to writepromise
- the ChannelPromise
to notify once the operation completesException
- thrown if an error accourpublic void flush(ChannelHandlerContext ctx) throws Exception
ChannelHandlerContext.flush()
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.flush
in interface ChannelHandler
ctx
- the ChannelHandlerContext
for which the flush operation is madeException
- thrown if an error accourCopyright © 2008–2015 The Netty Project. All rights reserved.