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() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(ChannelHandlerContext ctx,
SocketAddress localAddress,
ChannelPromise future)
Calls
ChannelOutboundInvoker.bind(SocketAddress, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline. |
void |
close(ChannelHandlerContext ctx,
ChannelPromise future)
Calls
ChannelOutboundInvoker.close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline. |
void |
connect(ChannelHandlerContext ctx,
SocketAddress remoteAddress,
SocketAddress localAddress,
ChannelPromise future)
Calls
ChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline. |
void |
deregister(ChannelHandlerContext ctx,
ChannelPromise future)
Calls
ChannelOutboundInvoker.close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline. |
void |
disconnect(ChannelHandlerContext ctx,
ChannelPromise future)
Calls
ChannelOutboundInvoker.disconnect(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline. |
void |
read(ChannelHandlerContext ctx)
Intercepts
ChannelOutboundInvoker.read(). |
void |
write(ChannelHandlerContext ctx,
MessageList<Object> msgs,
ChannelPromise promise)
Called once a flush operation is made and so the outbound data should be written.
|
channelActive, channelInactive, channelReadSuspended, channelRegistered, channelUnregistered, channelWritabilityChanged, messageReceived, userEventTriggeredexceptionCaught, handlerAdded, handlerRemovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise future) throws Exception
ChannelOutboundInvoker.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
ChannelOutboundInvoker.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
ChannelOutboundInvoker.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
ChannelOutboundInvoker.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
ChannelOutboundInvoker.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
ChannelOutboundHandlerChannelOutboundInvoker.read().read in interface ChannelOutboundHandlerExceptionpublic void write(ChannelHandlerContext ctx, MessageList<Object> msgs, ChannelPromise promise) throws Exception
ChannelOutboundHandlerwrite in interface ChannelOutboundHandlerctx - the ChannelHandlerContext for which the flush operation is madepromise - the ChannelPromise to notify once the operation completesException - thrown if an error accourCopyright © 2008-2013 The Netty Project. All Rights Reserved.