Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 63   Methods: 4
NCLOC: 35   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LockStrategyFactory.java 50% 87.5% 75% 81.8%
coverage 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   
 10    /**
 11    * Factory to create LockStragtegy instance.
 12    *
 13    * @author Ben Wang
 14    */
 15    public class LockStrategyFactory
 16    {
 17   
 18    /**
 19    * Transaction locking isolation level. Default.
 20    */
 21    private static IsolationLevel lockingLevel_ = IsolationLevel.REPEATABLE_READ;
 22   
 23    /**
 24    *
 25    */
 26  0 protected LockStrategyFactory()
 27    {
 28    }
 29   
 30  24 public static LockStrategy getLockStrategy()
 31    {
 32  24 return getLockStrategy(lockingLevel_);
 33    }
 34   
 35  180142 public static LockStrategy getLockStrategy(IsolationLevel lockingLevel)
 36    {
 37    //if(log_.isTraceEnabled()) {
 38    // log_.trace("LockStrategy is: " + lockingLevel);
 39    //}
 40  180142 if (lockingLevel == null)
 41  0 return new LockStrategyNone();
 42  180142 switch (lockingLevel)
 43    {
 44  12 case NONE:
 45  12 return new LockStrategyNone();
 46  24692 case SERIALIZABLE:
 47  24692 return new LockStrategySerializable();
 48  42 case READ_UNCOMMITTED:
 49  42 return new LockStrategyReadUncommitted();
 50  319 case READ_COMMITTED:
 51  319 return new LockStrategyReadCommitted();
 52  155077 case REPEATABLE_READ:
 53  0 default:
 54  155077 return new LockStrategyRepeatableRead();
 55    }
 56    }
 57   
 58  2844 public static void setIsolationLevel(IsolationLevel level)
 59    {
 60  2844 lockingLevel_ = level;
 61    }
 62   
 63    }