|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.scope.StepScope
public class StepScope
Scope for step context. Objects in this scope use the Spring container as an
object factory, so there is only one instance of such a bean per executing
step. All objects in this scope are <aop:scoped-proxy/> (no need to
decorate the bean definitions).
In addition, support is provided for late binding of references accessible
from the StepContext using #{..} placeholders. Using this feature,
bean properties can be pulled from the step or job execution context and the
job parameters. E.g.
<bean id="..." class="..." scope="step">
<property name="parent" ref="#{stepExecutionContext[helper]}" />
</bean>
<bean id="..." class="..." scope="step">
<property name="name" value="#{stepExecutionContext['input.name']}" />
</bean>
<bean id="..." class="..." scope="step">
<property name="name" value="#{jobParameters[input]}" />
</bean>
<bean id="..." class="..." scope="step">
<property name="name" value="#{jobExecutionContext['input.stem']}.txt" />
</bean>
The StepContext is referenced using standard bean property paths (as
per BeanWrapper). The examples above all show the use of the Map
accessors provided as a convenience for step and job attributes.
| Field Summary | |
|---|---|
static java.lang.String |
ID_KEY
Context key for clients to use for conversation identifier. |
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
StepScope()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory objectFactory)
|
java.lang.String |
getConversationId()
|
int |
getOrder()
|
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
Register this scope with the enclosing BeanFactory. |
void |
registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
|
java.lang.Object |
remove(java.lang.String name)
|
java.lang.Object |
resolveContextualObject(java.lang.String key)
If Spring 3.0 is available, this will be used to resolve expressions in step-scoped beans. |
void |
setName(java.lang.String name)
Public setter for the name property. |
void |
setOrder(int order)
|
void |
setProxyTargetClass(boolean proxyTargetClass)
Flag to indicate that proxies should use dynamic subclassing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ID_KEY
| Constructor Detail |
|---|
public StepScope()
| Method Detail |
|---|
public void setOrder(int order)
order - the order value to set priority of callback execution for
the BeanFactoryPostProcessor part of this scope bean.public int getOrder()
getOrder in interface org.springframework.core.Orderedpublic void setProxyTargetClass(boolean proxyTargetClass)
proxyTargetClass - set to true to have proxies created using dynamic
subclassespublic java.lang.Object resolveContextualObject(java.lang.String key)
public java.lang.Object get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory objectFactory)
get in interface org.springframework.beans.factory.config.ScopeScope.get(String, ObjectFactory)public java.lang.String getConversationId()
getConversationId in interface org.springframework.beans.factory.config.ScopeScope.getConversationId()
public void registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
registerDestructionCallback in interface org.springframework.beans.factory.config.ScopeScope.registerDestructionCallback(String, Runnable)public java.lang.Object remove(java.lang.String name)
remove in interface org.springframework.beans.factory.config.ScopeScope.remove(String)
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
throws org.springframework.beans.BeansException
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessorbeanFactory - the BeanFactory to register with
org.springframework.beans.BeansException - if there is a problem.BeanFactoryPostProcessor.postProcessBeanFactory(ConfigurableListableBeanFactory)public void setName(java.lang.String name)
name - the name to set for this scope.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||