PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/webccr/src/com/emis/caesarui/webccr/core/PromotionUpdateThread.java

https://bitbucket.org/sanliou/synccr
Java | 34 lines | 20 code | 10 blank | 4 comment | 0 complexity | dbb00db7d0e52d1e7c4055089bb087ad MD5 | raw file
 1package com.emis.caesarui.webccr.core;
 2
 3import javax.servlet.ServletContext;
 4
 5/**
 6 *  促銷reload執行緒 參考亞太
 7 *  10分鐘reload
 8 */
 9public class PromotionUpdateThread extends Thread {
10
11  ServletContext m_application;
12
13  public PromotionUpdateThread(ServletContext application) {
14    m_application = application;
15  }
16
17  public void run() {
18
19    while(true) {
20      try {
21        Thread.sleep( 10 * 60 * 1000);
22      } catch (Exception e) {}
23
24      try {
25        PromotionMgr.backgroundLoad(m_application);
26      } catch (Exception e) {
27        e.printStackTrace();
28      }
29
30    }
31
32
33  }
34}