messif.buckets.index
Interface Lockable
- All Known Implementing Classes:
- DiskStorage
public interface Lockable
Interface for objects that supports object-locking.
The lock
method can be used to acquire a lock that holds
until the unlock
method is called on that returned instance.
Method Summary |
Lock |
lock(boolean blocking)
Acquires a lock on this object. |
lock
Lock lock(boolean blocking)
throws java.lang.IllegalStateException
- Acquires a lock on this object.
If the locking was successful, a
Lock
object is obtained and
the lock holds until the Lock.unlock()
method is called.
Otherwise, this method blocks until the lock can be acquired or
null is returned if a non-blocking call was required.
- Parameters:
blocking
- if true, this method will block until the lock is obtained
- Returns:
- a lock on this object or null
- Throws:
java.lang.IllegalStateException
- if the lock cannot be obtained