|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.configuration.support.AutomaticJobRegistrar
public class AutomaticJobRegistrar
Loads and unloads Jobs when the application context is created
and destroyed. Each resource provided is loaded as an application context
with the current context as its parent, and then all the jobs from the child
context are registered under their bean names. A JobRegistry is
required.
| Field Summary |
|---|
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
AutomaticJobRegistrar()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
int |
getOrder()
|
boolean |
isRunning()
Check if this component has been started. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
Creates all the application contexts required and set up job registry entries with all the instances of Job found therein. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
The enclosing application context, which can be used to check if events come from the expected source. |
void |
setApplicationContextFactories(ApplicationContextFactory[] applicationContextFactories)
Add some factories to the set that will be used to load contexts and jobs. |
void |
setJobLoader(JobLoader jobLoader)
The job loader that will be used to load and manage jobs. |
void |
setOrder(int order)
The order to start up and shutdown. |
void |
start()
Take all the contexts from the factories provided and pass them to teh JobLoader. |
void |
stop()
Delegates to JobLoader.clear(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AutomaticJobRegistrar()
| Method Detail |
|---|
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
events come from the expected source.
setApplicationContext in interface org.springframework.context.ApplicationContextAwareapplicationContext - the enclosing application context if there is
oneApplicationContextAware.setApplicationContext(ApplicationContext)public void setApplicationContextFactories(ApplicationContextFactory[] applicationContextFactories)
applicationContextFactories - the ApplicationContextFactory
values to usepublic void setJobLoader(JobLoader jobLoader)
jobLoader - the JobLoader to setpublic int getOrder()
getOrder in interface org.springframework.core.Orderedpublic void setOrder(int order)
order - the order (default Ordered.LOWEST_PRECEDENCE).Orderedpublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic final void onApplicationEvent(org.springframework.context.ApplicationEvent event)
Job found therein. Also closes
the contexts when the enclosing context is closed.
onApplicationEvent in interface org.springframework.context.ApplicationListenerInitializingBean.afterPropertiesSet()public void stop()
JobLoader.clear().
stop in interface org.springframework.context.LifecycleLifecycle.stop()public void start()
JobLoader.
start in interface org.springframework.context.LifecycleLifecycle.start()public boolean isRunning()
isRunning in interface org.springframework.context.LifecycleLifecycle.isRunning()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||