Class BatchletAdapter
- java.lang.Object
- org.springframework.batch.core.jsr.step.batchlet.BatchletAdapter
- All Implemented Interfaces:
StoppableTasklet
,Tasklet
public class BatchletAdapter extends java.lang.Object implements StoppableTasklet
- Since:
- 3.0
- Author:
- Michael Minella
Constructor Summary
Constructors Constructor Description BatchletAdapter(javax.batch.api.Batchlet batchlet)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepeatStatus
execute(StepContribution contribution, ChunkContext chunkContext)
Given the current context in the form of a step contribution, do whatever is necessary to process this unit inside a transaction.void
stop()
Used to signal that the job thisTasklet
is executing within has been requested to stop.
Method Detail
execute
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws java.lang.Exception
Description copied from interface:Tasklet
Given the current context in the form of a step contribution, do whatever is necessary to process this unit inside a transaction. Implementations returnRepeatStatus.FINISHED
if finished. If not they returnRepeatStatus.CONTINUABLE
. On failure throws an exception.- 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:
java.lang.Exception
- thrown if error occurs during execution.
stop
public void stop()
Description copied from interface:StoppableTasklet
Used to signal that the job thisTasklet
is executing within has been requested to stop.- Specified by:
stop
in interfaceStoppableTasklet