public class CombinedChannelDuplexHandler<I extends ChannelInboundHandler,O extends ChannelOutboundHandler> extends ChannelDuplexHandler
ChannelHandler.Sharable| Modifier | Constructor and Description |
|---|---|
protected |
CombinedChannelDuplexHandler()
Creates a new uninitialized instance.
|
|
CombinedChannelDuplexHandler(I inboundHandler,
O outboundHandler)
Creates a new instance that combines the specified two handlers into one.
|
ensureNotSharable, isSharableprotected CombinedChannelDuplexHandler()
init(ChannelInboundHandler, ChannelOutboundHandler) before adding this handler into a
ChannelPipeline.protected final void init(I inboundHandler, O outboundHandler)
java.lang.IllegalStateException - if this handler was not constructed via the default constructor or
if this handler does not implement all required handler interfacesjava.lang.IllegalArgumentException - if the specified handlers cannot be combined into one due to a conflict
in the type hierarchyprotected final I inboundHandler()
protected final O outboundHandler()
public final void removeInboundHandler()
ChannelInboundHandler that was combined in this CombinedChannelDuplexHandler.public final void removeOutboundHandler()
ChannelOutboundHandler that was combined in this CombinedChannelDuplexHandler.public void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerAdapterhandlerAdded in interface ChannelHandlerhandlerAdded in class ChannelHandlerAdapterjava.lang.Exceptionpublic void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerAdapterhandlerRemoved in interface ChannelHandlerhandlerRemoved in class ChannelHandlerAdapterjava.lang.Exceptionpublic void channelRegistered(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelRegistered() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelRegistered in interface ChannelInboundHandlerchannelRegistered in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelUnregistered(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelUnregistered() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelUnregistered in interface ChannelInboundHandlerchannelUnregistered in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelActive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelActive() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelActive in interface ChannelInboundHandlerchannelActive in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelInactive() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelInactive in interface ChannelInboundHandlerchannelInactive in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireExceptionCaught(Throwable) to forward
to the next ChannelHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.exceptionCaught in interface ChannelHandlerexceptionCaught in interface ChannelInboundHandlerexceptionCaught in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void userEventTriggered(ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireUserEventTriggered(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.userEventTriggered in interface ChannelInboundHandleruserEventTriggered in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelRead in interface ChannelInboundHandlerchannelRead in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelReadComplete(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelReadComplete() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelReadComplete in interface ChannelInboundHandlerchannelReadComplete in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelWritabilityChanged(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelWritabilityChanged() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelWritabilityChanged in interface ChannelInboundHandlerchannelWritabilityChanged in class ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelDuplexHandlerChannelHandlerContext.bind(SocketAddress, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.bind in interface ChannelOutboundHandlerbind in class ChannelDuplexHandlerctx - 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
ChannelDuplexHandlerChannelHandlerContext.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 ChannelOutboundHandlerconnect in class ChannelDuplexHandlerctx - 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
ChannelDuplexHandlerChannelHandlerContext.disconnect(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.disconnect in interface ChannelOutboundHandlerdisconnect in class ChannelDuplexHandlerctx - 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
ChannelDuplexHandlerChannelHandlerContext.close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.close in interface ChannelOutboundHandlerclose in class ChannelDuplexHandlerctx - 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
ChannelDuplexHandlerChannelHandlerContext.close(ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.deregister in interface ChannelOutboundHandlerderegister in class ChannelDuplexHandlerctx - 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) throws java.lang.Exception
ChannelDuplexHandlerChannelHandlerContext.read() to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.read in interface ChannelOutboundHandlerread in class ChannelDuplexHandlerjava.lang.Exceptionpublic void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelDuplexHandlerChannelHandlerContext.write(Object, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.write in interface ChannelOutboundHandlerwrite in class ChannelDuplexHandlerctx - 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
ChannelDuplexHandlerChannelHandlerContext.flush() to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.flush in interface ChannelOutboundHandlerflush in class ChannelDuplexHandlerctx - the ChannelHandlerContext for which the flush operation is madejava.lang.Exception - thrown if an error occursCopyright © 2008–2018 The Netty Project. All rights reserved.