public static class ThreadedTasklet implements Tasklet {
@Override
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
SimpleAsyncTaskExecutor asyncTX = new SimpleAsyncTaskExecutor();
StepContext context = StepSynchronizationManager.getContext();
final StepExecution stepExecution = (context != null) ? context.getStepExecution() : null;
final AtomicBoolean done = new AtomicBoolean(false);
final Thread[] th = new Thread[1];
asyncTX.execute(new Runnable() {
@Override
public void run() {
th[0] = Thread.currentThread();
StepSynchronizationManager.register(stepExecution);
try {