什么是Spring Batch的“默认"商品?上下文变量? [英] What are the Spring Batch "default" Context Variables?
问题描述
在 Spring Batch step中-scope 文档,其中有三个无法解释的spring-batch上下文映射:jobParameters
,jobExecutionContext
和stepExecutionContext
.
Springsource示例代码,组合:
Springsource sample code, combined:
<bean id="flatFileItemReader" scope="step"
class="org.springframework.batch.item.file.FlatFileItemReader">
<property name="var1" value="#{jobParameters['input.file.name']}" />
<property name="var2" value="#{jobExecutionContext['input.file.name']}" />
<property name="var3" value="#{stepExecutionContext['input.file.name']}" />
</bean>
jobParameters
,jobExecutionContext
和stepExecutionContext
中可用的默认参数是什么?
What are the default parameters available within jobParameters
, jobExecutionContext
, and stepExecutionContext
?
Spring Batch版本1.x与2.x与3.x之间也可能存在差异-该领域的文档非常稀缺.
There are also likely differences between what's available in Spring Batch version 1.x vs. 2.x vs. 3.x--the documentation is pretty scarce in this area.
推荐答案
#{jobParameters}
,#{jobExecutionContext}
和#{stepExecutionContext}
是 JobExecution 和
#{jobParameters}
, #{jobExecutionContext}
and #{stepExecutionContext}
are the spEL (Spring Expression Language) counterpart of JobParameters, JobExecution and StepExecution objects available in late-binding to allow non-static access to this objects values from step scoped object.
它们支持Map
的访问,因此您可以访问与JobExecution
和StepExecution
关联的ExecutionContext 以及存储在JobParameters
中的值.
They support access as Map
s so you can access the ExecutionContext associated to JobExecution
and StepExecution
and values stored in JobParameters
.
还要检查 StepScope 文档以获取更多信息.
Also check StepScope documentation for more information.
这篇关于什么是Spring Batch的“默认"商品?上下文变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!