Batch-295:Added DefaultJobLauncher, which implements the JobLauncher interface in a different. Misc. other changes were made in support of this.

This commit is contained in:
lucasward
2008-01-18 00:42:41 +00:00
parent 0d43f7d307
commit 8565fdc069
6 changed files with 51 additions and 31 deletions

View File

@@ -34,27 +34,27 @@ public class JobInstance extends Entity {
private List stepInstances = new ArrayList();
private JobIdentifier identifier;
private Job job;
// TODO declare transient or make the class serializable
private BatchStatus status;
private int jobExecutionCount;
/**
* Package private constructor for Hibernate use only
*/
JobInstance() {
this(null);
public JobInstance(JobIdentifier jobIdentifier){
this.identifier = jobIdentifier;
}
public JobInstance(JobIdentifier identifier, Long id) {
public JobInstance(JobIdentifier identifier, Long id, Job job) {
super();
setId(id);
this.identifier = identifier;
this.job = job;
}
public JobInstance(JobIdentifier identifier) {
this(identifier, null);
public JobInstance(JobIdentifier jobIdentifier, Long id){
this(jobIdentifier, id, null);
}
public BatchStatus getStatus() {
@@ -108,5 +108,12 @@ public class JobInstance extends Entity {
public String toString() {
return super.toString()+", identifier=["+identifier+"]";
}
public Job getJob() {
return job;
}
public void setJob(Job job) {
this.job = job;
}
}

View File

@@ -48,7 +48,7 @@ import org.springframework.batch.restart.RestartData;
*/
public class StepInstance extends Entity {
private JobInstance job;
private JobInstance jobInstance;
// TODO declare transient or make serializable
private BatchStatus status;
@@ -76,7 +76,7 @@ public class StepInstance extends Entity {
public StepInstance(JobInstance job, String name, Long stepId) {
setId(stepId);
this.job = job;
this.jobInstance = job;
this.name = name;
}
@@ -104,8 +104,8 @@ public class StepInstance extends Entity {
this.status = status;
}
public JobInstance getJob() {
return job;
public JobInstance getJobInstance() {
return jobInstance;
}
public String getName() {
@@ -113,12 +113,12 @@ public class StepInstance extends Entity {
}
public Long getJobId() {
return job==null ? null : job.getId();
return jobInstance==null ? null : jobInstance.getId();
}
// @Override
public String toString() {
return super.toString() + ", name=" + name + ", status=" + getStatus() + " in " + job;
return super.toString() + ", name=" + name + ", status=" + getStatus() + " in " + jobInstance;
}
}