cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r667156 - in /cxf/trunk: api/ api/src/main/java/org/apache/cxf/ws/addressing/wsdl/ api/src/main/java/org/apache/cxf/wsdl/ common/schemas/src/main/resources/schemas/wsdl/ common/xsd/src/main/java/org/apache/cxf/maven_plugin/ distribution/bun...
Date Thu, 12 Jun 2008 16:50:09 GMT
Author: dkulp
Date: Thu Jun 12 09:50:09 2008
New Revision: 667156

URL: http://svn.apache.org/viewvc?rev=667156&view=rev
Log:
Use the ws-addressing UsingAddressing type already in the api package for the wsdl extensor.
  Removes the org.w3 stuff from the jar/bundle 

Added:
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java   (with
props)
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/jaxb.index
Removed:
    cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xjb
    cxf/trunk/rt/ws/addr/src/main/resources/schemas/ws-addr-wsdl.xsd
Modified:
    cxf/trunk/api/pom.xml
    cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
    cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/Messages.properties
    cxf/trunk/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb
    cxf/trunk/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java
    cxf/trunk/distribution/bundle/pom.xml
    cxf/trunk/parent/pom.xml
    cxf/trunk/rt/ws/addr/pom.xml
    cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/extensions.xml

Modified: cxf/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/api/pom.xml?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/api/pom.xml (original)
+++ cxf/trunk/api/pom.xml Thu Jun 12 09:50:09 2008
@@ -153,6 +153,7 @@
                                 <xsdOption>
                                     <xsd>${basedir}/target/schemas/schemas/wsdl/ws-addr-wsdl.xsd</xsd>
                                     <bindingFile>${basedir}/target/schemas/schemas/wsdl/ws-addr-wsdl.xjb</bindingFile>
+                                    <extension>true</extension>
                                 </xsdOption>
                             </xsdOptions>
                         </configuration>

Added: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java?rev=667156&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java Thu
Jun 12 09:50:09 2008
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.ws.addressing.wsdl;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.wsdl.TExtensibilityElementImpl;
+
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "UsingAddressing")
+public class UsingAddressing extends TExtensibilityElementImpl {
+
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this
class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/UsingAddressing.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/jaxb.index
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/jaxb.index?rev=667156&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/jaxb.index (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/wsdl/jaxb.index Thu Jun 12 09:50:09
2008
@@ -0,0 +1 @@
+UsingAddressing
\ No newline at end of file

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java Thu Jun 12 09:50:09
2008
@@ -23,6 +23,8 @@
 import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import javax.wsdl.Definition;
 import javax.wsdl.WSDLException;
@@ -36,12 +38,16 @@
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchema;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamWriter;
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
+import org.apache.cxf.common.util.StringUtils;
 
 
 /**
@@ -50,6 +56,8 @@
  *
  */
 public class JAXBExtensionHelper implements ExtensionSerializer, ExtensionDeserializer {
+    private static final Logger LOG = LogUtils.getL7dLogger(JAXBExtensionHelper.class);
+
     JAXBContext context;
     final Class<? extends TExtensibilityElementImpl> typeClass;
       
@@ -71,7 +79,7 @@
                                      Class<? extends TExtensibilityElementImpl> cls)
throws JAXBException {
         
         JAXBExtensionHelper helper = new JAXBExtensionHelper(cls);
-        
+        boolean found = false;
         try {
             Class<?> objectFactory = Class.forName(PackageUtils.getPackageName(cls)
+ ".ObjectFactory",
                                                    true, cls.getClassLoader());
@@ -85,15 +93,44 @@
                         QName elementType = new QName(elementDecl.namespace(), elementDecl.name());
                         registry.registerDeserializer(parentType, elementType, helper); 
                         registry.registerSerializer(parentType, elementType, helper);   
                     
-                        registry.mapExtensionTypes(parentType, elementType, cls);       
                
+                        registry.mapExtensionTypes(parentType, elementType, cls);
+                        found = true;
                     }                    
                 }
             }        
             
         } catch (ClassNotFoundException ex) {
-            // TODO
-            ex.printStackTrace();            
+            //ignore
         }        
+        if (!found) {
+            //not in object factory or no object factory, try other annotations
+            XmlRootElement elAnnot = cls.getAnnotation(XmlRootElement.class);
+            if (elAnnot != null) {
+                String name = elAnnot.name();
+                String ns = elAnnot.namespace();
+                if (StringUtils.isEmpty(ns)
+                    || "##default".equals(ns)) {
+                    XmlSchema schema = cls.getPackage().getAnnotation(XmlSchema.class);
+                    if (schema != null) {
+                        ns = schema.namespace();
+                    }
+                }
+                if (!StringUtils.isEmpty(ns) && !StringUtils.isEmpty(name)) {
+                    QName elementType = new QName(ns, name);
+                    registry.registerDeserializer(parentType, elementType, helper); 
+                    registry.registerSerializer(parentType, elementType, helper);       
                 
+                    registry.mapExtensionTypes(parentType, elementType, cls);
+                    
+                    helper.getJAXBContext();
+                    found = true;
+                }
+            }
+        }
+        
+        if (!found) {
+            LOG.log(Level.WARNING, "EXTENSION_NOT_REGISTERED", 
+                    new Object[] {cls.getName(), parentType.getName()});
+        }
     }
 
     protected JAXBContext getJAXBContext() {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/Messages.properties?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/Messages.properties (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/Messages.properties Thu Jun 12 09:50:09
2008
@@ -22,3 +22,4 @@
 
 COULD_NOT_CREATE_TRANSFORMER = Could not create transformer
 COULD_NOT_POPULATE_EPR = Populating metadata in EPR failed
+EXTENSION_NOT_REGISTERED = Could not register wsdl extension class {0} with parent {1} as
element name could not be determined
\ No newline at end of file

Modified: cxf/trunk/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb
URL: http://svn.apache.org/viewvc/cxf/trunk/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb (original)
+++ cxf/trunk/common/schemas/src/main/resources/schemas/wsdl/ws-addr-wsdl.xjb Thu Jun 12 09:50:09
2008
@@ -27,4 +27,7 @@
             <jaxb:package name="org.apache.cxf.ws.addressing.wsdl"/>
         </jaxb:schemaBindings>
     </jaxb:bindings>
+    <jaxb:bindings schemaLocation="ws-addr-wsdl.xsd" node="/xs:schema/xs:element[@name='UsingAddressing']">
+      <jaxb:class ref="org.apache.cxf.ws.addressing.wsdl.UsingAddressingImpl"/>
+    </jaxb:bindings>
 </jaxb:bindings>

Modified: cxf/trunk/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java (original)
+++ cxf/trunk/common/xsd/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaMojo.java Thu
Jun 12 09:50:09 2008
@@ -58,7 +58,6 @@
      * @parameter
      */
     XsdOption xsdOptions[];
-
     
     public void execute() throws MojoExecutionException {
         String outputDir = testSourceRoot == null ? sourceRoot : testSourceRoot;
@@ -159,7 +158,11 @@
                 list.add(it.next().toString());
             }
         }          
-        list.add("-quiet");
+        if (getLog().isDebugEnabled()) {
+            list.add("-verbose");            
+        } else { 
+            list.add("-quiet");
+        }
         list.add("-d");
         list.add(outputDir);
         list.add(option.getXsd());

Modified: cxf/trunk/distribution/bundle/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/bundle/pom.xml?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/distribution/bundle/pom.xml (original)
+++ cxf/trunk/distribution/bundle/pom.xml Thu Jun 12 09:50:09 2008
@@ -308,8 +308,6 @@
                             org.apache.cxf.*;version=${pom.version};-split-package:=merge-first,
                             org.xmlsoap.schemas*;version=${pom.version};-split-package:=merge-first,
                             org.codehaus.xfire.aegis.type.java5.*,
-                            org.xmlsoap.schemas.wsdl.http.*,
-                            org.w3._2006._05.addressing.wsdl.*,
                             '=META-INF.cxf'
                         </Export-Package>
                         <_failok>true</_failok>

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Thu Jun 12 09:50:09 2008
@@ -380,6 +380,12 @@
                 <version>2.0.4</version>
             </dependency>
             <dependency>
+                <groupId>org.apache.maven</groupId>
+                <artifactId>maven-core</artifactId>
+                <scope>provided</scope>
+                <version>2.0.4</version>
+            </dependency>
+            <dependency>
                 <groupId>httpunit</groupId>
                 <artifactId>httpunit</artifactId>
                 <version>1.6.2</version>

Modified: cxf/trunk/rt/ws/addr/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/pom.xml?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/pom.xml (original)
+++ cxf/trunk/rt/ws/addr/pom.xml Thu Jun 12 09:50:09 2008
@@ -86,7 +86,7 @@
 
     </dependencies>
 
-    <build>
+    <!--build>
 	<plugins>
 	    <plugin>
 		<groupId>org.apache.cxf</groupId>
@@ -116,7 +116,7 @@
 		</executions>
 	    </plugin>
 	</plugins>
-    </build>
+    </build-->
 
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/cxf/trunk/rt/ws/addr</connection>

Modified: cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/extensions.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/extensions.xml?rev=667156&r1=667155&r2=667156&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/extensions.xml (original)
+++ cxf/trunk/rt/ws/addr/src/main/resources/META-INF/cxf/extensions.xml Thu Jun 12 09:50:09
2008
@@ -20,5 +20,5 @@
 <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
 <properties>
     <!-- WS-A -->
-    <entry key="org.apache.cxf.ws.addressing-1">javax.wsdl.Binding=org.w3._2006._05.addressing.wsdl.UsingAddressing</entry>
+    <entry key="org.apache.cxf.ws.addressing-1">javax.wsdl.Binding=org.apache.cxf.ws.addressing.wsdl.UsingAddressing</entry>
 </properties>



Mime
View raw message