Package se.ikama.bauta.batch.tasklet
Class ReportingSystemCommandTasklet
- java.lang.Object
-
- org.springframework.batch.core.listener.StepExecutionListenerSupport
-
- se.ikama.bauta.batch.tasklet.ReportingSystemCommandTasklet
-
- All Implemented Interfaces:
org.springframework.batch.core.step.tasklet.StoppableTasklet,org.springframework.batch.core.step.tasklet.Tasklet,org.springframework.batch.core.StepExecutionListener,org.springframework.batch.core.StepListener,org.springframework.beans.factory.InitializingBean
public class ReportingSystemCommandTasklet extends org.springframework.batch.core.listener.StepExecutionListenerSupport implements org.springframework.batch.core.step.tasklet.StoppableTasklet, org.springframework.beans.factory.InitializingBean
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringreportDir
-
Constructor Summary
Constructors Constructor Description ReportingSystemCommandTasklet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.springframework.batch.repeat.RepeatStatusexecute(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext)Execute system executable (sql ..) and map its exit code toExitStatususingSystemProcessExitCodeMapper.voidsetTerminationCheckInterval(long checkInterval)The time interval how often the tasklet will check for termination status.voidsetTimeout(long timeout)Timeout in milliseconds.voidstop()Will try to interrupt the thread executing the system executable.
-
-
-
Method Detail
-
execute
public org.springframework.batch.repeat.RepeatStatus execute(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext) throws java.lang.ExceptionExecute system executable (sql ..) and map its exit code toExitStatususingSystemProcessExitCodeMapper.- Specified by:
executein interfaceorg.springframework.batch.core.step.tasklet.Tasklet- Throws:
java.lang.Exception
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
setTimeout
public void setTimeout(long timeout)
Timeout in milliseconds.- Parameters:
timeout- upper limit for how long the execution of the external program is allowed to last.
-
setTerminationCheckInterval
public void setTerminationCheckInterval(long checkInterval)
The time interval how often the tasklet will check for termination status.- Parameters:
checkInterval- time interval in milliseconds (1 second by default).
-
stop
public void stop()
Will try to interrupt the thread executing the system executable.- Specified by:
stopin interfaceorg.springframework.batch.core.step.tasklet.StoppableTasklet- See Also:
StoppableTasklet.stop()
-
-