Class LockManagerImpl

  • All Implemented Interfaces:
    javax.jcr.lock.LockManager

    public class LockManagerImpl
    extends java.lang.Object
    implements javax.jcr.lock.LockManager
    Simple lock manager implementation that just keeps track of a set of lock tokens and delegates all locking operations back to the Session and Node implementations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLockToken​(java.lang.String lockToken)  
      boolean canUnlock​(NodeDelegate node)
      Verifies if the current sessionContext can unlock the specified node
      @NotNull javax.jcr.lock.Lock getLock​(java.lang.String absPath)  
      @NotNull java.lang.String[] getLockTokens()  
      boolean holdsLock​(java.lang.String absPath)  
      boolean isLocked​(java.lang.String absPath)  
      @NotNull javax.jcr.lock.Lock lock​(java.lang.String absPath, boolean isDeep, boolean isSessionScoped, long timeoutHint, java.lang.String ownerInfo)  
      void removeLockToken​(java.lang.String lockToken)  
      void unlock​(java.lang.String absPath)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LockManagerImpl

        public LockManagerImpl​(SessionContext sessionContext)
    • Method Detail

      • getLockTokens

        @NotNull
        public @NotNull java.lang.String[] getLockTokens()
                                                  throws javax.jcr.RepositoryException
        Specified by:
        getLockTokens in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • addLockToken

        public void addLockToken​(java.lang.String lockToken)
                          throws javax.jcr.RepositoryException
        Specified by:
        addLockToken in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • removeLockToken

        public void removeLockToken​(java.lang.String lockToken)
                             throws javax.jcr.RepositoryException
        Specified by:
        removeLockToken in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • isLocked

        public boolean isLocked​(java.lang.String absPath)
                         throws javax.jcr.RepositoryException
        Specified by:
        isLocked in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • holdsLock

        public boolean holdsLock​(java.lang.String absPath)
                          throws javax.jcr.RepositoryException
        Specified by:
        holdsLock in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • getLock

        @NotNull
        public @NotNull javax.jcr.lock.Lock getLock​(java.lang.String absPath)
                                             throws javax.jcr.RepositoryException
        Specified by:
        getLock in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • lock

        @NotNull
        public @NotNull javax.jcr.lock.Lock lock​(java.lang.String absPath,
                                                 boolean isDeep,
                                                 boolean isSessionScoped,
                                                 long timeoutHint,
                                                 java.lang.String ownerInfo)
                                          throws javax.jcr.RepositoryException
        Specified by:
        lock in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • unlock

        public void unlock​(java.lang.String absPath)
                    throws javax.jcr.RepositoryException
        Specified by:
        unlock in interface javax.jcr.lock.LockManager
        Throws:
        javax.jcr.RepositoryException
      • canUnlock

        public boolean canUnlock​(NodeDelegate node)
        Verifies if the current sessionContext can unlock the specified node
        Parameters:
        node - the node state to check
        Returns:
        true if the current sessionContext can unlock the specified node