Class ExceptionHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

    public class ExceptionHandler
    extends io.netty.channel.ChannelDuplexHandler
    This handler listens to exceptions on the pipeline and sends them as ExceptionMessage to the peer.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(io.netty.channel.ChannelHandlerContext ctx, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)  
      void close​(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)  
      void connect​(io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)  
      void deregister​(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)  
      void disconnect​(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)  
      void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)  
      void write​(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)  
      • Methods inherited from class io.netty.channel.ChannelDuplexHandler

        flush, read
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Method Detail

      • bind

        public void bind​(io.netty.channel.ChannelHandlerContext ctx,
                         SocketAddress localAddress,
                         io.netty.channel.ChannelPromise promise)
                  throws Exception
        Specified by:
        bind in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        bind in class io.netty.channel.ChannelDuplexHandler
        Throws:
        Exception
      • connect

        public void connect​(io.netty.channel.ChannelHandlerContext ctx,
                            SocketAddress remoteAddress,
                            SocketAddress localAddress,
                            io.netty.channel.ChannelPromise promise)
        Specified by:
        connect in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        connect in class io.netty.channel.ChannelDuplexHandler
      • disconnect

        public void disconnect​(io.netty.channel.ChannelHandlerContext ctx,
                               io.netty.channel.ChannelPromise promise)
        Specified by:
        disconnect in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        disconnect in class io.netty.channel.ChannelDuplexHandler
      • close

        public void close​(io.netty.channel.ChannelHandlerContext ctx,
                          io.netty.channel.ChannelPromise promise)
        Specified by:
        close in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        close in class io.netty.channel.ChannelDuplexHandler
      • deregister

        public void deregister​(io.netty.channel.ChannelHandlerContext ctx,
                               io.netty.channel.ChannelPromise promise)
        Specified by:
        deregister in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        deregister in class io.netty.channel.ChannelDuplexHandler
      • write

        public void write​(io.netty.channel.ChannelHandlerContext ctx,
                          Object msg,
                          io.netty.channel.ChannelPromise promise)
        Specified by:
        write in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        write in class io.netty.channel.ChannelDuplexHandler
      • exceptionCaught

        public void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx,
                                    Throwable cause)
        Specified by:
        exceptionCaught in interface io.netty.channel.ChannelHandler
        Specified by:
        exceptionCaught in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        exceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapter