类 AutomaticJobRegistrar
- java.lang.Object
- org.springframework.batch.core.configuration.support.AutomaticJobRegistrar
- 所有已实现的接口:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
,org.springframework.core.Ordered
public class AutomaticJobRegistrar extends java.lang.Object implements org.springframework.core.Ordered, org.springframework.context.SmartLifecycle, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Loads and unloadsJobs
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. AJobRegistry
is required.- 从以下版本开始:
- 2.1
- 作者:
- Lucas Ward, Dave Syer, Mahmoud Ben Hassine
构造器概要
构造器 构造器 说明 AutomaticJobRegistrar()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
addApplicationContextFactory(ApplicationContextFactory applicationContextFactory)
Add some factories to the set that will be used to load contexts and jobs.void
afterPropertiesSet()
int
getOrder()
int
getPhase()
boolean
isAutoStartup()
boolean
isRunning()
Check if this component has been started.void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
The enclosing application context, which can be used to check ifevents
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
setAutoStartup(boolean autoStartup)
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
setPhase(int phase)
void
start()
Take all the contexts from the factories provided and pass them to theJobLoader
.void
stop()
Delegates toJobLoader.clear()
.void
stop(java.lang.Runnable callback)
构造器详细资料
AutomaticJobRegistrar
public AutomaticJobRegistrar()
方法详细资料
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
The enclosing application context, which can be used to check ifevents
come from the expected source.- 指定者:
setApplicationContext
在接口中org.springframework.context.ApplicationContextAware
- 参数:
applicationContext
- the enclosing application context if there is one- 另请参阅:
ApplicationContextAware.setApplicationContext(ApplicationContext)
addApplicationContextFactory
public void addApplicationContextFactory(ApplicationContextFactory applicationContextFactory)
Add some factories to the set that will be used to load contexts and jobs.- 参数:
applicationContextFactory
- theApplicationContextFactory
values to use
setApplicationContextFactories
public void setApplicationContextFactories(ApplicationContextFactory[] applicationContextFactories)
Add some factories to the set that will be used to load contexts and jobs.- 参数:
applicationContextFactories
- theApplicationContextFactory
values to use
setJobLoader
public void setJobLoader(JobLoader jobLoader)
The job loader that will be used to load and manage jobs.- 参数:
jobLoader
- theJobLoader
to set
getOrder
public int getOrder()
- 指定者:
getOrder
在接口中org.springframework.core.Ordered
setOrder
public void setOrder(int order)
The order to start up and shutdown.- 参数:
order
- the order (defaultOrdered.LOWEST_PRECEDENCE
).- 另请参阅:
Ordered
afterPropertiesSet
public void afterPropertiesSet()
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
stop
public void stop()
Delegates toJobLoader.clear()
.- 指定者:
stop
在接口中org.springframework.context.Lifecycle
- 另请参阅:
Lifecycle.stop()
start
public void start()
Take all the contexts from the factories provided and pass them to theJobLoader
.- 指定者:
start
在接口中org.springframework.context.Lifecycle
- 另请参阅:
Lifecycle.start()
isRunning
public boolean isRunning()
Check if this component has been started.- 指定者:
isRunning
在接口中org.springframework.context.Lifecycle
- 返回:
- true if started successfully and not stopped
- 另请参阅:
Lifecycle.isRunning()
isAutoStartup
public boolean isAutoStartup()
- 指定者:
isAutoStartup
在接口中org.springframework.context.SmartLifecycle
setAutoStartup
public void setAutoStartup(boolean autoStartup)
- 参数:
autoStartup
- true for auto start.- 另请参阅:
isAutoStartup()
getPhase
public int getPhase()
- 指定者:
getPhase
在接口中org.springframework.context.Phased
- 指定者:
getPhase
在接口中org.springframework.context.SmartLifecycle
setPhase
public void setPhase(int phase)
- 参数:
phase
- the phase.- 另请参阅:
getPhase()
stop
public void stop(java.lang.Runnable callback)
- 指定者:
stop
在接口中org.springframework.context.SmartLifecycle