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