1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
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 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
public class GraphEnvironment |
24 | |
{ |
25 | |
|
26 | |
|
27 | 4 | private boolean defaultTwoWay = false; |
28 | |
|
29 | |
|
30 | 4 | private boolean doingCombinedGeneration = false; |
31 | |
|
32 | |
|
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 | |
} |