Coverage Report - org.kuali.rice.kew.engine.BlanketApproveEngineFactoryImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
BlanketApproveEngineFactoryImpl
0%
0/24
0%
0/6
1.667
 
 1  
 /*
 2  
  * Copyright 2006-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kew.engine;
 17  
 
 18  
 import org.kuali.rice.core.framework.parameter.ParameterService;
 19  
 import org.kuali.rice.kew.engine.node.service.RouteNodeService;
 20  
 import org.kuali.rice.kew.routeheader.service.RouteHeaderService;
 21  
 import org.springframework.beans.factory.InitializingBean;
 22  
 
 23  
 /**
 24  
  * A simple implementation of a {@link BlanketApproveEngineFactory}.  Intended to be wired up in Spring
 25  
  * and initialized as part of the Spring lifecycle.
 26  
  * 
 27  
  * <p>In order for this factory to be properly constructed, all three service dependencies must be
 28  
  * injected into it.
 29  
  * 
 30  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 31  
  */
 32  0
 public class BlanketApproveEngineFactoryImpl implements BlanketApproveEngineFactory, InitializingBean {
 33  
 
 34  
         private RouteNodeService routeNodeService;
 35  
     private RouteHeaderService routeHeaderService;
 36  
     private ParameterService parameterService;
 37  
     
 38  
         /**
 39  
          * Ensures that all dependencies were injected into this factory.
 40  
          * 
 41  
          * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
 42  
          * @throws IllegalStateException if any of the required services are null
 43  
          */
 44  
         @Override
 45  
         public void afterPropertiesSet() {
 46  0
                 if (routeNodeService == null) {
 47  0
                         throw new IllegalStateException("routeNodeService not properly injected, was null.");
 48  
                 }
 49  0
                 if (routeHeaderService == null) {
 50  0
                         throw new IllegalStateException("routeHeaderService not properly injected, was null.");
 51  
                 }
 52  0
                 if (parameterService == null) {
 53  0
                         throw new IllegalStateException("parameterService not properly injected, was null.");
 54  
                 }
 55  0
         }
 56  
 
 57  
         /**
 58  
          * {@inheritDoc}
 59  
          * 
 60  
          * @see org.kuali.rice.kew.engine.BlanketApproveEngineFactory#newEngine(org.kuali.rice.kew.engine.OrchestrationConfig)
 61  
          */
 62  
         @Override
 63  
         public BlanketApproveEngine newEngine(final OrchestrationConfig config, final boolean runPostProcessor) {
 64  0
                 BlanketApproveEngine engine = new BlanketApproveEngine(config);
 65  0
                 engine.setRouteNodeService(getRouteNodeService());
 66  0
                 engine.setRouteHeaderService(getRouteHeaderService());
 67  0
                 engine.setParameterService(getParameterService());
 68  0
                 engine.setRunPostProcessorLogic(runPostProcessor);
 69  0
                 return engine;
 70  
         }
 71  
 
 72  
         /**
 73  
          * {@inheritDoc}
 74  
          * 
 75  
          * @see org.kuali.rice.kew.engine.BlanketApproveEngineFactory#newEngine(org.kuali.rice.kew.engine.OrchestrationConfig)
 76  
          */
 77  
         @Override
 78  
         public BlanketApproveEngine newEngine(final OrchestrationConfig config) {
 79  0
                 return newEngine(config, true);
 80  
         }
 81  
 
 82  
         public void setRouteNodeService(RouteNodeService routeNodeService) {
 83  0
                 this.routeNodeService = routeNodeService;
 84  0
         }
 85  
 
 86  
         public void setRouteHeaderService(RouteHeaderService routeHeaderService) {
 87  0
                 this.routeHeaderService = routeHeaderService;
 88  0
         }
 89  
 
 90  
         public void setParameterService(
 91  
             ParameterService parameterService) {
 92  0
                 this.parameterService = parameterService;
 93  0
         }
 94  
 
 95  
         protected final RouteNodeService getRouteNodeService() {
 96  0
                 return this.routeNodeService;
 97  
         }
 98  
 
 99  
         protected final RouteHeaderService getRouteHeaderService() {
 100  0
                 return this.routeHeaderService;
 101  
         }
 102  
 
 103  
         protected final ParameterService getParameterService() {
 104  0
                 return this.parameterService;
 105  
         }
 106  
 
 107  
 }