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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAssert that the callable is set.execute(StepContribution contribution, ChunkContext chunkContext) Execute the provided Callable and return itsRepeatStatus.voidsetCallable(Callable<RepeatStatus> callable) Public setter for theCallable.
-
Constructor Details
-
CallableTaskletAdapter
public CallableTaskletAdapter()
-
-
Method Details
-
setCallable
Public setter for theCallable.- Parameters:
callable- theCallableto set
-
afterPropertiesSet
Assert that the callable is set.- Specified by:
afterPropertiesSetin 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 theStepContributionand the attributes.- Specified by:
executein 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
RepeatStatusindicating whether processing is continuable. Returningnullis interpreted asRepeatStatus.FINISHED - Throws:
Exception- thrown if error occurs during execution.- See Also:
-