Package org.apache.mina.common

Examples of org.apache.mina.common.DefaultIoFilterChainBuilder


        mockChain.replay();

        DefaultIoFilterChainBuilderFactoryBean factory = new DefaultIoFilterChainBuilderFactoryBean();
        factory.setFilters(Arrays.asList(filters));
        factory.setFilterNamePrefix("prefix");
        DefaultIoFilterChainBuilder builder = (DefaultIoFilterChainBuilder) factory
                .createInstance();
        builder.buildFilterChain(chain);

        mockChain.verify();
    }
View Full Code Here


        mockChain.replay();

        DefaultIoFilterChainBuilderFactoryBean factory = new DefaultIoFilterChainBuilderFactoryBean();
        factory.setFilters(mappings);
        DefaultIoFilterChainBuilder builder = (DefaultIoFilterChainBuilder) factory
                .createInstance();
        builder.buildFilterChain(chain);

        mockChain.verify();
    }
View Full Code Here

       
        DefaultIoFilterChainBuilderFactoryBean factory =
                                   new DefaultIoFilterChainBuilderFactoryBean();
        factory.setFilters( filters );
        factory.setFilterNamePrefix( "prefix" );
        DefaultIoFilterChainBuilder builder =
                             ( DefaultIoFilterChainBuilder) factory.createInstance();
        builder.buildFilterChain( chain );
       
        mockChain.verify();
    }
View Full Code Here

        mockChain.replay();
       
        DefaultIoFilterChainBuilderFactoryBean factory =
                                   new DefaultIoFilterChainBuilderFactoryBean();
        factory.setFilterMappings( mappings );
        DefaultIoFilterChainBuilder builder =
                             ( DefaultIoFilterChainBuilder) factory.createInstance();
        builder.buildFilterChain( chain );
       
        mockChain.verify();
    }   
View Full Code Here

    private IoFilterMapping[] filterMappings = new IoFilterMapping[ 0 ];
    private String prefix = "filter";

    protected Object createInstance() throws Exception
    {
        DefaultIoFilterChainBuilder builder = new DefaultIoFilterChainBuilder();
        for( int i = 0; i < filterMappings.length; i++ )
        {
            String name = filterMappings[ i ].getName();
            if( name == null )
            {
                name = prefix + i;
            }
            builder.addLast( name, filterMappings[ i ].getFilter() );
        }
       
        return builder;
    }
View Full Code Here

    public static void main( String[] args ) throws Exception
    {
        IoAcceptor acceptor = new SocketAcceptor();
        IoAcceptorConfig config = new SocketAcceptorConfig();
        DefaultIoFilterChainBuilder chain = config.getFilterChain();
       
        // Add SSL filter if SSL is enabled.
        if( USE_SSL )
        {
            addSSLSupport( chain  );
View Full Code Here

    public static void main( String[] args ) throws Exception
    {
        IoAcceptor acceptor = new SocketAcceptor();
        IoAcceptorConfig config = new SocketAcceptorConfig();
        DefaultIoFilterChainBuilder chain = config.getFilterChain();

        // Add SSL filter if SSL is enabled.
        if( USE_SSL )
        {
            addSSLSupport( chain );
View Full Code Here

        return filterChainBuilder;
    }

    public void setFilterChainBuilder(IoFilterChainBuilder builder) {
        if (builder == null) {
            builder = new DefaultIoFilterChainBuilder();
        }
        filterChainBuilder = builder;
    }
View Full Code Here

    /** Set this to true if you want to make the server SSL */
    private static final boolean USE_SSL = false;

    public static void main(String[] args) throws Exception {
        SocketAcceptor acceptor = new NioSocketAcceptor();
        DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
       
        // Add SSL filter if SSL is enabled.
        if (USE_SSL) {
            addSSLSupport(chain);
        }
View Full Code Here

    /** Set this to true if you want to make the server SSL */
    private static final boolean USE_SSL = false;

    public static void main(String[] args) throws Exception {
        NioSocketAcceptor acceptor = new NioSocketAcceptor();
        DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();

        MdcInjectionFilter mdcInjectionFilter = new MdcInjectionFilter();
        chain.addLast("mdc", mdcInjectionFilter);

        // Add SSL filter if SSL is enabled.
        if (USE_SSL) {
            addSSLSupport(chain);
        }

        chain.addLast("codec", new ProtocolCodecFilter(
                new TextLineCodecFactory()));

        addLogger(chain);

        // Bind
View Full Code Here

TOP

Related Classes of org.apache.mina.common.DefaultIoFilterChainBuilder

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.