docs: @Override
      @FFDCIgnore({ OverlappingFileLockException.class })
      public boolean lockPeerLease(String recoveryIdentity) {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "lockPeerLease", new Object[] { recoveryIdentity, this });
          // What we need to do is to extract the log location for peer servers and put them somewhere to be used in TxRecoveryAgentImp.initiateRecovery.
          boolean claimedLock = false;
          // Read the appropriate lease file (equivalent to a record in the DB table)
          final File leaseFile = new File(_serverInstallLeaseLogDir + String.valueOf(File.separatorChar) + recoveryIdentity);
  
          FileLock fLock = null;
          FileChannel fChannel = null;
  
          // If the peer lease file does not exist then we can return early. This also prevents us from re-creating the file if it has
          // already been deleted by another peer. We could probably do this all a little more neatly if we didn't have to maintain Java6
          // compatibility but given the need for Java6, the best that we can do is to check for file existence and avoid the possibility
          // of re-creating the file - new RandomAccessFile(..., "rw") WILL create a new file - in merely attempting to acquire a lock (which
          // requires "rw" mode)
          boolean success = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
              @Override
              public Boolean run() {
                  boolean fileExists = true;
                  if (leaseFile == null || !leaseFile.exists()) {
                      fileExists = false;
                  }
                  return fileExists;
              }
          });
          if (!success) {
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "lockPeerLease", false);
              return false;
          }
  
          // At this point we are ready to acquire a lock on the lease file prior to attempting to read it.
          fChannel = AccessController.doPrivileged(new PrivilegedAction<FileChannel>() {
              @Override
              public FileChannel run() {
                  FileChannel theChannel = null;
                  try {
                      // Open for read-write, in order to use the locking scheme
                      theChannel = new RandomAccessFile(leaseFile, "rw").getChannel();
                  } catch (FileNotFoundException e) {
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "Caught FileNotFound exception when trying to lock lease file");
                      theChannel = null;
                  }
                  return theChannel;
              }
          });
  
          try {
              // Try acquiring the lock without blocking. This method returns
              // null or throws an exception if the file is already locked.
              if (fChannel != null) {
                  fLock = fChannel.tryLock();
  
                  if (fLock != null) {
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "We have claimed the lock for file - " + leaseFile);
                      claimedLock = true;
                      _peerLeaseLock = new LeaseLock(recoveryIdentity, fLock, fChannel);
                  }
              }
          } catch (OverlappingFileLockException e) {
              // File is already locked in this thread or virtual machine, We're not expecting this to happen. Log the event
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "The file aleady appears to be locked in another thread");
          } catch (IOException e) {
              // We're not expecting this to happen. Log the event
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "Caught an IOException");
          }
  
          // Tidy up if we failed to claim lock
          if (!claimedLock) {
              if (fChannel != null)
                  try {
                      fChannel.close();
                  } catch (IOException e) {
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "Caught an IOException on channel close");
                  }
              _localLeaseLock = null;
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "lockPeerLease", claimedLock);
          return claimedLock;
      }