Mark ChannelHandler.exceptionCaught(...) as deprecated in preparation to move to ChannelInboundHandler. Related to [#1808]
This commit is contained in:
parent
363531caf9
commit
af499b5fb4
|
@ -194,7 +194,12 @@ public interface ChannelHandler {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets called if a {@link Throwable} was thrown.
|
* Gets called if a {@link Throwable} was thrown.
|
||||||
|
*
|
||||||
|
* @deprecated Will be removed in the future and only {@link ChannelInboundHandler} will receive
|
||||||
|
* exceptionCaught events. For {@link ChannelOutboundHandler} the {@link ChannelPromise}
|
||||||
|
* must be failed.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception;
|
void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -54,6 +54,7 @@ public abstract class ChannelHandlerAdapter implements ChannelHandler {
|
||||||
*
|
*
|
||||||
* Sub-classes may override this method to change behavior.
|
* Sub-classes may override this method to change behavior.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
|
@ -68,4 +68,10 @@ public interface ChannelInboundHandler extends ChannelHandler {
|
||||||
* {@link Channel#isWritable()}.
|
* {@link Channel#isWritable()}.
|
||||||
*/
|
*/
|
||||||
void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception;
|
void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets called if a {@link Throwable} was thrown.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,4 +118,16 @@ public class ChannelInboundHandlerAdapter extends ChannelHandlerAdapter implemen
|
||||||
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
||||||
ctx.fireChannelWritabilityChanged();
|
ctx.fireChannelWritabilityChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls {@link ChannelHandlerContext#fireExceptionCaught(Throwable)} to forward
|
||||||
|
* to the next {@link ChannelHandler} in the {@link ChannelPipeline}.
|
||||||
|
*
|
||||||
|
* Sub-classes may override this method to change behavior.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
|
||||||
|
throws Exception {
|
||||||
|
ctx.fireExceptionCaught(cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user