cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r558716 - in /incubator/cxf/trunk/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/type/ main/java/org/apache/cxf/aegis/type/java5/ test/java/org/apache/cxf/aegis/type/java5/map/
Date Mon, 23 Jul 2007 13:29:00 GMT
Author: dandiep
Date: Mon Jul 23 06:28:59 2007
New Revision: 558716

URL: http://svn.apache.org/viewvc?view=rev&rev=558716
Log:
Fix problem with Maps on the service interface not being turned
into schemas correctly. Basically the XMLTypeCreator was taking over
when it should've delegated to the next type creator.


Added:
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/Student.java
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java
  (with props)
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java
  (with props)
    incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java
  (with props)
Modified:
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?view=diff&rev=558716&r1=558715&r2=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
Mon Jul 23 06:28:59 2007
@@ -237,10 +237,10 @@
     }
 
     protected Type getOrCreateMapKeyType(TypeClassInfo info) {
-        return createObjectType();
+        return nextCreator.getOrCreateMapKeyType(info);
     }
 
-    private Type createObjectType() {
+    protected Type createObjectType() {
         ObjectType type = new ObjectType();
         type.setSchemaType(DefaultTypeMappingRegistry.XSD_ANY);
         type.setTypeClass(Object.class);
@@ -249,7 +249,7 @@
     }
 
     protected Type getOrCreateMapValueType(TypeClassInfo info) {
-        return createObjectType();
+        return nextCreator.getOrCreateMapKeyType(info);
     }
 
     protected Type createMapType(TypeClassInfo info, Type keyType, Type valueType) {

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java?view=diff&rev=558716&r1=558715&r2=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeCreator.java
Mon Jul 23 06:28:59 2007
@@ -22,6 +22,7 @@
 import java.lang.reflect.Method;
 
 import org.apache.cxf.aegis.DatabindingException;
+import org.apache.cxf.aegis.type.AbstractTypeCreator.TypeClassInfo;
 import org.apache.cxf.aegis.type.basic.BeanType;
 import org.apache.cxf.aegis.type.basic.BeanTypeInfo;
 
@@ -74,5 +75,12 @@
         typeInfo.setExtensibleElements(getConfiguration().isDefaultExtensibleElements());
 
         return type;
+    }
+    protected Type getOrCreateMapKeyType(TypeClassInfo info) {
+        return createObjectType();
+    }
+
+    protected Type getOrCreateMapValueType(TypeClassInfo info) {
+        return createObjectType();
     }
 }

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java?view=diff&rev=558716&r1=558715&r2=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/DefaultTypeMappingRegistry.java
Mon Jul 23 06:28:59 2007
@@ -59,6 +59,7 @@
 import org.apache.cxf.aegis.type.basic.TimeType;
 import org.apache.cxf.aegis.type.basic.TimestampType;
 import org.apache.cxf.aegis.type.basic.URIType;
+import org.apache.cxf.aegis.type.java5.Java5TypeCreator;
 import org.apache.cxf.aegis.type.mtom.DataHandlerType;
 import org.apache.cxf.aegis.type.mtom.DataSourceType;
 import org.apache.cxf.aegis.type.xml.DocumentType;
@@ -227,28 +228,12 @@
 
     protected TypeCreator createTypeCreator() {
         AbstractTypeCreator xmlCreator = createRootTypeCreator();
-        xmlCreator.setNextCreator(createDefaultTypeCreator());
-
-        if (isJDK5andAbove()) {
-            try {
-                String j5TC = "org.apache.cxf.aegis.type.java5.Java5TypeCreator";
-
-                Class clazz = ClassLoaderUtils.loadClass(j5TC, getClass());
-
-                AbstractTypeCreator j5Creator = (AbstractTypeCreator)clazz.newInstance();
-                j5Creator.setNextCreator(createDefaultTypeCreator());
-                j5Creator.setConfiguration(getConfiguration());
-                xmlCreator.setNextCreator(j5Creator);
-            } catch (Throwable t) {
-                LOG.info("Couldn't find Java 5 module on classpath. Annotation"
-                         + " mappings will not be supported.");
-
-                if (!(t instanceof ClassNotFoundException)) {
-                    LOG.debug("Error loading Java 5 module", t);
-                }
-            }
-        }
-
+    
+        Java5TypeCreator j5Creator = new Java5TypeCreator();
+        j5Creator.setNextCreator(createDefaultTypeCreator());
+        j5Creator.setConfiguration(getConfiguration());
+        xmlCreator.setNextCreator(j5Creator);
+        
         return xmlCreator;
     }
 

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java?view=diff&rev=558716&r1=558715&r2=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
(original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
Mon Jul 23 06:28:59 2007
@@ -151,6 +151,10 @@
     protected Type getOrCreateParameterizedType(Object generic, int index) {
         Class clazz = getComponentType(generic, index);
 
+        if (clazz == null) {
+            return createObjectType();
+        }
+        
         if (!Collection.class.isAssignableFrom(clazz)) {
             return getTopCreator().createType(clazz);
         }

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/Student.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/Student.java?view=auto&rev=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/Student.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/Student.java
Mon Jul 23 06:28:59 2007
@@ -0,0 +1,23 @@
+/**
+ * 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.aegis.type.java5.map;
+
+public class Student {
+
+}

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java?view=auto&rev=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java
Mon Jul 23 06:28:59 2007
@@ -0,0 +1,40 @@
+/**
+ * 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.aegis.type.java5.map;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(targetNamespace = "http://client.webservice.crm.ecot.com/skeleton/StudentService",

+    name = "StudentService")
+@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
+public interface StudentService {
+
+    Student findStudent(Long id);
+
+    Map<Long, Student> getStudentsMap();
+
+    List<Student> getStudents(Map<String, String> filters);
+
+    List<Student> getStudentsByIds(List<String> ids);
+
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java?view=auto&rev=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java
Mon Jul 23 06:28:59 2007
@@ -0,0 +1,46 @@
+/**
+ * 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.aegis.type.java5.map;
+
+import java.util.List;
+import java.util.Map;
+
+public class StudentServiceImpl implements StudentService {
+
+    public Student findStudent(Long id) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public List<Student> getStudents(Map<String, String> filters) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public List<Student> getStudentsByIds(List<String> ids) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Map<Long, Student> getStudentsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java?view=auto&rev=558716
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java
(added)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java
Mon Jul 23 06:28:59 2007
@@ -0,0 +1,43 @@
+/**
+ * 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.aegis.type.java5.map;
+
+import org.w3c.dom.Document;
+
+import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.junit.Test;
+
+public class StudentTest extends AbstractAegisTest {
+    @Test
+    public void testWSDL() throws Exception {
+        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+        sf.setServiceClass(StudentService.class);
+        sf.setServiceBean(new StudentServiceImpl());
+        sf.setAddress("local://StudentService");
+        setupAegis(sf);
+        Server server = sf.create();
+        
+        Document wsdl = getWSDLDocument(server);
+        
+        DOMUtils.writeXml(wsdl, System.out);
+    }
+}

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/map/StudentTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message