package market.Qms.qcm.service.impl;

import java.util.Timer;

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

public class AutoGetDesicionInfoServlet  extends HttpServlet{
	 private boolean running=false;//是否开启自动获取数据
	    private static ServletContext context;
	    public static ServletContext getContext(){
	    	return context;
	    }
	    
	    public void init() throws ServletException {
	    	if(running){
		    	context=this.getServletContext();
		        System.out.println("--------------开启自动获取数据--------------------");
		        // 自动判定
		        new Timer().scheduleAtFixedRate(new AutoGetDesicionInfo(context),0,1800*1000);
	    	}
	    }
}
