package com.github.zengfr.project.stepchain.pipeline;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.github.zengfr.project.stepchain.*;
import com.github.zengfr.project.stepchain.context.BinaryContext;
import com.github.zengfr.project.stepchain.context.DataContext;
import com.github.zengfr.project.stepchain.context.TernaryContext;
import com.github.zengfr.project.stepchain.context.UnaryContext;
import com.github.zengfr.project.stepchain.step.StepBuilder;
/**
* @author zengfr QQ:362505707/1163551688 Email:zengfr3000@qq.com
* https://github.com/zengfr/stepchain-spring-boot-starter
*/
@Component
public class Pipeline implements IPipeline {
@Autowired
protected IContextBuilder contextBuilder;
@Autowired
protected IChainBuilder chainBuilder;
@Autowired
protected StepBuilder stepBuilder;
@Autowired
protected IProcessorBuilder processorBuilder;
@Override
public <A, B> IChain<A, B> createChain(Function<A, B> func) {
return chainBuilder.createChain(func);
}
@Override
public <A, B> IChain<A, B> createChain(IProcessor<A, B> processor) {
return chainBuilder.createChain(processor);
}
@Override
public <A, B, C> IChain<A, C> createChain(Function<A, B> func1, Function<B, C> func2) {
return chainBuilder.createChain(func1, func2);
}
@Override
public <A, B, C> IChain<A, C> createChain(IProcessor<A, B> processor1, IProcessor<B, C> processor2) {
return chainBuilder.createChain(processor1, processor2);
}
@Override
public <A, B, C> IChain<A, C> createChain(IProcessor<A, B> processor, IChain<B, C> chain) {
return chainBuilder.createChain(processor, chain);
}
@Override
public <A, B, C> IChain<A, C> createChain(IChain<A, B> chain1, IChain<B, C> chain2) {
return chainBuilder.createChain(chain1, chain2);
}
@Override
public <A, B, C> IChain<A, C> createChain(IChain<A, B> chain, IProcessor<B, C> processor) {
return chainBuilder.createChain(chain, processor);
}
@Override
public <T> IStep<T> createStep() {
return stepBuilder.createStep();
}
@Override
public <T> IStep<T> createStep(int parallelCount) {
return stepBuilder.createStep(parallelCount);
}
@Override
public <T> IStep<T> createStep(String parallelCountConfigName) {
return stepBuilder.createStep(parallelCountConfigName);
}
@Override
public <I> IProcessor<I, Boolean> createProcessor(Predicate<I> predicate) {
return processorBuilder.createProcessor(predicate);
}
@Override
public <I> IProcessor<I, Boolean> createProcessor(Consumer<I> consumer) {
return processorBuilder.createProcessor(consumer);
}
@Override
public <I, O> IProcessor<I, O> createProcessor(Function<I, O> func) {
return processorBuilder.createProcessor(func);
}
@Override
public <A, B, C> IProcessor<A, C> createProcessor(IProcessor<A, B> first, IProcessor<B, C> second) {
return processorBuilder.createProcessor(first, second);
}
@Override
public <A, B, C, D> IProcessor<A, D> createProcessor(IProcessor<A, B> processor1, IProcessor<B, C> processor2, IProcessor<C, D> processor3) {
return processorBuilder.createProcessor(processor1, processor2, processor3);
}
@Override
public <I, O> IConditionLoopProcessor<I, O> createConditionLoopProcessor(IProcessor<I, Boolean> validator, IProcessor<I, O> processor) {
return processorBuilder.createConditionLoopProcessor(validator, processor);
}
@Override
public <I, O> IConditionValidatorProcessor<I, O> createConditionValidatorProcessor(IProcessor<I, Boolean> validator, IProcessor<I, O> trueProcessor, IProcessor<I, O> falseProcessor) {
return processorBuilder.createConditionValidatorProcessor(validator, trueProcessor, falseProcessor);
}
@Override
public <I, O> IConditionValidatorSelectorProcessor<I, O> createConditionValidatorSelectorProcessor() {
return processorBuilder.createConditionValidatorSelectorProcessor();
}
@Override
public <I, S, O> IConditionSelectorProcessor<I, S, O> createConditionSelectorProcessor(IProcessor<I, S> selector) {
return processorBuilder.createConditionSelectorProcessor(selector);
}
@Override
public <I, S, O> IConditionSelectorProcessor<I, S, O> createConditionSelectorProcessor(IProcessor<I, S> selector, Map<S, IProcessor<I, O>> branchs) {
return processorBuilder.createConditionSelectorProcessor(selector, branchs);
}
@Override
public <A> UnaryContext<A> createContext(A context) {
return contextBuilder.createContext(context);
}
@Override
public <A, B> BinaryContext<A, B> createContext(A input, B output) {
return contextBuilder.createContext(input, output);
}
@Override
public <A, B, C> DataContext<A, B, C> createContext(A left, B middle, C right) {
return contextBuilder.createContext(left, middle, right);
}
@Override
public <A, B, C> DataContext<A, B, C> createContext() {
return contextBuilder.createContext();
}
@Override
public <I, O> IProcessor<I, O> createScheduledFixedDelayProcessor(IProcessor<I, O> processor, Long milliseconds) {
return processorBuilder.createScheduledFixedDelayProcessor(processor, milliseconds);
}
@Override
public <I, O> IProcessor<I, O> createScheduledFixedRateProcessor(IProcessor<I, O> processor, Long milliseconds) {
return processorBuilder.createScheduledFixedRateProcessor(processor, milliseconds);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
stepchain-master.zip
共86个文件
java:66个
jpg:5个
xml:3个
0 下载量 50 浏览量
2022-12-07
11:52:56
上传
评论
收藏 707KB ZIP 举报
温馨提示
stepchain 通用业务流程流水线处理框架。 类似于Commons Chain和Commons Pipeline这样的Java Pipeline Step Chain用于组织复杂处理流程执行的流行技术. Java Pipeline Step Chain like Apache Commons Chain and Commons Pipeline.A popular technique for organizing the execution of complex processing flows is the "Chain of Responsibility" pattern
资源推荐
资源详情
资源评论
收起资源包目录
stepchain-master.zip (86个子文件)
stepchain-master
LICENSE 11KB
stepchain-spring-boot-starter
pom.xml 2KB
src
test
java
com
github
zengfr
project
stepchain
test
StepChainTestApplication.java 457B
StepChainSpringBootTest.java 714B
main
resources
META-INF
spring.factories 132B
log4j2.xml 635B
log4j.properties 367B
java
com
github
zengfr
project
stepchain
spring
StepChainAutoConfiguration.java 783B
.project 1KB
.classpath 1KB
.gitignore 21B
stepchain
pom.xml 921B
src
test
java
com
github
zengfr
project
stepchain
test
processor
InitProcessor.java 807B
TaxProcessor.java 752B
FeeProcessor.java 752B
DiscountProcessor.java 776B
IncreaseProcessor.java 772B
SetProductResponse.java 120B
PipelineTest.java 4KB
context
SetProductContext.java 494B
DataMiddle.java 263B
SetProductDataMiddle.java 143B
SetProductRequest.java 152B
main
resources
META-INF
spring.factories 0B
stepchain-javadoc.PNG 55KB
pipeline.jpg 57KB
step.jpg 41KB
chain.jpg 29KB
processor.jpg 94KB
zengfr-stepchain.jpg 208KB
zengfr-stepchain.png 264KB
java
com
github
zengfr
project
stepchain
executor
ThreadPoolFactory.java 1KB
StepAsyncExecutor.java 2KB
StepSyncExecutor.java 1KB
IConditionValidatorProcessor.java 157B
IContext.java 78B
IHandler.java 222B
pipeline
Pipeline.java 5KB
processor
ConditionLoopProcessor.java 960B
FunctionProcessor.java 578B
CompositeProcessor.java 717B
ProcessorBuilder.java 4KB
EmptyStepProcessor.java 422B
ConditionSelectorProcessor.java 1KB
AbstractScheduledProcessor.java 2KB
ConsumerProcessor.java 466B
ConditionValidatorProcessor.java 281B
EmptyProcessor.java 416B
ScheduledFixedRateProcessor.java 800B
ConditionValidatorSelectorProcessor.java 1KB
PredicateProcessor.java 603B
ScheduledFixedDelayProcessor.java 909B
IPipeline.java 410B
IConditionSelectorProcessor.java 273B
IChainBuilder.java 806B
config
MemoryConfig.java 1KB
IStepBuilder.java 354B
IStep.java 1KB
IProcessor.java 288B
IExecutor.java 327B
IContextBuilder.java 542B
IStepProcessor.java 256B
package-info.java 372B
AbstractProcessor.java 784B
IConditionLoopProcessor.java 221B
IConfig.java 468B
IStepExecutor.java 249B
IExceptionHandler.java 317B
AbstractStepProcessor.java 1KB
chain
Chain.java 1KB
ChainBuilder.java 2KB
step
StepBuilder.java 932B
Step.java 4KB
IConditionValidatorSelectorProcessor.java 282B
context
DataContext.java 244B
TernaryContext.java 372B
ContextBuilder.java 684B
BinaryContext.java 321B
UnaryContext.java 278B
util
ProcessorUtil.java 2KB
IChain.java 545B
IProcessorBuilder.java 2KB
IExecuteHandler.java 347B
.project 1KB
.classpath 1KB
.gitignore 21B
共 86 条
- 1
资源评论
m0_72731342
- 粉丝: 0
- 资源: 1829
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功