Coverage Report - org.apache.commons.pipeline.driver.SynchronousStageDriverFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
SynchronousStageDriverFactory
57%
4/7
N/A
1
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  *
 9  
  *     http://www.apache.org/licenses/LICENSE-2.0
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 
 18  
 package org.apache.commons.pipeline.driver;
 19  
 
 20  
 import org.apache.commons.pipeline.Stage;
 21  
 import org.apache.commons.pipeline.StageContext;
 22  
 import org.apache.commons.pipeline.StageDriver;
 23  
 import org.apache.commons.pipeline.StageDriverFactory;
 24  
 
 25  
 /**
 26  
  * Factory for SynchronousStageDriver objects.
 27  
  *
 28  
  *
 29  
  */
 30  
 public class SynchronousStageDriverFactory implements StageDriverFactory {
 31  
     
 32  
     /** Creates a new instance of SynchronousStageDriverFactory */
 33  4
     public SynchronousStageDriverFactory() {
 34  4
     }
 35  
 
 36  
     /**
 37  
      * Creates a new {@link SynchronousStageDriver} based upon this factory's configuration.
 38  
      * @param stage the stage to be run by the newly created driver
 39  
      * @param context the context in which the stage will be run
 40  
      * @return the newly created and configured driver
 41  
      */
 42  
     public StageDriver createStageDriver(Stage stage, StageContext context) {
 43  7
         return new SynchronousStageDriver(stage, context, this.faultTolerance);
 44  
     }    
 45  
 
 46  
     /**
 47  
      * Holds value of property faultTolerance. Default value is {@link FaultTolerance.NONE}.
 48  
      */
 49  4
     private FaultTolerance faultTolerance = FaultTolerance.NONE;
 50  
 
 51  
     /**
 52  
      * Getter for property faultTolerance.
 53  
      * @return Value of property faultTolerance.
 54  
      */
 55  
     public FaultTolerance getFaultTolerance() {
 56  0
         return this.faultTolerance;
 57  
     }
 58  
 
 59  
     /**
 60  
      * Setter for property faultTolerance.
 61  
      * @param faultTolerance New value of property faultTolerance.
 62  
      */
 63  
     public void setFaultTolerance(FaultTolerance faultTolerance) {
 64  0
         this.faultTolerance = faultTolerance;
 65  0
     }
 66  
 }