com.yomahub.liteflow.solon.config.LiteflowMainAutoConfiguration Maven / Gradle / Ivy
The newest version!
package com.yomahub.liteflow.solon.config;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.FlowBus;
import com.yomahub.liteflow.property.LiteflowConfig;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Init;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.AppContext;
/**
* 主要的业务装配器 在这个装配器里装配了执行器,执行器初始化类,监控器
* 这个装配前置条件是需要LiteflowConfig,LiteflowPropertyAutoConfiguration以及SpringAware
*
* @author Bryan.Zhang
* @author noear
* @since 2.9
*/
@Configuration
public class LiteflowMainAutoConfiguration {
@Inject(value = "${liteflow.parseOnStart:true}", required = false)
boolean parseOnStart;
@Inject
AppContext appContext;
@Inject
LiteflowConfig liteflowConfig;
@Init
public void flowExecutor() {
//
// 实例化FlowExecutor
//
FlowExecutor flowExecutor = new FlowExecutor();
flowExecutor.setLiteflowConfig(liteflowConfig);
if (parseOnStart) {
flowExecutor.init(true);
FlowBus.needInit();
}
appContext.wrapAndPut(FlowExecutor.class, flowExecutor);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy