Package com.opengamma.util.async

Examples of com.opengamma.util.async.Cancelable.cancel()


    Cancelable job = jobDispatcher.dispatchJob(createTestJob(), result);
    assertNotNull(job);
    assertNull(result.getResult());
    final BlockingJobInvoker blockingInvoker = new BlockingJobInvoker(TIMEOUT);
    jobDispatcher.registerJobInvoker(blockingInvoker);
    assertTrue (job.cancel (false));
    assertTrue (blockingInvoker.isCancelled ());
  }

}
View Full Code Here


    final Cancelable handle = getCycle().getViewProcessContext().getComputationJobDispatcher().dispatchJob(job, this);
    executing.setCancel(handle);
    synchronized (this) {
      if (_executing == null) {
        // Completed or cancelled during the submission
        handle.cancel(true);
        return;
      }
      if (job.getTail() != null) {
        cancelableTailJobs(job, handle);
      }
View Full Code Here

    @Override
    public boolean cancel(final boolean mayInterruptedIfRunning) {
      Cancelable cancel = getCancel();
      if (cancel != null) {
        s_logger.debug("Cancelling {} for job {}", _cancel, _job);
        return cancel.cancel(mayInterruptedIfRunning);
      } else {
        return false;
      }
    }
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.