public void discover(String targetId) throws Exception {
  InterProcessLock lock=coordinatorClient.getLock(targetId);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Acquiring lock: " + targetId);
  }
  lock.acquire();
  try {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Acquired lock: " + targetId);
    }
    discoverInLock(targetId);
  }
  finally {
    lock.release();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Lock Released: " + targetId);
    }
  }
}

public void discover ( String targetId ) throws Exception { InterProcessLock lock = coordinatorClient . getLock ( targetId ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Acquiring lock: " + targetId ) ; } lock . acquire ( ) ; try { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Acquired lock: " + targetId ) ; } discoverInLock ( targetId ) ; } finally { lock . release ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Lock Released: " + targetId ) ; } } }
performs discovery of a given target . an exclusive lock is obtained for the target so that only a single node can be performing discovery for any given object at a time .
