Class 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.String reportDir  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()  
      org.springframework.batch.repeat.RepeatStatus execute​(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext)
      Execute system executable (sql ..) and map its exit code to ExitStatus using SystemProcessExitCodeMapper.
      void setTerminationCheckInterval​(long checkInterval)
      The time interval how often the tasklet will check for termination status.
      void setTimeout​(long timeout)
      Timeout in milliseconds.
      void stop()
      Will try to interrupt the thread executing the system executable.
      • Methods inherited from class org.springframework.batch.core.listener.StepExecutionListenerSupport

        afterStep, beforeStep
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • reportDir

        @Value("${bauta.reportDir}")
        protected java.lang.String reportDir
    • Constructor Detail

      • ReportingSystemCommandTasklet

        public ReportingSystemCommandTasklet()
    • 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.Exception
        Execute system executable (sql ..) and map its exit code to ExitStatus using SystemProcessExitCodeMapper.
        Specified by:
        execute in interface org.springframework.batch.core.step.tasklet.Tasklet
        Throws:
        java.lang.Exception
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.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:
        stop in interface org.springframework.batch.core.step.tasklet.StoppableTasklet
        See Also:
        StoppableTasklet.stop()