|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.Entity org.springframework.batch.core.JobExecution
public class JobExecution
Batch domain object representing the execution of a job.
Constructor Summary | |
---|---|
JobExecution(JobInstance job)
Constructor for transient (unsaved) instances. |
|
JobExecution(JobInstance job,
Long id)
Because a JobExecution isn't valid unless the job is set, this constructor is the only valid one from a modelling point of view. |
|
JobExecution(Long id)
|
Method Summary | |
---|---|
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()
|
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. |
Methods inherited from class org.springframework.batch.core.Entity |
---|
equals, getId, getVersion, hashCode, incrementVersion, setId, setVersion |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JobExecution(JobInstance job, Long id)
job
- the job of which this execution is a partpublic JobExecution(JobInstance job)
job
- the enclosing JobInstance
public JobExecution(Long id)
Method Detail |
---|
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.STOPPING
public void stop()
JobExecution
to stop. Iterates through the associated
StepExecution
s, calling StepExecution.setTerminateOnly()
.
public void setExecutionContext(ExecutionContext executionContext)
ExecutionContext
for this execution
executionContext
- 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 List<Throwable> getFailureExceptions()
public void addFailureException(Throwable t)
t
- public List<Throwable> getAllFailureExceptions()
public String toString()
toString
in class Entity
public void addStepExecutions(List<StepExecution> stepExecutions)
stepExecutions
- step executions to add to the current list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |