Package org.apache.geronimo.network.protocol

Examples of org.apache.geronimo.network.protocol.ProtocolFactory$AcceptedCallBack


        CallbackSocketProtocol spt = new CallbackSocketProtocol();
        // TODO configurable.
        spt.setTimeout(1000);
        spt.setSelectorManager(selectorManager);

        ProtocolFactory pf = new ProtocolFactory();
        pf.setClockPool(clockPool);
        // TODO configurable.
        pf.setMaxAge(Long.MAX_VALUE);
        pf.setMaxInactivity(1 * 60 * 60 * 1000);
        pf.setReclaimPeriod(500);
        pf.setTemplate(spt);
        pf.setAcceptedCallBack(this);

        serverSocketAcceptor.setAcceptorListener(pf);
        serverSocketAcceptor.setReuseAddress(true);
       
        try {
View Full Code Here


            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);

            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();

            startLatch.release();

            shutdownLatch.acquire();

            ssa.drain();

            pf.drain();

            sm.doStop();

            cp.doStop();

View Full Code Here

        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);

        clientStack.push(ccp);

        clientStack.setup();

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

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

        clientStack.drain();

        ssa.drain();

        pf.drain();

        sm.doStop();

        cp.doStop();

View Full Code Here

        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);

        clientStack.push(ccp);

        clientStack.setup();

        clientStack.sendDown(getDatagramPacket());
        clientStack.sendDown(getDatagramPacket());
        clientStack.sendDown(getDatagramPacket());

        Thread.sleep(5 * 1000);

        clientStack.drain();

        Thread.sleep(5 * 1000);

        ssa.drain();

        pf.drain();

        sm.doStop();

        cp.doStop();

View Full Code Here

            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);

            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();

            startLatch.release();

            shutdownLatch.acquire();

            ssa.drain();

            pf.drain();

            sm.doStop();

            cp.doStop();

View Full Code Here

        CallbackSocketProtocol spt = new CallbackSocketProtocol();
        // TODO configurable.
        spt.setTimeout(1000);
        spt.setSelectorManager(selectorManager);

        ProtocolFactory pf = new ProtocolFactory();
        pf.setClockPool(clockPool);
        // TODO configurable.
        pf.setMaxAge(Long.MAX_VALUE);
        pf.setMaxInactivity(1 * 60 * 60 * 1000);
        pf.setReclaimPeriod(500);
        pf.setTemplate(spt);
        pf.setAcceptedCallBack(this);

        serverSocketAcceptor.setAcceptorListener(pf);
        serverSocketAcceptor.setReuseAddress(true);
       
        try {
View Full Code Here

        ControlServerProtocolWaiter waiter = new ControlServerProtocolWaiter();
        waiter.push(new CountingProtocol());
        templateStack.push(waiter);
*/

        pf = new ProtocolFactory();
        pf.setClockPool(cp);
        pf.setMaxAge(Long.MAX_VALUE);
        pf.setMaxInactivity(Long.MAX_VALUE);
        //pf.setReclaimPeriod(Long.MAX_VALUE);
        pf.setReclaimPeriod(10 * 1000);
 
View Full Code Here

        ControlServerProtocolWaiter waiter = new ControlServerProtocolWaiter();
        waiter.push(new CountingProtocol());
        templateStack.push(waiter);
*/

        pf = new ProtocolFactory();
        pf.setClockPool(cp);
        pf.setMaxAge(Long.MAX_VALUE);
        pf.setMaxInactivity(Long.MAX_VALUE);
        //pf.setReclaimPeriod(Long.MAX_VALUE);
        pf.setReclaimPeriod(10 * 1000);
 
View Full Code Here

            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);

            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();

            startLatch.release();

            shutdownLatch.acquire();

            ssa.drain();

            pf.drain();

            sm.doStop();

            cp.doStop();

View Full Code Here

        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);

        clientStack.push(ccp);

        clientStack.setup();

        clientStack.sendDown(getDatagramPacket());
        clientStack.sendDown(getDatagramPacket());
        clientStack.sendDown(getDatagramPacket());

        Thread.sleep(5 * 1000);

        clientStack.drain();

        Thread.sleep(5 * 1000);

        ssa.drain();

        pf.drain();

        sm.doStop();

        cp.doStop();

View Full Code Here

TOP

Related Classes of org.apache.geronimo.network.protocol.ProtocolFactory$AcceptedCallBack

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.