CommonSignThreadManager.java 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 CommonSignThreadManager {
  19. private static CommonSignThread commonSignThread = null;
  20. private static Object lock = new Object();
  21. private CommonSignThreadManager() {
  22. super();
  23. }
  24. public static void doStart() {
  25. synchronized(lock) {
  26. if( commonSignThread == null ) {
  27. commonSignThread = new CommonSignThread();
  28. }
  29. commonSignThread.doStart();
  30. }
  31. }
  32. public static void doStop() {
  33. synchronized(lock) {
  34. if( commonSignThread != null ) {
  35. commonSignThread.doStop();
  36. commonSignThread = null;
  37. }
  38. }
  39. }
  40. public static boolean isRun() {
  41. if( commonSignThread == null )
  42. return false;
  43. else {
  44. return commonSignThread.isRun();
  45. }
  46. }
  47. }