public class DefaultJobLoader extends Object implements JobLoader
JobLoader
. Uses a JobRegistry
to
manage a population of loaded jobs and clears them up when asked.Constructor and Description |
---|
DefaultJobLoader()
Default constructor useful for declarative configuration.
|
DefaultJobLoader(JobRegistry jobRegistry)
Create a job loader with the job registry provided.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Unregister all the jobs and close all the contexts created by this
loader.
|
Collection<Job> |
load(ApplicationContextFactory factory)
Load an application context and register all the jobs.
|
Collection<Job> |
reload(ApplicationContextFactory factory)
Load an application context and register all the jobs, having first
unregistered them if already registered.
|
void |
setJobRegistry(JobRegistry jobRegistry)
The
JobRegistry to use for jobs created. |
public DefaultJobLoader()
public DefaultJobLoader(JobRegistry jobRegistry)
jobRegistry
- a JobRegistry
public void setJobRegistry(JobRegistry jobRegistry)
JobRegistry
to use for jobs created.jobRegistry
- public void clear()
clear
in interface JobLoader
JobLoader.clear()
public Collection<Job> reload(ApplicationContextFactory factory)
JobLoader
public Collection<Job> load(ApplicationContextFactory factory) throws DuplicateJobException
JobLoader
load
in interface JobLoader
factory
- a factory for an application context (containing jobs)DuplicateJobException
- if a job with the same name was already
registeredCopyright © 2013 SpringSource. All rights reserved.