KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > configuration > wsdl > WsdlHttpConfigurationProvider


1 package org.objectweb.celtix.bus.configuration.wsdl;
2
3 import java.util.List JavaDoc;
4
5 import javax.wsdl.Port;
6 import javax.wsdl.extensions.ExtensibilityElement;
7
8 import org.objectweb.celtix.configuration.Configuration;
9 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 ConfigurationProvider {
14     private final Port port;
15     private final boolean serverType;
16
17     public WsdlHttpConfigurationProvider(Port p, boolean s) {
18         port = p;
19         serverType = s;
20     }
21
22     public void init(Configuration configuration) {
23         // not needed
24
}
25
26     public Object JavaDoc getObject(String JavaDoc name) {
27         if (null == port) {
28             return null;
29         }
30         if ((serverType && "httpServer".equals(name)) || (!serverType && "httpClient".equals(name))) {
31             List JavaDoc<?> list = port.getExtensibilityElements();
32             for (Object JavaDoc ep : list) {
33                 ExtensibilityElement ext = (ExtensibilityElement)ep;
34                 if ((serverType && ext instanceof HTTPServerPolicy)
35                     || (!serverType && ext instanceof HTTPClientPolicy)) {
36                     return ext;
37                 }
38             }
39         }
40         return null;
41     }
42
43     /**
44      * TODO
45      */

46     public boolean setObject(String JavaDoc name, Object JavaDoc value) {
47         return false;
48     }
49     
50
51     public boolean save() {
52         //TODO:
53
return false;
54     }
55     
56 }
57
Popular Tags