View Javadoc

1   package com.atlassian.scheduler.core;
2   
3   import com.atlassian.scheduler.JobRunnerRequest;
4   
5   /**
6    * Represents a particular instance of a running job.
7    * <p>
8    * This adds management capabilities to a job runner request.
9    * </p>
10   *
11   * @since v1.3
12   */
13  public interface RunningJob extends JobRunnerRequest {
14      /**
15       * Requests that the job be cancelled.
16       * <p>
17       * Calling this method changes the return value of {@link #isCancellationRequested()} permanently
18       * to {@code true}.  It has no other effect; in particular, it does not interrupt the thread that
19       * is running the job.  It is the responsibility of the job runner implementation to cooperatively
20       * check for an respond to the {@link #isCancellationRequested()} flag.
21       * </p>
22       */
23      void cancel();
24  }