1 21 22 package com.rift.coad.lib.deployment; 23 24 30 public class DeploymentMonitor { 31 32 private static DeploymentMonitor singleton = null; 34 35 private boolean initDeployComplete = false; 37 private boolean terminated = false; 38 39 42 private DeploymentMonitor() { 43 } 44 45 46 49 public static synchronized DeploymentMonitor getInstance() { 50 if (singleton == null) { 51 singleton = new DeploymentMonitor(); 52 } 53 return singleton; 54 } 55 56 57 63 public synchronized boolean isInitDeployComplete() { 64 return initDeployComplete; 65 } 66 67 68 71 public synchronized void initDeployCompleted() { 72 initDeployComplete = true; 73 notify(); 74 } 75 76 77 80 public synchronized boolean isTerminated() { 81 return terminated; 82 } 83 84 85 88 public synchronized void terminate() { 89 terminated = true; 90 notify(); 91 } 92 93 94 98 public synchronized void waitUntilInitDeployComplete() { 99 try { 100 if (!initDeployComplete && !terminated) { 101 wait(); 102 } 103 } catch (Exception ex) { 104 } 106 } 107 } 108 | Popular Tags |