cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1502893 - in /cxf/trunk: api/ api/src/main/java/org/apache/cxf/common/jaxb/ parent/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/ rt/frontend/jaxrs/src/main/java/org/apache/cx...
Date Sat, 13 Jul 2013 21:30:03 GMT
Author: dkulp
Date: Sat Jul 13 21:30:02 2013
New Revision: 1502893

URL: http://svn.apache.org/r1502893
Log:
Initial support for using eclipselink Moxy instead of the JAXB ri.  Many tests will still
fail with it, but most of the simpler things are now working.

Modified:
    cxf/trunk/api/pom.xml
    cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
    cxf/trunk/parent/pom.xml
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java

Modified: cxf/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/api/pom.xml?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/api/pom.xml (original)
+++ cxf/trunk/api/pom.xml Sat Jul 13 21:30:02 2013
@@ -87,6 +87,13 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.moxy</artifactId>
+            <version>2.5.0</version>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <version>1.2.17</version>

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java Sat Jul 13 21:30:02
2013
@@ -37,6 +37,8 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -68,7 +70,6 @@ import org.w3c.dom.Node;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.ASMHelper;
 import org.apache.cxf.common.util.ASMHelper.ClassWriter;
 import org.apache.cxf.common.util.ASMHelper.FieldVisitor;
@@ -114,7 +115,6 @@ public final class JAXBUtils {
     
     private static final Map<String, String> BUILTIN_DATATYPES_MAP;
     private static final Map<String, Class<?>> HOLDER_TYPES_MAP;
-    private static final Logger LOG = LogUtils.getL7dLogger(JAXBUtils.class);
     private static ClassLoader jaxbXjcLoader;
 
     static {
@@ -577,28 +577,20 @@ public final class JAXBUtils {
             throw new JAXBException(e);
         }
     }
-    public static void setNamespaceWrapper(final Map<String, String> nspref,
+    public static Object setNamespaceWrapper(final Map<String, String> nspref,
                                            Marshaller marshaller) throws PropertyException
{
-        Object mapper = null;
+        Object mapper = createNamespaceWrapper(marshaller.getClass(), nspref);
         if (marshaller.getClass().getName().contains(".internal.")) {
-            mapper = createNamespaceWrapper(nspref);
-            if (mapper == null) {
-                LOG.log(Level.INFO, "Could not create namespace mapper for JDK internal"
-                        + " JAXB implementation.");
-            } else {
-                marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper",
+            marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper",
                                    mapper);
-            }
-        } else {
-            try {
-                Class<?> cls = Class.forName("org.apache.cxf.common.jaxb.NamespaceMapper");
-                mapper = cls.getConstructor(Map.class).newInstance(nspref);
-            } catch (Exception ex) {
-                LOG.log(Level.INFO, "Could not create NamespaceMapper", ex);
-            }
+        } else if (marshaller.getClass().getName().contains("com.sun")) {
             marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",
                                    mapper);
+        } else if (marshaller.getClass().getName().contains("eclipse")) {
+            marshaller.setProperty("eclipselink.namespace-prefix-mapper",
+                                   mapper);
         }
+        return mapper;
     }
     public static BridgeWrapper createBridge(Set<Class<?>> ctxClasses,
                                       QName qname,
@@ -1027,16 +1019,26 @@ public final class JAXBUtils {
         return false;
     }
     
-    private static synchronized Object createNamespaceWrapper(Map<String, String> map)
{
+    private static synchronized Object createNamespaceWrapper(Class<?> mcls, Map<String,
String> map) {
         ASMHelper helper = new ASMHelper();
-        String className = "org.apache.cxf.jaxb.NamespaceMapperInternal";
+        String className = "org.apache.cxf.jaxb.NamespaceMapper";
+        String postFix = ""; 
+        if (mcls.getName().contains("eclipse")) {
+            //can use the map directly
+            return map;
+        } else if (mcls.getName().contains(".internal")) {
+            postFix = "Internal";
+        } else if (mcls.getName().contains("com.sun")) {
+            postFix = "RI";
+        }
+        className += postFix;
         Class<?> cls = helper.findClass(className, JAXBUtils.class);
         if (cls == null) {
             ClassWriter cw = helper.createClassWriter();
             if (cw == null) {
                 return null;
             }
-            cls = createNamespaceWrapperInternal(helper, cw);
+            cls = createNamespaceWrapperInternal(helper, cw, postFix, mcls);
         }
         try {
             return cls.getConstructor(Map.class).newInstance(map);
@@ -1044,14 +1046,18 @@ public final class JAXBUtils {
             return null;
         }
     }
-    private static Class<?> createNamespaceWrapperInternal(ASMHelper helper, ClassWriter
cw) {
-        String className = "org.apache.cxf.jaxb.NamespaceMapperInternal";
+    private static Class<?> createNamespaceWrapperInternal(ASMHelper helper, ClassWriter
cw, 
+                                                           String postFix, Class<?>
ref) {
+        String className = "org.apache.cxf.jaxb.NamespaceMapper" + postFix;
+        String superName = "com/sun/xml/" 
+            + ("RI".equals(postFix) ? "" : "internal/") 
+            + "bind/marshaller/NamespacePrefixMapper";
         FieldVisitor fv;
         MethodVisitor mv;
         cw.visit(Opcodes.V1_5, 
                  Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER,
-                 "org/apache/cxf/jaxb/NamespaceMapperInternal", null,
-                 "com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper", null);
+                 "org/apache/cxf/jaxb/NamespaceMapper" + postFix, null,
+                 superName, null);
 
         cw.visitSource("NamespaceMapper.java", null);
 
@@ -1069,13 +1075,13 @@ public final class JAXBUtils {
         mv.visitLineNumber(30, l0);
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
-                           "com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper",
"<init>", "()V");
+                           superName, "<init>", "()V");
         Label l1 = helper.createLabel();
         mv.visitLabel(l1);
         mv.visitLineNumber(31, l1);
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitVarInsn(Opcodes.ALOAD, 1);
-        mv.visitFieldInsn(Opcodes.PUTFIELD, "org/apache/cxf/jaxb/NamespaceMapperInternal",
+        mv.visitFieldInsn(Opcodes.PUTFIELD, "org/apache/cxf/jaxb/NamespaceMapper" + postFix,
                           "nspref", "Ljava/util/Map;");
         Label l2 = helper.createLabel();
         mv.visitLabel(l2);
@@ -1083,7 +1089,7 @@ public final class JAXBUtils {
         mv.visitInsn(Opcodes.RETURN);
         Label l3 = helper.createLabel();
         mv.visitLabel(l3);
-        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapperInternal;", null,
l0, l3, 0);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapper" + postFix +
";", null, l0, l3, 0);
         mv.visitLocalVariable("nspref", "Ljava/util/Map;",
                               "Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;",

                               l0, l3, 1);
@@ -1099,7 +1105,7 @@ public final class JAXBUtils {
         mv.visitLineNumber(38, l0);
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitFieldInsn(Opcodes.GETFIELD, 
-                          "org/apache/cxf/jaxb/NamespaceMapperInternal", 
+                          "org/apache/cxf/jaxb/NamespaceMapper" + postFix, 
                           "nspref", "Ljava/util/Map;");
         mv.visitVarInsn(Opcodes.ALOAD, 1);
         mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/Map", 
@@ -1123,7 +1129,7 @@ public final class JAXBUtils {
         mv.visitInsn(Opcodes.ARETURN);
         Label l4 = helper.createLabel();
         mv.visitLabel(l4);
-        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapperInternal;", null,
l0, l4, 0);
+        mv.visitLocalVariable("this", "Lorg/apache/cxf/jaxb/NamespaceMapper" + postFix +
";", null, l0, l4, 0);
         mv.visitLocalVariable("namespaceUri", "Ljava/lang/String;", null, l0, l4, 1);
         mv.visitLocalVariable("suggestion", "Ljava/lang/String;", null, l0, l4, 2);
         mv.visitLocalVariable("requirePrefix", "Z", null, l0, l4, 3);
@@ -1133,29 +1139,61 @@ public final class JAXBUtils {
         cw.visitEnd();
 
         byte bts[] = cw.toByteArray();
-        
-        
-        Class<?> cls;
-        try {
-            cls = Class.forName("com.sun.xml.bind.api.JAXBRIContext");
-        } catch (ClassNotFoundException e) {
-            // TODO Auto-generated catch block
-            try {
-                cls = Class.forName("com.sun.xml.internal.bind.api.JAXBRIContext", true,
getXJCClassLoader());
-            } catch (ClassNotFoundException e1) {
-                cls = JAXBUtils.class;
-            }
-        }
-        
         return helper.loadClass(className,
-                                cls, bts);
+                                ref, bts);
     }
     
+    public static JAXBContextProxy createJAXBContextProxy(final JAXBContext ctx) {
+        if (ctx.getClass().getName().contains("eclipse")) {
+            final org.eclipse.persistence.jaxb.JAXBContext c = (org.eclipse.persistence.jaxb.JAXBContext)ctx;
+            return new JAXBContextProxy() {
+                public Object getBeanInfo(Class<?> cls) {
+                    final org.eclipse.persistence.oxm.XMLDescriptor xd 
+                        = (org.eclipse.persistence.oxm.XMLDescriptor)c.getXMLContext().getSession().getDescriptor(cls);
+                    final QName schemaType = xd.getSchemaReference().getSchemaContextAsQName();
+                    if (xd.getDefaultRootElementField() != null) {
+                        return new JAXBBeanInfo() {
+                            public boolean isElement() {
+                                return true;
+                            }
+                            public Collection<QName> getTypeNames() {
+                                return Collections.singletonList(schemaType);
+                            }
+                            public String getElementNamespaceURI(Object object) {
+                                return xd.getDefaultRootElementField().getXPathFragment().getNamespaceURI();
+                            }
+                            public String getElementLocalName(Object object) {
+                                return xd.getDefaultRootElementField().getXPathFragment().getLocalName();
+                            }
+                        };
+                    }
+                    return new JAXBBeanInfo() {
+                        public boolean isElement() {
+                            return false;
+                        }
+                        public Collection<QName> getTypeNames() {
+                            return Collections.singletonList(schemaType);
+                        }
+                        public String getElementNamespaceURI(Object object) {
+                            return null;
+                        }
+                        public String getElementLocalName(Object object) {
+                            return null;
+                        }
+                    };
+                }
+            };
+        }
+        return ReflectionInvokationHandler.createProxyWrapper(ctx, JAXBContextProxy.class);
+    }
     public static JAXBBeanInfo getBeanInfo(JAXBContextProxy context, Class<?> cls)
{
         Object o = context.getBeanInfo(cls);
         if (o == null) {
             return null;
         }
+        if (o instanceof JAXBBeanInfo) {
+            return (JAXBBeanInfo)o;
+        }
         return ReflectionInvokationHandler.createProxyWrapper(o, JAXBBeanInfo.class);
     }
 

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Sat Jul 13 21:30:02 2013
@@ -403,6 +403,7 @@
                             <spring.validation.mode>${cxf.spring.validation.mode}</spring.validation.mode>
                             <server.launcher.vmargs>${cxf.server.launcher.vmargs}</server.launcher.vmargs>
                             <org.apache.cxf.transport.http.async.usePolicy>ALWAYS</org.apache.cxf.transport.http.async.usePolicy>
+                            <!--javax.xml.bind.JAXBContext>org.eclipse.persistence.jaxb.JAXBContextFactory</javax.xml.bind.JAXBContext-->
                         </systemPropertyVariables>
                     </configuration>
                 </plugin>

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Sat
Jul 13 21:30:02 2013
@@ -71,7 +71,6 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.PropertyUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.common.util.ReflectionUtil;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.databinding.AbstractDataBinding;
@@ -428,16 +427,15 @@ public class JAXBDataBinding extends Abs
     }
     private void checkForJAXBAnnotations(MessagePartInfo mpi) {
         Annotation[] anns = (Annotation[])mpi.getProperty("parameter.annotations");
-        JAXBContextProxy ctx = ReflectionInvokationHandler.createProxyWrapper(context, JAXBContextProxy.class);
+        JAXBContextProxy ctx = JAXBUtils.createJAXBContextProxy(context);
         XmlJavaTypeAdapter jta = JAXBSchemaInitializer.findFromTypeAdapter(ctx, mpi.getTypeClass(),
anns);
-        JAXBBeanInfo jtaBeanInfo = null;
         if (jta != null) {
-            jtaBeanInfo = JAXBSchemaInitializer.findFromTypeAdapter(ctx, jta.value());
-        }
-        JAXBBeanInfo beanInfo = JAXBSchemaInitializer.getBeanInfo(ctx, mpi.getTypeClass());
-        if (jtaBeanInfo != beanInfo && jta != null) {
-            mpi.setProperty("parameter.annotations", anns);
-            mpi.setProperty("honor.jaxb.annotations", Boolean.TRUE);
+            JAXBBeanInfo jtaBeanInfo = JAXBSchemaInitializer.findFromTypeAdapter(ctx, jta.value());
+            JAXBBeanInfo beanInfo = JAXBSchemaInitializer.getBeanInfo(ctx, mpi.getTypeClass());
+            if (jtaBeanInfo != beanInfo) {
+                mpi.setProperty("parameter.annotations", anns);
+                mpi.setProperty("honor.jaxb.annotations", Boolean.TRUE);
+            }
         }
     }
 

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Sat Jul 13 21:30:02 2013
@@ -526,6 +526,9 @@ public final class JAXBEncoderDecoder {
                         }
                     }                
                 }
+                if (reader.getEventType() == XMLStreamReader.END_ELEMENT && q.equals(reader.getName()))
{
+                    reader.next();
+                }
             }
             return (Exception)obj;
         } catch (Exception e) {

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Sat Jul 13 21:30:02 2013
@@ -50,7 +50,6 @@ import org.apache.cxf.common.jaxb.JAXBBe
 import org.apache.cxf.common.jaxb.JAXBContextProxy;
 import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.interceptor.Fault;
@@ -87,7 +86,7 @@ class JAXBSchemaInitializer extends Serv
                                  boolean q) {
         super(serviceInfo);
         schemas = col;
-        this.context = ReflectionInvokationHandler.createProxyWrapper(context, JAXBContextProxy.class);
+        this.context = JAXBUtils.createJAXBContextProxy(context);
         this.qualifiedSchemas = q;
     }
 

Modified: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBDataBindingTest.java
Sat Jul 13 21:30:02 2013
@@ -48,8 +48,8 @@ import org.w3c.dom.Node;
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.common.jaxb.JAXBContextProxy;
+import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.helpers.CastUtils;
@@ -65,6 +65,7 @@ import org.apache.hello_world_soap_http.
 import org.apache.hello_world_soap_http.types.GreetMeOneWay;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
+
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -184,13 +185,16 @@ public class JAXBDataBindingTest extends
         Set<Class<?>> classes = new HashSet<Class<?>>();
         classes.add(ObjectFactory.class);
         JAXBContext ctx = db.createJAXBContext(classes);
-        JAXBContextProxy ctxp = ReflectionInvokationHandler.createProxyWrapper(ctx, JAXBContextProxy.class);
+        JAXBContextProxy ctxp = JAXBUtils.createJAXBContextProxy(ctx);
         assertNotNull(JAXBSchemaInitializer.getBeanInfo(ctxp, TestJAXBClass.class));
     }
     
     @Test 
     public void testContextProperties() throws Exception {
         JAXBDataBinding db = new JAXBDataBinding();
+        Map<String, String> nsMap = new HashMap<String, String>();
+        nsMap.put("uri:ultima:thule", "");
+        db.setNamespaceMap(nsMap);
         Map<String, Object> contextProperties = new HashMap<String, Object>();
         contextProperties.put("com.sun.xml.bind.defaultNamespaceRemap", "uri:ultima:thule");
         db.setContextProperties(contextProperties);
@@ -206,7 +210,7 @@ public class JAXBDataBindingTest extends
         writer.write(bean, xmlWriter);
         xmlWriter.flush();
         String xml = stringWriter.toString();
-        assertTrue(xml.contains("uri:ultima:thule"));
+        assertTrue(xml, xml.contains("uri:ultima:thule"));
     }
     
     @Test
@@ -216,7 +220,7 @@ public class JAXBDataBindingTest extends
         nsMap.put("uri:ultima:thule", "greenland");
         db.setNamespaceMap(nsMap);
         Map<String, Object> contextProperties = new HashMap<String, Object>();
-        contextProperties.put("com.sun.xml.bind.defaultNamespaceRemap", "uri:ultima:thule");
+        //contextProperties.put("com.sun.xml.bind.defaultNamespaceRemap", "uri:ultima:thule");
         db.setContextProperties(contextProperties);
         Set<Class<?>> classes = new HashSet<Class<?>>();
         classes.add(QualifiedBean.class);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Sat Jul 13 21:30:02 2013
@@ -77,7 +77,6 @@ import org.apache.cxf.common.jaxb.JAXBCo
 import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
-import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.util.XmlSchemaPrimitiveUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
@@ -1383,8 +1382,7 @@ public class WadlGenerator implements Co
         }
         if (useJaxbContextForQnames) {
             if (context != null) {
-                JAXBContextProxy proxy = ReflectionInvokationHandler
-                    .createProxyWrapper(context, JAXBContextProxy.class);
+                JAXBContextProxy proxy = JAXBUtils.createJAXBContextProxy(context);
                 return new JaxbContextQNameResolver(proxy);
             } else {
                 return null;

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java?rev=1502893&r1=1502892&r2=1502893&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
Sat Jul 13 21:30:02 2013
@@ -69,7 +69,6 @@ import org.xml.sax.helpers.DefaultHandle
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.jaxb.JAXBUtils;
-import org.apache.cxf.common.jaxb.NamespaceMapper;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -141,11 +140,9 @@ public abstract class AbstractJAXBProvid
     
     protected void setNamespaceMapper(Marshaller ms, 
                                       Map<String, String> map) throws Exception {
-        NamespaceMapper nsMapper = new NamespaceMapper(map);
+        Object nsMapper = JAXBUtils.setNamespaceWrapper(map, ms);
         if (namespaceMapperPropertyName != null) {
             setMarshallerProp(ms, nsMapper, namespaceMapperPropertyName, null);
-        } else {
-            setMarshallerProp(ms, nsMapper, NS_MAPPER_PROPERTY_RI, NS_MAPPER_PROPERTY_RI_INT);
         }
     }
     



Mime
View raw message