423461cb17629fdcc1731aa2d36370129f2113b5.svn-base 701 B

12345678910111213141516171819202122232425262728293031
  1. package QCM.JHY01.JHY0102;
  2. import java.util.Timer;
  3. import javax.servlet.ServletContext;
  4. import javax.servlet.ServletException;
  5. import javax.servlet.http.HttpServlet;
  6. /**
  7. * 定时类
  8. * @author dell
  9. *
  10. */
  11. public class AutoTimeEntrust extends HttpServlet {
  12. private boolean running=true;
  13. private static ServletContext context;
  14. public static ServletContext getContext(){
  15. return context;
  16. }
  17. public void init() throws ServletException {
  18. if(running){
  19. context=this.getServletContext();
  20. //new Timer().scheduleAtFixedRate(new AutoTimeEntrustTask(context),0,10*60*1000);
  21. //24*60*60*1000
  22. System.out.println("定时开始10分钟刷一次");
  23. }
  24. }
  25. }