Package org.apache.geronimo.network.protocol.control

Examples of org.apache.geronimo.network.protocol.control.ControlClientProtocolStack


            SelectorManager sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("Client Selector Manager");
            sm.doStart();

            ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
            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

            clientStack.push(ccp);

            clientStack.setup();

            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());

            Thread.sleep(5 * 1000);

            clientStack.drain();

            shutdownLatch.release();

            sm.doStop();

View Full Code Here


            SelectorManager sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("Client Selector Manager");
            sm.doStart();

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

            SocketProtocol sp = new SocketProtocol();
            sp.setTimeout(10 * 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(10 * 1000);

            clientStack.push(ccp);

            clientStack.setup();

            for (int i = 0; i < COUNT; i++) {
                clientStack.sendDown(getPlainPacket());
            }

            if (!completed.attempt(60 * 1000)) {
                throw new IllegalStateException("TIMEOUT");
            }

            clientStack.drain();

            shutdownLatch.release();

            sm.doStop();

View Full Code Here

            SelectorManager sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("Client Selector Manager");
            sm.doStart();

            ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
            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

            clientStack.push(ccp);

            clientStack.setup();
            Thread.sleep(5 * 1000); //todo delete

            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());

            Thread.sleep(5 * 1000); //todo back to 5s

            clientStack.drain();

            shutdownLatch.release();

            sm.doStop();

View Full Code Here

            SelectorManager sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("Client Selector Manager");
            sm.doStart();

            ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
            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

            clientStack.push(ccp);

            clientStack.setup();

            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());

            Thread.sleep(5 * 1000);

            clientStack.drain();

            shutdownLatch.release();

            sm.doStop();

View Full Code Here

            SelectorManager sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("Client Selector Manager");
            sm.doStart();

            ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
            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

            clientStack.push(ccp);

            clientStack.setup();

            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());

            Thread.sleep(5 * 1000);

            clientStack.drain();

            shutdownLatch.release();

            sm.doStop();

View Full Code Here

            SelectorManager sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("Client Selector Manager");
            sm.doStart();

            ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
            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

            clientStack.push(ccp);

            clientStack.setup();
            Thread.sleep(5 * 1000); //todo delete

            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());

            Thread.sleep(5 * 1000); //todo back to 5s

            clientStack.drain();

            shutdownLatch.release();

            sm.doStop();

View Full Code Here

TOP

Related Classes of org.apache.geronimo.network.protocol.control.ControlClientProtocolStack

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.