Package com.opengamma.engine.view.worker

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


    assertFalse(executor.wasInterrupted());

    // 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


    lock();
    final ViewProcessWorker worker = getWorker();
    if (worker != null) {
      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)");
View Full Code Here

      return;
    }
    if (_viewDefinitionChangeListener != null) {
      getProcessContext().getConfigSource().changeManager().removeChangeListener(_viewDefinitionChangeListener);
    }
    worker.terminate();
    // Let go of the worker and allow it to die on its own. A computation cycle might be taking place, but it will
    // not update the view process with its result because it has been terminated. As far as the view process is
    // concerned, live computation has now stopped, and it may be started again immediately in a new thread.
    // There is no need to slow things down by attempting to join the job.
    setWorker(null);
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.