Package org.apache.mina.common

Examples of org.apache.mina.common.DefaultIoFilterChainBuilder


         * Bind all.
         */
        for( int i = 0; i < bindings.length; i++ )
        {
            Binding b = bindings[ i ];
            DefaultIoFilterChainBuilder chainBuilder =
                new DefaultIoFilterChainBuilder();
           
            IoFilterMapping[] fm = b.getFilterMappings();
            for( int j = 0; j < fm.length; j++ )
            {
                chainBuilder.addLast( fm[ j ].getName(), fm[ j ].getFilter() );
            }
           
            SocketAddress address = parseSocketAddress( b.getAddress() );
            acceptor.bind( address, b.getHandler(), chainBuilder );
        }
View Full Code Here


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

            throws Exception
    {
        /*
         * Add filters to the end of the filter chain.
         */
        DefaultIoFilterChainBuilder builder = sessionManager.getFilterChain();
        for( int i = 0; i < filterMappings.length; i++ )
        {
            builder.addLast( filterMappings[ i ].getName(),
                             filterMappings[ i ].getFilter() );
        }
    }
View Full Code Here

        MockControl mockIoService = MockControl
                .createControl( IoService.class );

        IoService ioSessionManager = ( IoService ) mockIoService
                .getMock();
        DefaultIoFilterChainBuilder ioFilterChainBuilder = ( DefaultIoFilterChainBuilder ) mockIoFilterChainBuilder
                .getMock();

        /*
         * Record expectations.
         */
        ioSessionManager.getFilterChain();
        mockIoService.setReturnValue( ioFilterChainBuilder );
        ioFilterChainBuilder.clear();

        /*
         * Replay.
         */
        mockIoFilterChainBuilder.replay();
View Full Code Here

        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

    private static final boolean USE_SSL = false;

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

        ((SocketSessionConfig) config.getSessionConfig()).setReuseAddress(true);
        // Add SSL filter if SSL is enabled.
        if (USE_SSL) {
            addSSLSupport(chain);
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

        return filterChainBuilder;
    }

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

        return filterChainBuilder;
    }

    public void setFilterChainBuilder(IoFilterChainBuilder builder) {
        if (builder == null) {
            builder = new DefaultIoFilterChainBuilder();
        }
        filterChainBuilder = builder;
    }
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.