Class JobInstance
java.lang.Object
org.springframework.batch.core.Entity
org.springframework.batch.core.job.JobInstance
- All Implemented Interfaces:
Serializable
Batch domain object representing a uniquely identifiable job run.
JobInstance
can be restarted multiple times in case of execution failure, and its lifecycle ends
with first successful execution.
Trying to execute an existing JobInstance that has already completed
successfully results in an error. An error is also raised for an attempt to restart a
failed JobInstance if the Job is not restartable.
- Author:
- Lucas Ward, Dave Syer, Robert Kasanicky, Michael Minella, Mahmoud Ben Hassine
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddJobExecution(JobExecution jobExecution) longReturns an immutable copy of the list ofJobExecutions associated with this JobInstance.toString()Adds the job name to the string representation of the super class (Entity).Methods inherited from class Entity
equals, getId, getVersion, hashCode, incrementVersion, setVersion
-
Constructor Details
-
JobInstance
Constructor forJobInstance.- Parameters:
id- The instance ID.jobName- The name associated with theJobInstance.
-
-
Method Details
-
getJobName
- Returns:
- the job name. (Equivalent to
getJob().getName()).
-
getJobExecutions
Returns an immutable copy of the list ofJobExecutions associated with this JobInstance.- Returns:
- the job executions
-
toString
-
getInstanceId
public long getInstanceId()- Returns:
- The current instance ID.
-
addJobExecution
-