Package org.apache.mina.registry

Examples of org.apache.mina.registry.SimpleServiceRegistry$IoFilterChainBuilderWrapper


    /** 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
    {
        ServiceRegistry registry = new SimpleServiceRegistry();
       
        // Add SSL filter if SSL is enabled.
        if( USE_SSL )
        {
            addSSLSupport( registry );
        }
       
        addLogger( registry );
       
        // Bind
        Service service = new Service( "echo", TransportType.SOCKET, PORT );
        registry.bind( service, new EchoProtocolHandler() );

        System.out.println( "Listening on port " + PORT );
    }
View Full Code Here


        return buf.getHexDump();
    }

    protected void setUp() throws Exception
    {
        registry = new SimpleServiceRegistry();
       
        // Find an availble test port and bind to it.
        boolean socketBound = false;
        boolean datagramBound = false;
View Full Code Here

   
    private static final boolean USE_SSL = true;

    public static void main( String[] args ) throws Exception
    {
        ServiceRegistry registry = new SimpleServiceRegistry();
       
        // Add SSL filter if SSL is enabled.
        if( USE_SSL )
        {
            addSSLSupport( registry );
        }

        // Bind
        Service service = new Service( "http", TransportType.SOCKET, PORT );
        registry.bind( service, new HttpProtocolHandler() );

        System.out.println( "Listening on port " + PORT );
    }
View Full Code Here

public class Main
{

    public static void main( String[] args ) throws Exception
    {
        ServiceRegistry registry = new SimpleServiceRegistry();

        VmPipeAddress address = new VmPipeAddress( 8080 );

        // Set up server
        Service service = new Service( "tennis", TransportType.VM_PIPE, address );
        registry.bind( service, new TennisPlayer() );

        // Connect to the server.
        VmPipeConnector connector = new VmPipeConnector();
        ProtocolSession session = connector.connect( address,
                                                     new TennisPlayer() );

        // Send the first ping message
        session.write( new TennisBall( 10 ) );

        // Wait until the match ends.
        while( session.isConnected() )
        {
            Thread.sleep( 100 );
        }
       
        registry.unbind( service );
    }
View Full Code Here

    protected void setUp() throws Exception
    {
        if ( getName().equals( "testUsePassthru" ) )
        {
            registry = new SimpleServiceRegistry();
            super.extras.put( EnvKeys.PASSTHRU, registry );
        }

        super.setUp();
    }
View Full Code Here

        return buf.getHexDump();
    }

    protected void setUp() throws Exception
    {
        registry = new SimpleServiceRegistry();
       
        // Find an availble test port and bind to it.
        boolean socketBound = false;
        boolean datagramBound = false;
View Full Code Here

   
    private static final boolean USE_SSL = true;

    public static void main( String[] args ) throws Exception
    {
        ServiceRegistry registry = new SimpleServiceRegistry();
       
        // Add SSL filter if SSL is enabled.
        if( USE_SSL )
        {
            addSSLSupport( registry );
        }

        // Bind
        Service service = new Service( "http", TransportType.SOCKET, PORT );
        registry.bind( service, new HttpProtocolHandler() );

        System.out.println( "Listening on port " + PORT );
    }
View Full Code Here

public class Main
{

    public static void main( String[] args ) throws Exception
    {
        ServiceRegistry registry = new SimpleServiceRegistry();

        VmPipeAddress address = new VmPipeAddress( 8080 );

        // Set up server
        Service service = new Service( "tennis", TransportType.VM_PIPE, address );
        registry.bind( service, new TennisPlayer() );

        // Connect to the server.
        VmPipeConnector connector = new VmPipeConnector();
        ProtocolSession session = connector.connect( address,
                                                     new TennisPlayer() );

        // Send the first ping message
        session.write( new TennisBall( 10 ) );

        // Wait until the match ends.
        while( session.isConnected() )
        {
            Thread.sleep( 100 );
        }
       
        registry.unbind( service );
    }
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
    {
        ServiceRegistry registry = new SimpleServiceRegistry();
       
        // Add SSL filter if SSL is enabled.
        if( USE_SSL )
        {
            addSSLSupport( registry );
        }
       
        addLogger( registry );
       
        // Bind
        Service service = new Service( "echo", TransportType.SOCKET, PORT );
        registry.bind( service, new EchoProtocolHandler() );

        System.out.println( "Listening on port " + PORT );
    }
View Full Code Here

{
    private static final int PORT = 8080;

    public static void main( String[] args ) throws Exception
    {
        ServiceRegistry registry = new SimpleServiceRegistry();

        addLogger( registry );
        // Bind
        Service service = new Service( "reverse", TransportType.SOCKET, PORT );
        registry.bind( service, new ReverseProtocolProvider() );

        System.out.println( "Listening on port " + PORT );
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.registry.SimpleServiceRegistry$IoFilterChainBuilderWrapper

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.