Package org.apache.mina.transport.vmpipe

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


        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


        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

*/
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

    //-------------------------------------------------------------------------
    protected void setupVmProtocol(String uri) {
        boolean minaLogger = configuration.isMinaLogger();
        List<IoFilter> filters = configuration.getFilters();

        address = new VmPipeAddress(configuration.getPort());
        connector = new VmPipeConnector();

        // connector config
        if (minaLogger) {
            connector.getFilterChain().addLast("logger", new LoggingFilter());
View Full Code Here

    }

    @Test
    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

        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

*/
public class Main {

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

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

View Full Code Here

        }
    }

    protected MinaEndpoint createVmEndpoint(String uri, URI connectUri) {
        IoAcceptor acceptor = new VmPipeAcceptor();
        SocketAddress address = new VmPipeAddress(connectUri.getPort());
        IoConnector connector = new VmPipeConnector();
        return new MinaEndpoint(uri, this, address, acceptor, connector, null);
    }
View Full Code Here

      reqBuffer.flip();

      // Connect to the server.
      VmPipeConnector connector = new VmPipeConnector();
      IoHandler handler = new Handler(req, resp);
      ConnectFuture connectFuture = connector.connect(new VmPipeAddress(
          5080), handler);
      connectFuture.join();
      IoSession session = connectFuture.getSession();
      session.setAttachment(resp);
      session.write(reqBuffer);
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.