public class ExecutionContextPromotionListener extends StepExecutionListenerSupport implements org.springframework.beans.factory.InitializingBean
Step
ExecutionContext
to the Job
ExecutionContext
at the
end of a step. A list of keys should be provided that correspond to the items
in the Step
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 the PatternMatcher
, so wildcards are allowed. By default,
promotion will only occur for steps with an exit code of "COMPLETED".Constructor and Description |
---|
ExecutionContextPromotionListener() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
ExitStatus |
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step.
|
void |
setKeys(String[] keys) |
void |
setStatuses(String[] statuses) |
void |
setStrict(boolean strict)
If set to TRUE, the listener will throw an exception if any 'key' is not
found in the Step
ExecutionContext . |
beforeStep
public ExitStatus afterStep(StepExecution stepExecution)
StepExecutionListener
ExitStatus.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
in interface StepExecutionListener
afterStep
in class StepExecutionListenerSupport
ExitStatus
to combine with the normal value. Return
null to leave the old value unchanged.public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void setKeys(String[] keys)
keys
- A list of keys corresponding to items in the Step
ExecutionContext
that must be promoted.public void setStatuses(String[] statuses)
statuses
- A list of statuses for which the promotion should occur.
Statuses can may contain wildcards recognizable by a
PatternMatcher
.public void setStrict(boolean strict)
ExecutionContext
. FALSE by default.strict
- Copyright © 2014 Pivotal. All rights reserved.