Package org.apache.mina.transport.vmpipe

Examples of org.apache.mina.transport.vmpipe.VmPipeAddress


{

    public static void main( String[] args ) throws Exception
    {
        IoAcceptor acceptor = new VmPipeAcceptor();
        VmPipeAddress address = new VmPipeAddress( 8080 );

        // Set up server
        acceptor.bind( address, new TennisPlayer() );

        // Connect to the server.
View Full Code Here


        {
            s = s.substring( 1 );
        }
        try
        {
            return new VmPipeAddress( Integer.parseInt( s.trim() ) );
        }
        catch( NumberFormatException nfe )
        {
            throw new IllegalArgumentException( "Illegal vm pipe address: " + s );
        }
View Full Code Here

        return ":0";
    }

    @Override
    protected Object defaultValue() {
        return new VmPipeAddress(0);
    }
View Full Code Here

    protected Object toValue(String text) throws IllegalArgumentException {
        if (text.startsWith(":")) {
            text = text.substring(1);
        }
        try {
            return new VmPipeAddress(Integer.parseInt(text.trim()));
        } catch (NumberFormatException nfe) {
            throw new IllegalArgumentException("Illegal VmPipeAddress: " + text);
        }
    }
View Full Code Here

        editor = new VmPipeAddressEditor();
    }

    public void testSetAsTextWithLegalValues() throws Exception {
        editor.setAsText("1");
        assertEquals(new VmPipeAddress(1), editor.getValue());
        editor.setAsText(":10");
        assertEquals(new VmPipeAddress(10), editor.getValue());
        editor.setAsText(":100");
        assertEquals(new VmPipeAddress(100), editor.getValue());
    }
View Full Code Here

    }
   
    public void testSetAsTextWithLegalValues() throws Exception
    {
        editor.setAsText( "1" );
        assertEquals( new VmPipeAddress( 1 ), editor.getValue() );
        editor.setAsText( ":10" );
        assertEquals( new VmPipeAddress( 10 ), editor.getValue() );
        editor.setAsText( ":100" );
        assertEquals( new VmPipeAddress( 100 ), editor.getValue() );
    }
View Full Code Here

        {
            s = s.substring( 1 );
        }
        try
        {
            return new VmPipeAddress( Integer.parseInt( s.trim() ) );
        }
        catch( NumberFormatException nfe )
        {
            throw new IllegalArgumentException( "Illegal vm pipe address: " + s );
        }
View Full Code Here

        boolean minaLogger = configuration.isMinaLogger();
        boolean sync = configuration.isSync();
        List<IoFilter> filters = configuration.getFilters();

        IoAcceptor acceptor = new VmPipeAcceptor();
        SocketAddress address = new VmPipeAddress(configuration.getPort());
        IoConnector connector = new VmPipeConnector();

        // connector config
        configureCodecFactory("MinaProducer", connector.getDefaultConfig(), configuration);
        if (minaLogger) {
View Full Code Here

*/
public class Main {

    public static void main(String[] args) throws Exception {
        IoAcceptor acceptor = new VmPipeAcceptor();
        VmPipeAddress address = new VmPipeAddress(8080);

        // Set up server
        acceptor.bind(address, new TennisPlayer());

        // Connect to the server.
View Full Code Here

        s = s.trim();
        if (s.startsWith(":")) {
            s = s.substring(1);
        }
        try {
            return new VmPipeAddress(Integer.parseInt(s.trim()));
        } catch (NumberFormatException nfe) {
            throw new IllegalArgumentException("Illegal vm pipe address: " + s);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.transport.vmpipe.VmPipeAddress

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.