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: 96   Methods: 5
NCLOC: 64   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
PipelineFactory.java 100% 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.pipeline;
 16   
 
 17   
 import java.util.Iterator;
 18   
 import java.util.List;
 19   
 
 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   
 import org.apache.hivemind.lib.DefaultImplementationBuilder;
 27   
 import org.apache.hivemind.service.ClassFactory;
 28   
 
 29   
 public class PipelineFactory extends BaseLocatable implements ServiceImplementationFactory
 30   
 {
 31   
     private String _serviceId;
 32   
     private ClassFactory _classFactory;
 33   
     private DefaultImplementationBuilder _defaultImplementationBuilder;
 34   
     private ErrorHandler _errorHandler;
 35   
 
 36  4
     public Object createCoreServiceImplementation(
 37   
         String serviceId,
 38   
         Class serviceInterface,
 39   
         Module invokingModule,
 40   
         List parameters)
 41   
     {
 42  4
         HiveMind.checkFactoryParameterCount(_serviceId, parameters, 1);
 43   
 
 44  4
         PipelineParameters pp = (PipelineParameters) parameters.get(0);
 45   
 
 46  4
         PipelineAssembler pa =
 47   
             new PipelineAssembler(
 48   
                 LogFactory.getLog(serviceId),
 49   
                 _errorHandler,
 50   
                 serviceId,
 51   
                 serviceInterface,
 52   
                 pp.getFilterInterface(),
 53   
                 _classFactory,
 54   
                 _defaultImplementationBuilder,
 55   
                 invokingModule);
 56   
 
 57  4
         Object terminator = pp.getTerminator();
 58   
 
 59  4
         if (terminator != null)
 60  1
             pa.setTerminator(terminator, pp.getLocation());
 61   
 
 62  4
         List l = pp.getPipelineConfiguration();
 63   
 
 64  4
         Iterator i = l.iterator();
 65  4
         while (i.hasNext())
 66   
         {
 67  7
             PipelineContribution c = (PipelineContribution) i.next();
 68   
 
 69  7
             c.informAssembler(pa);
 70   
         }
 71   
 
 72  4
         return pa.createPipeline();
 73   
     }
 74   
 
 75  4
     public void setClassFactory(ClassFactory factory)
 76   
     {
 77  4
         _classFactory = factory;
 78   
     }
 79   
 
 80  4
     public void setDefaultImplementationBuilder(DefaultImplementationBuilder builder)
 81   
     {
 82  4
         _defaultImplementationBuilder = builder;
 83   
     }
 84   
 
 85  4
     public void setServiceId(String string)
 86   
     {
 87  4
         _serviceId = string;
 88   
     }
 89   
 
 90  4
     public void setErrorHandler(ErrorHandler handler)
 91   
     {
 92  4
         _errorHandler = handler;
 93   
     }
 94   
 
 95   
 }
 96