Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 52   Methods: 4
NCLOC: 22   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LockStrategyReadCommitted.java - 100% 100% 100%
coverage
 1    /*
 2    * JBoss, the OpenSource J2EE webOS
 3    *
 4    * Distributable under LGPL license.
 5    * See terms of license at gnu.org.
 6    */
 7    package org.jboss.cache.lock;
 8   
 9    import java.util.concurrent.locks.Lock;
 10   
 11    /**
 12    * Transaction isolation level of READ_COMMITTED. Similar to read/write lock, but writers are not blocked on readers
 13    * It prevents dirty read only.
 14    * <p> Dirty read allows (t1) write and then (t2) read within two separate threads, all without
 15    * transaction commit. </p>
 16    *
 17    * @author Ben Wang
 18    * @version $Revision: 1.2 $
 19    */
 20    public class LockStrategyReadCommitted implements LockStrategy
 21    {
 22    private NonBlockingWriterLock lock_;
 23   
 24  320 public LockStrategyReadCommitted()
 25    {
 26  320 lock_ = new NonBlockingWriterLock();
 27    }
 28   
 29    /**
 30    * @see org.jboss.cache.lock.LockStrategy#readLock()
 31    */
 32  289 public Lock readLock()
 33    {
 34  289 return lock_.readLock();
 35    }
 36   
 37    /**
 38    * @see org.jboss.cache.lock.LockStrategy#upgradeLockAttempt(long)
 39    */
 40  2 public Lock upgradeLockAttempt(long msecs) throws UpgradeException
 41    {
 42  2 return lock_.upgradeLockAttempt(msecs);
 43    }
 44   
 45    /**
 46    * @see org.jboss.cache.lock.LockStrategy#writeLock()
 47    */
 48  1612 public Lock writeLock()
 49    {
 50  1612 return lock_.writeLock();
 51    }
 52    }