com.atlassian.scheduler.core
Class JobLauncher

java.lang.Object
  extended by com.atlassian.scheduler.core.JobLauncher

public class JobLauncher
extends Object

Scheduler implementations can (and should) use JobLauncher to invoke jobs when it is time to run them. It will do the necessary checks to make sure that the job runner is registered, has the appropriate run mode, can reconstruct the job's parameter map, and so on. If everything checks out, it calls the job runner's runJob method and records the the resulting RunDetails using addRunDetails.

Since:
v1.0

Field Summary
protected  Date firedAt
           
protected  JobId jobId
           
protected static org.slf4j.Logger LOG
           
protected  RunMode schedulerRunMode
           
protected  AbstractSchedulerService schedulerService
           
 
Constructor Summary
JobLauncher(AbstractSchedulerService schedulerService, RunMode schedulerRunMode, Date firedAt, JobId jobId)
          Creates a job launcher to handle the running of a scheduled job.
 
Method Summary
 void launch()
          Call this to validate the job, run it, and update its status.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final org.slf4j.Logger LOG

schedulerService

protected final AbstractSchedulerService schedulerService

schedulerRunMode

protected final RunMode schedulerRunMode

firedAt

protected final Date firedAt

jobId

protected final JobId jobId
Constructor Detail

JobLauncher

public JobLauncher(AbstractSchedulerService schedulerService,
                   RunMode schedulerRunMode,
                   Date firedAt,
                   JobId jobId)
Creates a job launcher to handle the running of a scheduled job.

Parameters:
schedulerService - the scheduler that is invoking the job
schedulerRunMode - the expected run mode for the jobs that this scheduler owns
firedAt - the time that the job was started, if known; may be null, in which case the current time is used
jobId - the job ID of the job to run
Method Detail

launch

public void launch()
Call this to validate the job, run it, and update its status.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 Atlassian. All Rights Reserved.