diff --git a/transport/src/main/java/io/netty/channel/group/ChannelGroup.java b/transport/src/main/java/io/netty/channel/group/ChannelGroup.java index 579e498fe8..85cfa6e94b 100644 --- a/transport/src/main/java/io/netty/channel/group/ChannelGroup.java +++ b/transport/src/main/java/io/netty/channel/group/ChannelGroup.java @@ -156,12 +156,24 @@ public interface ChannelGroup extends Set, Comparable { */ ChannelGroupFuture writeAndFlush(Object message); + /** + * @deprecated Use {@link #writeAndFlush(Object)} instead. + */ + @Deprecated + ChannelGroupFuture flushAndWrite(Object message); + /** * Shortcut for calling {@link #write(Object)} and {@link #flush()} and only act on * {@link Channel}s that match the {@link ChannelMatcher}. */ ChannelGroupFuture writeAndFlush(Object message, ChannelMatcher matcher); + /** + * @deprecated Use {@link #writeAndFlush(Object, ChannelMatcher)} instead. + */ + @Deprecated + ChannelGroupFuture flushAndWrite(Object message, ChannelMatcher matcher); + /** * Disconnects all {@link Channel}s in this group from their remote peers. * @@ -200,6 +212,8 @@ public interface ChannelGroup extends Set, Comparable { ChannelGroupFuture close(ChannelMatcher matcher); /** + * @deprecated This method will be removed in the next major feature release. + * * Deregister all {@link Channel}s in this group from their {@link EventLoop}. * Please note that this operation is asynchronous as {@link Channel#deregister()} is. * @@ -210,6 +224,8 @@ public interface ChannelGroup extends Set, Comparable { ChannelGroupFuture deregister(); /** + * @deprecated This method will be removed in the next major feature release. + * * Deregister all {@link Channel}s in this group from their {@link EventLoop} that match the given * {@link ChannelMatcher}. Please note that this operation is asynchronous as {@link Channel#deregister()} is. * diff --git a/transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java b/transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java index 3e7f8d4a4c..d791ec1ff2 100644 --- a/transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java +++ b/transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java @@ -171,7 +171,9 @@ public class DefaultChannelGroup extends AbstractSet implements Channel public ChannelGroupFuture disconnect() { return disconnect(ChannelMatchers.all()); } + @Override + @Deprecated public ChannelGroupFuture deregister() { return deregister(ChannelMatchers.all()); } @@ -218,6 +220,11 @@ public class DefaultChannelGroup extends AbstractSet implements Channel return flush(ChannelMatchers.all()); } + @Override + public ChannelGroupFuture flushAndWrite(Object message) { + return writeAndFlush(message); + } + @Override public ChannelGroupFuture writeAndFlush(Object message) { return writeAndFlush(message, ChannelMatchers.all()); @@ -270,6 +277,7 @@ public class DefaultChannelGroup extends AbstractSet implements Channel } @Override + @Deprecated public ChannelGroupFuture deregister(ChannelMatcher matcher) { if (matcher == null) { throw new NullPointerException("matcher"); @@ -302,6 +310,11 @@ public class DefaultChannelGroup extends AbstractSet implements Channel return this; } + @Override + public ChannelGroupFuture flushAndWrite(Object message, ChannelMatcher matcher) { + return writeAndFlush(message, matcher); + } + @Override public ChannelGroupFuture writeAndFlush(Object message, ChannelMatcher matcher) { if (message == null) {