spring-batch JobFlowBuilder 源码
spring-batch JobFlowBuilder 代码
文件路径:/spring-batch-core/src/main/java/org/springframework/batch/core/job/builder/JobFlowBuilder.java
/*
* Copyright 2012-2013 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
*
* https://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.builder;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.job.flow.Flow;
import org.springframework.batch.core.job.flow.JobExecutionDecider;
import org.springframework.beans.factory.InitializingBean;
/**
* @author Dave Syer
*
*/
public class JobFlowBuilder extends FlowBuilder<FlowJobBuilder> {
private FlowJobBuilder parent;
public JobFlowBuilder(FlowJobBuilder parent) {
super(parent.getName());
this.parent = parent;
}
public JobFlowBuilder(FlowJobBuilder parent, Step step) {
super(parent.getName());
this.parent = parent;
start(step);
}
public JobFlowBuilder(FlowJobBuilder parent, JobExecutionDecider decider) {
super(parent.getName());
this.parent = parent;
start(decider);
}
public JobFlowBuilder(FlowJobBuilder parent, Flow flow) {
super(parent.getName());
this.parent = parent;
start(flow);
}
/**
* Build a flow and inject it into the parent builder. The parent builder is then
* returned so it can be enhanced before building an actual job. Normally called
* explicitly via {@link #end()}.
*
* @see org.springframework.batch.core.job.builder.FlowBuilder#build()
*/
@Override
public FlowJobBuilder build() {
Flow flow = flow();
if (flow instanceof InitializingBean) {
try {
((InitializingBean) flow).afterPropertiesSet();
}
catch (Exception e) {
throw new FlowBuilderException(e);
}
}
parent.flow(flow);
return parent;
}
}
相关信息
相关文章
spring-batch FlowBuilderException 源码
spring-batch FlowJobBuilder 源码
spring-batch JobBuilderException 源码
spring-batch JobBuilderHelper 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦