Examples of BorrowedThread


Examples of com.opengamma.engine.view.worker.SingleThreadViewProcessWorker.BorrowedThread

    resultListener.assertViewDefinitionCompiled(TIMEOUT);
    resultListener.assertCycleCompleted(TIMEOUT);

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    final SingleThreadViewProcessWorker worker = (SingleThreadViewProcessWorker) env.getCurrentWorker(viewProcess);
    final BorrowedThread recalcThread = worker.getThread();
    assertThreadReachesState(recalcThread, Thread.State.TIMED_WAITING);

    // We're now 'between cycles', waiting for the arrival of live data.
    // Interrupting should terminate the job gracefully
    worker.getJob().terminate();
    recalcThread.interrupt();

    recalcThread.join(TIMEOUT);
    assertEquals(Thread.State.TERMINATED, recalcThread.getState());
  }
View Full Code Here

Examples of com.opengamma.engine.view.worker.SingleThreadViewProcessWorker.BorrowedThread

    client.attachToViewProcess(env.getViewDefinition().getUniqueId(), executionOptions);

    resultListener.assertViewDefinitionCompiled(TIMEOUT);

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    final BorrowedThread recalcThread = ((SingleThreadViewProcessWorker) env.getCurrentWorker(viewProcess)).getThread();
    assertThreadReachesState(recalcThread, Thread.State.TIMED_WAITING);

    underlyingProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), 123d);
    underlyingProvider.addValue(ViewProcessorTestEnvironment.getPrimitive2(), 456d);
    recalcThread.join();
    resultListener.assertCycleCompleted(TIMEOUT);

    final Map<String, Object> resultValues = new HashMap<String, Object>();
    final ViewComputationResultModel result = client.getLatestResult();
    final ViewTargetResultModel targetResult = result.getTargetResult(ViewProcessorTestEnvironment.getPrimitiveTarget());
View Full Code Here

Examples of com.opengamma.engine.view.worker.SingleThreadViewProcessWorker.BorrowedThread

    resultListener.assertViewDefinitionCompiled(TIMEOUT);

    final ViewProcessImpl viewProcess = env.getViewProcess(vp, client.getUniqueId());
    final ViewProcessWorker currentWorker = env.getCurrentWorker(viewProcess);
    final BorrowedThread recalcThread = ((SingleThreadViewProcessWorker) currentWorker).getThread();
    assertThreadReachesState(recalcThread, Thread.State.TIMED_WAITING);

    // Cycle 1
    currentWorker.triggerCycle();
    resultListener.assertCycleCompleted(TIMEOUT);
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.