Clover coverage report - Code Coverage for hivemind-lib release 1.0-beta-1
Coverage timestamp: Sat Jul 3 2004 09:42:02 EDT
file stats: LOC: 69   Methods: 3
NCLOC: 38   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
BeanFactoryBuilder.java - 100% 100% 100%
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.lib.factory;
 16   
 
 17   
 import java.util.List;
 18   
 
 19   
 import org.apache.commons.logging.Log;
 20   
 import org.apache.commons.logging.LogFactory;
 21   
 import org.apache.hivemind.ErrorHandler;
 22   
 import org.apache.hivemind.HiveMind;
 23   
 import org.apache.hivemind.ServiceImplementationFactory;
 24   
 import org.apache.hivemind.impl.BaseLocatable;
 25   
 import org.apache.hivemind.internal.Module;
 26   
 
 27   
 /**
 28   
  * Service implementation factory that builds {@link org.apache.hivemind.lib.BeanFactory}
 29   
  * instances.
 30   
  *
 31   
  * @author Howard Lewis Ship
 32   
  */
 33   
 public class BeanFactoryBuilder extends BaseLocatable implements ServiceImplementationFactory
 34   
 {
 35   
     private String _serviceId;
 36   
     private ErrorHandler _errorHandler;
 37   
 
 38  2
     public Object createCoreServiceImplementation(
 39   
         String serviceId,
 40   
         Class serviceInterface,
 41   
         Module invokingModule,
 42   
         List parameters)
 43   
     {
 44  2
         HiveMind.checkFactoryParameterCount(_serviceId, parameters, 1);
 45   
 
 46  2
         BeanFactoryParameter p = (BeanFactoryParameter) parameters.get(0);
 47   
 
 48  2
         Log log = LogFactory.getLog(serviceId);
 49   
 
 50  2
         return new BeanFactoryImpl(
 51   
             log,
 52   
             _errorHandler,
 53   
             p.getVendClass(),
 54   
             p.getContributions(),
 55   
             p.getDefaultCacheable());
 56   
     }
 57   
 
 58  1
     public void setErrorHandler(ErrorHandler handler)
 59   
     {
 60  1
         _errorHandler = handler;
 61   
     }
 62   
 
 63  1
     public void setServiceId(String string)
 64   
     {
 65  1
         _serviceId = string;
 66   
     }
 67   
 
 68   
 }
 69