Package org.apache.geronimo.network.protocol

Examples of org.apache.geronimo.network.protocol.SocketProtocol


            clientStack.setClassLoader(Thread.currentThread().getContextClassLoader());
            clientStack.setThreadPool(tp);
            clientStack.setClockPool(cp);
            clientStack.setSelectorManager(sm);

            SocketProtocol sp = new SocketProtocol();
            sp.setTimeout(1000 * 1000); //todo reset to 10s
            sp.setInterface(new InetSocketAddress(ssa.getConnectURI().getHost(), 0));
            sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
            sp.setSelectorManager(sm);

            clientStack.push(sp);

            ControlClientProtocol ccp = new ControlClientProtocol();
            ccp.setTimeout(1000 * 1000); //todo set to 10s
View Full Code Here


            sm.setThreadName("Server Selector Manager");
            sm.doStart();

            ControlServerProtocolStack templateStack = new ControlServerProtocolStack();

            SocketProtocol spt = new SocketProtocol();
            spt.setTimeout(10 * 1000);
            spt.setSelectorManager(sm);

            templateStack.push(spt);

            ControlServerProtocol csp = new ControlServerProtocol();
            csp.setTimeout(1 * 1000);
 
View Full Code Here

        sm.setThreadName("SM");
        sm.doStart();

        ControlServerProtocolStack templateStack = new ControlServerProtocolStack();

        SocketProtocol spt = new SocketProtocol();
        spt.setTimeout(10 * 1000);
        spt.setSelectorManager(sm);

        templateStack.push(spt);

        ControlServerProtocol csp = new ControlServerProtocol();
        csp.setTimeout(1 * 1000);
        csp.setThreadPool(tp);
        csp.setClockPool(cp);
        csp.setSelectorManager(sm);
        csp.setControlServerListener(new ControlServerListener() {
            public void shutdown() {
                log.trace("SERVER SIDE SHUTDOWN_REQ");
            }
        });

        templateStack.push(csp);

        ControlServerProtocolWaiter waiter = new ControlServerProtocolWaiter();

        TestProtocol test = new TestProtocol();
        test.setValue("SimpleTest");
        test.setThreadPool(tp);
        test.setClockPool(cp);
        test.setSelectorManager(sm);

        waiter.push(test);

        templateStack.push(waiter);

        templateStack.push(new TestCountingProtocol(completed));

        ProtocolFactory pf = new ProtocolFactory();
        pf.setClockPool(cp);
        pf.setMaxAge(Long.MAX_VALUE);
        pf.setMaxInactivity(1 * 60 * 60 * 1000);
        pf.setReclaimPeriod(10 * 1000);
        pf.setTemplate(templateStack);

        ServerSocketAcceptor ssa = new ServerSocketAcceptor();
        ssa.setSelectorManager(sm);
        ssa.setTimeOut(5 * 1000);
        ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
        ssa.setAcceptorListener(pf);
        ssa.startup();

        ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
        clientStack.setClassLoader(Thread.currentThread().getContextClassLoader());
        clientStack.setThreadPool(tp);
        clientStack.setClockPool(cp);
        clientStack.setSelectorManager(sm);

        SocketProtocol sp = new SocketProtocol();
        sp.setTimeout(15 * 1000);
        sp.setInterface(new InetSocketAddress(ssa.getConnectURI().getHost(), 0));
        sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
        sp.setSelectorManager(sm);

        clientStack.push(sp);

        ControlClientProtocol ccp = new ControlClientProtocol();
        ccp.setTimeout(15 * 1000);
 
View Full Code Here

        sm.setThreadName("SM");
        sm.doStart();

        ControlServerProtocolStack templateStack = new ControlServerProtocolStack();

        SocketProtocol spt = new SocketProtocol();
        spt.setTimeout(10 * 1000);
        spt.setSelectorManager(sm);

        templateStack.push(spt);

        ControlServerProtocol csp = new ControlServerProtocol();
        csp.setTimeout(1 * 1000);
        csp.setThreadPool(tp);
        csp.setClockPool(cp);
        csp.setSelectorManager(sm);
        csp.setControlServerListener(new ControlServerListener() {
            public void shutdown() {
                log.trace("SERVER SIDE SHUTDOWN_REQ");
            }
        });

        templateStack.push(csp);

        ControlServerProtocolWaiter waiter = new ControlServerProtocolWaiter();

        waiter.push(new CountingProtocol());

        TestProtocol test = new TestProtocol();
        test.setValue("SimpleTest");
        test.setThreadPool(tp);
        test.setClockPool(cp);
        test.setSelectorManager(sm);

        waiter.push(test);

        templateStack.push(waiter);

        ProtocolFactory pf = new ProtocolFactory();
        pf.setClockPool(cp);
        pf.setMaxAge(Long.MAX_VALUE);
        pf.setMaxInactivity(1 * 60 * 60 * 1000);
        pf.setReclaimPeriod(10 * 1000);
        pf.setTemplate(templateStack);

        ServerSocketAcceptor ssa = new ServerSocketAcceptor();
        ssa.setSelectorManager(sm);
        ssa.setTimeOut(5 * 1000);
        ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
        ssa.setAcceptorListener(pf);
        ssa.startup();

        ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
        clientStack.setClassLoader(Thread.currentThread().getContextClassLoader());
        clientStack.setThreadPool(tp);
        clientStack.setClockPool(cp);
        clientStack.setSelectorManager(sm);

        SocketProtocol sp = new SocketProtocol();
        sp.setTimeout(15 * 1000);
        sp.setInterface(new InetSocketAddress(ssa.getConnectURI().getHost(), 0));
        sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
        sp.setSelectorManager(sm);

        clientStack.push(sp);

        ControlClientProtocol ccp = new ControlClientProtocol();
        ccp.setTimeout(15 * 1000);
 
View Full Code Here

            clientStack.setClassLoader(Thread.currentThread().getContextClassLoader());
            clientStack.setThreadPool(tp);
            clientStack.setClockPool(cp);
            clientStack.setSelectorManager(sm);

            SocketProtocol sp = new SocketProtocol();
            sp.setTimeout(1000 * 1000); //todo reset to 10s
            sp.setInterface(new InetSocketAddress(ssa.getConnectURI().getHost(), 0));
            sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
            sp.setSelectorManager(sm);

            clientStack.push(sp);

            ControlClientProtocol ccp = new ControlClientProtocol();
            ccp.setTimeout(1000 * 1000); //todo set to 10s
View Full Code Here

            sm.setThreadName("Server Selector Manager");
            sm.doStart();

            ControlServerProtocolStack templateStack = new ControlServerProtocolStack();

            SocketProtocol spt = new SocketProtocol();
            spt.setTimeout(10 * 1000);
            spt.setSelectorManager(sm);

            templateStack.push(spt);

            ControlServerProtocol csp = new ControlServerProtocol();
            csp.setTimeout(1 * 1000);
 
View Full Code Here

        startLatch = new Latch();

/*
        ControlServerProtocolStack templateStack = new ControlServerProtocolStack();
*/
        SocketProtocol spt = new SocketProtocol();
        spt.setTimeout(30 * 1000);
        spt.setSelectorManager(sm);
/*
        templateStack.push(spt);

        ControlServerProtocol csp = new ControlServerProtocol();
        csp.setTimeout(30 * 1000);
 
View Full Code Here

        .getContextClassLoader());
    clientStack.setThreadPool(tp);
    clientStack.setClockPool(cp);
    clientStack.setSelectorManager(sm);
*/
        SocketProtocol sp = new SocketProtocol();
        sp.setTimeout(1000 * 30);
        if (localLocation != null) {
            sp.setInterface(new InetSocketAddress(InetAddress
                    .getByName(localLocation.getHost()), localLocation
                    .getPort()));
        }
        sp.setAddress(new InetSocketAddress(InetAddress
                .getByName(remoteLocation.getHost()), remoteLocation
                .getPort()));
        sp.setSelectorManager(sm);
/*
    clientStack.push(sp);
    ControlClientProtocol ccp = new ControlClientProtocol();
    ccp.setTimeout(1000 * 30);
    clientStack.push(ccp);
    clientStack.setup();
*/
//    init(clientStack);
        init(sp);
        sp.setup();
    }
View Full Code Here

        .getContextClassLoader());
    clientStack.setThreadPool(tp);
    clientStack.setClockPool(cp);
    clientStack.setSelectorManager(sm);
*/
        SocketProtocol sp = new SocketProtocol();
        sp.setTimeout(1000 * 30);
        if (localLocation != null) {
            sp.setInterface(new InetSocketAddress(InetAddress
                    .getByName(localLocation.getHost()), localLocation
                    .getPort()));
        }
        sp.setAddress(new InetSocketAddress(InetAddress
                .getByName(remoteLocation.getHost()), remoteLocation
                .getPort()));
        sp.setSelectorManager(sm);
/*
    clientStack.push(sp);
    ControlClientProtocol ccp = new ControlClientProtocol();
    ccp.setTimeout(1000 * 30);
    clientStack.push(ccp);
    clientStack.setup();
*/
//    init(clientStack);
        init(sp);
        sp.setup();
    }
View Full Code Here

        startLatch = new Latch();

/*
        ControlServerProtocolStack templateStack = new ControlServerProtocolStack();
*/
        SocketProtocol spt = new SocketProtocol();
        spt.setTimeout(30 * 1000);
        spt.setSelectorManager(sm);
/*
        templateStack.push(spt);

        ControlServerProtocol csp = new ControlServerProtocol();
        csp.setTimeout(30 * 1000);
 
View Full Code Here

TOP

Related Classes of org.apache.geronimo.network.protocol.SocketProtocol

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.