Code example for CountDownLatch

Methods: countDown

0
   public void nodeUP(TopologyMember topologyMember, boolean last)
   { 
      final String nodeID = topologyMember.getNodeId();
 
      if (ownId.equals(nodeID) && topologyMember.getBackup() != null)
         latch.countDown();
   } 
 
   @Override 
   public void nodeDown(long eventUID, String nodeID)
   { 
      // no-op 
   } 
 
   boolean waitForBackup() 
   { 
      try 
      { 
         return latch.await(WAIT_TIMEOUT, TimeUnit.SECONDS);
      } 
      catch (InterruptedException e)