OPEN - issue BATCH-324: Step as factory for StepExecutor

http://jira.springframework.org/browse/BATCH-324

Same treatment for JobExecutor - roll it up into the Job interface
This commit is contained in:
dsyer
2008-01-29 18:07:57 +00:00
parent 3d7f40ca90
commit 911e368a71
64 changed files with 486 additions and 581 deletions

View File

@@ -17,6 +17,7 @@
package org.springframework.batch.sample;
import org.springframework.batch.core.domain.Job;
import org.springframework.batch.core.domain.JobSupport;
import org.springframework.batch.core.domain.JobParameters;
import org.springframework.batch.execution.launch.JobLauncher;
import org.springframework.context.ApplicationContext;
@@ -60,7 +61,7 @@ public abstract class AbstractBatchLauncherTests extends
}
/**
* Public setter for the {@link Job} property.
* Public setter for the {@link JobSupport} property.
*
* @param job the job to set
*/

View File

@@ -8,6 +8,7 @@ import java.util.Iterator;
import java.util.Map;
import org.springframework.batch.core.domain.Job;
import org.springframework.batch.core.domain.JobSupport;
import org.springframework.batch.core.repository.ListableJobRegistry;
import org.springframework.batch.core.repository.NoSuchJobException;
import org.springframework.beans.BeanWrapperImpl;
@@ -50,7 +51,7 @@ public class DefaultJobLoader implements JobLoader,
public void loadResource(String path) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
new String[] { path }, applicationContext);
String[] names = context.getBeanNamesForType(Job.class);
String[] names = context.getBeanNamesForType(JobSupport.class);
for (int i = 0; i < names.length; i++) {
String name = names[i];
configurations.put(name, path);

View File

@@ -8,7 +8,7 @@ import java.util.List;
import java.util.Set;
import org.springframework.batch.core.domain.BatchStatus;
import org.springframework.batch.core.domain.Job;
import org.springframework.batch.core.domain.JobSupport;
import org.springframework.batch.core.domain.JobExecution;
import org.springframework.batch.core.domain.JobInstance;
import org.springframework.batch.core.domain.JobParameters;
@@ -22,7 +22,7 @@ public class JdbcJobRepositoryTests extends AbstractTransactionalDataSourceSprin
private JobRepository repository;
private Job jobConfiguration;
private JobSupport jobConfiguration;
private Set jobExecutionIds = new HashSet();
@@ -39,7 +39,7 @@ public class JdbcJobRepositoryTests extends AbstractTransactionalDataSourceSprin
}
protected void onSetUpInTransaction() throws Exception {
jobConfiguration = new Job("test-job");
jobConfiguration = new JobSupport("test-job");
jobConfiguration.setRestartable(true);
}

View File

@@ -1,6 +1,6 @@
package org.springframework.batch.sample.item.writer;
import org.springframework.batch.core.domain.Job;
import org.springframework.batch.core.domain.JobSupport;
import org.springframework.batch.core.domain.JobExecution;
import org.springframework.batch.core.domain.JobInstance;
import org.springframework.batch.core.domain.JobParameters;
@@ -27,7 +27,7 @@ public class StagingItemProcessorTests extends AbstractTransactionalDataSourceSp
protected void prepareTestInstance() throws Exception {
SimpleStepContext stepScopeContext = new SimpleStepContext(new StepExecution(new StepInstance(new Long(11)),
new JobExecution(new JobInstance(new Long(12), new JobParameters(), new Job("job")))));
new JobExecution(new JobInstance(new Long(12), new JobParameters(), new JobSupport("job")))));
StepSynchronizationManager.register(stepScopeContext);
super.prepareTestInstance();
}