Package org.apache.mina.filter.codec

Examples of org.apache.mina.filter.codec.ProtocolCodecFilter


        {
            log.debug( "{} CREATED:  {}", session.getRemoteAddress(), session.getTransportMetadata() );
        }

        session.getFilterChain().addFirst( "codec",
            new ProtocolCodecFilter( ChangePasswordProtocolCodecFactory.getInstance() ) );
    }
View Full Code Here


            {
                chain = new DefaultIoFilterChainBuilder();
            }

            // Inject the codec into the chain
            ( ( DefaultIoFilterChainBuilder ) chain ).addLast( "codec", new ProtocolCodecFilter( this
                .getProtocolCodecFactory() ) );

            // Now inject an ExecutorFilter for the write operations
            // We use the same number of thread than the number of IoProcessor
            // (NOTE : this has to be double checked)
View Full Code Here

            // Create a service configuration
            SocketAcceptorConfig cfg = new SocketAcceptorConfig();
            cfg.setReuseAddress(true);
            cfg.getFilterChain().addLast(
                    "protocolFilter",
                    new ProtocolCodecFilter(
                            new HttpServerProtocolCodecFactory()));
            cfg.getFilterChain().addLast("logger", new LoggingFilter());

            acceptor
                    .bind(new InetSocketAddress(port), new ServerHandler(), cfg);
View Full Code Here

        SocketAcceptorConfig cfg = new SocketAcceptorConfig();
        cfg.setReuseAddress(true);
        cfg.getFilterChain().addLast("logger", new LoggingFilter());
        cfg.getFilterChain().addLast(
                "codec",
                new ProtocolCodecFilter(new TextLineCodecFactory(Charset
                        .forName("UTF-8"))));

        // Bind
        acceptor.bind(new InetSocketAddress(PORT),
                new ReverseProtocolHandler(), cfg);
View Full Code Here

        cfg.setReuseAddress(true);
        if (USE_CUSTOM_CODEC) {
            cfg.getFilterChain()
                    .addLast(
                            "codec",
                            new ProtocolCodecFilter(
                                    new SumUpProtocolCodecFactory(true)));
        } else {
            cfg.getFilterChain().addLast(
                    "codec",
                    new ProtocolCodecFilter(
                            new ObjectSerializationCodecFactory()));
        }
        cfg.getFilterChain().addLast("logger", new LoggingFilter());

        acceptor.bind(new InetSocketAddress(SERVER_PORT),
View Full Code Here

        SocketConnectorConfig cfg = new SocketConnectorConfig();
        cfg.setConnectTimeout(CONNECT_TIMEOUT);
        if (USE_CUSTOM_CODEC) {
            cfg.getFilterChain().addLast(
                    "codec",
                    new ProtocolCodecFilter(
                            new SumUpProtocolCodecFactory(false)));
        } else {
            cfg.getFilterChain().addLast(
                    "codec",
                    new ProtocolCodecFilter(
                            new ObjectSerializationCodecFactory()));
        }
        cfg.getFilterChain().addLast("logger", new LoggingFilter());

        IoSession session;
View Full Code Here

                ( ( NioSocketAcceptor ) acceptor ).setReuseAddress( true );
            }

            // Inject the codec
            ( ( DefaultIoFilterChainBuilder ) chainBuilder ).addFirst( "codec",
                new ProtocolCodecFilter(
                    KerberosProtocolCodecFactory.getInstance() ) );

            acceptor.setFilterChainBuilder( chainBuilder );

            // Inject the protocol handler
View Full Code Here

    public void sessionCreated( IoSession session ) throws Exception
    {
        logger.debug( "{} CREATED", session.getLocalAddress() );
        session.getFilterChain().addFirst( "codec",
            new ProtocolCodecFilter( new DhcpProtocolCodecFactory() ) );
    }
View Full Code Here

        SocketAddress address = new InetSocketAddress(connectUri.getHost(), connectUri.getPort());
        IoConnector connector = new SocketConnector();

        // TODO customize the config via URI
        SocketConnectorConfig config = new SocketConnectorConfig();
        config.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));

        return new MinaEndpoint(uri, this, address, acceptor, connector, config);
    }
View Full Code Here

        SocketAddress address = new InetSocketAddress(connectUri.getHost(), connectUri.getPort());
        IoConnector connector = new DatagramConnector();

        // TODO customize the config via URI
        DatagramConnectorConfig config = new DatagramConnectorConfig();
        config.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));

        return new MinaEndpoint(uri, this, address, acceptor, connector, config);
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.filter.codec.ProtocolCodecFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.