org.jboss.cache.lock
Interface LockStrategy

All Known Implementing Classes:
BelasLockStrategy (src) , LockStrategyNone (src) , LockStrategyReadCommitted (src) , LockStrategyReadUncommitted (src) , LockStrategyRepeatableRead (src) , LockStrategySerializable (src)

public interface LockStrategy

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


Method Summary
 Sync readLock()
          Return a read lock object.
 Sync upgradeLockAttempt(long msecs)
          Attempt to upgrade the current read lock to write lock with msecs timeout.
 Sync writeLock()
          Return a write lock object.
 

Method Detail

readLock

public Sync readLock()
Return a read lock object.

Returns:
Sync (@see EDU.oswego.cs.dl.util.concurrent.Sync)

writeLock

public Sync writeLock()
Return a write lock object.

Returns:
Sync (@see EDU.oswego.cs.dl.util.concurrent.Sync)

upgradeLockAttempt

public Sync upgradeLockAttempt(long msecs)
                        throws UpgradeException (src) 
Attempt to upgrade the current read lock to write lock with msecs timeout.

Parameters:
msecs - Timeout in milliseconds.
Returns:
Sync object. Will return null if timeout or failed.
Throws:
UpgradeException (src)