Class CallableTaskletAdapter
java.lang.Object
org.springframework.batch.core.step.tasklet.CallableTaskletAdapter
- All Implemented Interfaces:
Tasklet
,org.springframework.beans.factory.InitializingBean
public class CallableTaskletAdapter
extends Object
implements Tasklet, org.springframework.beans.factory.InitializingBean
- Author:
- Dave Syer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Assert that the callable is set.execute
(StepContribution contribution, ChunkContext chunkContext) Execute the provided Callable and return itsRepeatStatus
.void
setCallable
(Callable<RepeatStatus> callable) Public setter for theCallable
.
-
Constructor Details
-
CallableTaskletAdapter
public CallableTaskletAdapter()
-
-
Method Details
-
setCallable
Public setter for theCallable
.- Parameters:
callable
- theCallable
to set
-
afterPropertiesSet
Assert that the callable is set.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- See Also:
-
InitializingBean.afterPropertiesSet()
-
execute
@Nullable public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception Execute the provided Callable and return itsRepeatStatus
. Ignores theStepContribution
and the attributes.- Specified by:
execute
in interfaceTasklet
- Parameters:
contribution
- mutable state to be passed back to update the current step executionchunkContext
- attributes shared between invocations but not between restarts- Returns:
- an
RepeatStatus
indicating whether processing is continuable. Returningnull
is interpreted asRepeatStatus.FINISHED
- Throws:
Exception
- thrown if error occurs during execution.- See Also:
-