From 66f8de91b11e7644c1f5db72498fab92f7e2890f Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Sat, 3 Mar 2012 19:14:36 +0100 Subject: [PATCH] Make it more clear in the javadocs that you should use *Later methods to send upstream events from a ChannelDownstreamHandler --- .../java/io/netty/channel/ChannelDownstreamHandler.java | 4 ++++ .../io/netty/channel/SimpleChannelDownstreamHandler.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/transport/src/main/java/io/netty/channel/ChannelDownstreamHandler.java b/transport/src/main/java/io/netty/channel/ChannelDownstreamHandler.java index 6f652c944d..3cfc13157c 100644 --- a/transport/src/main/java/io/netty/channel/ChannelDownstreamHandler.java +++ b/transport/src/main/java/io/netty/channel/ChannelDownstreamHandler.java @@ -56,6 +56,10 @@ package io.netty.channel; *

* You will also find various helper methods in {@link Channels} to be useful * to generate and send an artificial or manipulated event. + *

+ * Caution: + *

+ * Use the *Later(..) methods of the {@link Channels} class if you want to send an upstream event from a {@link ChannelDownstreamHandler} otherwise you may run into threading issues. * *

State management

* diff --git a/transport/src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java b/transport/src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java index 2108c07734..f98de0bf90 100644 --- a/transport/src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java +++ b/transport/src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java @@ -49,6 +49,12 @@ import java.net.SocketAddress; * super.handleDownstream(ctx, e); * } * } + * + *

+ * Caution: + *

+ * Use the *Later(..) methods of the {@link Channels} class if you want to send an upstream event from a {@link ChannelDownstreamHandler} otherwise you may run into threading issues. + * */ public class SimpleChannelDownstreamHandler implements ChannelDownstreamHandler {