Interface LockContainer

All Known Implementing Classes:
PerKeyLockContainer, StripedLockContainer

public interface LockContainer
A container for locks
Since:
4.0
Author:
Manik Surtani, Mircea.Markus@jboss.com, Pedro Ruivo
  • Method Details

    • acquire

      ExtendedLockPromise acquire(Object key, Object lockOwner, long time, TimeUnit timeUnit)
      Parameters:
      key - the key to lock.
      Returns:
      the lock for a specific object to be acquired. If the lock does not exists, it is created.
    • getLock

      InfinispanLock getLock(Object key)
      Parameters:
      key - the key to lock.
      Returns:
      the lock for a specific object. If the lock does not exists, it return null.
    • release

      void release(Object key, Object lockOwner)
    • getNumLocksHeld

      int getNumLocksHeld()
      Returns:
      number of locks held
    • isLocked

      boolean isLocked(Object key)
      Parameters:
      key - the key to test.
      Returns:
      true if the key is locked, false otherwise.
    • size

      int size()
      Returns:
      the size of the shared lock pool
    • deadlockCheck

      void deadlockCheck(DeadlockChecker deadlockChecker)
      It forces a deadlock checks in all existing locks.