package market.Qms.qcm.service.impl;

import java.util.TimerTask;

import javax.servlet.ServletContext;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.hnshituo.basic.service.util.ServiceUtil;

public class AutoGetDesicionInfo extends TimerTask{
	private ApplicationContext context;

	public AutoGetDesicionInfo(ServletContext servletContext) {
		context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
	}
	private boolean fristStart = true;// 首次启动
	private static ServiceUtil util = new ServiceUtil();
//	private QcmJhyPhyresultService phyService;// 材质
	@Override
	public void run() {
		// TODO Auto-generated method stub
		if (fristStart) {
			util.setApplicationContext(context);
			fristStart = false;
			try {
//				phyService = util.getService(QcmJhyPhyresultServiceImpl.class);
			} catch (Exception ex) {
				System.out.print("创建自动判定相关类失败：" + ex.getMessage());
			}
		}
		try {
//			phyService.AutoGetDesicionInfo();
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
        
}
