01: package org.objectweb.celtix.bus.configuration.wsdl;
02:
03: import java.util.List;
04:
05: import javax.wsdl.Port;
06: import javax.wsdl.extensions.ExtensibilityElement;
07:
08: import org.objectweb.celtix.configuration.Configuration;
09: import org.objectweb.celtix.configuration.ConfigurationProvider;
10: import org.objectweb.celtix.transports.http.configuration.HTTPClientPolicy;
11: import org.objectweb.celtix.transports.http.configuration.HTTPServerPolicy;
12:
13: public class WsdlHttpConfigurationProvider implements
14: ConfigurationProvider {
15: private final Port port;
16: private final boolean serverType;
17:
18: public WsdlHttpConfigurationProvider(Port p, boolean s) {
19: port = p;
20: serverType = s;
21: }
22:
23: public void init(Configuration configuration) {
24: // not needed
25: }
26:
27: public Object getObject(String name) {
28: if (null == port) {
29: return null;
30: }
31: if ((serverType && "httpServer".equals(name))
32: || (!serverType && "httpClient".equals(name))) {
33: List<?> list = port.getExtensibilityElements();
34: for (Object ep : list) {
35: ExtensibilityElement ext = (ExtensibilityElement) ep;
36: if ((serverType && ext instanceof HTTPServerPolicy)
37: || (!serverType && ext instanceof HTTPClientPolicy)) {
38: return ext;
39: }
40: }
41: }
42: return null;
43: }
44:
45: /**
46: * TODO
47: */
48: public boolean setObject(String name, Object value) {
49: return false;
50: }
51:
52: public boolean save() {
53: //TODO:
54: return false;
55: }
56:
57: }
|