/** * 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); }
/** * 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); }
/** * 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); }
/** Marks job as finished and records job end time. */ public void done() { changeJobState(null, JobState.DONE); }