示例#1
0
 /**
  * Signal exceptional cancellation of this job.
  *
  * @param ex exception causing the termination of job.
  */
 public void failed(Throwable ex) {
   StringWriter sw = new StringWriter();
   PrintWriter pw = new PrintWriter(sw);
   ex.printStackTrace(pw);
   String stackTrace = sw.toString();
   changeJobState(
       "Got exception '" + ex.getClass() + "', with msg '" + ex.getMessage() + "'\n" + stackTrace,
       JobState.FAILED);
   // if(_fjtask != null && !_fjtask.isDone()) _fjtask.completeExceptionally(ex);
 }
示例#2
0
 /**
  * Signal exceptional cancellation of this job.
  *
  * @param msg cancellation message explaining reason for cancellation
  */
 public void cancel(final String msg) {
   changeJobState(msg, msg == null ? JobState.CANCELLED : JobState.FAILED);
 }
示例#3
0
 /**
  * Signal cancellation of this job.
  *
  * <p>The job will be switched to state {@link JobState#CANCELLED} which signals that the job was
  * cancelled by a user.
  */
 public void cancel() {
   changeJobState(null, JobState.CANCELLED);
 }
示例#4
0
 /** Marks job as finished and records job end time. */
 public void done() {
   changeJobState(null, JobState.DONE);
 }