123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /**
- * @(#)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);
- }
- }
- }
- }
|