code: protected void jobFinished(Throwable error)
      {
          this.lock.lock();
  
          try {
              if (this.status instanceof AbstractJobStatus) {
                  // Store error
                  ((AbstractJobStatus) this.status).setError(error);
              }
  
              // Give a chance to any listener to do custom action associated to the job
              this.observationManager.notify(new JobFinishingEvent(getRequest().getId(), getType(), this.request), this,
                  error);
  
              if (getRequest().isVerbose()) {
                  if (getStatus().getRequest().getId() != null) {
                      this.logger.info(LOG_END_ID, "Finished job of type [{}] with identifier [{}]", getType(),
                          getStatus().getRequest().getId());
                  } else {
                      this.logger.info(LOG_END, "Finished job of type [{}]", getType());
                  }
              }
  
              if (this.status instanceof AbstractJobStatus) {
                  // Indicate when the job ended
                  ((AbstractJobStatus) this.status).setEndDate(new Date());
  
                  // Stop updating job status (progress, log, etc.)
                  ((AbstractJobStatus) this.status).stopListening();
  
                  // Update job state
                  ((AbstractJobStatus) this.status).setState(JobStatus.State.FINISHED);
              }
  
              // Release threads waiting for job being done
              this.finishedCondition.signalAll();
  
              // Remove the job from the current jobs context
              this.jobContext.popCurrentJob();
  
              // Store the job status
              try {
                  if (this.request.getId() != null) {
                      this.store.storeAsync(this.status);
                  }
              } catch (Throwable t) {
                  this.logger.warn(LOG_STATUS_STORE_FAILED, "Failed to store job status [{}]", this.status, t);
              }
          } finally {
              this.lock.unlock();
  
              // Notify listener that job is fully finished
              this.observationManager.notify(new JobFinishedEvent(getRequest().getId(), getType(), this.request), this,
                  error);
          }
      }
docs: Called when the job is done.
  
  @param error the exception throw during execution of the job