private boolean grantLocalDLockAfterObtainingRemoteLock(Object name, DLockToken token,
      int threadId, long leaseExpireTime, int lockId, LockGrantorId theLockGrantorId,
      DLockRequestProcessor processor, int recursion) {
    boolean needToReleaseOrphanedGrant = false;

    Assert.assertHoldsLock(destroyLock, false);
    synchronized (lockGrantorIdLock) {
      if (!checkLockGrantorId(theLockGrantorId)) {
        // race: grantor changed
        if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {
          logger.trace(LogMarker.DLS_VERBOSE,
              "Cannot honor grant from {} because {} is now a grantor.", theLockGrantorId,
              lockGrantorId);
        }
      } else if (isDestroyed()) {
        // race: dls was destroyed
        if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {
          logger.trace(LogMarker.DLS_VERBOSE,
              "Cannot honor grant from {} because this lock service has been destroyed.",
              theLockGrantorId);
        }
        needToReleaseOrphanedGrant = true;
      } else {
        synchronized (tokens) {
          checkDestroyed();
          Assert.assertTrue(token == basicGetToken(name));
          RemoteThread rThread = new RemoteThread(getDistributionManager().getId(), threadId);
          token.grantLock(leaseExpireTime, lockId, recursion, rThread);
          return true;
        } // tokens sync
      }
    }

    if (needToReleaseOrphanedGrant) {
      processor.getResponse().releaseOrphanedGrant(dm);
    }
    return false;
  }
@param name the name of the lock to acquire in this service. This object must conform to the
       general contract of <code>equals(Object)</code> and <code>hashCode()</code> as described
       in {@link java.lang.Object#hashCode()}.

@param waitTimeMillis the number of milliseconds to try to acquire the lock before giving up
       and returning false. A value of -1 causes this method to block until the lock is
       acquired.

@param leaseTimeMillis the number of milliseconds to hold the lock after granting it, before
       automatically releasing it if it hasn't already been released by invoking
       {@link #unlock(Object)}. If <code>leaseTimeMillis</code> is -1, hold the lock until
       explicitly unlocked.

@param tryLock true if the lock should be acquired or fail if currently held. waitTimeMillis
       will be ignored if the lock is currently held by another client.

@param interruptible true if this lock request is interruptible

@param disableAlerts true to disable logging alerts if the dlock is taking a long time to
       acquired.

@return true if the lock was acquired, false if the timeout <code>waitTimeMillis</code> passed
        without acquiring the lock.

@throws InterruptedException if the thread is interrupted before or during this method.

@throws UnsupportedOperationException if attempt to lock batch involves non-tryLocks
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java