Interface ReadWriteLockManager

    • Method Detail

      • tryReadLock

        Lock tryReadLock()
        Gets a read lock, if available. This method will return null if the read lock is not immediately available.
      • getReadLock

        Lock getReadLock()
                  throws java.lang.InterruptedException
        Gets a read lock. This method blocks until the read lock is available.
        Throws:
        java.lang.InterruptedException - In case the thread requesting the lock was interrupted.
      • tryWriteLock

        Lock tryWriteLock()
        Gets an exclusive write lock, if available. This method will return null if the write lock is not immediately available.
      • getWriteLock

        Lock getWriteLock()
                   throws java.lang.InterruptedException
        Gets an exclusive write lock. This method blocks until the write lock is available.
        Throws:
        java.lang.InterruptedException - In case the thread requesting the lock was interrupted.
      • isWriterActive

        boolean isWriterActive()
        Returns false if there are no active write locks, otherwise returns true.
      • isReaderActive

        boolean isReaderActive()
        Returns false if there are no active read locks, otherwise returns true.
      • waitForActiveWriter

        void waitForActiveWriter()
                          throws java.lang.InterruptedException
        Blocks until all write locks have been released.
        Throws:
        java.lang.InterruptedException - In case the thread requesting the lock was interrupted.
      • waitForActiveReaders

        void waitForActiveReaders()
                           throws java.lang.InterruptedException
        Blocks until all read locks have been released.
        Throws:
        java.lang.InterruptedException - In case the thread requesting the lock was interrupted.