Undeprecate deregister() and chanelUnregistered()
Motivation: As discussed in #2250, it will become much less complicated to implement deregistration and reregistration of a channel once #2250 is resolved. Therefore, there's no need to deprecate deregister() and channelUnregistered(). Modification: - Undeprecate deregister() and channelUnregistered() - Remove SuppressWarnings annotations where applicable Result: We (including @jakobbuchgraber) are now ready to play with #2250 at master
This commit is contained in:
parent
d765f6b870
commit
0fceef8ab6
@ -370,7 +370,6 @@ public class SslHandler extends ByteToMessageDecoder implements ChannelOutboundH
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
||||
ctx.deregister(promise);
|
||||
}
|
||||
|
@ -292,7 +292,6 @@ public interface Channel extends AttributeMap, Comparable<Channel> {
|
||||
* {@link Channel}.
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelFuture deregister();
|
||||
|
||||
/**
|
||||
@ -380,7 +379,6 @@ public interface Channel extends AttributeMap, Comparable<Channel> {
|
||||
* method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
|
||||
* {@link Channel}.
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelFuture deregister(ChannelPromise promise);
|
||||
|
||||
/**
|
||||
@ -502,7 +500,6 @@ public interface Channel extends AttributeMap, Comparable<Channel> {
|
||||
* Deregister the {@link Channel} of the {@link ChannelPromise} from {@link EventLoop} and notify the
|
||||
* {@link ChannelPromise} once the operation was complete.
|
||||
*/
|
||||
@Deprecated
|
||||
void deregister(ChannelPromise promise);
|
||||
|
||||
/**
|
||||
|
@ -192,12 +192,7 @@ public interface ChannelHandler {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
|
@ -81,10 +81,8 @@ public abstract class ChannelHandlerAdapter implements ChannelHandler {
|
||||
*
|
||||
* Sub-classes may override this method to change behavior.
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
|
||||
throws Exception {
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
ctx.fireExceptionCaught(cause);
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,6 @@ public interface ChannelHandlerContext extends AttributeMap {
|
||||
* called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the
|
||||
* {@link Channel}.
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelHandlerContext fireChannelUnregistered();
|
||||
|
||||
/**
|
||||
@ -308,7 +307,6 @@ public interface ChannelHandlerContext extends AttributeMap {
|
||||
* {@link Channel}.
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelFuture deregister();
|
||||
|
||||
/**
|
||||
@ -396,7 +394,6 @@ public interface ChannelHandlerContext extends AttributeMap {
|
||||
* method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
|
||||
* {@link Channel}.
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelFuture deregister(ChannelPromise promise);
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,6 @@ public final class ChannelHandlerInvokerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void invokeChannelUnregisteredNow(ChannelHandlerContext ctx) {
|
||||
try {
|
||||
((ChannelInboundHandler) ctx.handler()).channelUnregistered(ctx);
|
||||
@ -60,7 +59,6 @@ public final class ChannelHandlerInvokerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void invokeExceptionCaughtNow(final ChannelHandlerContext ctx, final Throwable cause) {
|
||||
try {
|
||||
ctx.handler().exceptionCaught(ctx, cause);
|
||||
@ -138,7 +136,6 @@ public final class ChannelHandlerInvokerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void invokeDeregisterNow(final ChannelHandlerContext ctx, final ChannelPromise promise) {
|
||||
try {
|
||||
((ChannelOutboundHandler) ctx.handler()).deregister(ctx, promise);
|
||||
|
@ -28,10 +28,7 @@ public interface ChannelInboundHandler extends ChannelHandler {
|
||||
|
||||
/**
|
||||
* The {@link Channel} of the {@link ChannelHandlerContext} was unregistered from its {@link EventLoop}
|
||||
*
|
||||
* @deprecated use {@link #channelInactive(ChannelHandlerContext)}
|
||||
*/
|
||||
@Deprecated
|
||||
void channelUnregistered(ChannelHandlerContext ctx) throws Exception;
|
||||
|
||||
/**
|
||||
|
@ -69,7 +69,6 @@ public interface ChannelOutboundHandler extends ChannelHandler {
|
||||
* @param promise the {@link ChannelPromise} to notify once the operation completes
|
||||
* @throws Exception thrown if an error accour
|
||||
*/
|
||||
@Deprecated
|
||||
void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception;
|
||||
|
||||
/**
|
||||
|
@ -693,7 +693,6 @@ public interface ChannelPipeline extends Iterable<Entry<String, ChannelHandler>>
|
||||
* called of the next {@link ChannelInboundHandler} contained in the {@link ChannelPipeline} of the
|
||||
* {@link Channel}.
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelPipeline fireChannelUnregistered();
|
||||
|
||||
/**
|
||||
@ -827,7 +826,6 @@ public interface ChannelPipeline extends Iterable<Entry<String, ChannelHandler>>
|
||||
* {@link Channel}.
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelFuture deregister();
|
||||
|
||||
/**
|
||||
@ -915,7 +913,6 @@ public interface ChannelPipeline extends Iterable<Entry<String, ChannelHandler>>
|
||||
* method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
|
||||
* {@link Channel}.
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelFuture deregister(ChannelPromise promise);
|
||||
|
||||
/**
|
||||
|
@ -228,7 +228,6 @@ public interface ChannelGroup extends Set<Channel>, Comparable<ChannelGroup> {
|
||||
* @return the {@link ChannelGroupFuture} instance that notifies when
|
||||
* the operation is done for all channels
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelGroupFuture deregister();
|
||||
|
||||
/**
|
||||
@ -240,6 +239,5 @@ public interface ChannelGroup extends Set<Channel>, Comparable<ChannelGroup> {
|
||||
* @return the {@link ChannelGroupFuture} instance that notifies when
|
||||
* the operation is done for all channels
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelGroupFuture deregister(ChannelMatcher matcher);
|
||||
}
|
||||
|
@ -190,7 +190,6 @@ public class DefaultChannelGroup extends AbstractSet<Channel> implements Channel
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ChannelGroupFuture deregister() {
|
||||
return deregister(ChannelMatchers.all());
|
||||
}
|
||||
@ -294,7 +293,6 @@ public class DefaultChannelGroup extends AbstractSet<Channel> implements Channel
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ChannelGroupFuture deregister(ChannelMatcher matcher) {
|
||||
if (matcher == null) {
|
||||
throw new NullPointerException("matcher");
|
||||
|
@ -214,7 +214,6 @@ public class ReentrantChannelTest extends BaseChannelTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
ctx.close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user