|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor
public class JobRegistryBeanPostProcessor
A BeanPostProcessor that registers Job beans with a
JobRegistry. Include a bean of this type along with your job
configuration, and use the same JobRegistry as a JobLocator
when you need to locate a Job to launch.
| Constructor Summary | |
|---|---|
JobRegistryBeanPostProcessor()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
Make sure the registry is set before use. |
void |
destroy()
De-register all the Job instances that were regsistered by this
post processor. |
protected java.lang.String |
getGroupName(org.springframework.beans.factory.config.BeanDefinition beanDefinition,
Job job)
Determine a group name for the job to be registered. |
java.lang.Object |
postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
If the bean is an instance of Job then register it. |
java.lang.Object |
postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
Do nothing. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
void |
setGroupName(java.lang.String groupName)
The group name for jobs registered by this component. |
void |
setJobRegistry(JobRegistry jobRegistry)
Injection setter for JobRegistry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JobRegistryBeanPostProcessor()
| Method Detail |
|---|
public void setGroupName(java.lang.String groupName)
JobRegistry: child contexts can then
define an instance with a unique group name to avoid clashes between job
names.
groupName - the groupName to setpublic void setJobRegistry(JobRegistry jobRegistry)
JobRegistry.
jobRegistry - the jobConfigurationRegistry to set
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansException
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.ExceptionInitializingBean.afterPropertiesSet()
public void destroy()
throws java.lang.Exception
Job instances that were regsistered by this
post processor.
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.ExceptionDisposableBean.destroy()
public java.lang.Object postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
Job then register it.
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.FatalBeanException - if there is a DuplicateJobException.
org.springframework.beans.BeansExceptionBeanPostProcessor.postProcessAfterInitialization(java.lang.Object,
java.lang.String)
protected java.lang.String getGroupName(org.springframework.beans.factory.config.BeanDefinition beanDefinition,
Job job)
groupName
configured. Provides an extension point for specialised subclasses.
beanDefinition - the bean definition for the jobjob - the job
public java.lang.Object postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionBeanPostProcessor.postProcessBeforeInitialization(java.lang.Object,
java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||