package com.steering.jobface.mch;

import java.util.Timer;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.Logger;


public class CoreRtdMeasurePosDataServlet extends HttpServlet {
    /**
     * @Fields serialVersionUID :
     */


    public void init() throws ServletException {
        //定时扫描数据库
        long schceduleTimeMin = 10l;

        ScheduledExecutorService schedule = Executors.newScheduledThreadPool(1);

        // 成品测量点数据采集 2个数据源 定时扫描 20s 短时间 扫描前200条数据
        schedule.scheduleWithFixedDelay(
                new CoreRtdMeasurePosDataHelper(),
                1, 30, TimeUnit.SECONDS);




   /*     // 成品测量点数据采集 2个数据源 定时扫描 20s 短时间 扫描前200条数据
        new Timer().scheduleAtFixedRate(new CoreRtdMeasurePosDataHelper(), 10,
                schceduleTimeMin  * 1000);*/

    }



}
