public LockInfo lock(SessionInfo sessionInfo, final NodeId nodeId, final boolean deep, final boolean sessionScoped, final long timeoutHint, final String ownerHint) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException {
final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
return (LockInfo) executeWithLocalEvents(new Callable() {
public Object run() throws RepositoryException {
Node n = getNode(nodeId, sInfo);
Lock lock;
javax.jcr.lock.LockManager lMgr = (sInfo.getSession().getWorkspace()).getLockManager();
lock = lMgr.lock(n.getPath(), deep, sessionScoped, timeoutHint, ownerHint);
return LockInfoImpl.createLockInfo(lock, idFactory);
}
}, sInfo);