Package org.apache.mina.filter.codec

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


            // Inject the chain
            IoFilterChainBuilder udpChainBuilder = new DefaultIoFilterChainBuilder();

            ((DefaultIoFilterChainBuilder)udpChainBuilder).addFirst( "codec",
                    new ProtocolCodecFilter(
                            KerberosUdpProtocolCodecFactory.getInstance() ) );

            acceptor.setFilterChainBuilder( udpChainBuilder );

            // Inject the protocol handler
            acceptor.setHandler( new KerberosProtocolHandler( this, store ) );
           
            // Bind to the configured address
            acceptor.bind();
        }
        else
        {
            // Kerberos can use UDP or TCP
            for ( Transport transport:transports )
            {
                IoAcceptor acceptor = transport.getAcceptor();
               
                // Now, configure the acceptor
                // Inject the chain
                IoFilterChainBuilder chainBuilder = new DefaultIoFilterChainBuilder();
   
                if ( transport instanceof TcpTransport )
                {
                    // Now, configure the acceptor
                    // Disable the disconnection of the clients on unbind
                    acceptor.setCloseOnDeactivation( false );
                   
                    // No Nagle's algorithm
                    ((NioSocketAcceptor)acceptor).getSessionConfig().setTcpNoDelay( true );
                   
                    // Allow the port to be reused even if the socket is in TIME_WAIT state
                    ((NioSocketAcceptor)acceptor).setReuseAddress( true );

                    // Inject the codec
                    ((DefaultIoFilterChainBuilder)chainBuilder).addFirst( "codec",
                        new ProtocolCodecFilter(
                                KerberosTcpProtocolCodecFactory.getInstance() ) );
                }
                else
                {
                    // Inject the codec
                    ((DefaultIoFilterChainBuilder)chainBuilder).addFirst( "codec",
                        new ProtocolCodecFilter(
                                KerberosUdpProtocolCodecFactory.getInstance() ) );
                }

                acceptor.setFilterChainBuilder( chainBuilder );
               
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)
            ((DefaultIoFilterChainBuilder)chain).addLast( "executor",
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

            {
                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

                ( ( 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

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

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

                    .getInstance(true));
            acceptor.getFilterChain().addLast("sslFilter", sslFilter);
        }
        acceptor.getFilterChain().addLast(
                "codec",
                new ProtocolCodecFilter(new TextLineCodecFactory(Charset
                        .forName("UTF-8"))));

        EchoHandler handler = new EchoHandler();
        acceptor.bind(socketAddress, handler);
        System.out.println("MINA server started.");
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

        addCodecFactory(config, codecFactory);
    }

    private void addCodecFactory(IoServiceConfig config, ProtocolCodecFactory codecFactory) {
        config.getFilterChain().addLast("codec", new ProtocolCodecFilter(codecFactory));
    }
View Full Code Here

            eventExecutor.setCorePoolSize(eventThreads + 1);
            eventExecutor.setMaximumPoolSize(eventThreads + 1);
            eventExecutor.setKeepAliveTime(60, TimeUnit.SECONDS);
            multiplexerSocketAcceptor.getDefaultConfig().setThreadModel(threadModel);
            // Add the XMPP codec filter
            multiplexerSocketAcceptor.getFilterChain().addFirst("xmpp", new ProtocolCodecFilter(new XMPPCodecFactory()));

        }
    }
View Full Code Here

TOP

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

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.