users@grizzly.java.net

Re: DefaultProtocolChainInstanceHandler

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 11 Feb 2008 15:44:49 -0500

Oups should have been:

> public void returnContext(Context ctx){
> + ProtocolChainInstanceHandler pciHandler =
> + ctx.getSelectorHandler().getProtocolChainInstanceHandler();
> + if (pciHandler == null){
> + pciHandler = instanceHandler;
> + }
> + pciHandler.offer(ctx.getProtocolChain());
> +
> + ctx.recycle();
> contexts.offer(ctx);
> }
  ;-)


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