@Override public boolean holdsLock() { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().holdsLock(this); }
@Override public Lock lock( boolean isDeep, boolean isSessionScoped ) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().lock(this, isDeep, isSessionScoped, Long.MAX_VALUE, null); }
@Override public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { // Session's liveness will be checked in 'lockManager()' ... session.lockManager().unlock(this); }
@Override public Lock lock( boolean isDeep, boolean isSessionScoped ) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().lock(this, isDeep, isSessionScoped, Long.MAX_VALUE, null); }
@Override public boolean isLocked() throws RepositoryException { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().isLocked(this); }
@Override public boolean holdsLock() { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().holdsLock(this); }
@Override public boolean isLocked() throws RepositoryException { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().isLocked(this); }
@Override public final Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().getLock(this); }
@Override public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException { // Session's liveness will be checked in 'lockManager()' ... session.lockManager().unlock(this); }
@Override public final Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException { // Session's liveness will be checked in 'lockManager()' ... return session.lockManager().getLock(this); }
protected final Lock getLockIfExists() throws UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException { return session.lockManager().getLockIfExists(this); }
@Override @SuppressWarnings("deprecation") public void addLockToken( String lockToken ) { CheckArg.isNotNull(lockToken, "lockToken"); try { lockManager().addLockToken(lockToken); } catch (LockException le) { // For backwards compatibility (and API compatibility), the LockExceptions from the LockManager need to get swallowed } }
@Override @SuppressWarnings("deprecation") public void addLockToken( String lockToken ) { CheckArg.isNotNull(lockToken, "lockToken"); try { lockManager().addLockToken(lockToken); } catch (LockException le) { // For backwards compatibility (and API compatibility), the LockExceptions from the LockManager need to get swallowed } }
@Override @SuppressWarnings("deprecation") public String[] getLockTokens() { if (!isLive()) return new String[] {}; return lockManager().getLockTokens(); }
@Override @SuppressWarnings("deprecation") public String[] getLockTokens() { if (!isLive()) return new String[] {}; return lockManager().getLockTokens(); }
@Override @SuppressWarnings("deprecation") public void removeLockToken( String lockToken ) { CheckArg.isNotNull(lockToken, "lockToken"); // A LockException is thrown if the lock associated with the specified lock token is session-scoped. try { lockManager().removeLockToken(lockToken); } catch (LockException le) { // For backwards compatibility (and API compatibility), the LockExceptions from the LockManager need to get swallowed } }
@Override @SuppressWarnings("deprecation") public void removeLockToken( String lockToken ) { CheckArg.isNotNull(lockToken, "lockToken"); // A LockException is thrown if the lock associated with the specified lock token is session-scoped. try { lockManager().removeLockToken(lockToken); } catch (LockException le) { // For backwards compatibility (and API compatibility), the LockExceptions from the LockManager need to get swallowed } }
private void cleanLocks() { try { lockManager().cleanLocks(); } catch (RepositoryException e) { // This can only happen if the session is not live, which is checked above ... Logger.getLogger(getClass()).error(e, JcrI18n.unexpectedException, e.getMessage()); } }
private void cleanLocks() { try { lockManager().cleanLocks(); } catch (RepositoryException e) { // This can only happen if the session is not live, which is checked above ... Logger.getLogger(getClass()).error(e, JcrI18n.unexpectedException, e.getMessage()); } }
@Test @FixFor( "MODE-2047" ) public void shouldNotAllowLockOnTransientNode() throws Exception { AbstractJcrNode testNode = session.getRootNode().addNode("test"); testNode.addMixin("mix:lockable"); JcrLockManager lockManager = session.lockManager(); try { lockManager.lock(testNode, true, false, Long.MAX_VALUE, null); fail("Transient nodes should not be locked"); } catch (InvalidItemStateException e) { // expected } }