org.jboss.cache.lock
Interface LockStrategy

All Known Implementing Classes:
LockStrategyNone, LockStrategyReadCommitted, LockStrategyReadUncommitted, LockStrategyRepeatableRead, LockStrategySerializable

public interface LockStrategy

Interface to specify lock strategy, e.g., for different isolation levels.

Author:
Ben Wang

Method Summary
 java.util.concurrent.locks.Lock readLock()
          Return a read lock object.
 java.util.concurrent.locks.Lock upgradeLockAttempt(long msecs)
          Attempt to upgrade the current read lock to write lock with msecs timeout.
 java.util.concurrent.locks.Lock writeLock()
          Return a write lock object.
 

Method Detail

readLock

java.util.concurrent.locks.Lock readLock()
Return a read lock object.


writeLock

java.util.concurrent.locks.Lock writeLock()
Return a write lock object.


upgradeLockAttempt

java.util.concurrent.locks.Lock upgradeLockAttempt(long msecs)
                                                   throws UpgradeException
Attempt to upgrade the current read lock to write lock with msecs timeout.

Parameters:
msecs - Timeout in milliseconds.
Returns:
Lock object. Will return null if timeout or failed.
Throws:
UpgradeException