protected void initialize() throws IOException {
        NioSocketAcceptor acceptor = new NioSocketAcceptor();
        ExecutorService executor = Executors.newCachedThreadPool();
acceptor.getFilterChain().addLast("executor", new ExecutorFilter(executor, IoEventType.MESSAGE_RECEIVED)); acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory())); acceptor.getFilterChain().addLast("logger", new LoggingFilter());
        acceptor.setHandler(getMessageHandler());
        acceptor.bind(new InetSocketAddress(getPort()));
LoggerFactory.getLogger(getClass()).debug("Listening on port " + getPort());
    }

This is one setup I'm using.
Should be able to add your own codecs pretty easily.
Look at the MINA code for their filters for a starting point.

On May 30, 2008, at 9:48 AM, Thomas Kistel wrote:

Sorry for the broken link. That should be the correct one
http://www.nabble.com/Re%3A-Why-only-one-ProtocolCodecFilter-per-chain-p1101
9097.html


-----Ursprüngliche Nachricht-----
Von: Thomas Kistel [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 30. Mai 2008 16:44
An: [email protected]
Betreff: MINA 2.0 with multiple ProtocolCodecFilters

Hi,



does anybody know how to add multiple ProtocolCodecFilter to the
FilterChain. Regarding to earlier discussions
(http://www.nabble.com/Re%3A-Why-only-one-ProtocolCodecFilter-per-chain-p110
19097.html) that wasn't possible with MINA 1.x but should be resolved in
MINA 2.0.



I want to implement a protocol stack (i.e. the ISO layer-7 protocols ACSE, ROSE and CMDISE) with MINA. Therefore I need several Encoders and Decoders on a protocol stack, each responsible for de/encoding the specific layer.
I'm currently using MINA 2.0M1.



Thanks very much for your help.



Thomas




Reply via email to