Clover coverage report - Code Coverage for hivemind release 1.0-beta-2
Coverage timestamp: Sun Aug 1 2004 14:03:45 EDT
file stats: LOC: 138   Methods: 16
NCLOC: 93   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
ModuleImpl.java 50% 100% 100% 97.6%
coverage coverage
 1   
 //  Copyright 2004 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.hivemind.impl;
 16   
 
 17   
 import java.util.List;
 18   
 import java.util.Locale;
 19   
 
 20   
 import org.apache.hivemind.ClassResolver;
 21   
 import org.apache.hivemind.ErrorHandler;
 22   
 import org.apache.hivemind.Location;
 23   
 import org.apache.hivemind.Messages;
 24   
 import org.apache.hivemind.internal.Module;
 25   
 import org.apache.hivemind.internal.RegistryInfrastructure;
 26   
 import org.apache.hivemind.internal.ServiceModelFactory;
 27   
 import org.apache.hivemind.internal.ServicePoint;
 28   
 import org.apache.hivemind.schema.Translator;
 29   
 import org.apache.hivemind.util.IdUtils;
 30   
 import org.apache.hivemind.util.ToStringBuilder;
 31   
 
 32   
 /**
 33   
  * Implementation of {@link org.apache.hivemind.internal.Module}.
 34   
  *
 35   
  * @author Howard Lewis Ship
 36   
  */
 37   
 public final class ModuleImpl extends BaseLocatable implements Module
 38   
 {
 39   
     private String _moduleId;
 40   
     private RegistryInfrastructure _registry;
 41   
     private ClassResolver _resolver;
 42   
     private Messages _messages;
 43   
 
 44  173
     public List getConfiguration(String extensionPointId)
 45   
     {
 46  173
         String qualifiedId = IdUtils.qualify(_moduleId, extensionPointId);
 47   
 
 48  173
         return _registry.getConfiguration(qualifiedId);
 49   
     }
 50   
 
 51  536
     public String getModuleId()
 52   
     {
 53  536
         return _moduleId;
 54   
     }
 55   
 
 56  701
     public Object getService(String serviceId, Class serviceInterface)
 57   
     {
 58  701
         String qualifiedId = IdUtils.qualify(_moduleId, serviceId);
 59   
 
 60  701
         return _registry.getService(qualifiedId, serviceInterface);
 61   
     }
 62   
 
 63  3
     public Object getService(Class serviceInterface)
 64   
     {
 65  3
         return _registry.getService(serviceInterface);
 66   
     }
 67   
 
 68  166
     public void setModuleId(String string)
 69   
     {
 70  166
         _moduleId = string;
 71   
     }
 72   
 
 73  167
     public void setRegistry(RegistryInfrastructure registry)
 74   
     {
 75  167
         _registry = registry;
 76   
     }
 77   
 
 78  166
     public void setClassResolver(ClassResolver resolver)
 79   
     {
 80  166
         _resolver = resolver;
 81   
     }
 82   
 
 83  5939
     public ClassResolver getClassResolver()
 84   
     {
 85  5939
         return _resolver;
 86   
     }
 87   
 
 88  4
     public synchronized Messages getMessages()
 89   
     {
 90  4
         if (_messages == null)
 91  4
             _messages = new MessagesImpl(getLocation().getResource(), _registry.getLocale());
 92   
 
 93  4
         return _messages;
 94   
     }
 95   
 
 96  3272
     public String expandSymbols(String input, Location location)
 97   
     {
 98  3272
         return _registry.expandSymbols(input, location);
 99   
     }
 100   
 
 101  1
     public String toString()
 102   
     {
 103  1
         ToStringBuilder builder = new ToStringBuilder(this);
 104   
 
 105  1
         builder.append("moduleId", _moduleId);
 106  1
         builder.append("classResolver", _resolver);
 107   
 
 108  1
         return builder.toString();
 109   
     }
 110   
 
 111  247
     public ServicePoint getServicePoint(String serviceId)
 112   
     {
 113  247
         String qualifiedId = IdUtils.qualify(_moduleId, serviceId);
 114   
 
 115  247
         return _registry.getServicePoint(qualifiedId);
 116   
     }
 117   
 
 118  512
     public ServiceModelFactory getServiceModelFactory(String name)
 119   
     {
 120  512
         return _registry.getServiceModelFactory(name);
 121   
     }
 122   
 
 123  3582
     public Translator getTranslator(String translator)
 124   
     {
 125  3582
         return _registry.getTranslator(translator);
 126   
     }
 127   
 
 128  3
     public Locale getLocale()
 129   
     {
 130  3
         return _registry.getLocale();
 131   
     }
 132   
 
 133  560
     public ErrorHandler getErrorHandler()
 134   
     {
 135  560
         return _registry.getErrorHander();
 136   
     }
 137   
 }
 138