You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2006/03/03 14:56:22 UTC

svn commit: r382814 - in /incubator/woden/java/src/org/apache/woden: internal/ internal/util/ internal/wsdl20/ internal/wsdl20/extensions/ internal/wsdl20/extensions/soap/ wsdl20/ wsdl20/extensions/ wsdl20/extensions/soap/

Author: jkaputin
Date: Fri Mar  3 05:56:20 2006
New Revision: 382814

URL: http://svn.apache.org/viewcvs?rev=382814&view=rev
Log:
Added an extension mechanism for adding extension
properties to the WSDL Component model (i.e. 'properties'
here is an abstraction of extension attributes and
extension elements in the WSDL Element model). Have 
included SOAPBindingExtensions as the first implementation
of this extension mechanism.

Added:
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/ComponentExtensionsImpl.java
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ComponentExtensions.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java
Modified:
    incubator/woden/java/src/org/apache/woden/internal/Messages.properties
    incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/WSDLObjectImpl.java
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
    incubator/woden/java/src/org/apache/woden/wsdl20/WSDLComponent.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java

Modified: incubator/woden/java/src/org/apache/woden/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/Messages.properties?rev=382814&r1=382813&r2=382814&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/Messages.properties (original)
+++ incubator/woden/java/src/org/apache/woden/internal/Messages.properties Fri Mar  3 05:56:20 2006
@@ -48,6 +48,8 @@
 WSDL012=No Java type was registered for the extension element "{0}" in the context of "{1}".
 WSDL013=The Java class "{0}" does not implement the "ExtensionElement" interface.
 WSDL014=No Extension Registry was set on the DescriptionElement so cannot handle the extension element "{0}" in the context of "{1}".
+WSDL015=The extension namespace "{0}" in the context of "{1}" does not have a Java class registered.
+WSDL016=The Java class "{0}" does not implement the "ComponentExtensions" interface.
 
 # ------------ Parsing errors -------------------
 
@@ -67,6 +69,7 @@
 WSDL520=Extension element "{0}" in the context of "{1}" must not be in the WSDL namespace.
 WSDL521=Could not parse an inline schema in the WSDL at URL "{0}".
 WSDL522=Could not parse a schema imported from URL "{0}".
+WSDL523=The QName of an extension attribute must not be null.
 
 # ------------ TODO determine if these errors are needed -------------------
 

Modified: incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java?rev=382814&r1=382813&r2=382814&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java Fri Mar  3 05:56:20 2006
@@ -23,6 +23,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.woden.WSDLException;
 import org.apache.woden.internal.wsdl20.BindingFaultImpl;
 import org.apache.woden.internal.wsdl20.BindingFaultReferenceImpl;
 import org.apache.woden.internal.wsdl20.BindingImpl;
@@ -40,8 +41,12 @@
 import org.apache.woden.internal.wsdl20.ServiceImpl;
 import org.apache.woden.internal.wsdl20.TypeDefinitionImpl;
 import org.apache.woden.internal.wsdl20.TypesImpl;
+import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
+import org.apache.woden.wsdl20.Binding;
 import org.apache.woden.wsdl20.Interface;
 import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
+import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
 import org.apache.woden.wsdl20.xml.BindingElement;
 import org.apache.woden.wsdl20.xml.BindingFaultElement;
 import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
@@ -324,6 +329,7 @@
                 buildProperties(bindImpl.getPropertyElements(), bindImpl);
                 buildBindingFaults(bindImpl);
                 buildBindingOperations(bindImpl);
+                buildBindingExtensions(bindImpl);
                 fBindingsDone.add(bindImpl);
             }
         }
@@ -348,6 +354,26 @@
             buildProperties(oper.getPropertyElements(), oper);
             buildBindingFaultReferences(oper);
             buildBindingMessageReferences(oper);
+        }
+    }
+    
+    private void buildBindingExtensions(BindingImpl binding)
+    {
+        ExtensionRegistry er = fDesc.getExtensionRegistry();
+        URI[] extNamespaces = er.queryComponentExtensionNamespaces(Binding.class);
+        for(int i=0; i<extNamespaces.length; i++)
+        {
+            URI extNS = extNamespaces[i];
+            ComponentExtensions compExt = null;
+            try {
+                compExt = er.createComponentExtension(Binding.class, extNS);
+                ((ComponentExtensionsImpl)compExt).init(binding, extNS);
+            } catch (WSDLException e) {
+                //This exception occurs if there is no Java class registered for the namespace, but
+                //this namespace was obtained from the extension registry so we know that a Java class is
+                //registered and that this exception cannot occur. Ignore the catch block.
+            }
+            binding.setComponentExtensions(extNS, compExt);
         }
     }
     

Modified: incubator/woden/java/src/org/apache/woden/internal/wsdl20/WSDLObjectImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/WSDLObjectImpl.java?rev=382814&r1=382813&r2=382814&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/WSDLObjectImpl.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/WSDLObjectImpl.java Fri Mar  3 05:56:20 2006
@@ -15,7 +15,12 @@
  */
 package org.apache.woden.internal.wsdl20;
 
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
 
 /**
  * All classes implementing the WSDL 2.0 Component and Element
@@ -31,8 +36,38 @@
 public abstract class WSDLObjectImpl extends WSDLElementImpl
                                      implements WSDLComponent
 {
-    /* No definitions required within this class. Its purpose is just to provide
-     * 'hooks' for WSDLComponent and WSDLElement and access to the common behaviour
-     * defined for all WSDL Elements (i.e. extensibility). 
+    private Map fCompExtensions = new HashMap(); //map of ComponentExtensions keyed by namespace
+    
+    /* ************************************************************
+     *  WSDLComponent interface methods (i.e. WSDL Component API)
+     * ************************************************************/
+    
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.WSDLComponent#getWSDLExtensionsForNamespace(java.net.URI)
+     */
+    public ComponentExtensions getComponentExtensionsForNamespace(URI namespace)
+    {
+        return (ComponentExtensions)fCompExtensions.get(namespace);
+    }
+    
+    /* ************************************************************
+     *  Non-API implementation methods
+     * ************************************************************/
+
+    /*
+     * Store the extensions in a map using the namespace string as the key.
+     * If the extensions value is null, delete any existing entry in the map
+     * for this namespace. If the nsmespace string is null, do nothing.
      */
+    public void setComponentExtensions(URI namespace, ComponentExtensions extensions)
+    {
+        if(namespace != null)
+        {
+            if(extensions != null) {
+                fCompExtensions.put(namespace, extensions);
+            } else {
+                fCompExtensions.remove(namespace);
+            }
+        }
+    }
 }

Added: incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/ComponentExtensionsImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/ComponentExtensionsImpl.java?rev=382814&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/ComponentExtensionsImpl.java (added)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/ComponentExtensionsImpl.java Fri Mar  3 05:56:20 2006
@@ -0,0 +1,53 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20.extensions;
+
+import java.net.URI;
+
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+
+/**
+ * This class represents group of WSDL extension properties (i.e. extension
+ * elements or attributes) related by their non-WSDL namespace. 
+ * The only behaviour of this class is to return the namespace.
+ * Implementations may extend this class to define behaviour specific to 
+ * their required extensions.
+ * 
+ * @author jkaputin@apache.org
+ */
+public abstract class ComponentExtensionsImpl implements ComponentExtensions 
+{
+    protected WSDLElement fParentElement = null;
+    private URI fNamespace = null;
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensions#getNamespace()
+     */
+    public URI getNamespace() {
+        return fNamespace;
+    }
+    
+    /* ************************************************************
+     *  Non-API implementation methods
+     * ************************************************************/
+
+    public void init(WSDLElement parentElement, URI namespace)
+    {
+        fParentElement = parentElement;
+        fNamespace = namespace;
+    }
+}

Modified: incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java?rev=382814&r1=382813&r2=382814&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java Fri Mar  3 05:56:20 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.woden.internal.wsdl20.extensions;
 
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingExtensionsImpl;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPConstants;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPHeaderBlockDeserializer;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPHeaderBlockImpl;
@@ -24,6 +25,8 @@
 import org.apache.woden.internal.xml.QNameListAttrImpl;
 import org.apache.woden.internal.xml.StringAttrImpl;
 import org.apache.woden.internal.xml.URIAttrImpl;
+import org.apache.woden.wsdl20.Binding;
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
 import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
 import org.apache.woden.wsdl20.xml.BindingElement;
 import org.apache.woden.wsdl20.xml.BindingFaultElement;
@@ -115,6 +118,11 @@
                            SOAPConstants.Q_ELEM_SOAP_HEADER,
                            SOAPHeaderBlockImpl.class);
         
+        //------------ WSDL Component Extensions ------------ 
+        
+        registerComponentExtension(Binding.class, 
+                           ComponentExtensions.URI_NS_SOAP, 
+                           SOAPBindingExtensionsImpl.class);
         
     }
 }

Added: incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java?rev=382814&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java (added)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPBindingExtensionsImpl.java Fri Mar  3 05:56:20 2006
@@ -0,0 +1,80 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20.extensions.soap;
+
+import java.net.URI;
+
+import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions;
+import org.apache.woden.wsdl20.extensions.soap.SOAPModule;
+import org.apache.woden.xml.StringAttr;
+import org.apache.woden.xml.URIAttr;
+
+/**
+ * This class defines the properties from the SOAP namespace
+ * added to the WSDL <code>Binding</code> component as part 
+ * of the SOAP binding extension defined by the WSDL 2.0 spec. 
+ * 
+ * @author jkaputin@apache.org
+ */
+public class SOAPBindingExtensionsImpl extends ComponentExtensionsImpl
+                                       implements SOAPBindingExtensions 
+{
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions#getSoapVersion()
+     */
+    public String getSoapVersion() 
+    {
+        StringAttr version = 
+            (StringAttr)fParentElement.getExtensionAttribute(SOAPConstants.Q_ATTR_SOAP_VERSION);
+        return version != null ? version.getString() : null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions#getSoapUnderlyingProtocol()
+     */
+    public URI getSoapUnderlyingProtocol() 
+    {
+        URIAttr protocol = 
+            (URIAttr)fParentElement.getExtensionAttribute(SOAPConstants.Q_ATTR_SOAP_PROTOCOL);
+        return protocol != null ? protocol.getURI() : null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions#getSoapMepDefault()
+     */
+    public URI getSoapMepDefault() 
+    {
+        URIAttr mepDefault = 
+            (URIAttr)fParentElement.getExtensionAttribute(SOAPConstants.Q_ATTR_SOAP_MEPDEFAULT);
+        return mepDefault != null ? mepDefault.getURI() : null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions#getSoapModules()
+     */
+    public SOAPModule[] getSoapModules() 
+    {
+        ExtensionElement[] extEls = fParentElement.getExtensionElementsOfType(SOAPConstants.Q_ELEM_SOAP_MODULE);
+        int len = extEls.length;
+        SOAPModule[] soapMods = new SOAPModule[len];
+        System.arraycopy(extEls, 0, soapMods, 0, len);
+        return soapMods;
+    }
+    
+}

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/WSDLComponent.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/WSDLComponent.java?rev=382814&r1=382813&r2=382814&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/WSDLComponent.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/WSDLComponent.java Fri Mar  3 05:56:20 2006
@@ -15,12 +15,24 @@
  */
 package org.apache.woden.wsdl20;
 
+import java.net.URI;
+
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
+
 /**
  * All components directly or indirectly extend this interface, so it provides 
  * a common term of reference for all components.
  * 
  * @author jkaputin@apache.org
  */
-public interface WSDLComponent {
-
+public interface WSDLComponent 
+{
+    /**
+     * Gets the group of extension properties, belonging to the specified non-WSDL
+     * namespace, that extend this WSDL component.
+     * 
+     * @param namespace a namespace URI different to the WSDL 2.0 namespace.
+     * @return the <code>ComponentExtensions</code> with the specified namespace.
+     */
+    public ComponentExtensions getComponentExtensionsForNamespace(URI namespace);
 }

Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ComponentExtensions.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ComponentExtensions.java?rev=382814&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ComponentExtensions.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ComponentExtensions.java Fri Mar  3 05:56:20 2006
@@ -0,0 +1,53 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+package org.apache.woden.wsdl20.extensions;
+
+import java.net.URI;
+
+/**
+ * This interface represents a group of properties that extend a <code>WSDLComponent</code>.
+ * These properties share the same namespace and it is different to the WSDL 2.0 namespace.
+ * The XML representation of these properties are the elements and attributes
+ * from outside the WSDL 2.0 namespace that extend a WSDL element.
+ * For example, the elements and attributes from the SOAP namespace that extend the 
+ * WSDL &lt;binding&gt; element are represented by this interface as extension
+ * properties of the <code>Binding</code> component. 
+ * <p>
+ * This interface provides a common point of reference to a WSDL component's extension
+ * properties that belong to a particular namespace. 
+ * The interface does not define any behaviour specific to the individual properties.
+ * Woden implementations that need to support WSDL extensions from a particular namespace
+ * should implement this interface and add support specific to those extensions.
+ * <p>
+ * For example, Woden implements this interface to support the SOAP and HTTP binding
+ * extensions defined in the W3C WSDL 2.0 specification.
+ * 
+ * @author jkaputin@apache.org
+ */
+public interface ComponentExtensions 
+{
+    /**
+     * Namespace URIs for extensions defined by WSDL 2.0 Specification.
+     */
+    public static final URI URI_NS_SOAP = URI.create("http://www.w3.org/2006/01/wsdl/soap");
+    public static final URI URI_NS_HTTP = URI.create("http://www.w3.org/2006/01/wsdl/http");
+    
+    /**
+     * @return the non-WSDL URI shared by this group of extension properties
+     */
+    public URI getNamespace();
+    
+}

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java?rev=382814&r1=382813&r2=382814&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java Fri Mar  3 05:56:20 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.woden.wsdl20.extensions;
 
+import java.net.URI;
 import java.util.Hashtable;
 import java.util.Map;
 import java.util.Set;
@@ -78,6 +79,13 @@
   */
   protected Map extAttributeReg = new Hashtable();
   
+  /*
+   * This is a Map of Maps. The top-level Map is keyed by (Class)parentComponent
+   * and the inner Map is keyed by (URI)extensionNamespace with a value of
+   * (Class)componentExtensions.
+   */
+  protected Map compExtReg = new Hashtable();
+  
   private ErrorReporter errorReporter = null;
   
   public void setErrorReporter(ErrorReporter errRpt)
@@ -416,6 +424,7 @@
 
     if (extensionType == null)
     {
+      //TODO use ErrorReporter to get formatted error msg WSDL012
       throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                               "No Java extensionType found " +
                               "to represent a '" + elementType +
@@ -424,6 +433,7 @@
     }
     else if (!(ExtensionElement.class.isAssignableFrom(extensionType)))
     {
+      //TODO use ErrorReporter to get formatted error msg WSDL013
       throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
                               "The Java extensionType '" +
                               extensionType.getName() + "' does " +
@@ -592,4 +602,127 @@
       
       return attr;
   }
+  
+  /**
+   * Register the Java class which will represent extensions from a specified 
+   * namespace that will extend the specified WSDL component class.
+   * 
+   * @param parentClass the WSDL component class
+   * @param extNamespace the extension namespace
+   * @param compExtClass the Java class representing these extensions
+   */
+  public void registerComponentExtension(Class parentClass,
+                                         URI extNamespace,
+                                         Class compExtClass)
+  {
+      if(!(ComponentExtensions.class.isAssignableFrom(compExtClass)))
+      {
+          String msg = getErrorReporter().getFormattedMessage("WSDL016", 
+                  new Object[] {compExtClass.getName()});    
+          throw new IllegalArgumentException(msg);
+      }
+      
+      Map innerCompExtReg =
+          (Map)compExtReg.get(parentClass);
+      
+      if (innerCompExtReg == null)
+      {
+          innerCompExtReg = new Hashtable();
+          
+          compExtReg.put(parentClass, innerCompExtReg);
+      }
+      
+      innerCompExtReg.put(extNamespace, compExtClass);
+  }
+  
+  /**
+   * Return the Java class that represents the extensions from the specified
+   * namespace that extend the specified WSDL component class.
+   * 
+   * @param parentClass the WSDL component
+   * @param extNamespace the extension namespace
+   * @return the Class of the component extensions
+   */
+  public Class queryComponentExtension(Class parentClass, URI extNamespace)
+  {
+      Map innerCompExtReg =
+          (Map)compExtReg.get(parentClass);
+      Class compExtClass = null;
+      
+      if (innerCompExtReg != null)
+      {
+          compExtClass = (Class)innerCompExtReg.get(extNamespace);
+      }
+      
+      return compExtClass;
+  }
+
+  /**
+   * Return the extension namespaces registered for the specified WSDL Component class.
+   * 
+   * @param parentClass the class of WSDL component extended by these namespaces
+   * @return an array of namespace URIs
+   */
+  public URI[] queryComponentExtensionNamespaces(Class parentClass)
+  {
+      Map innerCompExtReg =
+          (Map)compExtReg.get(parentClass);
+      
+      if (innerCompExtReg != null)
+      {
+          Set namespaceKeys = innerCompExtReg.keySet();
+          URI[] extNamespaces = new URI[namespaceKeys.size()];
+          namespaceKeys.toArray(extNamespaces);
+          return extNamespaces;
+      }
+      else
+      {
+          return new URI[0]; //return an empty array, rather than null
+      }
+      
+  }
+  
+  /**
+   * Return a ComponentExtensions object from the Java class registered for 
+   * the specified extension namespace against the specified WSDL component class.
+   * 
+   * @param parentClass the WSDL component class.
+   * @param extNamespace the extension namespace.
+   * @return a <code>ComponentExtensions</code> object
+   * @throws WSDLException if no Java class is registered for this namespace and WSDL component.
+   */
+  public ComponentExtensions createComponentExtension(Class parentClass, 
+                                                      URI extNamespace)
+                                                      throws WSDLException
+  {
+      Class compExtClass = queryComponentExtension(parentClass, extNamespace);
+      
+      if(compExtClass == null)
+      {
+          String msg = getErrorReporter().getFormattedMessage("WSDL015",
+                  new Object[] {extNamespace.toString(), parentClass.getName()});
+          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL015: " + msg);
+      }
+          
+      ComponentExtensions compExt = null;
+      
+      try {
+          compExt = (ComponentExtensions)compExtClass.newInstance();
+      } 
+      catch (InstantiationException e) 
+      {
+          e.printStackTrace();
+          String msg = getErrorReporter().getFormattedMessage("WSDL009",
+                  new Object[] {compExtClass.getName()});
+          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL009: " + msg, e);
+      } 
+      catch (IllegalAccessException e) {
+          String msg = getErrorReporter().getFormattedMessage("WSDL009",
+                  new Object[] {compExtClass.getName()});
+          throw new WSDLException(WSDLException.CONFIGURATION_ERROR, "WSDL009: " + msg, e);
+      }
+      
+      return compExt;
+  }
+  
 }

Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java?rev=382814&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java Fri Mar  3 05:56:20 2006
@@ -0,0 +1,38 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+package org.apache.woden.wsdl20.extensions.soap;
+
+import java.net.URI;
+
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
+
+/**
+ * This interface represents the properties from the SOAP namespace
+ * added to the WSDL 2.0 <code>Binding</code> component as part 
+ * of the SOAP binding extension. 
+ * 
+ * @author jkaputin@apache.org
+ */
+public interface SOAPBindingExtensions extends ComponentExtensions 
+{
+    public String getSoapVersion();
+    
+    public URI getSoapUnderlyingProtocol();
+    
+    public URI getSoapMepDefault();
+    
+    public SOAPModule[] getSoapModules();
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org


Re: svn commit: r382814 - in /incubator/woden/java/src/org/apache/woden: internal/ internal/util/ internal/wsdl20/ internal/wsdl20/extensions/ internal/wsdl20/extensions/soap/ wsdl20/ wsdl20/extensions/ wsdl20/extensions/soap/

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Nice work, John.

I'm hoping to get some time to check this out on the plane on the way 
home from France on Sunday.

--Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org