Class NettyLogger

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

    public class NettyLogger
    extends io.netty.channel.ChannelDuplexHandler
    • Nested Class Summary

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

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

      Fields 
      Modifier and Type Field Description
      protected org.slf4j.Logger log  
      protected java.lang.String name  
    • Constructor Summary

      Constructors 
      Constructor Description
      NettyLogger​(org.slf4j.Logger log, java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(io.netty.channel.ChannelHandlerContext ctx, java.net.SocketAddress localAddress, io.netty.channel.ChannelPromise promise)  
      void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)  
      void channelUnregistered​(io.netty.channel.ChannelHandlerContext ctx)  
      void close​(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)  
      void connect​(io.netty.channel.ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.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, java.lang.Throwable cause)  
      void write​(io.netty.channel.ChannelHandlerContext ctx, java.lang.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, channelRead, channelReadComplete, channelRegistered, channelWritabilityChanged, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Field Detail

      • log

        protected final org.slf4j.Logger log
      • name

        protected final java.lang.String name
    • Constructor Detail

      • NettyLogger

        public NettyLogger​(org.slf4j.Logger log,
                           java.lang.String name)
    • Method Detail

      • bind

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

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

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

        public void deregister​(io.netty.channel.ChannelHandlerContext ctx,
                               io.netty.channel.ChannelPromise promise)
                        throws java.lang.Exception
        Specified by:
        deregister in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        deregister in class io.netty.channel.ChannelDuplexHandler
        Throws:
        java.lang.Exception
      • disconnect

        public void disconnect​(io.netty.channel.ChannelHandlerContext ctx,
                               io.netty.channel.ChannelPromise promise)
                        throws java.lang.Exception
        Specified by:
        disconnect in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        disconnect in class io.netty.channel.ChannelDuplexHandler
        Throws:
        java.lang.Exception
      • write

        public void write​(io.netty.channel.ChannelHandlerContext ctx,
                          java.lang.Object msg,
                          io.netty.channel.ChannelPromise promise)
                   throws java.lang.Exception
        Specified by:
        write in interface io.netty.channel.ChannelOutboundHandler
        Overrides:
        write in class io.netty.channel.ChannelDuplexHandler
        Throws:
        java.lang.Exception
      • channelInactive

        public void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)
                             throws java.lang.Exception
        Specified by:
        channelInactive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelInactive in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        java.lang.Exception
      • channelUnregistered

        public void channelUnregistered​(io.netty.channel.ChannelHandlerContext ctx)
                                 throws java.lang.Exception
        Specified by:
        channelUnregistered in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelUnregistered in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        java.lang.Exception
      • exceptionCaught

        public void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx,
                                    java.lang.Throwable cause)
                             throws java.lang.Exception
        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
        Throws:
        java.lang.Exception