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

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

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

Lock.isDeep介绍

[英]Returns true if this is a deep lock; false otherwise.
[中]如果这是深锁,则返回truefalse否则。

代码示例

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

/**
 * @see ActiveLock#isDeep()
 */
public boolean isDeep() {
  return lock.isDeep();
}

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

@Override
public boolean isDeep() {
  synchronized (session) {
    return lock.isDeep();
  }
}

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

@Override
public boolean isDeep() {
  return delegate.isDeep();
}

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

/** {@inheritDoc} */
public boolean isDeep() throws RemoteException {
  return lock.isDeep();
}

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

public boolean isDeep() {
  return lock.isDeep();
}

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

public boolean isDeep() {
  return lock.isDeep();
}

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

/**
 * Test {@link javax.jcr.lock.Lock#isDeep()}.
 */
public void testIsDeep() {
  assertEquals("Lock.isDeep must be consistent with lock call.", isDeep(), lock.isDeep());
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.jcr

public boolean isLocked(String s) throws PathNotFoundException, RepositoryException {
  boolean islocked = false;
  String parentPath = ((RegistryNode) (session.getItem(s))).getParent().getPath();
  if ((allLocks.get(s) != null)
      || (getLock(parentPath) != null) && (getLock(parentPath).isDeep())) {
    islocked = true;
  }
  return islocked;
}

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

/**
 * Test Lock.isDeep()
 */
public void testIsDeep() throws RepositoryException, NotExecutableException {
  // create two lockable nodes
  Node n1 = testRootNode.addNode(nodeName1, testNodeType);
  ensureMixinType(n1, mixLockable);
  Node n2 = testRootNode.addNode(nodeName2, testNodeType);
  ensureMixinType(n2, mixLockable);
  testRootNode.getSession().save();
  // lock node 1 "undeeply"
  Lock lock1 = n1.lock(false, true);
  assertFalse("Lock.isDeep() must be false if the lock has not been set " +
      "as not deep",
      lock1.isDeep());
  // lock node 2 "deeply"
  Lock lock2 = n2.lock(true, true);
  assertTrue("Lock.isDeep() must be true if the lock has been set " +
      "as deep",
      lock2.isDeep());
}

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

public void testLockIsDeep() throws RepositoryException {
  assertTrue("Lock.isDeep() if lock has been created deeply.", lock.isDeep());
}

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

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

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

private void computeAndWriteNodeDelta(final ConfigurationNode baselineNode,
                   final ConfigurationNode updateNode,
                   final Node targetNode,
                   final boolean isNew,
                   final boolean forceApply,
                   final List<UnprocessedReference> unprocessedReferences)
    throws RepositoryException, IOException {
  if (targetNode.isLocked()) {
    log.warn("Target node {} is locked, skipping its processing", targetNode.getPath());
    final LockManager lockManager = targetNode.getSession().getWorkspace().getLockManager();
    try {
      final Lock lock = lockManager.getLock(targetNode.getPath());
      if (lock.isDeep()) {
        return;
      }
    } catch (LockException ignored) {
    }
  } else {
    computeAndWritePrimaryTypeDelta(baselineNode, updateNode, targetNode, forceApply);
    computeAndWriteMixinTypesDelta(baselineNode, updateNode, targetNode, forceApply);
    computeAndWritePropertiesDelta(baselineNode, updateNode, targetNode, isNew, forceApply, unprocessedReferences);
  }
  computeAndWriteChildNodesDelta(baselineNode, updateNode, targetNode, forceApply, unprocessedReferences);
}

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

/**
 * Creates a new lock info for the given JCR lock object.
 *
 * @param lock the lock.
 * @param idFactory the id factory.
 * @throws RepositoryException if an error occurs while the node from the
 * given lock or while creating the node id.
 */
private LockInfoImpl(Lock lock, IdFactoryImpl idFactory) throws RepositoryException {
  super(lock.getLockToken(), lock.getLockOwner(), lock.isDeep(),
      lock.isSessionScoped(), lock.getSecondsRemaining(), lock.isLockOwningSession(), 
      idFactory.createNodeId(lock.getNode()));
}

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

/**
 * Creates a new lock info for the given JCR lock object.
 *
 * @param lock the lock.
 * @param idFactory the id factory.
 * @throws RepositoryException if an error occurs while the node from the
 * given lock or while creating the node id.
 */
private LockInfoImpl(Lock lock, IdFactoryImpl idFactory) throws RepositoryException {
  super(lock.getLockToken(), lock.getLockOwner(), lock.isDeep(),
      lock.isSessionScoped(), lock.getSecondsRemaining(), lock.isLockOwningSession(), 
      idFactory.createNodeId(lock.getNode()));
}

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

/**
 * @see javax.jcr.lock.LockManager#isLocked(String)
 */
public boolean isLocked(String absPath) throws RepositoryException {
  NodeImpl node = (NodeImpl) session.getNode(absPath);
  /*
   NOTE: with JSR 283 a transient node below a deep lock will report
   islocked = true. therefore, the shortcut for NEW nodes that was
   present with NodeImpl.isLocked before cannot be applied any more.
   */
  if (node.isNew()) {
    while (node.isNew()) {
      node = (NodeImpl) node.getParent();
    }
    return systemLockMgr.isLocked(node) && systemLockMgr.getLock(node).isDeep();
  } else {
    return systemLockMgr.isLocked(node);
  }
}

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

/**
 * @see javax.jcr.lock.LockManager#isLocked(String)
 */
public boolean isLocked(String absPath) throws RepositoryException {
  NodeImpl node = (NodeImpl) session.getNode(absPath);
  /*
   NOTE: with JSR 283 a transient node below a deep lock will report
   islocked = true. therefore, the shortcut for NEW nodes that was
   present with NodeImpl.isLocked before cannot be applied any more.
   */
  if (node.isNew()) {
    while (node.isNew()) {
      node = (NodeImpl) node.getParent();
    }
    return systemLockMgr.isLocked(node) && systemLockMgr.getLock(node).isDeep();
  } else {
    return systemLockMgr.isLocked(node);
  }
}

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

/**
 * @see javax.jcr.lock.LockManager#getLock(String)
 */
public Lock getLock(String absPath) throws
    UnsupportedRepositoryOperationException, LockException,
    AccessDeniedException, RepositoryException {
  NodeImpl node = (NodeImpl) session.getNode(absPath);
  if (node.isNew()) {
    while (node.isNew()) {
      node = (NodeImpl) node.getParent();
    }
    Lock l = systemLockMgr.getLock(node);
    if (l.isDeep()) {
      return l;
    } else {
      throw new LockException("Node not locked: " + node);
    }
  } else {
    return systemLockMgr.getLock(node);
  }
}

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

/**
 * @see javax.jcr.lock.LockManager#getLock(String)
 */
public Lock getLock(String absPath) throws
    UnsupportedRepositoryOperationException, LockException,
    AccessDeniedException, RepositoryException {
  NodeImpl node = (NodeImpl) session.getNode(absPath);
  if (node.isNew()) {
    while (node.isNew()) {
      node = (NodeImpl) node.getParent();
    }
    Lock l = systemLockMgr.getLock(node);
    if (l.isDeep()) {
      return l;
    } else {
      throw new LockException("Node not locked: " + node);
    }
  } else {
    return systemLockMgr.getLock(node);
  }
}

相关文章