Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureResponse.awaitUninterruptibly()


            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingUDP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
            }
View Full Code Here


            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 1);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(false, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
            }
View Full Code Here

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(0, 1);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingTCP(recv1.peerBean().serverPeerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(false, fr.isSuccess());
            System.err.println("done:" + fr.failedReason());
            Assert.assertEquals(true, fr.failedReason().contains("/ timeout"));
           
        } finally {
View Full Code Here

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingUDP(recv1.peerBean().serverPeerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(false, fr.isSuccess());
        } finally {
            if (cc != null) {
                cc.shutdown().await();
            }
View Full Code Here

            FutureChannelCreator fcc = recv1.connectionBean().reservation().create(1, 0);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
            FutureResponse fr = handshake.pingUDP(recv1.peerBean().serverPeerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(false, fr.isSuccess());
            System.err.println("done:" + fr.failedReason());
            Assert.assertEquals(true, fr.failedReason().contains("/ timeout"));
        } finally {
            if (cc != null) {
View Full Code Here

            fcc.awaitUninterruptibly();
            ChannelCreator cc = fcc.channelCreator();
            FutureResponse fr = sender.pingRPC().pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            Utils.addReleaseListener(cc, fr);
            fr.awaitUninterruptibly();
            fr.awaitListeners();
            Assert.assertEquals(true, fr.isSuccess());
            FutureResponse fr2 = sender.pingRPC().pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr2.awaitUninterruptibly();
View Full Code Here

            fr.awaitUninterruptibly();
            fr.awaitListeners();
            Assert.assertEquals(true, fr.isSuccess());
            FutureResponse fr2 = sender.pingRPC().pingTCP(recv1.peerAddress(), cc,
                    new DefaultConnectionConfiguration());
            fr2.awaitUninterruptibly();
            fr2.awaitListeners();
            // we have released the reservation here
            // System.err.println(fr2.getFailedReason());
            Assert.assertEquals(false, fr2.isSuccess());
View Full Code Here

            dataMap.put(new Number160(22), new Data("testme"));
            FutureResponse futureResponse = peer1.getTaskRPC().sendTask(peer1.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId, dataMap, new MyWorker1(), null, false, false);
            Utils.addReleaseListenerAll(futureResponse, peer1.getConnectionBean().getConnectionReservation(),
                    futureChannelCreator.getChannelCreator());
            futureResponse.awaitUninterruptibly();
            Assert.assertEquals(true, futureResponse.isSuccess());
            Thread.sleep(1000);
        } finally {
            if (peer1 != null) {
                peer1.halt();
View Full Code Here

            Number160 taskId3 = new Number160(13);
            Map<Number160, Data> dataMap = new HashMap<Number160, Data>();
            dataMap.put(new Number160(22), new Data("testme"));
            FutureResponse futureResponse1 = peer1.getTaskRPC().sendTask(peer1.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId1, dataMap, new MyWorker2(), null, false, false);
            futureResponse1.awaitUninterruptibly();
            FutureResponse futureResponse2 = peer1.getTaskRPC().sendTask(peer1.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId2, dataMap, new MyWorker2(), null, false, false);
            futureResponse2.awaitUninterruptibly();
            FutureResponse futureResponse3 = peer1.getTaskRPC().sendTask(peer1.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId3, dataMap, new MyWorker2(), null, false, false);
View Full Code Here

            FutureResponse futureResponse1 = peer1.getTaskRPC().sendTask(peer1.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId1, dataMap, new MyWorker2(), null, false, false);
            futureResponse1.awaitUninterruptibly();
            FutureResponse futureResponse2 = peer1.getTaskRPC().sendTask(peer1.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId2, dataMap, new MyWorker2(), null, false, false);
            futureResponse2.awaitUninterruptibly();
            FutureResponse futureResponse3 = peer1.getTaskRPC().sendTask(peer1.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId3, dataMap, new MyWorker2(), null, false, false);
            futureResponse3.awaitUninterruptibly();
            Assert.assertEquals(true, futureResponse1.isSuccess());
            Assert.assertEquals(true, futureResponse2.isSuccess());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.