Clover coverage report - JFox Service-Oriented Application Framework - 1.0-RC2
Coverage timestamp: 星期四 十二月 15 2005 11:58:01 CST
file stats: LOC: 93   Methods: 5
NCLOC: 33   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
SwarmCacheServiceImpl.java 0% 0% 0% 0%
coverage
 1   
 /**
 2   
  * @(#)SwarmCacheServiceImpl.java
 3   
  *  
 4   
  * JFoxSOAF, Service-Oriented Application Framework
 5   
  * 
 6   
  * Copyright(c) JFoxSOAF Team
 7   
  * 
 8   
  * Licensed under the GNU LGPL, Version 2.1 (the "License"); 
 9   
  * you may not use this file except in compliance with the License. 
 10   
  * You may obtain a copy of the License at  
 11   
  * 
 12   
  * http://www.gnu.org/copyleft/lesser.html
 13   
  * 
 14   
  * Unless required by applicable law or agreed to in writing, software
 15   
  * distributed under the License is distributed on an "AS IS" BASIS, 
 16   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 17   
  * See the License for the specific language governing permissions and 
 18   
  * limitations under the License. 
 19   
  * 
 20   
  * For more information, please visit:
 21   
  * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
 22   
  * http://www.huihoo.org/jfox/jfoxsoaf
 23   
  */
 24   
 
 25   
 package org.huihoo.jfox.soaf.services.cache;
 26   
 
 27   
 import java.io.Serializable;
 28   
 
 29   
 import net.sf.swarmcache.ObjectCache;
 30   
 
 31   
 import org.huihoo.jfox.soaf.exception.CacheServiceException;
 32   
 
 33   
 /**
 34   
  * <p>
 35   
  * Support for SwarmCache.
 36   
  * </p>
 37   
  * 
 38   
  * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
 39   
  * @author <a href="mailto:m.bogaert@intrasoft.be">Mathias Bogaert </a>
 40   
  * @version $Revision: 1.1 $ $Date: 2005/05/22 06:48:52 $
 41   
  * @version Revision: 1.0
 42   
  */
 43   
 
 44   
 public class SwarmCacheServiceImpl implements CacheService {
 45   
 
 46   
     private ObjectCache cache;
 47   
 
 48  0
     public SwarmCacheServiceImpl(ObjectCache cache) {
 49  0
         this.cache = cache;
 50   
     }
 51   
 
 52   
     /**
 53   
      * @see org.huihoo.jfox.soaf.services.cache.CacheService#get(java.lang.Object)
 54   
      */
 55  0
     public Object get(Object key) throws CacheServiceException {
 56  0
         if (key instanceof Serializable) {
 57  0
             return cache.get((Serializable) key);
 58   
         } else {
 59  0
             throw new CacheServiceException("Keys must implement Serializable");
 60   
         }
 61   
     }
 62   
 
 63   
     /**
 64   
      * @see org.huihoo.jfox.soaf.services.cache.CacheService#put(java.lang.Object,
 65   
      *      java.lang.Object)
 66   
      */
 67  0
     public void put(Object key, Object value) throws CacheServiceException {
 68  0
         if (key instanceof Serializable) {
 69  0
             cache.put((Serializable) key, value);
 70   
         } else {
 71  0
             throw new CacheServiceException("Keys must implement Serializable");
 72   
         }
 73   
     }
 74   
 
 75   
     /**
 76   
      * @see org.huihoo.jfox.soaf.services.cache.CacheService#remove(java.lang.Object)
 77   
      */
 78  0
     public void remove(Object key) throws CacheServiceException {
 79  0
         if (key instanceof Serializable) {
 80  0
             cache.clear((Serializable) key);
 81   
         } else {
 82  0
             throw new CacheServiceException("Keys must implement Serializable");
 83   
         }
 84   
     }
 85   
 
 86   
     /**
 87   
      * @see org.huihoo.jfox.soaf.services.cache.CacheService#clear()
 88   
      */
 89  0
     public void clear() throws CacheServiceException {
 90  0
         cache.clearAll();
 91   
     }
 92   
 
 93   
 }