public class StepScope extends Object implements org.springframework.beans.factory.config.Scope, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered
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.Modifier and Type | Field and Description |
---|---|
static String |
ID_KEY
Context key for clients to use for conversation identifier.
|
Constructor and Description |
---|
StepScope() |
Modifier and Type | Method and Description |
---|---|
Object |
get(String name,
org.springframework.beans.factory.ObjectFactory objectFactory) |
String |
getConversationId() |
int |
getOrder() |
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
Register this scope with the enclosing BeanFactory.
|
void |
registerDestructionCallback(String name,
Runnable callback) |
Object |
remove(String name) |
Object |
resolveContextualObject(String key)
This will be used to resolve expressions in step-scoped beans.
|
void |
setAutoProxy(boolean autoProxy)
Flag to indicate that bean definitions need not be auto proxied.
|
void |
setName(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.
|
public static final String ID_KEY
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.Ordered
public void setProxyTargetClass(boolean proxyTargetClass)
proxyTargetClass
- set to true to have proxies created using dynamic
subclassespublic void setAutoProxy(boolean autoProxy)
autoProxy
- the flag value to set (default true)public Object resolveContextualObject(String key)
resolveContextualObject
in interface org.springframework.beans.factory.config.Scope
public Object get(String name, org.springframework.beans.factory.ObjectFactory objectFactory)
get
in interface org.springframework.beans.factory.config.Scope
Scope.get(String, ObjectFactory)
public String getConversationId()
getConversationId
in interface org.springframework.beans.factory.config.Scope
Scope.getConversationId()
public void registerDestructionCallback(String name, Runnable callback)
registerDestructionCallback
in interface org.springframework.beans.factory.config.Scope
Scope.registerDestructionCallback(String, Runnable)
public Object remove(String name)
remove
in interface org.springframework.beans.factory.config.Scope
Scope.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.BeanFactoryPostProcessor
beanFactory
- the BeanFactory to register withorg.springframework.beans.BeansException
- if there is a problem.BeanFactoryPostProcessor.postProcessBeanFactory(ConfigurableListableBeanFactory)
public void setName(String name)
name
- the name to set for this scope.Copyright © 2014 Pivotal. All rights reserved.