users@grizzly.java.net

Grizzly 2.0 M3: multi-binding requires other than SingletonFilterChainFactory

From: JopieC <jopie.cruijff_at_gmail.com>
Date: Tue, 9 Jun 2009 02:48:31 -0700 (PDT)

The TCPNIOTransport uses a SingletonFilterChainFactory:

...
        PatternFilterChainFactory patternFactory =
                new SingletonFilterChainFactory();
        FilterChain filterChain = new DefaultFilterChain(patternFactory);
        patternFactory.setFilterChainPattern(filterChain);

        filterChainFactory = patternFactory;
...

which makes it 'hard' to create a multi-bind server with different
FilterChain's. I now use this for every ServerConnection:

PatternFilterChainFactory factory = new SingletonFilterChainFactory();
filterChain = new DefaultFilterChain(factory);
...

Which is against the idea behind a factory.

Of course I could create another Factory that implements FilterChainFactory,
but I think this should be in the framework itself. But not through the
TCPNIOTransport class!, since the processor is related to the
ServerConnection and not to the Transport.

So it would be better, in my opinion, if something like this would be
possible:

Connection serverConnection = m_transport.bind(sAddress, iPort);
...FilterChainFactory factory = serverConnection.getFilterChainFactory(); //
anything, but NOT a SingletonFilterChainFactory!
...FilterChain filterChain = factory.create();
-- 
View this message in context: http://www.nabble.com/Grizzly-2.0-M3%3A-multi-binding-requires-other-than-SingletonFilterChainFactory-tp23939701p23939701.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.