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
 Lock readLock()
          Return a read lock object.
 Lock upgradeLockAttempt(long msecs)
          Attempt to upgrade the current read lock to write lock with msecs timeout.
 Lock writeLock()
          Return a write lock object.
 

Method Detail

readLock

Lock readLock()
Return a read lock object.


writeLock

Lock writeLock()
Return a write lock object.


upgradeLockAttempt

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


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.