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 void
ensureNotSharable()
void
exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause)
Deprecated.is part ofChannelInboundHandler
void
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.void
handlerRemoved(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.boolean
isSharable()
Returntrue
if the implementation isChannelHandler.Sharable
and so can be added to differentChannelPipeline
s.
-
-
-
Method Detail
-
ensureNotSharable
protected void ensureNotSharable()
-
isSharable
public boolean isSharable()
Returntrue
if the implementation isChannelHandler.Sharable
and so can be added to differentChannelPipeline
s.
-
handlerAdded
public void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
Do nothing by default, sub-classes may override this method.- Specified by:
handlerAdded
in 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:
handlerRemoved
in interfaceChannelHandler
- Throws:
java.lang.Exception
-
exceptionCaught
@Deprecated public void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
Deprecated.is part ofChannelInboundHandler
CallsChannelHandlerContext.fireExceptionCaught(Throwable)
to forward to the nextChannelHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
exceptionCaught
in interfaceChannelHandler
- Throws:
java.lang.Exception
-
-