类 ExecutionContextPromotionListener
- java.lang.Object
- org.springframework.batch.core.listener.StepExecutionListenerSupport
- org.springframework.batch.core.listener.ExecutionContextPromotionListener
- 所有已实现的接口:
StepExecutionListener
,StepListener
,org.springframework.beans.factory.InitializingBean
public class ExecutionContextPromotionListener extends StepExecutionListenerSupport implements org.springframework.beans.factory.InitializingBean
This class can be used to automatically promote items from theStep
ExecutionContext
to theJob
ExecutionContext
at the end of a step. A list of keys should be provided that correspond to the items in theStep
ExecutionContext
that should be promoted. Additionally, an optional list of statuses can be set to indicate for which exit status codes the promotion should occur. These statuses will be checked using thePatternMatcher
, so wildcards are allowed. By default, promotion will only occur for steps with an exit code of "COMPLETED".- 从以下版本开始:
- 2.0
- 作者:
- Dan Garrette
构造器概要
构造器 构造器 说明 ExecutionContextPromotionListener()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
ExitStatus
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step.void
setKeys(java.lang.String[] keys)
void
setStatuses(java.lang.String[] statuses)
void
setStrict(boolean strict)
If set to TRUE, the listener will throw an exception if any 'key' is not found in the StepExecutionContext
.从类继承的方法 org.springframework.batch.core.listener.StepExecutionListenerSupport
beforeStep
构造器详细资料
ExecutionContextPromotionListener
public ExecutionContextPromotionListener()
方法详细资料
afterStep
public ExitStatus afterStep(StepExecution stepExecution)
从接口复制的说明:StepExecutionListener
Give a listener a chance to modify the exit status from a step. The value returned will be combined with the normal exit status usingExitStatus.and(ExitStatus)
. Called after execution of step's processing logic (both successful or failed). Throwing exception in this method has no effect, it will only be logged.- 指定者:
afterStep
在接口中StepExecutionListener
- 覆盖:
afterStep
在类中StepExecutionListenerSupport
- 参数:
stepExecution
-StepExecution
instance.- 返回:
- an
ExitStatus
to combine with the normal value. Returnnull
to leave the old value unchanged.
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 抛出:
java.lang.Exception
setKeys
public void setKeys(java.lang.String[] keys)
- 参数:
keys
- A list of keys corresponding to items in theStep
ExecutionContext
that must be promoted.
setStatuses
public void setStatuses(java.lang.String[] statuses)
- 参数:
statuses
- A list of statuses for which the promotion should occur. Statuses can may contain wildcards recognizable by aPatternMatcher
.
setStrict
public void setStrict(boolean strict)
If set to TRUE, the listener will throw an exception if any 'key' is not found in the StepExecutionContext
. FALSE by default.- 参数:
strict
- boolean the value of the flag.