|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.core.listener.StepExecutionListenerSupport
org.springframework.batch.core.resource.StepExecutionSimpleCompletionPolicy
public class StepExecutionSimpleCompletionPolicy
A CompletionPolicy that picks up a commit interval from
JobParameters by listening to the start of a step. Use anywhere that
a CompletionPolicy can be used (usually at the chunk level in a
step), and inject as a StepExecutionListener into the surrounding
step. N.B. only after the step has started will the completion policy be
usable.
It is easier and probably preferable to simply declare the chunk with a
commit-interval that is a late-binding expression (e.g.
#{jobParameters['commit.interval']}). That feature is available
from of Spring Batch 2.1.7.
CompletionPolicy| Constructor Summary | |
|---|---|
StepExecutionSimpleCompletionPolicy()
|
|
| Method Summary | |
|---|---|
void |
beforeStep(StepExecution stepExecution)
Set up a SimpleCompletionPolicy with a commit interval taken from
the JobParameters. |
boolean |
isComplete(RepeatContext context)
|
boolean |
isComplete(RepeatContext context,
RepeatStatus result)
|
void |
setKeyName(java.lang.String keyName)
Public setter for the key name of a Long value in the JobParameters that will contain a commit interval. |
RepeatContext |
start(RepeatContext parent)
|
java.lang.String |
toString()
Delegates to the wrapped CompletionPolicy if set, otherwise
returns the value of setKeyName(String). |
void |
update(RepeatContext context)
|
| Methods inherited from class org.springframework.batch.core.listener.StepExecutionListenerSupport |
|---|
afterStep |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StepExecutionSimpleCompletionPolicy()
| Method Detail |
|---|
public void setKeyName(java.lang.String keyName)
JobParameters that will contain a commit interval. Defaults to
"commit.interval".
keyName - the keyName to setpublic void beforeStep(StepExecution stepExecution)
SimpleCompletionPolicy with a commit interval taken from
the JobParameters. If there is a Long parameter with the given
key name, the intValue of this parameter is used. If not an exception
will be thrown.
beforeStep in interface StepExecutionListenerbeforeStep in class StepExecutionListenerSupportStepExecutionListenerSupport.beforeStep(org.springframework.batch.core.StepExecution)
public boolean isComplete(RepeatContext context,
RepeatStatus result)
isComplete in interface CompletionPolicycontext - result -
CompletionPolicy.isComplete(RepeatContext, RepeatStatus)public boolean isComplete(RepeatContext context)
isComplete in interface CompletionPolicycontext -
CompletionPolicy.isComplete(org.springframework.batch.repeat.RepeatContext)public RepeatContext start(RepeatContext parent)
start in interface CompletionPolicyparent -
RepeatContextCompletionPolicy.start(org.springframework.batch.repeat.RepeatContext)public void update(RepeatContext context)
update in interface CompletionPolicycontext - CompletionPolicy.update(org.springframework.batch.repeat.RepeatContext)public java.lang.String toString()
CompletionPolicy if set, otherwise
returns the value of setKeyName(String).
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||