com.norconex.jef
Interface IJob

All Known Subinterfaces:
IJobGroup
All Known Implementing Classes:
AbstractJob, AbstractJobGroup, AbstractResumableJob, AsyncJobGroup, AsyncLimitedJobGroup, SyncJobGroup, SystemCommandJob

public interface IJob

A job to be executed by the Job Execution Framework. Implementors are responsible for reporting job progress and errors in a uniform way. Great care should be taken to make every jobs recoverable.

Jobs are usually assembled together to form a JobSuite. Progress tracking, error handling, logging, etc., are all handled by job suites and implementors do not have to worry about these concerns when creating jobs.

To ensure the best integration possible with the framework, implementors are invited to adhere to the following practices:

Author:
Pascal Essiembre

Method Summary
 IJobContext createJobContext()
          Contextual information about the job to run.
 void execute(JobProgress progress, JobSuite suite)
          Executes this job.
 String getId()
          Gets the job unique identifier.
 void stop(IJobStatus progress, JobSuite suite)
          Stops this job.
 

Method Detail

createJobContext

IJobContext createJobContext()
Contextual information about the job to run. Cannot be null.

Returns:
job context

getId

String getId()
Gets the job unique identifier.

Returns:
job unique identifier

execute

void execute(JobProgress progress,
             JobSuite suite)
Executes this job. Implementors are responsible for updating execution progress on the given JobProgress.

Parameters:
progress - current job progress
suite - job suite this job is part of

stop

void stop(IJobStatus progress,
          JobSuite suite)
Stops this job. Implementors are responsible for terminating the execution of this job. The progress and other contextual information can be set, but the "status" should not be overwritten, as the framework will take care of assigning it.

Parameters:
progress - current job progress
suite - job suite this job is part of
Since:
2.0


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