Package com.opengamma.engine.view.worker

Examples of com.opengamma.engine.view.worker.ViewProcessWorker.join()


    // Interrupting should cause everything to terminate gracefully
    ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    ViewProcessWorker worker = env.getCurrentWorker(viewProcess);
    worker.terminate();
    worker.join(TIMEOUT);
    for (int i = 0; (i < TIMEOUT / 10) && !executor.wasInterrupted(); i++) {
      Thread.sleep(10);
    }
    assertTrue(executor.wasInterrupted());
  }
View Full Code Here


  private void waitForCompletionAndShutdown(final ViewProcessorImpl vp, final ViewClient client, final ViewProcessorTestEnvironment env) throws InterruptedException {
    client.waitForCompletion();
    // Note: notification of client completion happens before the client computation thread terminates and performs its postRunCycle - must wait for this to happen
    final ViewProcessWorker worker = env.getCurrentWorker(env.getViewProcess(vp, client.getUniqueId()));
    client.shutdown();
    worker.join();
  }

  @Test
  public void testSuspend_viewExists() throws InterruptedException, ExecutionException {
    final ViewProcessorTestEnvironment env = new ViewProcessorTestEnvironment();
View Full Code Here

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    final ViewProcessWorker worker = env.getCurrentWorker(viewProcess);

    client.shutdown();
    worker.join();

    assertEquals(0, vp.getViewCycleManager().getResourceCount());
  }

  @Test
View Full Code Here

      s_logger.debug("Suspending calculation job");
      setWorker(null);
      worker.terminate();
      try {
        s_logger.debug("Waiting for calculation thread(s) to finish");
        worker.join();
      } catch (final InterruptedException e) {
        s_logger.warn("Interrupted waiting for calculation thread(s)");
        throw new OpenGammaRuntimeException("Couldn't suspend view process", e);
      }
    }
View Full Code Here

    assertFalse(viewProcess1 == viewProcess2);
    assertTrue(worker1.join(TIMEOUT));

    vp.stop();

    assertTrue(worker2.join(TIMEOUT));
  }

  //-------------------------------------------------------------------------
  @Test
  public void testSetMinimumLogMode() throws InterruptedException {
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.