Interface LockCountManager<L>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int decreaseAndGetLockCount​(L object)
      Decreases the number of times the designated object holds the lock.
      String getLockOwner()
      Returns a string representation of one object that currently has a lock.
      boolean hasLock​(L object)
      Returns whether the designated object has a lock at least once.
      boolean hasLocks()
      Returns whether this lock count manager knows at least one object that has a lock.
      int increaseAndGetLockCount​(L object)
      Increases the number of times the designated object holds the lock.
    • Method Detail

      • hasLock

        boolean hasLock​(L object)
        Returns whether the designated object has a lock at least once.
        Parameters:
        object - The object which is checked whether it holds a lock.
        Returns:
        Whether the designated object has a lock at least once.
      • hasLocks

        boolean hasLocks()
        Returns whether this lock count manager knows at least one object that has a lock.
        Returns:
        Whether at least one object has a lock.
      • getLockOwner

        String getLockOwner()
        Returns a string representation of one object that currently has a lock. This can be used for user information or tracking purpose. A locking object may not be returned since this would allow to unlock.
        Returns:
        A string representation of one object that currently has a lock.
      • increaseAndGetLockCount

        int increaseAndGetLockCount​(L object)
        Increases the number of times the designated object holds the lock.
        Parameters:
        object - The object which has acquired the lock (once again).
        Returns:
        The number of times the designated object has the lock after the increment.
      • decreaseAndGetLockCount

        int decreaseAndGetLockCount​(L object)
        Decreases the number of times the designated object holds the lock. If the object does not hold the lock, the decrement will be ignored.
        Parameters:
        object - The object which has released the lock (once again).
        Returns:
        The number of times the designated object has the lock after the decrement.