1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.springframework.extensions.config;
20
21 import java.util.List;
22
23 import org.springframework.extensions.config.ConfigElement;
24 import org.springframework.extensions.config.ConfigException;
25 import org.springframework.extensions.config.element.ConfigElementAdapter;
26
27
28
29
30 public class ServerConfigElement extends ConfigElementAdapter implements ServerProperties
31 {
32 public static final String CONFIG_ELEMENT_ID = "server";
33
34 private String scheme = null;
35 private String hostname = null;
36 private Integer port = null;
37
38
39
40
41 public ServerConfigElement()
42 {
43 super(CONFIG_ELEMENT_ID);
44 }
45
46
47
48
49
50
51 public ServerConfigElement(String name)
52 {
53 super(name);
54 }
55
56
57
58
59 public List<ConfigElement> getChildren()
60 {
61 throw new ConfigException("Reading the Server config via the generic interfaces is not supported");
62 }
63
64
65
66
67 public ConfigElement combine(ConfigElement configElement)
68 {
69 ServerConfigElement newElement = (ServerConfigElement)configElement;
70 ServerConfigElement combinedElement = new ServerConfigElement();
71
72 combinedElement.setScheme(newElement.getScheme());
73 combinedElement.setHostName(newElement.getHostName());
74 combinedElement.setPort(newElement.getPort());
75
76 return combinedElement;
77 }
78
79
80
81
82 public String getScheme()
83 {
84 return scheme;
85 }
86
87
88
89
90 public void setScheme(String scheme)
91 {
92 this.scheme = scheme;
93 }
94
95
96
97
98 public String getHostName()
99 {
100 return hostname;
101 }
102
103
104
105
106 public void setHostName(String hostname)
107 {
108 this.hostname = hostname;
109 }
110
111
112
113
114 public Integer getPort()
115 {
116 return port;
117 }
118
119
120
121
122 public void setPort(Integer port)
123 {
124 this.port = port;
125 }
126
127 }