Search in sources :

Example 1 with MOFInstallMgtAction

use of com.creditease.agent.feature.nodeopagent.actions.MOFInstallMgtAction 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");
    }
}
Also used : NodeOperHttpServer(com.creditease.agent.feature.nodeopagent.NodeOperHttpServer) MSCPGeneralAction(com.creditease.agent.feature.nodeopagent.actions.MSCPGeneralAction) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) MOFInstallMgtAction(com.creditease.agent.feature.nodeopagent.actions.MOFInstallMgtAction) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) IActionEngine(com.creditease.agent.spi.IActionEngine) MOFCtrlAction(com.creditease.agent.feature.nodeopagent.actions.MOFCtrlAction)

Aggregations

NodeOperHttpServer (com.creditease.agent.feature.nodeopagent.NodeOperHttpServer)1 MOFCtrlAction (com.creditease.agent.feature.nodeopagent.actions.MOFCtrlAction)1 MOFInstallMgtAction (com.creditease.agent.feature.nodeopagent.actions.MOFInstallMgtAction)1 MSCPGeneralAction (com.creditease.agent.feature.nodeopagent.actions.MSCPGeneralAction)1 IActionEngine (com.creditease.agent.spi.IActionEngine)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1