@Transactional public class SchedulerServiceImpl extends Object implements SchedulerService
Modifier and Type | Field and Description |
---|---|
protected org.kuali.rice.core.api.datetime.DateTimeService |
dateTimeService |
protected Map<String,JobDescriptor> |
externalizedJobDescriptors
Holds a list of job name to job descriptor mappings for those jobs that are externalized (i.e.
|
protected static String |
HARD_DEPENDENCY_CODE |
protected JobListener |
jobListener |
protected static List<String> |
jobStatuses |
protected org.kuali.rice.coreservice.framework.parameter.ParameterService |
parameterService |
protected org.quartz.Scheduler |
scheduler |
protected static String |
SOFT_DEPENDENCY_CODE |
CANCELLED_JOB_STATUS_CODE, FAILED_JOB_STATUS_CODE, JOB_STATUS_PARAMETER, PENDING_JOB_STATUS_CODE, RUNNING_JOB_STATUS_CODE, SCHEDULE_JOB_NAME, SCHEDULED_GROUP, SCHEDULED_JOB_STATUS_CODE, SUCCEEDED_JOB_STATUS_CODE, UNSCHEDULED_GROUP
Constructor and Description |
---|
SchedulerServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addJob(org.quartz.JobDetail jobDetail) |
void |
addScheduled(org.quartz.JobDetail job)
Adds the given job to the "scheduled" group.
|
protected void |
addTrigger(org.quartz.Trigger trigger) |
void |
addUnscheduled(org.quartz.JobDetail job)
Adds the given job to the "unscheduled" group.
|
protected void |
dropDependenciesNotScheduled()
Remove dependencies that are not scheduled.
|
BatchJobStatus |
getJob(String groupName,
String jobName)
Gets a single job based on its name and group.
|
protected Map<String,String> |
getJobDependencies(String jobName) |
protected List<String> |
getJobNamesForScheduleJob() |
List<BatchJobStatus> |
getJobs()
Get all jobs known to the scheduler wrapped within a BusinessObject-derived class.
|
List<BatchJobStatus> |
getJobs(String groupName) |
List<String> |
getJobStatuses()
Returns a list of all possible statuses.
|
Date |
getNextStartTime(BatchJobStatus job)
Returns the next start time for the given job.
|
Date |
getNextStartTime(String groupName,
String jobName)
Returns the next start time for the given job.
|
List<org.quartz.JobExecutionContext> |
getRunningJobs()
Returns the list of job currently running within the scheduler.
|
protected org.quartz.JobDetail |
getScheduledJobDetail(String jobName) |
List<String> |
getSchedulerGroups()
Returns a list of all groups defined in the scheduler.
|
String |
getStatus(org.quartz.JobDetail jobDetail) |
boolean |
hasIncompleteJob()
This method checks whether any jobs in the SCHEDULED job group are pending or currently scheduled.
|
void |
initialize() |
void |
initializeJob(String jobName,
Job job) |
protected void |
initializeJobsForModule(org.kuali.rice.krad.service.ModuleService moduleService)
Initializes all of the jobs into Quartz for the given ModuleService
|
protected void |
initializeTriggersForModule(org.kuali.rice.krad.service.ModuleService moduleService)
Loops through all the triggers associated with the given module service, adding each trigger to Quartz
|
void |
interruptJob(String jobName)
Requests that the given job be stopped as soon as possble.
|
protected boolean |
isCancelled(org.quartz.JobDetail jobDetail) |
protected boolean |
isDependencySatisfiedNegatively(org.quartz.JobDetail dependentJobDetail,
org.quartz.JobDetail dependencyJobDetail) |
protected boolean |
isDependencySatisfiedPositively(org.quartz.JobDetail dependentJobDetail,
org.quartz.JobDetail dependencyJobDetail) |
protected boolean |
isFailed(org.quartz.JobDetail jobDetail) |
protected boolean |
isIncomplete(org.quartz.JobDetail scheduledJobDetail) |
boolean |
isJobRunning(String jobName)
Tests whether the referenced job name is running, regardless of group.
|
boolean |
isPastScheduleCutoffTime()
This method should be used to determine when the daily batch schedule should terminate.
|
protected boolean |
isPastScheduleCutoffTime(Calendar dateTime,
boolean log) |
protected boolean |
isPending(org.quartz.JobDetail jobDetail) |
protected boolean |
isScheduled(org.quartz.JobDetail jobDetail) |
protected boolean |
isSoftDependency(String dependentJobName,
String dependencyJobName) |
protected boolean |
isSucceeded(org.quartz.JobDetail jobDetail) |
protected void |
loadJob(JobDescriptor jobDescriptor) |
void |
logScheduleResults() |
void |
processWaitingJobs() |
void |
reinitializeScheduledJobs() |
void |
removeScheduled(String jobName)
Removes a job from the scheduled group.
|
protected JobDescriptor |
retrieveJobDescriptor(String jobName) |
void |
runJob(String jobName,
int startStep,
int stopStep,
Date startTime,
String requestorEmailAddress)
Immediately runs the specified job.
|
void |
runJob(String jobName,
String requestorEmailAddress)
Immediately runs the specified job.
|
void |
runJob(String groupName,
String jobName,
int startStep,
int stopStep,
Date jobStartTime,
String requestorEmailAddress) |
void |
runStep(String groupName,
String jobName,
String stepName,
Date startTime,
String requestorEmailAddress) |
protected void |
scheduleJob(String groupName,
String jobName,
int startStep,
int endStep,
Date startTime,
String requestorEmailAddress,
Map<String,String> additionalJobData) |
void |
setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.
|
void |
setJobListener(JobListener jobListener)
Sets the jobListener attribute value.
|
void |
setKualiModuleService(org.kuali.rice.krad.service.KualiModuleService moduleService)
Sets the moduleService attribute value.
|
void |
setMailService(org.kuali.rice.krad.service.MailService mailService) |
void |
setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService) |
void |
setScheduler(org.quartz.Scheduler scheduler)
Sets the scheduler attribute value.
|
protected boolean |
shouldCancelJob(org.quartz.JobDetail jobDetail) |
boolean |
shouldNotRun(org.quartz.JobDetail jobDetail) |
protected boolean |
shouldScheduleJob(org.quartz.JobDetail jobDetail) |
void |
updateStatus(org.quartz.JobDetail jobDetail,
String jobStatus) |
protected void |
updateStatus(String groupName,
String jobName,
String jobStatus) |
protected static final String SOFT_DEPENDENCY_CODE
protected static final String HARD_DEPENDENCY_CODE
protected org.quartz.Scheduler scheduler
protected JobListener jobListener
protected org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService
protected org.kuali.rice.core.api.datetime.DateTimeService dateTimeService
protected Map<String,JobDescriptor> externalizedJobDescriptors
protected static final List<String> jobStatuses
public SchedulerServiceImpl()
public void initialize()
initialize
in interface SchedulerService
SchedulerService.initialize()
protected void initializeJobsForModule(org.kuali.rice.krad.service.ModuleService moduleService)
moduleService
- the ModuleService implementation to initalize jobs forprotected void initializeTriggersForModule(org.kuali.rice.krad.service.ModuleService moduleService)
moduleService
- the ModuleService instance to initialize triggers forprotected void loadJob(JobDescriptor jobDescriptor)
protected void dropDependenciesNotScheduled()
public void initializeJob(String jobName, Job job)
initializeJob
in interface SchedulerService
SchedulerService.initializeJob(java.lang.String,org.kuali.ole.sys.batch.Job)
public boolean hasIncompleteJob()
SchedulerService
hasIncompleteJob
in interface SchedulerService
SchedulerService.hasIncompleteJob()
protected boolean isIncomplete(org.quartz.JobDetail scheduledJobDetail)
public boolean isPastScheduleCutoffTime()
SchedulerService
isPastScheduleCutoffTime
in interface SchedulerService
SchedulerService.isPastScheduleCutoffTime()
protected boolean isPastScheduleCutoffTime(Calendar dateTime, boolean log)
public void processWaitingJobs()
processWaitingJobs
in interface SchedulerService
SchedulerService.processWaitingJobs()
public void logScheduleResults()
logScheduleResults
in interface SchedulerService
SchedulerService.logScheduleResults()
public boolean shouldNotRun(org.quartz.JobDetail jobDetail)
shouldNotRun
in interface SchedulerService
SchedulerService.shouldNotRun(org.quartz.JobDetail)
public void updateStatus(org.quartz.JobDetail jobDetail, String jobStatus)
updateStatus
in interface SchedulerService
SchedulerService.updateStatus(org.quartz.JobDetail,java.lang.String jobStatus)
public void runJob(String jobName, String requestorEmailAddress)
SchedulerService
runJob
in interface SchedulerService
public void runJob(String jobName, int startStep, int stopStep, Date startTime, String requestorEmailAddress)
SchedulerService
runJob
in interface SchedulerService
public void runJob(String groupName, String jobName, int startStep, int stopStep, Date jobStartTime, String requestorEmailAddress)
runJob
in interface SchedulerService
public void runStep(String groupName, String jobName, String stepName, Date startTime, String requestorEmailAddress)
public boolean isJobRunning(String jobName)
SchedulerService
isJobRunning
in interface SchedulerService
protected void addJob(org.quartz.JobDetail jobDetail)
protected void addTrigger(org.quartz.Trigger trigger)
protected void scheduleJob(String groupName, String jobName, int startStep, int endStep, Date startTime, String requestorEmailAddress, Map<String,String> additionalJobData)
protected boolean shouldScheduleJob(org.quartz.JobDetail jobDetail)
protected boolean shouldCancelJob(org.quartz.JobDetail jobDetail)
protected boolean isDependencySatisfiedPositively(org.quartz.JobDetail dependentJobDetail, org.quartz.JobDetail dependencyJobDetail)
protected boolean isDependencySatisfiedNegatively(org.quartz.JobDetail dependentJobDetail, org.quartz.JobDetail dependencyJobDetail)
protected boolean isSoftDependency(String dependentJobName, String dependencyJobName)
protected Map<String,String> getJobDependencies(String jobName)
protected boolean isPending(org.quartz.JobDetail jobDetail)
protected boolean isScheduled(org.quartz.JobDetail jobDetail)
protected boolean isSucceeded(org.quartz.JobDetail jobDetail)
protected boolean isFailed(org.quartz.JobDetail jobDetail)
protected boolean isCancelled(org.quartz.JobDetail jobDetail)
public String getStatus(org.quartz.JobDetail jobDetail)
getStatus
in interface SchedulerService
protected org.quartz.JobDetail getScheduledJobDetail(String jobName)
public void setScheduler(org.quartz.Scheduler scheduler)
setScheduler
in interface SchedulerService
scheduler
- The scheduler to set.public void setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService)
public void setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
dateTimeService
- The dateTimeService to set.public void setKualiModuleService(org.kuali.rice.krad.service.KualiModuleService moduleService)
moduleService
- The moduleService to set.public void setJobListener(JobListener jobListener)
jobListener
- The jobListener to set.public List<BatchJobStatus> getJobs()
SchedulerService
getJobs
in interface SchedulerService
public BatchJobStatus getJob(String groupName, String jobName)
SchedulerService
getJob
in interface SchedulerService
public List<BatchJobStatus> getJobs(String groupName)
getJobs
in interface SchedulerService
public List<org.quartz.JobExecutionContext> getRunningJobs()
SchedulerService
getRunningJobs
in interface SchedulerService
protected void updateStatus(String groupName, String jobName, String jobStatus)
public void removeScheduled(String jobName)
SchedulerService
removeScheduled
in interface SchedulerService
public void addScheduled(org.quartz.JobDetail job)
SchedulerService
addScheduled
in interface SchedulerService
public void addUnscheduled(org.quartz.JobDetail job)
SchedulerService
addUnscheduled
in interface SchedulerService
public List<String> getSchedulerGroups()
SchedulerService
getSchedulerGroups
in interface SchedulerService
public List<String> getJobStatuses()
SchedulerService
getJobStatuses
in interface SchedulerService
public void interruptJob(String jobName)
SchedulerService
interruptJob
in interface SchedulerService
public Date getNextStartTime(BatchJobStatus job)
SchedulerService
getNextStartTime
in interface SchedulerService
public Date getNextStartTime(String groupName, String jobName)
SchedulerService
getNextStartTime
in interface SchedulerService
public void setMailService(org.kuali.rice.krad.service.MailService mailService)
protected JobDescriptor retrieveJobDescriptor(String jobName)
protected List<String> getJobNamesForScheduleJob()
public void reinitializeScheduledJobs()
reinitializeScheduledJobs
in interface SchedulerService
Copyright © 2004–2014 The Kuali Foundation. All rights reserved.