OPEN - issue BATCH-791: Ditch Tasklet (StepHandler is more flexible)

Done.  Use StepHandler instead.
This commit is contained in:
dsyer
2008-08-26 09:15:13 +00:00
parent 0111123bb7
commit 207e882e37
39 changed files with 211 additions and 605 deletions

View File

@@ -15,19 +15,22 @@
*/
package org.springframework.batch.integration.job;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.step.handler.StepHandler;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.core.AttributeAccessor;
/**
* @author Dave Syer
*
*
*/
public class TestTasklet implements Tasklet {
public class TestStepHandler implements StepHandler {
/* (non-Javadoc)
* @see org.springframework.batch.core.step.tasklet.Tasklet#execute()
/*
* (non-Javadoc)
*
*/
public ExitStatus execute() throws Exception {
public ExitStatus handle(StepContribution contribution, AttributeAccessor attributes) throws Exception {
return ExitStatus.FINISHED;
}

View File

@@ -33,11 +33,10 @@
<property name="steps" ref="step" />
</bean>
<bean id="step" class="org.springframework.batch.core.step.tasklet.TaskletStep">
<property name="tasklet">
<bean class="org.springframework.batch.integration.job.TestTasklet" />
<bean id="step" parent="handlerStep">
<property name="stepHandler">
<bean class="org.springframework.batch.integration.job.TestStepHandler" />
</property>
<property name="jobRepository" ref="jobRepository" />
</bean>
</beans>

View File

@@ -26,9 +26,10 @@
<property name="jobRepository" ref="jobRepository" />
<property name="restartable" value="true" />
</bean>
<bean id="taskletStep"
class="org.springframework.batch.core.step.tasklet.TaskletStep"
<bean id="handlerStep"
class="org.springframework.batch.core.step.handler.StepHandlerStep"
abstract="true">
<property name="transactionManager" ref="transactionManager" />
<property name="jobRepository" ref="jobRepository" />
<property name="allowStartIfComplete" value="true" />
</bean>