public class JobRunner extends JobExecutor implements java.util.concurrent.Callable<java.lang.Void>
For more control over the job execution and outcome consider querying the Job
s or using Spring Batch (see the reference documentation for more info).
To make the runner execute at startup, use setRunAtStartup(boolean)
.
JobExecutor.JobListener
log
Constructor and Description |
---|
JobRunner() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
java.lang.Void |
call() |
void |
setPostAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
Actions to be invoked after running the action.
|
void |
setPreAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
Actions to be invoked before running the action.
|
void |
setRunAtStartup(boolean runAtStartup)
Indicates whether the jobs should be submitted at startup (default) or not.
|
destroy, findJobs, isKillJobsAtShutdown, isVerbose, isWaitForCompletion, setBeanFactory, setExecutor, setJob, setJobNames, setJobs, setKillJobAtShutdown, setVerbose, setWaitForCompletion, startJobs, startJobs, stopJobs, stopJobs
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class JobExecutor
java.lang.Exception
public java.lang.Void call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<java.lang.Void>
java.lang.Exception
public void setRunAtStartup(boolean runAtStartup)
runAtStartup
- The runAtStartup to set.public void setPreAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
actions
- actionspublic void setPostAction(java.util.Collection<java.util.concurrent.Callable<?>> actions)
actions
- actions