public class MethodInvokingTaskletAdapter extends AbstractMethodInvokingDelegator<java.lang.Object> implements Tasklet
Tasklet that wraps a method in a POJO. By default the return
value is ExitStatus.COMPLETED unless the delegate POJO itself returns
an ExitStatus. The POJO method is usually going to have no arguments,
but a static argument or array of arguments can be used by setting the
arguments property.AbstractMethodInvokingDelegatorAbstractMethodInvokingDelegator.InvocationTargetThrowableWrapper| Constructor and Description |
|---|
MethodInvokingTaskletAdapter() |
| Modifier and Type | Method and Description |
|---|---|
RepeatStatus |
execute(StepContribution contribution,
ChunkContext chunkContext)
Delegate execution to the target object and translate the return value to
an
ExitStatus by invoking a method in the delegate POJO. |
protected ExitStatus |
mapResult(java.lang.Object result)
If the result is an
ExitStatus already just return that,
otherwise return ExitStatus.COMPLETED. |
afterPropertiesSet, getArguments, invokeDelegateMethod, invokeDelegateMethodWithArgument, invokeDelegateMethodWithArguments, setArguments, setTargetMethod, setTargetObjectpublic RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws java.lang.Exception
ExitStatus by invoking a method in the delegate POJO. Ignores
the StepContribution and the attributes.execute in interface Taskletcontribution - mutable state to be passed back to update the current
step executionchunkContext - attributes shared between invocations but not between
restartsRepeatStatus indicating whether processing is
continuable. Returning null is interpreted as RepeatStatus.FINISHEDjava.lang.Exception - thrown if error occurs during execution.Tasklet.execute(StepContribution, ChunkContext)protected ExitStatus mapResult(java.lang.Object result)
ExitStatus already just return that,
otherwise return ExitStatus.COMPLETED.result - the value returned by the delegate methodExitStatus consistent with the result