public class ChannelDuplexHandler extends ChannelInboundHandlerAdapter implements ChannelOutboundHandler
ChannelHandler implementation which represents a combination out of a ChannelInboundHandler and
the ChannelOutboundHandler.
It is a good starting point if your ChannelHandler implementation needs to intercept operations and also
state updates.ChannelHandler.Sharable| Constructor and Description |
|---|
ChannelDuplexHandler() |
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredhandlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise future) throws Exception
ChannelHandlerContext.bind(SocketAddress, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.bind in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the bind operation is madelocalAddress - the SocketAddress to which it should boundfuture - the ChannelPromise to notify once the operation completesException - thrown if an error accourpublic void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise future) throws Exception
ChannelHandlerContext.connect(SocketAddress, SocketAddress, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.connect 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 connectfuture - the ChannelPromise to notify once the operation completesException - thrown if an error accourpublic void disconnect(ChannelHandlerContext ctx, ChannelPromise future) throws Exception
ChannelHandlerContext.disconnect(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.disconnect in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the disconnect operation is madefuture - the ChannelPromise to notify once the operation completesException - thrown if an error accourpublic void close(ChannelHandlerContext ctx, ChannelPromise future) throws Exception
ChannelHandlerContext.close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.close in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the close operation is madefuture - the ChannelPromise to notify once the operation completesException - thrown if an error accourpublic void deregister(ChannelHandlerContext ctx, ChannelPromise future) throws Exception
ChannelHandlerContext.close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.deregister in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the close operation is madefuture - 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 ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.read in interface ChannelOutboundHandlerExceptionpublic void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
ChannelHandlerContext.write(Object, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.write in interface ChannelOutboundHandlerctx - 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 ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.flush in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the flush operation is madeException - thrown if an error accourCopyright © 2008–2013 The Netty Project. All rights reserved.