javax.jcr.lock.Lock.isSessionScoped()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(258)

本文整理了Java中javax.jcr.lock.Lock.isSessionScoped()方法的一些代码示例,展示了Lock.isSessionScoped()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lock.isSessionScoped()方法的具体详情如下:
包路径:javax.jcr.lock.Lock
类名称:Lock
方法名:isSessionScoped

Lock.isSessionScoped介绍

[英]Returns true if this is a session-scoped lock and the scope is bound to the current session. Returns false otherwise.
[中]如果这是一个会话作用域锁,并且该作用域已绑定到当前会话,则返回true。否则返回false

代码示例

代码示例来源:origin: org.onehippo.cms7/hippo-repository-engine

  1. @Override
  2. public boolean isSessionScoped() {
  3. synchronized (session) {
  4. return lock.isSessionScoped();
  5. }
  6. }

代码示例来源:origin: apache/jackrabbit

  1. /**
  2. * @return The scope of this lock, which may either by an {@link Scope#EXCLUSIVE exclusive}
  3. * or {@link ItemResourceConstants#EXCLUSIVE_SESSION exclusive session scoped}
  4. * lock.
  5. * @see ActiveLock#getScope()
  6. */
  7. public Scope getScope() {
  8. return (lock.isSessionScoped()) ? ItemResourceConstants.EXCLUSIVE_SESSION : Scope.EXCLUSIVE;
  9. }
  10. }

代码示例来源:origin: apache/jackrabbit

  1. /** {@inheritDoc} */
  2. public boolean isSessionScoped() throws RemoteException {
  3. return lock.isSessionScoped();
  4. }

代码示例来源:origin: net.adamcin.oakpal/oakpal-core

  1. @Override
  2. public boolean isSessionScoped() {
  3. return delegate.isSessionScoped();
  4. }

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-ocm

  1. public boolean isSessionScoped() {
  2. return lock.isSessionScoped();
  3. }

代码示例来源:origin: org.apache/jackrabbit-ocm

  1. public boolean isSessionScoped() {
  2. return lock.isSessionScoped();
  3. }

代码示例来源:origin: apache/jackrabbit

  1. /**
  2. * Test {@link javax.jcr.lock.Lock#isSessionScoped()}
  3. */
  4. public void testIsSessionScoped() {
  5. assertEquals("Lock.isSessionScoped must be consistent with lock call.", isSessionScoped(), lock.isSessionScoped());
  6. }

代码示例来源:origin: apache/jackrabbit

  1. /**
  2. * Test Lock.isSessionScoped()
  3. */
  4. public void testIsSessionScoped() throws RepositoryException,
  5. NotExecutableException {
  6. // create two lockable nodes
  7. Node n1 = testRootNode.addNode(nodeName1, testNodeType);
  8. ensureMixinType(n1, mixLockable);
  9. Node n2 = testRootNode.addNode(nodeName2, testNodeType);
  10. ensureMixinType(n2, mixLockable);
  11. testRootNode.getSession().save();
  12. // lock node 1 session-scoped
  13. Lock lock1 = n1.lock(false, true);
  14. assertTrue("Lock.isSessionScoped() must be true if the lock " +
  15. "is session-scoped",
  16. lock1.isSessionScoped());
  17. // lock node 2 open-scoped
  18. Lock lock2 = n2.lock(false, false);
  19. assertFalse("Lock.isSessionScoped() must be false if the lock " +
  20. "is open-scoped",
  21. lock2.isSessionScoped());
  22. n2.unlock();
  23. }

代码示例来源:origin: org.onehippo.cms7/hippo-repository-engine

  1. lock = lockManager.lock(lock.getNode().getPath(), lock.isDeep(), lock.isSessionScoped(), timeout, lock.getLockOwner());
  2. setTimeout(lock, timeout);
  3. success = true;

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-spi2jcr

  1. /**
  2. * Creates a new lock info for the given JCR lock object.
  3. *
  4. * @param lock the lock.
  5. * @param idFactory the id factory.
  6. * @throws RepositoryException if an error occurs while the node from the
  7. * given lock or while creating the node id.
  8. */
  9. private LockInfoImpl(Lock lock, IdFactoryImpl idFactory) throws RepositoryException {
  10. super(lock.getLockToken(), lock.getLockOwner(), lock.isDeep(),
  11. lock.isSessionScoped(), lock.getSecondsRemaining(), lock.isLockOwningSession(),
  12. idFactory.createNodeId(lock.getNode()));
  13. }

代码示例来源:origin: apache/jackrabbit

  1. /**
  2. * Creates a new lock info for the given JCR lock object.
  3. *
  4. * @param lock the lock.
  5. * @param idFactory the id factory.
  6. * @throws RepositoryException if an error occurs while the node from the
  7. * given lock or while creating the node id.
  8. */
  9. private LockInfoImpl(Lock lock, IdFactoryImpl idFactory) throws RepositoryException {
  10. super(lock.getLockToken(), lock.getLockOwner(), lock.isDeep(),
  11. lock.isSessionScoped(), lock.getSecondsRemaining(), lock.isLockOwningSession(),
  12. idFactory.createNodeId(lock.getNode()));
  13. }

相关文章