예제 #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);
 }