本文整理了Java中javax.jcr.Node.getLock()
方法的一些代码示例,展示了Node.getLock()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getLock()
方法的具体详情如下:
包路径:javax.jcr.Node
类名称:Node
方法名:getLock
[英]Returns the Lock
object that applies to this node. This may be either a lock on this node itself or a deep lock on a node above this node.
[中]返回应用于此节点的Lock
对象。这可能是此节点本身上的锁,也可能是此节点上方节点上的深锁。
代码示例来源:origin: org.apache.sling/org.apache.sling.scripting.javascript
public Object jsFunction_getLock() {
try {
return node.getLock();
} catch (RepositoryException re) {
return Undefined.instance;
}
}
代码示例来源:origin: info.magnolia/magnolia-core
@Override
public Lock getLock() throws LockException, RepositoryException {
return this.node.getLock();
}
代码示例来源:origin: nl.vpro/jcr-criteria
@Override
@Deprecated
public Lock getLock() throws RepositoryException {
return getNode().getLock();
}
代码示例来源:origin: brix-cms/brix-cms
/**
* @deprecated
*/
@Deprecated
public Lock getLock() throws RepositoryException {
return getDelegate().getLock();
}
代码示例来源:origin: net.adamcin.oakpal/oakpal-core
@Override
public Lock getLock() throws RepositoryException {
Lock internal = delegate.getLock();
return new LockFacade<>(internal, session);
}
代码示例来源:origin: info.magnolia/magnolia-core
@Override
public Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException {
return getWrappedNode().getLock();
}
代码示例来源:origin: apache/jackrabbit
public void testGetLockOnChild() throws RepositoryException {
// get lock must succeed even if child is not lockable.
childNode.getLock();
}
代码示例来源:origin: apache/jackrabbit
public void testGetLockOnNewChild() throws RepositoryException {
// get lock must succeed even if child is not lockable.
Node newChild = lockedNode.addNode(nodeName3, testNodeType);
newChild.getLock();
}
代码示例来源:origin: apache/jackrabbit
/**
* @see javax.jcr.lock.LockManager#getLock(String)
*/
public javax.jcr.lock.Lock getLock(String absPath) throws LockException, RepositoryException {
Node n = itemManager.getNode(resolver.getQPath(absPath));
return n.getLock();
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr2spi
/**
* @see javax.jcr.lock.LockManager#getLock(String)
*/
public javax.jcr.lock.Lock getLock(String absPath) throws LockException, RepositoryException {
Node n = itemManager.getNode(resolver.getQPath(absPath));
return n.getLock();
}
代码示例来源:origin: apache/jackrabbit
public void testGetNodeOnLockObtainedFromNewChild() throws RepositoryException {
Node newChild = lockedNode.addNode(nodeName3, testNodeType);
javax.jcr.lock.Lock lock = newChild.getLock();
assertTrue("Lock.getNode() must return the lock holding node even if lock is obtained from child node.", lock.getNode().isSame(lockedNode));
}
代码示例来源:origin: apache/jackrabbit
/**
* {@inheritDoc}
*/
public void refreshLock(SessionInfo sessionInfo, NodeId nodeId)
throws LockException, RepositoryException {
getNode(nodeId, getSessionInfoImpl(sessionInfo)).getLock().refresh();
}
代码示例来源:origin: org.apache.jackrabbit/jackrabbit-spi2jcr
/**
* {@inheritDoc}
*/
public void refreshLock(SessionInfo sessionInfo, NodeId nodeId)
throws LockException, RepositoryException {
getNode(nodeId, getSessionInfoImpl(sessionInfo)).getLock().refresh();
}
代码示例来源:origin: apache/jackrabbit
/** {@inheritDoc} */
public RemoteLock getLock() throws RepositoryException, RemoteException {
try {
return getFactory().getRemoteLock(node.getLock());
} catch (RepositoryException ex) {
throw getRepositoryException(ex);
}
}
代码示例来源:origin: apache/jackrabbit
public void testGetNodeOnLockObtainedFromChild() throws RepositoryException {
javax.jcr.lock.Lock lock = childNode.getLock();
assertTrue("Lock.getNode() must return the lock holding node even if lock is obtained from child node.", lock.getNode().isSame(lockedNode));
}
代码示例来源:origin: apache/jackrabbit
public void testGetNodeOnLockObtainedFromNewChild() throws RepositoryException {
Node newChild = lockedNode.addNode(nodeName3, testNodeType);
Lock lock = newChild.getLock();
assertTrue("Lock.getNode() must return the lock holding node even if lock is obtained from child node.", lock.getNode().isSame(lockedNode));
}
代码示例来源:origin: apache/jackrabbit
public void testReadLockContent() throws RepositoryException, NotExecutableException {
Node n = createLockedNode(testRootNode);
Node childN = n.addNode(nodeName2);
modifyPrivileges(n.getPath(), Privilege.JCR_READ, false);
modifyPrivileges(childN.getPath(), Privilege.JCR_READ, true);
Node childN2 = (Node) getTestSession().getItem(childN.getPath());
try {
childN2.getLock();
fail("TestUser doesn't have permission to read the jcr:lockIsDeep property.");
} catch (AccessDeniedException e) {
// success
}
}
代码示例来源:origin: apache/jackrabbit
/**
* If a locked nodes is unlocked again, any Lock instance retrieved by
* another session must change the lock-status. Similarly, the previously
* locked node must not be marked locked any more.
*/
public void testUnlockByOtherSession() throws RepositoryException {
Node ln2 = (Node) otherSession.getItem(lockedNode.getPath());
Lock l2 = ln2.getLock();
lockedNode.unlock();
assertFalse("Lock must be informed if Node is unlocked.", l2.isLive());
}
代码示例来源:origin: apache/jackrabbit
public void testGetNodeOnLockObtainedFromChild() throws RepositoryException {
Lock lock = childNode.getLock();
assertTrue("Lock.getNode() must return the lock holding node even if lock is obtained from child node.", lock.getNode().isSame(lockedNode));
}
代码示例来源:origin: apache/jackrabbit
public void testRefreshAfterTokenTransfer2() throws Exception {
String lockToken = lock.getLockToken();
Node n2 = (Node) otherSession.getItem(lockedNode.getPath());
try {
superuser.removeLockToken(lockToken);
otherSession.addLockToken(lockToken);
n2.getLock().refresh();
} finally {
// move lock token back in order to have lock removed properly
otherSession.removeLockToken(lockToken);
superuser.addLockToken(lockToken);
}
}
内容来源于网络,如有侵权,请联系作者删除!