Class ExceptionHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.drasyl.peer.connection.handler.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
ErrorMessage
to the
peer.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExceptionHandler
(Identity identity) Exception handler that does not re-throw occurredException
s onexceptionCaught(io.netty.channel.ChannelHandlerContext, java.lang.Throwable)
to the next pipeline.ExceptionHandler
(Identity identity, boolean rethrowExceptions) Exception handler that does re-throw occurredException
s onexceptionCaught(io.netty.channel.ChannelHandlerContext, java.lang.Throwable)
to the next pipeline, ifrethrowExceptions
istrue
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
exceptionCaught
(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read, write
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 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 Details
-
EXCEPTION_HANDLER
- See Also:
-
-
Constructor Details
-
ExceptionHandler
Exception handler that does not re-throw occurredException
s onexceptionCaught(io.netty.channel.ChannelHandlerContext, java.lang.Throwable)
to the next pipeline.- Parameters:
identity
- node's identity
-
ExceptionHandler
Exception handler that does re-throw occurredException
s onexceptionCaught(io.netty.channel.ChannelHandlerContext, java.lang.Throwable)
to the next pipeline, ifrethrowExceptions
istrue
.- Parameters:
identity
- node's identityrethrowExceptions
- iftrue
re-throws to next channel in the pipeline
-
-
Method Details
-
exceptionCaught
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classio.netty.channel.ChannelInboundHandlerAdapter
-