users@grizzly.java.net

DefaultProtocolChainInstanceHandler

From: Erik Svensson <erik.svensson_at_six.se>
Date: Mon, 11 Feb 2008 15:38:44 +0100

A question here:

In DefaultProtocolChainInstanceHandler
the method poll looks like:

    public ProtocolChain poll() {
        ProtocolChain protocolChain = protocolChains.poll();
        if (protocolChain == null){
            protocolChain = new DefaultProtocolChain();
        }
        return protocolChain;
    }

Should there be a 'offer(protocolChain)' here?

    public ProtocolChain poll() {
        ProtocolChain protocolChain = protocolChains.poll();
        if (protocolChain == null){
            protocolChain = new DefaultProtocolChain();
            // PATCH
            offer(protocolChain);
            // END PATCH
        }
        return protocolChain;
    }

Otherwise a new protocolchain will be created everytime poll is called
unless one is manually added through offer.

cheers

Erik Svensson, SIX AB