Package org.mockserver.logging
Class LoggingHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelDuplexHandler
-
- org.mockserver.logging.LoggingHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
@Sharable public class LoggingHandler extends io.netty.channel.ChannelDuplexHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description LoggingHandler(Class loggerClass)
LoggingHandler(String loggerName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLoggingHandler(io.netty.channel.ChannelHandlerContext ctx)
void
bind(io.netty.channel.ChannelHandlerContext ctx, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)
void
channelActive(io.netty.channel.ChannelHandlerContext ctx)
void
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
void
channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
void
channelRegistered(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, 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
flush(io.netty.channel.ChannelHandlerContext ctx)
protected String
format(io.netty.channel.ChannelHandlerContext ctx, String message)
void
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
void
write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelWritabilityChanged
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Method Detail
-
addLoggingHandler
public void addLoggingHandler(io.netty.channel.ChannelHandlerContext ctx)
-
channelRegistered
public void channelRegistered(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelRegistered
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRegistered
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
channelUnregistered
public void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelUnregistered
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelUnregistered
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
- Specified by:
channelInactive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
userEventTriggered
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception
- Specified by:
userEventTriggered
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
userEventTriggered
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
bind
public void bind(io.netty.channel.ChannelHandlerContext ctx, SocketAddress localAddress, io.netty.channel.ChannelPromise promise) throws Exception
- Specified by:
bind
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
bind
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-
connect
public void connect(io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, io.netty.channel.ChannelPromise promise) throws Exception
- Specified by:
connect
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
connect
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-
disconnect
public void disconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws Exception
- Specified by:
disconnect
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
disconnect
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-
close
public void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws Exception
- Specified by:
close
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
close
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-
deregister
public void deregister(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws Exception
- Specified by:
deregister
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
deregister
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
- Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.channel.ChannelDuplexHandler
-
flush
public void flush(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
flush
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
flush
in classio.netty.channel.ChannelDuplexHandler
-
-