Search in sources :

Example 1 with MDFListenServer

use of com.creditease.agent.feature.monitoragent.MDFListenServer in project uavstack by uavorg.

the class MonitorAgent method startMDSListenServer.

private void startMDSListenServer() {
    boolean isStartMDFListener = DataConvertHelper.toBoolean(this.getConfigManager().getFeatureConfiguration(this.feature, "http.enable"), false);
    if (isStartMDFListener == true) {
        // start MDFListenServer
        int port = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.port"));
        int backlog = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.backlog"));
        int core = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.core"));
        int max = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.max"));
        int bqsize = Integer.parseInt(this.getConfigManager().getFeatureConfiguration(this.feature, "http.bqsize"));
        mdfListenServer = new MDFListenServer("MDFListenServer", this.feature, "mdfhandlers");
        @SuppressWarnings({ "rawtypes", "unchecked" }) ThreadPoolExecutor exe = new ThreadPoolExecutor(core, max, 30000, TimeUnit.MILLISECONDS, new ArrayBlockingQueue(bqsize));
        mdfListenServer.start(exe, port, backlog);
        if (log.isTraceEnable()) {
            log.info(this, "MDFListenServer started");
        }
    }
}
Also used : ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) MDFListenServer(com.creditease.agent.feature.monitoragent.MDFListenServer) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Aggregations

MDFListenServer (com.creditease.agent.feature.monitoragent.MDFListenServer)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1