/** * @(#)file SignThread.java * @(#)author DaeJin Lee * @(#)version 1.0 * @(#)date Jun 10, 2005 * @(#)since JDK 1.4.2 * * Copyright (c) www.dcchem.co.kr, Inc. * All rights reserved. * This software is the proprietary information of dcchem, Inc. */ package kr.co.udapsoft.common.commonSign; import kr.co.hsnc.common.logger.Logger; /** * * @version 1.0 * @author DaeJin Lee */ public class CommonMailThread extends Thread { private boolean IS_RUN = false; //1000l * 120 * 1 2분주기 private long INTERVAL = 1000l * 120 * 1 ; //1000l * 60 * 60 * 1 1시간에 한번. 오전09:00 실행 private static CommonMailThreadBiz biz = null; protected CommonMailThread() { biz = new CommonMailThreadBiz(); } /** * Thread 가동여부를 리턴 * @return */ public boolean isRun() { return this.IS_RUN; } /** * Thread Start */ public void doStart() { if( !this.IS_RUN ) { this.IS_RUN = true; this.start(); } } /** * Thread Stop */ public void doStop() { if( this.IS_RUN ) { this.IS_RUN = false; super.interrupt(); } } /* (non-Javadoc) * @see java.lang.Runnable#run() */ public void run() { while(IS_RUN) { try { Thread.sleep(INTERVAL); } catch(InterruptedException ie) { } try { if( IS_RUN ) { Logger.debug.println("hwenc.common.commonSign.CommonMailThread run."); biz.doBiz(); } } catch(Exception e) { e.printStackTrace(System.out); Logger.err.printStackTrace(e); } } } }