OPEN - issue BATCH-679: Add support package for flow concerns

This commit is contained in:
dsyer
2008-10-30 09:51:24 +00:00
parent b1292a82d7
commit 4718f0f006
28 changed files with 86 additions and 43 deletions

View File

@@ -17,9 +17,9 @@ package org.springframework.batch.core.configuration.xml;
import java.util.Collection;
import org.springframework.batch.core.job.flow.DecisionState;
import org.springframework.batch.core.job.flow.JobExecutionDecider;
import org.springframework.batch.core.job.flow.StateTransition;
import org.springframework.batch.core.job.flow.support.DecisionState;
import org.springframework.batch.core.job.flow.support.JobExecutionDecider;
import org.springframework.batch.core.job.flow.support.StateTransition;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;

View File

@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import org.springframework.batch.core.job.flow.Flow;
import org.springframework.batch.core.job.flow.SimpleFlow;
import org.springframework.batch.core.job.flow.support.SimpleFlow;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;

View File

@@ -19,9 +19,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.springframework.batch.core.job.flow.JobExecutionDecider;
import org.springframework.batch.core.job.flow.SplitState;
import org.springframework.batch.core.job.flow.StateTransition;
import org.springframework.batch.core.job.flow.support.JobExecutionDecider;
import org.springframework.batch.core.job.flow.support.SplitState;
import org.springframework.batch.core.job.flow.support.StateTransition;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;

View File

@@ -21,9 +21,9 @@ import java.util.List;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.job.flow.EndState;
import org.springframework.batch.core.job.flow.StateTransition;
import org.springframework.batch.core.job.flow.StepState;
import org.springframework.batch.core.job.flow.support.EndState;
import org.springframework.batch.core.job.flow.support.StateTransition;
import org.springframework.batch.core.job.flow.support.StepState;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;

View File

@@ -15,7 +15,6 @@
*/
package org.springframework.batch.core.job.flow;
/**
* @author Dave Syer
*
@@ -33,8 +32,8 @@ public interface Flow {
FlowExecution start(JobFlowExecutor executor) throws FlowExecutionException;
/**
* @param stateName the name of the {@link State} to resume on
* @param executor the context to be passed into each {@link State} executed
* @param stateName the name of the state to resume on
* @param executor the context to be passed into each state executed
* @return a {@link FlowExecution} containing the exit status of the flow
* @throws FlowExecutionException
*/

View File

@@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
/**

View File

@@ -1,4 +1,6 @@
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
/**
@@ -12,7 +14,7 @@ public class DecisionState extends AbstractState {
/**
* @param name
*/
DecisionState(JobExecutionDecider decider, String name) {
public DecisionState(JobExecutionDecider decider, String name) {
super(name);
this.decider = decider;
}

View File

@@ -1,7 +1,9 @@
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
/**
* {@link State} implementation for ending a job if it is in progress and
@@ -17,7 +19,7 @@ public class EndState extends AbstractState {
/**
* @param name
*/
EndState(BatchStatus status, String name) {
public EndState(BatchStatus status, String name) {
super(name);
this.status = status;
}

View File

@@ -13,10 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import java.util.Collection;
import org.springframework.batch.core.job.flow.FlowExecution;
/**
* Strategy interface for aggregating {@link FlowExecution} instances into a
* single exit status.

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;

View File

@@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import java.util.Collection;
import java.util.Collections;
import org.springframework.batch.core.job.flow.FlowExecution;
/**
* @author Dave Syer
*

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
/**
* @author Dave Syer

View File

@@ -1,7 +1,9 @@
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
/**
* @author Dave Syer
@@ -12,7 +14,7 @@ public class PauseState extends AbstractState {
/**
* @param name
*/
PauseState(String name) {
public PauseState(String name) {
super(name);
}

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import java.util.Collection;
import java.util.HashMap;
@@ -24,6 +24,10 @@ import java.util.SortedSet;
import java.util.TreeSet;
import org.springframework.batch.core.JobExecutionException;
import org.springframework.batch.core.job.flow.Flow;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.FlowExecutionException;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
import org.springframework.beans.factory.InitializingBean;
import com.sun.org.apache.xerces.internal.impl.xpath.XPath.Step;

View File

@@ -13,13 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import org.springframework.batch.core.job.flow.Flow;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.FlowExecutionException;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.core.task.TaskRejectedException;

View File

@@ -13,7 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.util.StringUtils;

View File

@@ -1,6 +1,7 @@
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
/**
* {@link State} implementation that delegates to a {@link JobFlowExecutor} to
@@ -16,7 +17,7 @@ public class StepState extends AbstractState {
/**
* @param step the step that will be executed
*/
StepState(Step step) {
public StepState(Step step) {
super(step.getName());
this.step = step;
}

View File

@@ -26,7 +26,7 @@ import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.flow.JobExecutionDecider;
import org.springframework.batch.core.job.flow.support.JobExecutionDecider;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -26,7 +26,7 @@ import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.flow.JobExecutionDecider;
import org.springframework.batch.core.job.flow.support.JobExecutionDecider;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;

View File

@@ -32,6 +32,13 @@ import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.UnexpectedJobExecutionException;
import org.springframework.batch.core.job.flow.support.DecisionState;
import org.springframework.batch.core.job.flow.support.EndState;
import org.springframework.batch.core.job.flow.support.JobExecutionDecider;
import org.springframework.batch.core.job.flow.support.PauseState;
import org.springframework.batch.core.job.flow.support.SimpleFlow;
import org.springframework.batch.core.job.flow.support.StateTransition;
import org.springframework.batch.core.job.flow.support.StepState;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
import org.springframework.batch.core.step.StepSupport;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -25,6 +25,11 @@ import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.FlowExecutionException;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
import org.springframework.batch.core.job.flow.support.SimpleFlow;
import org.springframework.batch.core.job.flow.support.StateTransition;
/**
* @author Dave Syer

View File

@@ -13,14 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
/**
* @author Dave Syer

View File

@@ -13,13 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.StartLimitExceededException;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
import org.springframework.batch.core.repository.JobRestartException;
/**

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -23,7 +23,7 @@ import java.util.Collections;
import org.junit.Test;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.MaxValueFlowExecutionAggregator;
import org.springframework.batch.core.job.flow.support.MaxValueFlowExecutionAggregator;
/**
* @author Dave Syer

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import static org.junit.Assert.assertEquals;
@@ -22,6 +22,9 @@ import java.util.Collection;
import org.easymock.EasyMock;
import org.junit.Test;
import org.springframework.batch.core.job.flow.Flow;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.support.SplitState;
import org.springframework.core.task.SimpleAsyncTaskExecutor;

View File

@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import org.springframework.batch.core.job.flow.AbstractState;
import org.springframework.batch.core.job.flow.FlowExecution;
import org.springframework.batch.core.job.flow.State;
import org.springframework.batch.core.job.flow.JobFlowExecutor;
import org.springframework.batch.core.job.flow.support.AbstractState;
import org.springframework.batch.core.job.flow.support.State;
/**
* Base class for {@link State} implementations.

View File

@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.job.flow;
package org.springframework.batch.core.job.flow.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.springframework.batch.core.job.flow.support.StateTransition;
/**
* @author Dave Syer