Package org.hive2hive.core

Examples of org.hive2hive.core.H2HWaiter


    // send message
    assertTrue(nodeA.getMessageManager().send(message, getPublicKey(nodeB)));

    // wait till message gets handled
    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);
View Full Code Here


    // send message
    assertTrue(nodeA.getMessageManager().send(message, getPublicKey(nodeB)));

    // wait till message gets handled
    // this might need some time
    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeB.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);
View Full Code Here

    // send message
    assertTrue(nodeA.getMessageManager().send(message, getPublicKey(nodeB)));

    // wait till callback handler gets executed
    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);
View Full Code Here

    // send message
    assertTrue(nodeA.getMessageManager().send(message, getPublicKey(nodeB)));

    // wait till callback handler gets executed
    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);
View Full Code Here

    // send message
    assertTrue(nodeA.getMessageManager().sendDirect(message, getPublicKey(nodeB)));

    // wait till callback handler gets executed
    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);
View Full Code Here

    // send message
    assertTrue(nodeA.getMessageManager().sendDirect(message, getPublicKey(nodeB)));

    // wait till callback handler gets executed
    H2HWaiter w = new H2HWaiter(10);
    FutureGet futureGet = null;
    do {
      w.tickASecond();
      futureGet = nodeB.getDataManager().getUnblocked(
          new Parameters().setLocationKey(nodeA.getNodeId()).setContentKey(contentKey));
      futureGet.awaitUninterruptibly();
    } while (futureGet.getData() == null);
View Full Code Here

   *            the file to synchronize
   * @param appearing
   *            <code>true</code> if file should appear, <code>false</code> if file should disappear
   */
  private static void waitTillSynchronized(File synchronizingFile, boolean appearing) {
    H2HWaiter waiter = new H2HWaiter(40);
    if (appearing) {
      do {
        waiter.tickASecond();
      } while (!synchronizingFile.exists());
    } else {
      do {
        waiter.tickASecond();
      } while (synchronizingFile.exists());
    }
  }
View Full Code Here

   *
   * @param synchronizingFile
   *            the file to synchronize
   */
  private static void waitTillSynchronized(File synchronizingFile) {
    H2HWaiter waiter = new H2HWaiter(40);
    do {
      waiter.tickASecond();
    } while (!synchronizingFile.exists());
  }
View Full Code Here

   *            the file to synchronize
   * @param appearing
   *            <code>true</code> if file should appear, <code>false</code> if file should disappear
   */
  private static void waitTillSynchronizedAdding(File synchronizingFile) {
    H2HWaiter waiter = new H2HWaiter(40);
    do {
      waiter.tickASecond();
    } while (!synchronizingFile.exists());
  }
View Full Code Here

   *            the file to synchronize
   * @param appearing
   *            <code>true</code> if file should appear, <code>false</code> if file should disappear
   */
  private static void waitTillSynchronizedUpdating(File updatingFile, long lastModified) {
    H2HWaiter waiter = new H2HWaiter(40);
    do {
      waiter.tickASecond();
    } while (updatingFile.lastModified() == lastModified);
  }
View Full Code Here

TOP

Related Classes of org.hive2hive.core.H2HWaiter

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.