Package net.tomp2p.futures

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


            dataMap.put(new Number160(22), new Data("testme"));
            FutureAsyncTask futureAsyncTask = peer1.getAsyncTask().submit(peer2.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId, dataMap, new MyWorker3(), false, false);
            Utils.addReleaseListenerAll(futureAsyncTask, peer1.getConnectionBean().getConnectionReservation(),
                    futureChannelCreator.getChannelCreator());
            futureAsyncTask.awaitUninterruptibly();
            Assert.assertEquals(true, futureAsyncTask.isSuccess());
            Assert.assertEquals("yup", futureAsyncTask.getDataMap().get(Number160.ONE).getObject());
        } catch (Throwable t) {
            t.printStackTrace();
        } finally {
View Full Code Here


            FutureAsyncTask futureAsyncTask = peer1.getAsyncTask().submit(peer2.getPeerAddress(),
                    futureChannelCreator.getChannelCreator(), taskId, dataMap, new MyWorker3(), false, false);
            Utils.addReleaseListenerAll(futureAsyncTask, peer1.getConnectionBean().getConnectionReservation(),
                    futureChannelCreator.getChannelCreator());
            peer2.halt();
            futureAsyncTask.awaitUninterruptibly();
            Assert.assertEquals(false, futureAsyncTask.isSuccess());
        } finally {
            if (peer1 != null) {
                peer1.halt();
            }
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.