throws UnsupportedRepositoryOperationException, LockException,
AccessDeniedException, InvalidItemStateException,
RepositoryException {
// check state of this instance
sanityCheck();
LockManager lockMgr = ((WorkspaceImpl) session.getWorkspace()).getLockManager();
return lockMgr.lock(getPath(), isDeep, isSessionScoped, Long.MAX_VALUE, null);
}