Package org.apache.mina.common

Examples of org.apache.mina.common.IoFilter


* @author The Apache Directory Project (mina-dev@directory.apache.org)
* @version $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
*/
public class IoFilterMappingTest extends TestCase {
    public void testConstructor() throws Exception {
        IoFilter filter = (IoFilter) MockControl.createControl(IoFilter.class)
                .getMock();

        try {
            new IoFilterMapping(null, filter);
            fail("null name. IllegalArgumentException expected.");
View Full Code Here


*/
public class IoFilterMappingTest extends TestCase
{
    public void testConstructor() throws Exception
    {
        IoFilter filter = ( IoFilter ) MockControl.createControl(
                IoFilter.class ).getMock();

        try
        {
            new IoFilterMapping( null, filter );
View Full Code Here

    }

    public void testAcceptorFilterChain() throws Exception {
        int port = AvailablePortFinder.getNextAvailable(1024);
        DatagramAcceptorConfig expectedConfig = new DatagramAcceptorConfig();
        IoFilter mockFilter = new MockFilter();
        IoHandler mockHandler = new MockHandler();

        expectedConfig.getFilterChain().addLast("mock", mockFilter);
        acceptor.bind(new InetSocketAddress(port), mockHandler, expectedConfig);
View Full Code Here

                    + filter + " in " + getSession(), e);
        }
    }

    private void deregister(EntryImpl entry) {
        IoFilter filter = entry.getFilter();

        try {
            filter.onPreRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPreRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }

        deregister0(entry);

        try {
            filter.onPostRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPostRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }
    }
View Full Code Here

                    + filter + " in " + getSession(), e);
        }
    }

    private void deregister(EntryImpl entry) {
        IoFilter filter = entry.getFilter();

        try {
            filter.onPreRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPreRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }

        deregister0(entry);

        try {
            filter.onPostRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPostRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }
    }
View Full Code Here

        }
    }

    private void deregister( EntryImpl entry )
    {
        IoFilter filter = entry.getFilter();

        try
        {
            filter.onPreRemove( this, entry.getName(), entry.getNextFilter() );
        }
        catch( Exception e )
        {
            throw new IoFilterLifeCycleException( "onPreRemove(): " + entry.getName() + ':' + filter
                                                  + " in " + getSession(), e );
        }

        deregister0( entry );

        try
        {
            filter.onPostRemove( this, entry.getName(), entry.getNextFilter() );
        }
        catch( Exception e )
        {
            throw new IoFilterLifeCycleException( "onPostRemove(): " + entry.getName() + ':' + filter
                                                  + " in " + getSession(), e );
View Full Code Here

   
    public void testAcceptorFilterChain() throws Exception
    {
        int port = AvailablePortFinder.getNextAvailable( 1024 );
        DatagramAcceptorConfig expectedConfig = new DatagramAcceptorConfig();
        IoFilter mockFilter = new MockFilter();
        IoHandler mockHandler = new MockHandler();
       
        expectedConfig.getFilterChain().addLast( "mock", mockFilter );
        acceptor.bind( new InetSocketAddress( port ), mockHandler, expectedConfig );
       
View Full Code Here

                    + filter + " in " + getSession(), e);
        }
    }

    private void deregister(EntryImpl entry) {
        IoFilter filter = entry.getFilter();

        try {
            filter.onPreRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPreRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }

        deregister0(entry);

        try {
            filter.onPostRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPostRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }
    }
View Full Code Here

*/
public class IoFilterMappingTest extends TestCase
{
    public void testConstructor() throws Exception
    {
        IoFilter filter = ( IoFilter ) MockControl.createControl(
                IoFilter.class ).getMock();

        try
        {
            new IoFilterMapping( null, filter );
View Full Code Here

                    + filter + " in " + getSession(), e);
        }
    }

    private void deregister(EntryImpl entry) {
        IoFilter filter = entry.getFilter();

        try {
            filter.onPreRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPreRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }

        deregister0(entry);

        try {
            filter.onPostRemove(this, entry.getName(), entry.getNextFilter());
        } catch (Exception e) {
            throw new IoFilterLifeCycleException("onPostRemove(): "
                    + entry.getName() + ':' + filter + " in " + getSession(), e);
        }
    }
View Full Code Here

TOP

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

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.