|
||||||||||
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.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 String |
getGroupName(BeanDefinition beanDefinition,
Job job)
Determine a group name for the job to be registered. |
Object |
postProcessAfterInitialization(Object bean,
String beanName)
If the bean is an instance of Job then register it. |
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
Do nothing. |
void |
setBeanFactory(BeanFactory beanFactory)
|
void |
setGroupName(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(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 setpublic void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
InitializingBean.afterPropertiesSet()
public void destroy() throws Exception
Job
instances that were regsistered by this
post processor.
destroy
in interface DisposableBean
Exception
DisposableBean.destroy()
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
Job
then register it.
postProcessAfterInitialization
in interface BeanPostProcessor
FatalBeanException
- if there is a DuplicateJobException
.
BeansException
BeanPostProcessor.postProcessAfterInitialization(java.lang.Object,
java.lang.String)
protected String getGroupName(BeanDefinition beanDefinition, Job job)
groupName
configured. Provides an extension point for specialised subclasses.
beanDefinition
- the bean definition for the jobjob
- the job
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
postProcessBeforeInitialization
in interface BeanPostProcessor
BeansException
BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object,
java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |