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: 134   Methods: 0
NCLOC: 24   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
Module.java - - - -
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.internal;
 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.Locatable;
 23   
 import org.apache.hivemind.Location;
 24   
 import org.apache.hivemind.Messages;
 25   
 import org.apache.hivemind.schema.Translator;
 26   
 
 27   
 /**
 28   
  * The definition of a HiveMind Module.  A Module is
 29   
  * a container of service extension points and
 30   
  * configuration extension points.  It also acts as a "gateway" so that services
 31   
  * and configurations in other modules may be accessed.
 32   
  * 
 33   
  * <p>
 34   
  * Why do we expose the Module rather than the {@link org.apache.hivemind.internal.RegistryInfrastructure}?
 35   
  * It's more than just qualifying ids before passing them up to the RI.
 36   
  * At some future point, a concept of visibility will be added to HiveMind. This will make many services
 37   
  * and configurations private to the module which defines them and the necessary visibility filtering
 38   
  * logic will be here.
 39   
  *
 40   
  * @author Howard Lewis Ship
 41   
  */
 42   
 public interface Module extends Locatable
 43   
 {
 44   
     /**
 45   
      * Returns the unique identifier for this module.
 46   
      */
 47   
     public String getModuleId();
 48   
 
 49   
     /**
 50   
      * Looks up
 51   
      * the {@link ServicePoint} (throwing an exception if not found)
 52   
      * and invokes {@link ServicePoint#getService(Class)}.
 53   
      * 
 54   
      * @param serviceId an unqualified id for a service within this module, or a fully qualified id for a service in this or any other module
 55   
      * @param serviceInterface type the result will be cast to
 56   
      */
 57   
     public Object getService(String serviceId, Class serviceInterface);
 58   
 
 59   
     /**
 60   
      * Finds a service that implements the provided interface. Exactly one such service may exist or an exception is thrown.
 61   
      * 
 62   
      * @param serviceInterface used to locate the service
 63   
      */
 64   
     public Object getService(Class serviceInterface);
 65   
 
 66   
     /**
 67   
      * Returns the identified service extension point.
 68   
      * 
 69   
      * @param serviceId an unqualified id for a service within this module, or a fully qualified id for a service in this or any other module
 70   
      * @throws org.apache.hivemind.ApplicationRuntimeException if no such service extension point exists
 71   
      */
 72   
 
 73   
     public ServicePoint getServicePoint(String serviceId);
 74   
 
 75   
     /**
 76   
      * Returns the {@link java.util.List} of elements for the
 77   
      * specified configuration point.  The returned List
 78   
      * is unmodifiable.  It may be empty, but won't be null.
 79   
      * 
 80   
      * <p>It is expressly the <em>caller's</em> job to sort the elements
 81   
      * into an appropriate order (a copy will have to be made since
 82   
      * the returned List is unmodifiable).
 83   
      * 
 84   
      * @param configurationId an unqualified id for a configuration within this module, or a fully qualified id for a configuration in this or any other module
 85   
      * @throws ApplicationRuntimeException if this module does not
 86   
      * contain the specified configuration extension point.
 87   
      * 
 88   
      */
 89   
     public List getConfiguration(String configurationId);
 90   
 
 91   
     /**
 92   
      * Returns the resource resolver for this module.  The resource resolver
 93   
      * is used to locate classes by name (using the correct classloader).
 94   
      */
 95   
 
 96   
     public ClassResolver getClassResolver();
 97   
 
 98   
     /**
 99   
      * Returns an object that can provide and format localized messages for this
 100   
      * module.  The messages come from a properties file,
 101   
      * <code>hivemodule.properties</code> (localized)
 102   
      * stored with the HiveMind deployment descriptor in the META-INF folder.
 103   
      */
 104   
 
 105   
     public Messages getMessages();
 106   
 
 107   
     /**
 108   
      * @see RegistryInfrastructure#getTranslator(String)
 109   
      */
 110   
     public Translator getTranslator(String translator);
 111   
 
 112   
     /**
 113   
      * @see RegistryInfrastructure#getServiceModelFactory(String)
 114   
      */
 115   
     public ServiceModelFactory getServiceModelFactory(String name);
 116   
 
 117   
     /**
 118   
      * @see org.apache.hivemind.Registry#getLocale()
 119   
      */
 120   
     public Locale getLocale();
 121   
 
 122   
     /**
 123   
      *  @see org.apache.hivemind.internal.RegistryInfrastructure#expandSymbols(String, Location)
 124   
      * 
 125   
      */
 126   
     public String expandSymbols(String input, Location location);
 127   
 
 128   
     /**
 129   
      * Returns the {@link org.apache.hivemind.ErrorHandler} for this Registry.
 130   
      */
 131   
 
 132   
     public ErrorHandler getErrorHandler();
 133   
 }
 134