コード例 #1
0
ファイル: ServiceManager.java プロジェクト: chums122/Spigot
 void awaitHealthy() {
   this.monitor.enterWhenUninterruptibly(this.awaitHealthGuard);
   try {
     checkHealthy();
   } finally {
     this.monitor.leave();
   }
 }
コード例 #2
0
ファイル: ServiceManager.java プロジェクト: chums122/Spigot
 void awaitHealthy(long timeout, TimeUnit unit) throws TimeoutException {
   this.monitor.enter();
   try {
     if (!this.monitor.waitForUninterruptibly(this.awaitHealthGuard, timeout, unit)) {
       throw new TimeoutException(
           "Timeout waiting for the services to become healthy. The following services have not started: "
               + Multimaps.filterKeys(
                   this.servicesByState,
                   Predicates.in(ImmutableSet.of(Service.State.NEW, Service.State.STARTING))));
     }
     checkHealthy();
   } finally {
     this.monitor.leave();
   }
 }