JobInstance now creates JobExecutions instead of letting someone else.
This commit is contained in:
@@ -101,9 +101,10 @@ public class JobInstance extends Entity {
|
||||
return identifier==null ? null : identifier.getName();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.core.domain.Entity#toString()
|
||||
*/
|
||||
public JobExecution createNewJobExecution() {
|
||||
return new JobExecution(this);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return super.toString()+", identifier=["+identifier+"]";
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ class SimpleJobExecutorFacade implements JobExecutorFacade,
|
||||
|
||||
JobInstance job = jobRepository.findOrCreateJob(jobConfiguration,
|
||||
jobIdentifier);
|
||||
JobExecution execution = new JobExecution(job);
|
||||
JobExecution execution = job.createNewJobExecution();
|
||||
|
||||
// Save the JobExecution so that it picks up an ID (useful for clients
|
||||
// monitoring asynchronous executions):
|
||||
|
||||
Reference in New Issue
Block a user