|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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(ApplicationEvent event)
Creates all the application contexts required and set up job registry entries with all the instances of Job found therein. |
void |
setApplicationContext(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(ApplicationContext applicationContext)
events
come from the expected source.
setApplicationContext
in interface ApplicationContextAware
applicationContext
- 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 Ordered
public void setOrder(int order)
order
- the order (default Ordered.LOWEST_PRECEDENCE
).Ordered
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
Exception
public final void onApplicationEvent(ApplicationEvent event)
Job
found therein. Also closes
the contexts when the enclosing context is closed.
onApplicationEvent
in interface ApplicationListener
InitializingBean.afterPropertiesSet()
public void stop()
JobLoader.clear()
.
stop
in interface Lifecycle
Lifecycle.stop()
public void start()
JobLoader
.
start
in interface Lifecycle
Lifecycle.start()
public boolean isRunning()
isRunning
in interface Lifecycle
Lifecycle.isRunning()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |