2009/04/15 - Apache HiveMind has been retired.

For more information, please explore the Attic.

Clover coverage report - Code Coverage for hivemind release 1.2.1
Coverage timestamp: Fri Feb 10 2006 16:33:43 PST
file stats: LOC: 100   Methods: 9
NCLOC: 58   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ServiceImplementationFactoryParametersImpl.java 100% 86.7% 77.8% 84.6%
coverage coverage
 1    // Copyright 2004, 2005 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   
 19    import org.apache.commons.logging.Log;
 20    import org.apache.hivemind.ServiceImplementationFactoryParameters;
 21    import org.apache.hivemind.ErrorLog;
 22    import org.apache.hivemind.internal.Module;
 23    import org.apache.hivemind.internal.ServicePoint;
 24    import org.apache.hivemind.util.Defense;
 25   
 26    /**
 27    * Wrapper around a {@link org.apache.hivemind.internal.ServicePoint} and a List of parameters,
 28    * passed to a {@link org.apache.hivemind.ServiceImplementationFactory}.
 29    *
 30    * @author Howard M. Lewis Ship
 31    * @since 1.1
 32    */
 33    public class ServiceImplementationFactoryParametersImpl implements
 34    ServiceImplementationFactoryParameters
 35    {
 36    private ServicePoint _servicePoint;
 37   
 38    private Module _invokingModule;
 39   
 40    private List _parameters;
 41   
 42  793 public ServiceImplementationFactoryParametersImpl(ServicePoint servicePoint,
 43    Module invokingModule, List parameters)
 44    {
 45  793 Defense.notNull(servicePoint, "servicePoint");
 46  793 Defense.notNull(invokingModule, "invokingModule");
 47  793 Defense.notNull(parameters, "parameters");
 48   
 49  793 _servicePoint = servicePoint;
 50  793 _invokingModule = invokingModule;
 51  793 _parameters = parameters;
 52    }
 53   
 54    /**
 55    * This method is only used in testing.
 56    */
 57   
 58  1 public boolean equals(Object other)
 59    {
 60  1 ServiceImplementationFactoryParametersImpl p = (ServiceImplementationFactoryParametersImpl) other;
 61   
 62  1 return _servicePoint == p._servicePoint && _invokingModule == p._invokingModule
 63    && _parameters.equals(p._parameters);
 64    }
 65   
 66  1097 public String getServiceId()
 67    {
 68  1097 return _servicePoint.getExtensionPointId();
 69    }
 70   
 71  0 public Class getServiceInterface()
 72    {
 73  0 return _servicePoint.getServiceInterface();
 74    }
 75   
 76  1564 public Log getLog()
 77    {
 78  1564 return _servicePoint.getLog();
 79    }
 80   
 81  128 public ErrorLog getErrorLog()
 82    {
 83  128 return _servicePoint.getErrorLog();
 84    }
 85   
 86  1973 public Module getInvokingModule()
 87    {
 88  1973 return _invokingModule;
 89    }
 90   
 91  0 public List getParameters()
 92    {
 93  0 return _parameters;
 94    }
 95   
 96  783 public Object getFirstParameter()
 97    {
 98  783 return _parameters.isEmpty() ? null : _parameters.get(0);
 99    }
 100    }