Clover coverage report - CRISPY - 1.1.1
Coverage timestamp: Mi Nov 15 2006 13:09:46 CET
file stats: LOC: 54   Methods: 5
NCLOC: 35   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MiniLocalObjectServer.java - 100% 100% 100%
coverage
 1    package net.sf.crispy.impl.local;
 2   
 3    import java.util.Hashtable;
 4    import java.util.Map;
 5   
 6    import net.sf.crispy.impl.MiniServer;
 7    import net.sf.crispy.util.Util;
 8   
 9    import org.apache.commons.logging.Log;
 10    import org.apache.commons.logging.LogFactory;
 11   
 12    /**
 13    * Simulate a server for local Java Object access.
 14    *
 15    * @author Linke
 16    *
 17    */
 18    public class MiniLocalObjectServer implements MiniServer {
 19   
 20    protected static final Log log = LogFactory.getLog (MiniLocalObjectServer.class);
 21   
 22    private static Map serviceRegistry = new Hashtable();
 23   
 24  2 public void addService (String pvServiceInterface, String pvServiceObject) {
 25  2 try {
 26  2 Object lvServiceObject = Util.createObject(pvServiceObject);
 27  1 Class clazzInterface = Class.forName(pvServiceInterface);
 28  1 addService(clazzInterface, lvServiceObject);
 29    } catch (Exception e) {
 30    if (log.isDebugEnabled()) { log.debug("The service-interface: "
 31    + pvServiceInterface + " or the service-impl:" + pvServiceObject
 32    + " can't added." , e); }
 33    }
 34    }
 35   
 36  9 public void addService (Class pvInterface, Object pvServiceObject) {
 37  9 serviceRegistry.put(pvInterface, pvServiceObject);
 38    }
 39   
 40  73 public static Object getServiceByInterface (Class pvInterface) {
 41  73 return serviceRegistry.get(pvInterface);
 42    }
 43   
 44  66 public static void removeService(Class pvInterface) {
 45  66 serviceRegistry.remove(pvInterface);
 46    }
 47   
 48  8 public void start() { }
 49   
 50    public void stop() {
 51    serviceRegistry.clear();
 52    }
 53   
 54    }