org.infinispan.util.concurrent.locks.containers
Interface LockContainer
- All Known Implementing Classes:
- AbstractPerEntryLockContainer, AbstractStripedLockContainer, OwnableReentrantPerEntryLockContainer, OwnableReentrantStripedLockContainer, ReentrantPerEntryLockContainer, ReentrantStripedLockContainer
public interface LockContainer
A container for locks
- Since:
- 4.0
- Author:
- Manik Surtani
ownsLock
boolean ownsLock(Object key,
Object owner)
- Tests if a give owner owns a lock on a specified object.
- Parameters:
key
- object to checkowner
- owner to test
- Returns:
- true if owner owns lock, false otherwise
isLocked
boolean isLocked(Object key)
- Parameters:
key
- object
- Returns:
- true if an object is locked, false otherwise
getLock
Lock getLock(Object key)
- Parameters:
key
- object
- Returns:
- the lock for a specific object
getNumLocksHeld
int getNumLocksHeld()
- Returns:
- number of locks held
size
int size()
- Returns:
- the size of the shared lock pool
acquireLock
boolean acquireLock(Object key,
long timeout,
TimeUnit unit)
throws InterruptedException
- Throws:
InterruptedException
releaseLock
void releaseLock(Object key)
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.