public class StepScope extends BatchScopeSupport
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.BatchScopeSupport.Scopifier| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ID_KEY
Context key for clients to use for conversation identifier.
|
| Constructor and Description |
|---|
StepScope() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory) |
java.lang.String |
getConversationId() |
java.lang.String |
getTargetNamePrefix() |
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)
This will be used to resolve expressions in step-scoped beans.
|
createScopedProxy, getName, getOrder, postProcessBeanFactory, setAutoProxy, setName, setOrder, setProxyTargetClasspublic static final java.lang.String ID_KEY
public java.lang.Object resolveContextualObject(java.lang.String key)
public java.lang.Object get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory)
Scope.get(String, ObjectFactory)public java.lang.String getConversationId()
Scope.getConversationId()public void registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
Scope.registerDestructionCallback(String, Runnable)public java.lang.Object remove(java.lang.String name)
Scope.remove(String)public java.lang.String getTargetNamePrefix()
getTargetNamePrefix in class BatchScopeSupport