Examples of awaitUninterruptibly()


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

            // FutureTracker ft = nodes[300].addToTracker(trackerID, "test",
            // null, rc, tc);
            PeerTracker closest = findClosest(nodes, trackerID);
            FutureTracker ft = nodes[300].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
            ft.awaitUninterruptibly();
            Assert.assertEquals(true, ft.isSuccess());
            Thread.sleep(2000);
            tc = new TrackerConfiguration(1, 1, 0, 1);
            ft = nodes[301].getTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc)
View Full Code Here

Examples of net.tomp2p.nat.FutureNAT.awaitUninterruptibly()

            PeerNAT peerNAT = new PeerBuilderNAT(peer).start();
            PeerAddress masterNodeAddress = new PeerAddress(Number160.createHash(seedNodeId), seedNodeIP, seedNodePort,
                                                            seedNodePort);
            FutureDiscover futureDiscover = peer.discover().peerAddress(masterNodeAddress).start();
            FutureNAT futureNAT = peerNAT.startSetupPortforwarding(futureDiscover);
            futureNAT.awaitUninterruptibly();
            if (futureNAT.isSuccess()) {
                log.info("Automatic port forwarding is setup. Now we do a futureDiscover again. Address = " +
                                 futureNAT.peerAddress());
                futureDiscover = peer.discover().peerAddress(masterNodeAddress).start();
                futureDiscover.awaitUninterruptibly();
View Full Code Here

Examples of net.tomp2p.nat.FutureRelayNAT.awaitUninterruptibly()

            PeerAddress masterNodeAddress = new PeerAddress(Number160.createHash(seedNodeId), seedNodeIP, seedNodePort,
                                                            seedNodePort);
            FutureDiscover futureDiscover = peer.discover().peerAddress(masterNodeAddress).start();
            FutureNAT futureNAT = peerNAT.startSetupPortforwarding(futureDiscover);
            FutureRelayNAT futureRelayNAT = peerNAT.startRelay(futureDiscover, futureNAT);
            futureRelayNAT.awaitUninterruptibly();
            if (futureRelayNAT.isSuccess()) {
                log.info("Bootstrap using relay was successful. Address = " + peer.peerAddress());
                //cachedPeers.put(id, peer);
                return peer;
View Full Code Here

Examples of org.apache.mina.common.ConnectFuture.awaitUninterruptibly()

        connector.setHandler(new NetCatProtocolHandler());
        ConnectFuture cf = connector.connect(
                new InetSocketAddress(args[0], Integer.parseInt(args[1])));

        // Wait for the connection attempt to be finished.
        cf.awaitUninterruptibly();
        cf.getSession().getCloseFuture().awaitUninterruptibly();
       
        connector.dispose();
    }
}
View Full Code Here

Examples of org.apache.mina.common.WriteFuture.awaitUninterruptibly()

                // This will align message arrival order in connectionless transport types
                waitForResponse(handler, (i + 1) * DATA_SIZE);
            }
        }

        writeFuture.awaitUninterruptibly();

        waitForResponse(handler, DATA_SIZE * COUNT);

        // Assert data
        //// Please note that BufferOverflowException can be thrown
View Full Code Here

Examples of org.apache.mina.core.future.CloseFuture.awaitUninterruptibly()

        System.out.println("Disposing connector ... *finished*");

      }
    });

    closeFuture.awaitUninterruptibly();   
    acceptor.dispose(true);

    List threadsAfter = getThreadNames();

    System.out.println("threadsBefore = " + threadsBefore);
View Full Code Here

Examples of org.apache.mina.core.future.CloseFuture.awaitUninterruptibly()

        if ( ldapSession != null )
        {
            CloseFuture closeFuture = ldapSession.close( true );

            LOG.debug( "waiting for closeFuture" );
            closeFuture.awaitUninterruptibly();
            LOG.debug( "closeFuture done" );
            connected.set( false );
        }

        // Last, not least, reset the MessageId value
View Full Code Here

Examples of org.apache.mina.core.future.CloseFuture.awaitUninterruptibly()

        if ( ldapSession != null )
        {
            CloseFuture closeFuture = ldapSession.close( true );

            LOG.debug( "waiting for closeFuture" );
            closeFuture.awaitUninterruptibly();
            LOG.debug( "closeFuture done" );
            connected.set( false );
        }

        // Last, not least, reset the MessageId value
View Full Code Here

Examples of org.apache.mina.core.future.ConnectFuture.awaitUninterruptibly()

      log.debug("About to connect to the server... PORT: "+ClientConnectionBean.host);
     
      ConnectFuture connFuture = connector.connect(new InetSocketAddress(
                          ClientConnectionBean.host, port));
      log.debug("About to wait.");
      connFuture.awaitUninterruptibly();
      log.debug("Adding a future listener.");
      connFuture.addListener(new IoFutureListener<ConnectFuture>() {
        public void operationComplete(ConnectFuture future) {
          if (future.isConnected()) {
            log.debug("...connected");
View Full Code Here

Examples of org.apache.mina.core.future.ConnectFuture.awaitUninterruptibly()

        InetSocketAddress addr = new InetSocketAddress("localhost",
                AvailablePortFinder.getNextAvailable(20000));

        acceptor.bind(addr);
        ConnectFuture future = connector.connect(addr);
        future.awaitUninterruptibly();
        IoSession session = future.getSession();
        WriteFuture wf = session.write(IoBuffer.allocate(1))
                .awaitUninterruptibly();
        assertNotNull(wf.getException());
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.