1 22 package org.cofax.cms; 23 24 import org.cofax.*; 25 26 34 35 public class CofaxToolsLifeCycleThread extends Thread { 36 37 DataStore db; 38 39 public String logFile = ""; 40 41 int i = 0; 42 43 public void setDataStore(DataStore db) { 44 this.db = db; 45 } 46 47 public void setLogFile(String logFile) { 48 this.logFile = logFile; 49 } 50 51 public void run() { 52 while (true) { 53 try { 54 i++; 55 CofaxToolsLifeCycle lf = new CofaxToolsLifeCycle(); 56 lf.setLogFile(logFile); 57 boolean ret = lf.updateAllPublications(db); 58 } catch (Exception ex) { 59 System.err.println("CofaxToolsLifeCycleThread : exception " + ex); 60 } finally { 61 try { 62 sleep(3600000 * 12); } catch (Exception e) { 64 System.err.println("CofaxToolsLifeCycleThread : sleep ERROR: " + e); 65 } 66 } 67 } 68 69 } 70 71 } 72 | Popular Tags |