cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1221825 - /cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java
Date Wed, 21 Dec 2011 18:01:08 GMT
Author: ay
Date: Wed Dec 21 18:01:07 2011
New Revision: 1221825

URL: http://svn.apache.org/viewvc?rev=1221825&view=rev
Log:
[CXF-3993] ws-rm's blueprint configuration fails to parse RMAssertion entries

Modified:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java?rev=1221825&r1=1221824&r2=1221825&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java
Wed Dec 21 18:01:07 2011
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.ws.rm.blueprint;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.logging.Logger;
 
 import javax.xml.bind.JAXBContext;
@@ -39,7 +41,6 @@ import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.rm.RMManager;
 import org.apache.cxf.ws.rm.manager.DeliveryAssuranceType;
 import org.apache.cxf.ws.rm.manager.DestinationPolicyType;
-import org.apache.cxf.ws.rm.manager.ObjectFactory;
 import org.apache.cxf.ws.rm.manager.SourcePolicyType;
 import org.osgi.service.blueprint.reflect.Metadata;
 
@@ -53,7 +54,7 @@ public class RMBPBeanDefinitionParser ex
 
     private static final Logger LOG = LogUtils.getL7dLogger(RMBPBeanDefinitionParser.class);
 
-    private JAXBContext jaxbContext;
+    private Map<Class<?>, JAXBContext> jaxbContexts = new HashMap<Class<?>,
JAXBContext>();
 
     private Class<?> beanClass;
     
@@ -84,7 +85,7 @@ public class RMBPBeanDefinitionParser ex
         mapElementToJaxbProperty(context, bean, element,
                 new QName("http://docs.oasis-open.org/ws-rx/wsrmp/200702", "RMAssertion"),

                 "RMAssertion",
-                org.apache.cxf.ws.rmp.v200702.RMAssertion.class);
+                org.apache.cxf.ws.rmp.v200502.RMAssertion.class);
 
         parseAttributes(element, context, bean);
         parseChildElements(element, context, bean);
@@ -119,7 +120,7 @@ public class RMBPBeanDefinitionParser ex
         Element data = DOMUtils.getFirstElement(parent);
         
         try {
-            Unmarshaller unmarshaller = getJAXBContext().createUnmarshaller();
+            Unmarshaller unmarshaller = getJAXBContext(c).createUnmarshaller();
             MutablePassThroughMetadata value = ctx.createMetadata(MutablePassThroughMetadata.class);
             value.setObject(unmarshaller.unmarshal(data, c).getValue());
             bean.addProperty(propertyName, value);
@@ -128,10 +129,12 @@ public class RMBPBeanDefinitionParser ex
         }
     }
 
-    private synchronized JAXBContext getJAXBContext() throws JAXBException {
+    private synchronized JAXBContext getJAXBContext(Class<?> c) throws JAXBException
{
+        JAXBContext jaxbContext = jaxbContexts.get(c);
         if (jaxbContext == null) {
-            jaxbContext = JAXBContext.newInstance(PackageUtils.getPackageName(ObjectFactory.class),

-                                                  ObjectFactory.class.getClassLoader());
+            jaxbContext = JAXBContext.newInstance(PackageUtils.getPackageName(c), 
+                                                  c.getClassLoader());
+            jaxbContexts.put(c, jaxbContext);
         }
         return jaxbContext;
     }



Mime
View raw message