Coverage Report - org.mule.tools.visualizer.config.GraphEnvironment
 
Classes in this File Line Coverage Branch Coverage Complexity
GraphEnvironment
56%
18/32
0%
0/2
1.062
 
 1  
 /*
 2  
  * $Id: GraphEnvironment.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.tools.visualizer.config;
 12  
 
 13  
 import org.mule.tools.visualizer.components.EndpointRegistry;
 14  
 
 15  
 import java.util.Properties;
 16  
 
 17  
 /**
 18  
  * todo document
 19  
  * 
 20  
  * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
 21  
  * @version $Revision: 7963 $
 22  
  */
 23  
 public class GraphEnvironment
 24  
 {
 25  
 
 26  
     // Determines if the manager is running synchronously by default
 27  4
     private boolean defaultTwoWay = false;
 28  
 
 29  
     // Is the parser doing a combined generation
 30  4
     private boolean doingCombinedGeneration = false;
 31  
 
 32  
     // Stores references to endpoints registered in the graph
 33  
     private EndpointRegistry endpointRegistry;
 34  
 
 35  
     private GraphConfig config;
 36  
 
 37  
     private Properties properties;
 38  
 
 39  
     public GraphEnvironment(GraphConfig config)
 40  4
     {
 41  4
         this.config = config;
 42  4
         properties = new Properties();
 43  4
         endpointRegistry = new EndpointRegistry(this);
 44  4
     }
 45  
 
 46  
     public boolean isDefaultTwoWay()
 47  
     {
 48  14
         return defaultTwoWay;
 49  
     }
 50  
 
 51  
     public void setDefaultTwoWay(boolean defaultTwoWay)
 52  
     {
 53  0
         this.defaultTwoWay = defaultTwoWay;
 54  0
     }
 55  
 
 56  
     public boolean isDoingCombinedGeneration()
 57  
     {
 58  0
         return doingCombinedGeneration;
 59  
     }
 60  
 
 61  
     public void setDoingCombinedGeneration(boolean doingCombinedGeneration)
 62  
     {
 63  4
         this.doingCombinedGeneration = doingCombinedGeneration;
 64  4
     }
 65  
 
 66  
     public EndpointRegistry getEndpointRegistry()
 67  
     {
 68  46
         return endpointRegistry;
 69  
     }
 70  
 
 71  
     public void setEndpointRegistry(EndpointRegistry endpointRegistry)
 72  
     {
 73  4
         this.endpointRegistry = endpointRegistry;
 74  4
     }
 75  
 
 76  
     public GraphConfig getConfig()
 77  
     {
 78  218
         return config;
 79  
     }
 80  
 
 81  
     public void setConfig(GraphConfig config)
 82  
     {
 83  0
         this.config = config;
 84  0
     }
 85  
 
 86  
     public Properties getProperties()
 87  
     {
 88  12
         return properties;
 89  
     }
 90  
 
 91  
     public void setProperties(Properties properties)
 92  
     {
 93  0
         this.properties = properties;
 94  0
     }
 95  
 
 96  
     public void setProperty(String name, String value)
 97  
     {
 98  0
         properties.setProperty(name, value);
 99  0
     }
 100  
 
 101  
     public String getProperty(String name)
 102  
     {
 103  0
         return getProperty(name, null);
 104  
     }
 105  
 
 106  
     public String getProperty(String name, String defaultValue)
 107  
     {
 108  8
         return properties.getProperty(name, defaultValue);
 109  
     }
 110  
 
 111  
     public void log(String message)
 112  
     {
 113  130
         System.out.println(message);
 114  130
     }
 115  
 
 116  
     public void logError(String message, Exception e)
 117  
     {
 118  0
         System.err.println(message);
 119  0
         if (e != null)
 120  
         {
 121  0
             e.printStackTrace(System.err);
 122  
         }
 123  0
     }
 124  
 }