users@grizzly.java.net

Re: DefaultProtocolChainInstanceHandler

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Mon, 11 Feb 2008 22:48:00 +0100

Hi,

I agree with your propose! :)
Also think implementation could become easier if we will add
Context.getProtocolChainInstanceHandler() like this:

    public ProtocolChainInstanceHandler getProtocolChainInstanceHandler() {
        ProtocolChainInstanceHandler protocolChainInstanceHandler =
                selectorHandler.getProtocolChainInstanceHandler();
        return protocolChainInstanceHandler != null ?
            protocolChainInstanceHandler :
            controller.getProtocolChainInstanceHandler();
    }

This way we will have that logic just in one single place :)

Thanks.

WBR,
Alexey.

Jeanfrancois Arcand wrote:
> Salut,
>
> Oleksiy Stashok wrote:
>> Hello,
>>
>> IMHO to use correctly
>> ProtocolChainInstanceHandler.offer(ProtocolChain) - we need to add
>> one more method to ProtocolChain API:
>> ProtocolChainInstanceHandler getInstanceHandler();
>>
>> as at time, when ProtocolChain could be released - we don't know from
>> which ProtocolChainInstanceHandler the ProtocolChain was polled from.
>> Once method above will be added to the ProtocolChain interface - we
>> can easily implement ProtocolChain releasing in Controller's
>> returnContext() method:
>>
>> public void returnContext(Context ctx){
>> / ProtocolChain protocolChain = ctx.getProtocolChain();
>> protocolChain.getInstanceHandler().offer(protocolChain);
>> / contexts.offer(ctx);
>> }
>>
>> What do you think?
>
> An alternative is to change the Controller and delegate the
> ProtocolChain configuration to the Context (see patch). That way no
> API changes :-)
>
> What do you think?
>
> -- Jeanfrancois
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net