Package io.netty.channel
Class ChannelHandlerAdapter
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- All Implemented Interfaces:
ChannelHandler
- Direct Known Subclasses:
ChannelInboundHandlerAdapter,ChannelOutboundHandlerAdapter,Http2FrameLogger
public abstract class ChannelHandlerAdapter extends java.lang.Object implements ChannelHandler
Skeleton implementation of aChannelHandler.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Constructor Summary
Constructors Constructor Description ChannelHandlerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidensureNotSharable()voidexceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause)Deprecated.is part ofChannelInboundHandlervoidhandlerAdded(ChannelHandlerContext ctx)Do nothing by default, sub-classes may override this method.voidhandlerRemoved(ChannelHandlerContext ctx)Do nothing by default, sub-classes may override this method.booleanisSharable()Returntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
-
-
Method Detail
-
ensureNotSharable
protected void ensureNotSharable()
-
isSharable
public boolean isSharable()
Returntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
handlerAdded
public void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
Do nothing by default, sub-classes may override this method.- Specified by:
handlerAddedin interfaceChannelHandler- Throws:
java.lang.Exception
-
handlerRemoved
public void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
Do nothing by default, sub-classes may override this method.- Specified by:
handlerRemovedin interfaceChannelHandler- Throws:
java.lang.Exception
-
exceptionCaught
@Deprecated public void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
Deprecated.is part ofChannelInboundHandlerCallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
exceptionCaughtin interfaceChannelHandler- Throws:
java.lang.Exception
-
-