Package javax.jcr.lock

Examples of javax.jcr.lock.LockManager


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


    public Lock getLock()
            throws UnsupportedRepositoryOperationException, LockException,
            AccessDeniedException, RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = getSession().getWorkspace().getLockManager();
        return lockMgr.getLock(getPath());
    }
View Full Code Here

            throws UnsupportedRepositoryOperationException, LockException,
            AccessDeniedException, InvalidItemStateException,
            RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = getSession().getWorkspace().getLockManager();
        lockMgr.unlock(getPath());
    }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean holdsLock() throws RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = getSession().getWorkspace().getLockManager();
        return lockMgr.holdsLock(getPath());
    }
View Full Code Here

     * {@inheritDoc}
     */
    public boolean isLocked() throws RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = getSession().getWorkspace().getLockManager();
        return lockMgr.isLocked(getPath());
    }
View Full Code Here

  @Override
  public boolean lock(int timeout) throws CaoException {
    try {
      Lock lock = null;
      LockManager manager = node.getSession().getWorkspace().getLockManager();
        try {
          lock = manager.getLock(node.getPath());
          if (lock.getLockToken() != null) {
            return true;
          }
        } catch (LockException e) {
        }
        lock = null;
        long sleepTime = 100;
        int tries = 0;
        while (tries++ < 300 ) {
          try {
          manager.lock(node.getPath(), false, false, timeout, "");
            return true;
          } catch (Exception ex) {
          if (timeout <= 0) return false;
            if ( sleepTime < 500 ) {
              sleepTime = sleepTime + 10;
View Full Code Here

  }

  @Override
  public boolean unlock() throws CaoException {
    try {
      LockManager manager = node.getSession().getWorkspace().getLockManager();
      if (!manager.holdsLock(node.getPath()))return false;
      manager.unlock(node.getPath());
      return true;
    } catch (RepositoryException e) {
      throw new CaoException(e);
    }
  }
View Full Code Here

            throws UnsupportedRepositoryOperationException, LockException,
            AccessDeniedException, InvalidItemStateException,
            RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = getSession().getWorkspace().getLockManager();
        return lockMgr.lock(getPath(), isDeep, isSessionScoped,
                sessionContext.getWorkspace().getConfig().getDefaultLockTimeout(), null);
    }
View Full Code Here

    public Lock getLock()
            throws UnsupportedRepositoryOperationException, LockException,
            AccessDeniedException, RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = getSession().getWorkspace().getLockManager();
        return lockMgr.getLock(getPath());
    }
View Full Code Here

            throws UnsupportedRepositoryOperationException, LockException,
            AccessDeniedException, InvalidItemStateException,
            RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = getSession().getWorkspace().getLockManager();
        lockMgr.unlock(getPath());
    }
View Full Code Here

TOP

Related Classes of javax.jcr.lock.LockManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.