List of usage examples for org.springframework.batch.core.step.tasklet SystemCommandTasklet SystemCommandTasklet
SystemCommandTasklet
From source file:org.springframework.batch.core.step.tasklet.SystemCommandTaskletIntegrationTests.java
private void initializeTasklet() { tasklet = new SystemCommandTasklet(); tasklet.setEnvironmentParams(null); // inherit from parent process tasklet.setWorkingDirectory(null); // inherit from parent process tasklet.setSystemProcessExitCodeMapper(new TestExitCodeMapper()); tasklet.setTimeout(5000); // long enough timeout tasklet.setTerminationCheckInterval(500); tasklet.setCommand("invalid command, change value for successful execution"); tasklet.setInterruptOnCancel(true);/*from ww w . j av a2 s.co m*/ tasklet.setTaskExecutor(new SimpleAsyncTaskExecutor()); }