public class JobExecution extends Entity
| Constructor and Description |
|---|
JobExecution(JobInstance job,
JobParameters jobParameters)
Constructor for transient (unsaved) instances.
|
JobExecution(JobInstance job,
Long id,
JobParameters jobParameters)
Because a JobExecution isn't valid unless the job is set, this
constructor is the only valid one from a modeling point of view.
|
JobExecution(Long id) |
JobExecution(Long id,
JobParameters jobParameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFailureException(Throwable t)
Add the provided throwable to the failure exception list.
|
void |
addStepExecutions(List<StepExecution> stepExecutions)
Add some step executions.
|
StepExecution |
createStepExecution(String stepName)
Register a step execution with the current job execution.
|
List<Throwable> |
getAllFailureExceptions()
Return all failure causing exceptions for this JobExecution, including
step executions.
|
Date |
getCreateTime() |
Date |
getEndTime() |
ExecutionContext |
getExecutionContext()
Returns the
ExecutionContext for this execution. |
ExitStatus |
getExitStatus() |
List<Throwable> |
getFailureExceptions() |
Long |
getJobId()
Convenience getter for for the id of the enclosing job.
|
JobInstance |
getJobInstance() |
JobParameters |
getJobParameters() |
Date |
getLastUpdated()
Get the date representing the last time this JobExecution was updated in
the JobRepository.
|
Date |
getStartTime() |
BatchStatus |
getStatus() |
Collection<StepExecution> |
getStepExecutions()
Accessor for the step executions.
|
boolean |
isRunning()
Test if this
JobExecution indicates that it is running. |
boolean |
isStopping()
Test if this
JobExecution indicates that it has been signalled to
stop. |
void |
setCreateTime(Date createTime) |
void |
setEndTime(Date endTime) |
void |
setExecutionContext(ExecutionContext executionContext)
Sets the
ExecutionContext for this execution |
void |
setExitStatus(ExitStatus exitStatus) |
void |
setJobInstance(JobInstance jobInstance) |
void |
setLastUpdated(Date lastUpdated)
Set the last time this JobExecution was updated.
|
void |
setStartTime(Date startTime) |
void |
setStatus(BatchStatus status)
Set the value of the status field.
|
void |
stop()
Signal the
JobExecution to stop. |
String |
toString() |
void |
upgradeStatus(BatchStatus status)
Upgrade the status field if the provided value is greater than the
existing one.
|
equals, getId, getVersion, hashCode, incrementVersion, setId, setVersionpublic JobExecution(JobInstance job, Long id, JobParameters jobParameters)
job - the job of which this execution is a partpublic JobExecution(JobInstance job, JobParameters jobParameters)
job - the enclosing JobInstancepublic JobExecution(Long id, JobParameters jobParameters)
public JobExecution(Long id)
public JobParameters getJobParameters()
public Date getEndTime()
public void setJobInstance(JobInstance jobInstance)
public void setEndTime(Date endTime)
public Date getStartTime()
public void setStartTime(Date startTime)
public BatchStatus getStatus()
public void setStatus(BatchStatus status)
status - the status to setpublic void upgradeStatus(BatchStatus status)
status - the new status valuepublic Long getJobId()
public void setExitStatus(ExitStatus exitStatus)
exitStatus - public ExitStatus getExitStatus()
public JobInstance getJobInstance()
public Collection<StepExecution> getStepExecutions()
public StepExecution createStepExecution(String stepName)
stepName - the name of the step the new execution is associated withpublic boolean isRunning()
JobExecution indicates that it is running. It should
be noted that this does not necessarily mean that it has been persisted
as such yet.public boolean isStopping()
JobExecution indicates that it has been signalled to
stop.BatchStatus.STOPPINGpublic void stop()
JobExecution to stop. Iterates through the associated
StepExecutions, calling StepExecution.setTerminateOnly().public void setExecutionContext(ExecutionContext executionContext)
ExecutionContext for this executionexecutionContext - the contextpublic ExecutionContext getExecutionContext()
ExecutionContext for this execution. The content is
expected to be persisted after each step completion (successful or not).public Date getCreateTime()
public void setCreateTime(Date createTime)
createTime - creation time of this execution.public Date getLastUpdated()
public void setLastUpdated(Date lastUpdated)
lastUpdated - public void addFailureException(Throwable t)
t - public List<Throwable> getAllFailureExceptions()
public void addStepExecutions(List<StepExecution> stepExecutions)
stepExecutions - step executions to add to the current listCopyright © 2014 Pivotal. All rights reserved.