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.jms.JMSAddressPolicyType;
11: import org.objectweb.celtix.transports.jms.JMSClientBehaviorPolicyType;
12: import org.objectweb.celtix.transports.jms.JMSServerBehaviorPolicyType;
13:
14: public class WsdlJMSConfigurationProvider implements
15: ConfigurationProvider {
16: private final Port port;
17: private final boolean serverType;
18:
19: public WsdlJMSConfigurationProvider(Port p, boolean s) {
20: port = p;
21: serverType = s;
22: }
23:
24: public void init(Configuration configuration) {
25: // not needed
26: }
27:
28: public Object getObject(String name) {
29: if (null == port) {
30: return null;
31: }
32: if ((serverType && "jmsServer".equals(name))
33: || (!serverType && "jmsClient".equals(name))
34: || "jmsAddress".equals(name)) {
35: List<?> list = port.getExtensibilityElements();
36: for (Object ep : list) {
37: ExtensibilityElement ext = (ExtensibilityElement) ep;
38: if (("jmsServer".equals(name) && ext instanceof JMSServerBehaviorPolicyType)
39: || ("jmsClient".equals(name) && ext instanceof JMSClientBehaviorPolicyType)
40: || ("jmsAddress".equals(name) && ext instanceof JMSAddressPolicyType)) {
41: return ext;
42: }
43: }
44: }
45: return null;
46: }
47:
48: /**
49: * TODO
50: */
51: public boolean setObject(String name, Object value) {
52: return false;
53: }
54:
55: public boolean save() {
56: //TODO:
57: return false;
58: }
59:
60: }
|