org.jboss.cache.lock
Class LockStrategyReadUncommitted

java.lang.Object
  extended by org.jboss.cache.lock.LockStrategyReadUncommitted
All Implemented Interfaces:
LockStrategy

public class LockStrategyReadUncommitted
extends java.lang.Object
implements LockStrategy

Transaction isolation level of READ-UNCOMMITTED. Reads always succeed (NullLock), whereas writes are exclusive. It prevents none of the dirty read, non-repeatable read, or phantom read.

Version:
$Revision: 1.2 $
Author:
Ben Wang

Constructor Summary
LockStrategyReadUncommitted()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockStrategyReadUncommitted

public LockStrategyReadUncommitted()
Method Detail

readLock

public java.util.concurrent.locks.Lock readLock()
Description copied from interface: LockStrategy
Return a read lock object.

Specified by:
readLock in interface LockStrategy
See Also:
LockStrategy.readLock()

upgradeLockAttempt

public java.util.concurrent.locks.Lock upgradeLockAttempt(long msecs)
                                                   throws UpgradeException
Description copied from interface: LockStrategy
Attempt to upgrade the current read lock to write lock with msecs timeout.

Specified by:
upgradeLockAttempt in interface LockStrategy
Parameters:
msecs - Timeout in milliseconds.
Returns:
Lock object. Will return null if timeout or failed.
Throws:
UpgradeException
See Also:
LockStrategy.upgradeLockAttempt(long)

writeLock

public java.util.concurrent.locks.Lock writeLock()
Description copied from interface: LockStrategy
Return a write lock object.

Specified by:
writeLock in interface LockStrategy
See Also:
LockStrategy.writeLock()