code: public LockImpl getLock(NodeImpl node) throws LockException, RepositoryException
     {
        LockData lData = lockManager.getExactNodeOrCloseParentLock((NodeData)node.getData());
  
        if (lData == null || (!node.getInternalIdentifier().equals(lData.getNodeIdentifier()) && !lData.isDeep()))
        {
           throw new LockException("Node not locked: " + node.getData().getQPath());
        }
        return new CacheLockImpl(node.getSession(), lData, this);
     }
docs: {@inheritDoc}