OPEN - issue BATCH-324: Step as factory for StepExecutor
http://jira.springframework.org/browse/BATCH-324 Substantial re-org of core domain packages to align concerns
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
/**
|
||||
* Checked exception indicating that an Incorrect number of jobs has
|
||||
* been found.
|
||||
*
|
||||
* @author Lucas Ward
|
||||
*
|
||||
*/
|
||||
public class IncorrectJobCountException extends JobException {
|
||||
|
||||
public IncorrectJobCountException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
public IncorrectJobCountException(String msg, Throwable e) {
|
||||
super(msg, e);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.executor;
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -14,10 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.core.executor;
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
import org.springframework.batch.core.domain.JobExecution;
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import org.springframework.batch.core.executor.StepExecutor;
|
||||
|
||||
/**
|
||||
* Batch domain interface representing the configuration of a step. As with the
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
/**
|
||||
* Interface for processing a step. Implementations are free to process the step
|
||||
* and return when finished, or to schedule the step for processing
|
||||
* concurrently, or in the future. The status of the execution should be
|
||||
* trackable with the step execution. The step should be treated as immutable.<br/>
|
||||
*
|
||||
* Because step execution parameters and policies can vary from step to step, a
|
||||
* {@link StepExecutor} should be created by the caller using a {@link Step}.
|
||||
*
|
||||
* @author Lucas Ward
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public interface StepExecutor {
|
||||
|
||||
/**
|
||||
* It is not safe to re-use an instance of {@link StepExecutor} to process
|
||||
* multiple concurrent executions. Use the factory method in {@link Step} to
|
||||
* create a new instance and execute that.
|
||||
*
|
||||
* @param stepExecution an entity representing the step to be executed
|
||||
*
|
||||
* @throws StepInterruptedException if the step is interrupted externally
|
||||
* @throws BatchCriticalException if there is a problem that needs to be
|
||||
* signalled to the caller
|
||||
*/
|
||||
ExitStatus process(StepExecution stepExecution) throws StepInterruptedException, BatchCriticalException;
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.core.executor;
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
|
||||
import org.springframework.batch.core.executor.StepExecutor;
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright 2006-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.core.executor;
|
||||
|
||||
import org.springframework.batch.core.domain.Step;
|
||||
import org.springframework.batch.core.domain.StepExecution;
|
||||
import org.springframework.batch.io.exception.BatchCriticalException;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
|
||||
/**
|
||||
* Interface for processing a step. Implementations are free to process the step
|
||||
* and return when finished, or to schedule the step for processing
|
||||
* concurrently, or in the future. The status of the execution should be
|
||||
* trackable with the step execution. The step should be treated as
|
||||
* immutable.<br/>
|
||||
*
|
||||
* Because step execution parameters and policies can vary from step to step, a
|
||||
* {@link StepExecutor} should be created by the caller using a
|
||||
* {@link StepExecutorFactory}.
|
||||
*
|
||||
* @author Lucas Ward
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public interface StepExecutor {
|
||||
|
||||
/**
|
||||
* Process the step according to the given step. Implementations
|
||||
* can be expected to modify their state when this method is called, to take
|
||||
* account of any policy information in the step. Thus it is not
|
||||
* safe to re-use an instance of {@link StepExecutor} to process multiple
|
||||
* concurrent executions.
|
||||
*
|
||||
* @param step
|
||||
* the configuration to use when running the step. Contains a
|
||||
* recipe for the business logic of an individual processing
|
||||
* operation. Also used to determine policies for commit
|
||||
* intervals and exception handling, for instance.
|
||||
*
|
||||
* @param stepExecution
|
||||
* an entity representing the step to be executed
|
||||
* @throws StepInterruptedException
|
||||
* if the step is interrupted externally
|
||||
* @throws BatchCriticalException
|
||||
* if there is a problem that needs to be signalled to the
|
||||
* caller
|
||||
*/
|
||||
ExitStatus process(Step step,
|
||||
StepExecution stepExecution) throws StepInterruptedException,
|
||||
BatchCriticalException;
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<p>
|
||||
Interfaces and generic implementations of executor concerns.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -13,7 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
|
||||
/**
|
||||
* Checked exception that indicates a name clash when registering
|
||||
@@ -13,7 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
|
||||
/**
|
||||
* Base class for checked exceptions related to {@link Job}
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import org.springframework.batch.core.executor.JobExecutionException;
|
||||
import org.springframework.batch.core.domain.JobExecutionException;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
|
||||
/**
|
||||
* A runtime service locator interface for retrieving job configurations by
|
||||
@@ -13,7 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
|
||||
/**
|
||||
* A runtime service registry interface for registering job configurations by
|
||||
@@ -13,10 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
|
||||
/**
|
||||
* A listable extension of {@link JobRegistry}.
|
||||
*
|
||||
@@ -13,7 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.domain;
|
||||
package org.springframework.batch.core.repository;
|
||||
|
||||
import org.springframework.batch.core.domain.Job;
|
||||
|
||||
|
||||
/**
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.batch.core.executor;
|
||||
package org.springframework.batch.core.runtime;
|
||||
|
||||
import org.springframework.batch.common.ExceptionClassifier;
|
||||
import org.springframework.batch.repeat.ExitStatus;
|
||||
Reference in New Issue
Block a user