Examples of await()


Examples of org.hive2hive.core.network.data.futures.FutureRemoveListener.await()

  @Override
  public boolean remove(IParameters parameters) {
    FutureRemove futureRemove = removeUnblocked(parameters);
    FutureRemoveListener listener = new FutureRemoveListener(parameters, false, this);
    futureRemove.addListener(listener);
    return listener.await();
  }

  @Override
  public boolean removeVersion(IParameters parameters) {
    FutureRemove futureRemove = removeVersionUnblocked(parameters);
View Full Code Here

Examples of org.hive2hive.core.network.messages.futures.FutureDirectListener.await()

    FutureDirect futureDirect = networkManager.getConnection().getPeer()
        .sendDirect(message.getTargetAddress()).setObject(encryptedMessage).start();
    // attach a future listener to log, handle and notify events
    FutureDirectListener listener = new FutureDirectListener(message, targetPublicKey, this);
    futureDirect.addListener(listener);
    boolean success = listener.await();

    if (success) {
      logger.debug("Message (direct) sent. Message ID = '{}', Target address = '{}', Sender address = '{}'.",
          message.getMessageID(), message.getTargetAddress(), message.getSenderAddress());
    } else {
View Full Code Here

Examples of org.hive2hive.core.network.messages.futures.FutureRoutedListener.await()

        .setRequestP2PConfiguration(createSendingConfiguration()).start();

    // attach a future listener to log, handle and notify events
    FutureRoutedListener listener = new FutureRoutedListener(message, targetPublicKey, this);
    futureSend.addListener(listener);
    boolean success = listener.await();

    if (success) {
      logger.debug("Message sent. Target key = '{}', Message ID = '{}'.",
          message.getTargetKey(), message.getMessageID());
    } else {
View Full Code Here

Examples of org.hive2hive.core.processes.framework.concretes.SequentialProcess.await()

   
    // succeeding process
    SequentialProcess process = new SequentialProcess();
    process.add(new BusySucceedingStep());
    process.start();
    process.await();
    if (process.getState() != ProcessState.SUCCEEDED)
      fail("Busy process should have finished. Await() did not block.");
    TestUtil.wait(TestUtil.DEFAULT_WAITING_TIME);
    assertTrue(process.getState() == ProcessState.SUCCEEDED);
   
View Full Code Here

Examples of org.hive2hive.core.processes.framework.decorators.AsyncComponent.await()

    // succeeding process
    SequentialProcess process = new SequentialProcess();
    process.add(new BusySucceedingStep());
    AsyncComponent asyncProcess = new AsyncComponent(process);
    asyncProcess.start();
    asyncProcess.await();
    if (asyncProcess.getState() != ProcessState.SUCCEEDED)
      fail("Busy process should have finished. Await() did not block.");
    TestUtil.wait(TestUtil.DEFAULT_WAITING_TIME);
    assertTrue(asyncProcess.getState() == ProcessState.SUCCEEDED);
   
View Full Code Here

Examples of org.hive2hive.core.processes.framework.interfaces.IProcessComponent.await()

      try {
        logger.debug("Starting to delete buffered file {}.", toDelete);
        IProcessComponent delete = fileManager.delete(toDelete);
        if (!fileManager.isAutostart())
          delete.start();
        delete.await(MAX_DELETION_PROCESS_DURATION_MS);
      } catch (NoSessionException | NoPeerConnectionException | InvalidProcessStateException
          | InterruptedException e) {
        logger.error(e.getMessage());
      }
    }
View Full Code Here

Examples of org.hornetq.utils.Future.await()

   {
      Future future = new Future();

      executor.execute(future);

      boolean ok = future.await(10000);

      if (!ok)
      {
         log.warn("Couldn't finish waiting executors. Try increasing the thread pool size");
      }
View Full Code Here

Examples of org.hornetq.utils.FutureLatch.await()

   {
      FutureLatch future = new FutureLatch();

      executor.execute(future);

      while (!future.await(10000))
      {
         HornetQServerLogger.LOGGER.timedOutStoppingPagingCursor(future, executor);
      }
   }
View Full Code Here

Examples of org.hornetq.utils.ReusableLatch.await()

         Assert.assertEquals(i, latch.getCount());
         latch.countDown();
         Assert.assertEquals(i - 1, latch.getCount());
      }

      latch.await();
   }

   /**
    *
    * This test will open numberOfThreads threads, and add numberOfAdds on the
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.await()

      log.debugf("Data on node %s: %s", address(1), cache(1).keySet());
      log.debugf("Data on node %s: %s", address(2), cache(2).keySet());

      // Now that we know which node to kill, allow the START_STATE_TRANSFER command to proceed.
      // The corresponding StateResponseCommand will be blocked on cache 0
      checkPoint.await("IN_START_STATE_TRANSFER_" + address(liveNode), 1, SECONDS);
      checkPoint.trigger("OUT_START_STATE_TRANSFER_" + address(liveNode));

      // Kill cache cacheToStop to force a topology update.
      // The topology update will remove the transfers from cache(nodeToKill).
      cache(nodeToKill).stop();
View Full Code Here
TOP
Copyright © 2015 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.