@ManagedResource public class JobLauncherSynchronizer extends Object implements InitializingBean
JobLauncher that synchronizes jobs globally so that
only one execution of a given Job can be active at once.| Constructor and Description |
|---|
JobLauncherSynchronizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addJobName(String jobName)
A job name that will be synchronized.
|
void |
afterPropertiesSet() |
void |
checkJobBeforeLaunch(Job job) |
void |
checkJobDuringLaunch(String jobName,
JobExecution jobExecution) |
Set<String> |
getJobNames() |
void |
removeJobName(String jobName)
Remove a job name from the list to synchronize.
|
void |
setJobExplorer(JobExplorer jobExplorer)
The
JobExplorer to use to inspect existing executions. |
void |
setJobNames(Set<String> jobNames)
Set of job names that will be synchronized.
|
void |
setJobRepository(JobRepository jobRepository)
The
JobRepository needed for updates to execution data. |
public void setJobExplorer(JobExplorer jobExplorer)
JobExplorer to use to inspect existing executions.jobExplorer - a JobExplorerpublic void setJobRepository(JobRepository jobRepository)
JobRepository needed for updates to execution data.jobRepository - a JobRepositorypublic void setJobNames(Set<String> jobNames)
jobNames - the job names@ManagedOperation public void addJobName(String jobName)
jobName - the job name@ManagedOperation public void removeJobName(String jobName)
jobName - the job name@ManagedAttribute public Set<String> getJobNames()
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void checkJobBeforeLaunch(Job job) throws JobExecutionAlreadyRunningException
public void checkJobDuringLaunch(String jobName, JobExecution jobExecution) throws JobExecutionAlreadyRunningException
Copyright © 2015. All rights reserved.