CommonMailThreadManager.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @(#)file CommonSignThreadManager.java
  3. * @(#)author DaeJin Lee
  4. * @(#)version 1.0
  5. * @(#)date Jun 10, 2005
  6. * @(#)since JDK 1.4.2
  7. *
  8. * Copyright (c) www.dcchem.co.kr, Inc.
  9. * All rights reserved.
  10. * This software is the proprietary information of dcchem, Inc.
  11. */
  12. package kr.co.udapsoft.common.commonSign;
  13. /**
  14. *
  15. * @version 1.0
  16. * @author DaeJin Lee
  17. */
  18. public class CommonMailThreadManager {
  19. private static CommonMailThread CommonMailThread = null;
  20. private static Object lock = new Object();
  21. private CommonMailThreadManager() {
  22. super();
  23. }
  24. public static void doStart() {
  25. synchronized(lock) {
  26. if( CommonMailThread == null ) {
  27. CommonMailThread = new CommonMailThread();
  28. }
  29. CommonMailThread.doStart();
  30. }
  31. }
  32. public static void doStop() {
  33. synchronized(lock) {
  34. if( CommonMailThread != null ) {
  35. CommonMailThread.doStop();
  36. CommonMailThread = null;
  37. }
  38. }
  39. }
  40. public static boolean isRun() {
  41. if( CommonMailThread == null )
  42. return false;
  43. else {
  44. return CommonMailThread.isRun();
  45. }
  46. }
  47. }