JobInstance now creates JobExecutions instead of letting someone else.

This commit is contained in:
nebhale
2007-11-27 09:32:38 +00:00
parent 17cead220c
commit bdb199760e
2 changed files with 5 additions and 4 deletions

View File

@@ -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+"]";
}

View File

@@ -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):