BATCH-1053: refactor State and AbstractJob to remove cycle
This commit is contained in:
@@ -1,51 +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.job.flow.support;
|
||||
|
||||
import org.springframework.batch.core.job.flow.FlowExecution;
|
||||
import org.springframework.batch.core.job.flow.FlowExecutionStatus;
|
||||
import org.springframework.batch.core.job.flow.FlowExecutor;
|
||||
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
public interface State {
|
||||
|
||||
/**
|
||||
* The name of the state. Should be unique within a flow.
|
||||
*
|
||||
* @return the name of this state
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Handle some business or processing logic and return a status that can be
|
||||
* used to drive a flow to the next {@link State}. The status can be any
|
||||
* string, but special meaning is assigned to the static constants in
|
||||
* {@link FlowExecution}. The context can be used by implementations to do
|
||||
* whatever they need to do. The same context will be passed to all
|
||||
* {@link State} instances, so implementations should be careful that the
|
||||
* context is thread safe, or used in a thread safe manner.
|
||||
*
|
||||
* @param executor the context passed in by the caller
|
||||
* @return a {@link FlowExecutionStatus} for the execution
|
||||
* @throws Exception if anything goes wrong
|
||||
*/
|
||||
FlowExecutionStatus handle(FlowExecutor executor) throws Exception;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user