com.norconex.jef
Class AbstractResumableJob

java.lang.Object
  extended by com.norconex.jef.AbstractResumableJob
All Implemented Interfaces:
IJob

public abstract class AbstractResumableJob
extends Object
implements IJob

Convenience class separating normal execution from recovery. If the job is starting clean, the startExecution method will get invoked. Else, provided that there is already progress on a starting job and the job is incomplete (i.e. failure), the resumeExecution method will be invoked.

Typical usage of this class might be when extra (or different) steps need to be undertaken when resuming a job. Otherwise, there may be no benefits to using this class over a straight implementation of IJob.

Author:
Pascal Essiembre

Constructor Summary
AbstractResumableJob()
          Constructor.
 
Method Summary
 void execute(JobProgress progress, JobSuite suite)
          Executes this job.
protected abstract  void resumeExecution(JobProgress progress, JobSuite suite)
          Resumes the execution of a job.
protected abstract  void startExecution(JobProgress progress, JobSuite suite)
          Starts the execution of a job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.norconex.jef.IJob
createJobContext, getId, stop
 

Constructor Detail

AbstractResumableJob

public AbstractResumableJob()
Constructor.

Method Detail

execute

public final void execute(JobProgress progress,
                          JobSuite suite)
Description copied from interface: IJob
Executes this job. Implementors are responsible for updating execution progress on the given JobProgress.

Specified by:
execute in interface IJob
Parameters:
progress - current job progress
suite - job suite this job is part of

startExecution

protected abstract void startExecution(JobProgress progress,
                                       JobSuite suite)
Starts the execution of a job.

Parameters:
progress - job progress
suite - job suite

resumeExecution

protected abstract void resumeExecution(JobProgress progress,
                                        JobSuite suite)
Resumes the execution of a job.

Parameters:
progress - job progress
suite - job suite


Copyright © 2007-2013 Norconex Inc.. All Rights Reserved.