| 12345678910111213141516171819202122232425262728293031 |
- package QCM.JHY01.JHY0102;
- import java.util.Timer;
- import javax.servlet.ServletContext;
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServlet;
- /**
- * 定时类
- * @author dell
- *
- */
- public class AutoTimeEntrust extends HttpServlet {
- private boolean running=true;
- private static ServletContext context;
- public static ServletContext getContext(){
- return context;
- }
-
- public void init() throws ServletException {
- if(running){
- context=this.getServletContext();
- //new Timer().scheduleAtFixedRate(new AutoTimeEntrustTask(context),0,10*60*1000);
- //24*60*60*1000
- System.out.println("定时开始10分钟刷一次");
- }
- }
- }
|