diff --git a/transport/src/main/java/io/netty/channel/AbstractChannelSink.java b/transport/src/main/java/io/netty/channel/AbstractChannelSink.java index 805995ac72..1210a8b94e 100644 --- a/transport/src/main/java/io/netty/channel/AbstractChannelSink.java +++ b/transport/src/main/java/io/netty/channel/AbstractChannelSink.java @@ -67,5 +67,4 @@ public abstract class AbstractChannelSink implements ChannelSink { return Channels.failedFuture(pipeline.getChannel(), t); } } - } diff --git a/transport/src/main/java/io/netty/channel/ChannelPipeline.java b/transport/src/main/java/io/netty/channel/ChannelPipeline.java index 4620e83fbd..f69df63fbe 100644 --- a/transport/src/main/java/io/netty/channel/ChannelPipeline.java +++ b/transport/src/main/java/io/netty/channel/ChannelPipeline.java @@ -432,7 +432,6 @@ public interface ChannelPipeline { */ ChannelHandlerContext getContext(Class handlerType); - /** * Sends the specified {@link ChannelEvent} to the first * {@link ChannelUpstreamHandler} in this pipeline. @@ -442,9 +441,6 @@ public interface ChannelPipeline { */ void sendUpstream(ChannelEvent e); - - ChannelFuture execute(Runnable task); - /** * Sends the specified {@link ChannelEvent} to the last * {@link ChannelDownstreamHandler} in this pipeline. @@ -454,6 +450,12 @@ public interface ChannelPipeline { */ void sendDownstream(ChannelEvent e); + /** + * Schedules the specified task to be executed in the I/O thread associated + * with this pipeline's {@link Channel}. + */ + ChannelFuture execute(Runnable task); + /** * Returns the {@link Channel} that this pipeline is attached to. * diff --git a/transport/src/main/java/io/netty/channel/ChannelSink.java b/transport/src/main/java/io/netty/channel/ChannelSink.java index e0e2650211..77187f62b6 100644 --- a/transport/src/main/java/io/netty/channel/ChannelSink.java +++ b/transport/src/main/java/io/netty/channel/ChannelSink.java @@ -39,7 +39,8 @@ public interface ChannelSink { void exceptionCaught(ChannelPipeline pipeline, ChannelEvent e, ChannelPipelineException cause) throws Exception; /** - * Execute the given {@link Runnable} later in the io-thread. Some implementation may not support his and just execute it directly + * Execute the given {@link Runnable} later in the io-thread. + * Some implementation may not support this and just execute it directly. */ ChannelFuture execute(ChannelPipeline pipeline, Runnable task); } diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java index de75705212..df7e72ecb8 100644 --- a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java @@ -584,11 +584,6 @@ public class DefaultChannelPipeline implements ChannelPipeline { } } - @Override - public ChannelFuture execute(Runnable task) { - return getSink().execute(this, task); - } - @Override public void sendDownstream(ChannelEvent e) { DefaultChannelHandlerContext tail = getActualDownstreamContext(this.tail); @@ -655,6 +650,11 @@ public class DefaultChannelPipeline implements ChannelPipeline { return realCtx; } + @Override + public ChannelFuture execute(Runnable task) { + return getSink().execute(this, task); + } + protected void notifyHandlerException(ChannelEvent e, Throwable t) { if (e instanceof ExceptionEvent) { if (logger.isWarnEnabled()) {