use of com.creditease.agent.feature.nodeopagent.NodeOperHttpServer in project uavstack by uavorg.
the class NodeOperAgent method start.
@Override
public void start() {
IActionEngine engine = this.getActionEngineMgr().getActionEngine("NodeOperActionEngine");
// setup actions
new MOFInstallMgtAction("installmof", feature, engine);
new MOFInstallMgtAction("uninstallmof", feature, engine);
new MSCPGeneralAction("fstart", feature, engine);
new MSCPGeneralAction("fstop", feature, engine);
new MSCPGeneralAction("killproc", feature, engine);
new MSCPGeneralAction("kill", feature, engine);
new MSCPGeneralAction("shutdown", feature, engine);
new MSCPGeneralAction("chgsyspro", feature, engine);
new MSCPGeneralAction("loadnodepro", feature, engine);
new MSCPGeneralAction("chgnodepro", feature, engine);
new MSCPGeneralAction("watch", feature, engine);
new MSCPGeneralAction("unwatch", feature, engine);
new MSCPGeneralAction("upgrade", feature, engine);
new MSCPGeneralAction("restart", feature, engine);
new MSCPGeneralAction("stopuav", feature, engine);
new MOFCtrlAction("ctrlmof", feature, engine);
// start HeartBeatServerListenWorker
nodeOperHttpServer = new NodeOperHttpServer("NodeOperHttpServer", this.feature, "nodeophandlers");
int port = DataConvertHelper.toInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.port"), 10101);
int backlog = DataConvertHelper.toInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.backlog"), 10);
int core = DataConvertHelper.toInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.core"), 5);
int max = DataConvertHelper.toInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.max"), 10);
int bqsize = DataConvertHelper.toInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.bqsize"), 10);
@SuppressWarnings({ "rawtypes", "unchecked" }) ThreadPoolExecutor exe = new ThreadPoolExecutor(core, max, 30000, TimeUnit.MILLISECONDS, new ArrayBlockingQueue(bqsize));
/**
* if the node ctrl server port conflicts, the node process will exit
*/
nodeOperHttpServer.start(exe, port, backlog, true);
if (log.isTraceEnable()) {
log.info(this, "NodeOperHttpServer started");
}
}
Aggregations