Class SynchronousJobOperator

  • All Implemented Interfaces:
    javax.batch.operations.JobOperator

    public class SynchronousJobOperator
    extends Object
    implements javax.batch.operations.JobOperator
    An implementation of JobOperator delegating to real JBatch implementation but waiting for start/stop/restart method. Note: would be great to keep this class portable, if not we should just extend BatchKernel and use org.apache.batchee.container.services.kernel.DefaultBatchKernel#jobExecutionDone(org.apache.batchee.container.impl.jobinstance.RuntimeJobExecution)
    • Constructor Detail

      • SynchronousJobOperator

        public SynchronousJobOperator()
    • Method Detail

      • start

        public long start​(String name,
                          Properties properties)
                   throws javax.batch.operations.JobStartException,
                          javax.batch.operations.JobSecurityException
        Specified by:
        start in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.JobStartException
        javax.batch.operations.JobSecurityException
      • restart

        public long restart​(long id,
                            Properties properties)
                     throws javax.batch.operations.JobExecutionAlreadyCompleteException,
                            javax.batch.operations.NoSuchJobExecutionException,
                            javax.batch.operations.JobExecutionNotMostRecentException,
                            javax.batch.operations.JobRestartException,
                            javax.batch.operations.JobSecurityException
        Specified by:
        restart in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.JobExecutionAlreadyCompleteException
        javax.batch.operations.NoSuchJobExecutionException
        javax.batch.operations.JobExecutionNotMostRecentException
        javax.batch.operations.JobRestartException
        javax.batch.operations.JobSecurityException
      • stop

        public void stop​(long id)
                  throws javax.batch.operations.NoSuchJobExecutionException,
                         javax.batch.operations.JobExecutionNotRunningException,
                         javax.batch.operations.JobSecurityException
        Specified by:
        stop in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobExecutionException
        javax.batch.operations.JobExecutionNotRunningException
        javax.batch.operations.JobSecurityException
      • abandon

        public void abandon​(long id)
                     throws javax.batch.operations.NoSuchJobExecutionException,
                            javax.batch.operations.JobExecutionIsRunningException,
                            javax.batch.operations.JobSecurityException
        Specified by:
        abandon in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobExecutionException
        javax.batch.operations.JobExecutionIsRunningException
        javax.batch.operations.JobSecurityException
      • getJobNames

        public Set<String> getJobNames()
                                throws javax.batch.operations.JobSecurityException
        Specified by:
        getJobNames in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.JobSecurityException
      • getJobInstanceCount

        public int getJobInstanceCount​(String name)
                                throws javax.batch.operations.NoSuchJobException,
                                       javax.batch.operations.JobSecurityException
        Specified by:
        getJobInstanceCount in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobException
        javax.batch.operations.JobSecurityException
      • getJobInstances

        public List<javax.batch.runtime.JobInstance> getJobInstances​(String name,
                                                                     int start,
                                                                     int count)
                                                              throws javax.batch.operations.NoSuchJobException,
                                                                     javax.batch.operations.JobSecurityException
        Specified by:
        getJobInstances in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobException
        javax.batch.operations.JobSecurityException
      • getRunningExecutions

        public List<Long> getRunningExecutions​(String name)
                                        throws javax.batch.operations.NoSuchJobException,
                                               javax.batch.operations.JobSecurityException
        Specified by:
        getRunningExecutions in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobException
        javax.batch.operations.JobSecurityException
      • getParameters

        public Properties getParameters​(long id)
                                 throws javax.batch.operations.NoSuchJobExecutionException,
                                        javax.batch.operations.JobSecurityException
        Specified by:
        getParameters in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobExecutionException
        javax.batch.operations.JobSecurityException
      • getJobInstance

        public javax.batch.runtime.JobInstance getJobInstance​(long id)
                                                       throws javax.batch.operations.NoSuchJobExecutionException,
                                                              javax.batch.operations.JobSecurityException
        Specified by:
        getJobInstance in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobExecutionException
        javax.batch.operations.JobSecurityException
      • getJobExecutions

        public List<javax.batch.runtime.JobExecution> getJobExecutions​(javax.batch.runtime.JobInstance jobInstance)
                                                                throws javax.batch.operations.NoSuchJobInstanceException,
                                                                       javax.batch.operations.JobSecurityException
        Specified by:
        getJobExecutions in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobInstanceException
        javax.batch.operations.JobSecurityException
      • getJobExecution

        public javax.batch.runtime.JobExecution getJobExecution​(long id)
                                                         throws javax.batch.operations.NoSuchJobExecutionException,
                                                                javax.batch.operations.JobSecurityException
        Specified by:
        getJobExecution in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobExecutionException
        javax.batch.operations.JobSecurityException
      • getStepExecutions

        public List<javax.batch.runtime.StepExecution> getStepExecutions​(long id)
                                                                  throws javax.batch.operations.NoSuchJobExecutionException,
                                                                         javax.batch.operations.JobSecurityException
        Specified by:
        getStepExecutions in interface javax.batch.operations.JobOperator
        Throws:
        javax.batch.operations.NoSuchJobExecutionException
        javax.batch.operations.JobSecurityException