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

@@ -115,7 +115,6 @@
<bean id="jobLauncher"
class="org.springframework.batch.execution.launch.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
<property name="jobExecutor" ref="jobExecutor" />
<property name="taskExecutor">
<bean
class="org.springframework.core.task.SimpleAsyncTaskExecutor" />

View File

@@ -12,9 +12,7 @@
<bean parent="stepScope" />
<bean parent="jobConfigurationRegistryBeanPostProcessor" />
<bean id="footballJob"
class="org.springframework.batch.core.domain.Job">
<property name="restartable" value="true" />
<bean id="footballJob" parent="simpleJob">
<property name="startLimit" value="100" />
<property name="steps">
<list>

View File

@@ -13,7 +13,6 @@
<bean parent="jobConfigurationRegistryBeanPostProcessor"/>
<bean id="jobLauncher" class="org.springframework.batch.execution.launch.SimpleJobLauncher">
<property name="jobExecutor" ref="jobExecutor" />
<property name="jobRepository" ref="jobRepository" />
<property name="taskExecutor">
<bean class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>

View File

@@ -24,7 +24,6 @@
<bean id="jobLauncher"
class="org.springframework.batch.execution.launch.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
<property name="jobExecutor" ref="jobExecutor" />
</bean>
<bean id="jobConfigurationRegistry"
@@ -44,11 +43,6 @@
</tx:attributes>
</tx:advice>
<bean id="jobExecutor"
class="org.springframework.batch.execution.job.DefaultJobExecutor">
<property name="jobRepository" ref="jobRepository" />
</bean>
<bean id="jobRepository"
class="org.springframework.batch.execution.repository.SimpleJobRepository">
<constructor-arg ref="jobDao" />
@@ -84,7 +78,8 @@
</bean>
<bean id="simpleJob"
class="org.springframework.batch.core.domain.Job" abstract="true">
class="org.springframework.batch.execution.job.simple.SimpleJob" abstract="true">
<property name="jobRepository" ref="jobRepository" />
<property name="restartable" value="true" />
</bean>

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();
}