com.norconex.jef
Class JobRunner

java.lang.Object
  extended by com.norconex.jef.JobRunner

public class JobRunner
extends Object

Responsible for managing the execution of a suite and its related jobs.

Author:
Pascal Essiembre

Constructor Summary
JobRunner()
           
 
Method Summary
static String getCurrentJobId()
          Gets the job identifier representing the currently running job for the current thread.
 boolean runSuite(JobSuite suite)
          Runs a job suite.
 boolean runSuite(JobSuite suite, boolean resumeIfIncomplete)
          Runs a job suite.
static void setCurrentJobId(String jobId)
          Sets a job identifier as the currently running job for the the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobRunner

public JobRunner()
Method Detail

runSuite

public final boolean runSuite(JobSuite suite)
Runs a job suite. If the execution of a suite has been stopped, in mid-process an exception will be thrown. Use the runSuite(JobSuite, boolean variant for resuming jobs.

Parameters:
suite - the job suite to run
Returns:
true if the suite ran successfully

runSuite

public final boolean runSuite(JobSuite suite,
                              boolean resumeIfIncomplete)
Runs a job suite.

Parameters:
suite - the job suite to run
resumeIfIncomplete - if true, stopped and aborted jobs jobs will be resumed
Returns:
true if the suite ran successfully

setCurrentJobId

public static void setCurrentJobId(String jobId)
Sets a job identifier as the currently running job for the the current thread. This method is called by the framework. Framework users may call this method when implementing their own threads to associated a job with the thread. Framework code may rely on this to behave as expected. Otherwise, it is best advised not to use this method.

Parameters:
jobId - job identifier

getCurrentJobId

public static String getCurrentJobId()
Gets the job identifier representing the currently running job for the current thread.

Returns:
job identifier or null if no job is currently associated with the current thread


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