类 JobExecution

  • 所有已实现的接口:
    java.io.Serializable

    public class JobExecution
    extends Entity
    Batch domain object representing the execution of a job.
    作者:
    Lucas Ward, Michael Minella, Mahmoud Ben Hassine, Dimitrios Liapis
    另请参阅:
    序列化表格
    • 构造器详细资料

      • JobExecution

        public JobExecution​(JobInstance job,
                            java.lang.Long id,
                            @Nullable
                            JobParameters jobParameters,
                            java.lang.String jobConfigurationName)
        Because a JobExecution isn't valid unless the job is set, this constructor is the only valid one from a modeling point of view.
        参数:
        job - the job of which this execution is a part
        id - Long that represents the id for the JobExecution.
        jobParameters - JobParameters instance for this JobExecution.
        jobConfigurationName - String instance that represents the job configuration name (used with JSR-352).
      • JobExecution

        public JobExecution​(java.lang.Long id,
                            JobParameters jobParameters,
                            java.lang.String jobConfigurationName)
    • 方法详细资料

      • setEndTime

        public void setEndTime​(java.util.Date endTime)
      • setStartTime

        public void setStartTime​(java.util.Date startTime)
      • setStatus

        public void setStatus​(BatchStatus status)
        Set the value of the status field.
        参数:
        status - the status to set
      • upgradeStatus

        public void upgradeStatus​(BatchStatus status)
        Upgrade the status field if the provided value is greater than the existing one. Clients using this method to set the status can be sure that they don't overwrite a failed status with an successful one.
        参数:
        status - the new status value
      • getJobId

        public java.lang.Long getJobId()
        Convenience getter for for the id of the enclosing job. Useful for DAO implementations.
        返回:
        the id of the enclosing job
      • getStepExecutions

        public java.util.Collection<StepExecutiongetStepExecutions()
        Accessor for the step executions.
        返回:
        the step executions that were registered
      • createStepExecution

        public StepExecution createStepExecution​(java.lang.String stepName)
        Register a step execution with the current job execution.
        参数:
        stepName - the name of the step the new execution is associated with
        返回:
        StepExecution an empty StepExecution associated with this JobExecution.
      • isRunning

        public boolean isRunning()
        Test if this JobExecution indicates that it is running. It should be noted that this does not necessarily mean that it has been persisted as such yet.
        返回:
        true if the end time is null and the start time is not null
      • getCreateTime

        public java.util.Date getCreateTime()
        返回:
        the time when this execution was created.
      • setCreateTime

        public void setCreateTime​(java.util.Date createTime)
        参数:
        createTime - creation time of this execution.
      • getLastUpdated

        public java.util.Date getLastUpdated()
        Get the date representing the last time this JobExecution was updated in the JobRepository.
        返回:
        Date representing the last time this JobExecution was updated.
      • setLastUpdated

        public void setLastUpdated​(java.util.Date lastUpdated)
        Set the last time this JobExecution was updated.
        参数:
        lastUpdated - Date instance to mark job execution's lastUpdated attribute.
      • addFailureException

        public void addFailureException​(java.lang.Throwable t)
        Add the provided throwable to the failure exception list.
        参数:
        t - Throwable instance to be added failure exception list.
      • getAllFailureExceptions

        public java.util.List<java.lang.Throwable> getAllFailureExceptions()
        Return all failure causing exceptions for this JobExecution, including step executions.
        返回:
        List<Throwable> containing all exceptions causing failure for this JobExecution.
      • addStepExecutions

        public void addStepExecutions​(java.util.List<StepExecution> stepExecutions)
        Add some step executions. For internal use only.
        参数:
        stepExecutions - step executions to add to the current list