Adding ChannelPipelineCoverage("one") annotated handler to default pipeline

Trustin Lee tlee at redhat.com
Thu Apr 2 01:16:31 EDT 2009


Hi,

On Mon, Mar 30, 2009 at 4:53 PM, hezjing <hezjing at gmail.com> wrote:
> Hi
> In the Javadoc of ClientBootstrap, the first approach of configuring a
> channel pipeline will let the bootstrap to "clone" the handler for each new
> channel.
> When a handler is cloned, it means a new instance is created?

No.  Cloning is done against the 'list' of handler rather than
individual 'handlers.'  That is, it is shallow copy.  Let me update
the Javadoc to avoid confusion.

> I think we should never add a ChannelPipelineCoverage("one") annotated
> handler to the bootstrap's default pipeline.
> Can Netty warns if the user try to add a ChannelPipelineCoverage("one")
> annotated handler to the bootstrap's default pipeline?

I thought about that, but there's a case where a user creates only one
connection.  In this case, a handler with
ChannelPipelineCoverage("one") should be allowed.  We could do more
precise counter-based validation, but it will cost quite a big IMHO.
However, it might not cost that much as I thought.  Any contribution
is appreciated. :)

HTH,

— Trustin Lee, http://gleamynode.net/




More information about the netty-users mailing list