From commits-return-17350-apmail-cxf-commits-archive=cxf.apache.org@cxf.apache.org Thu Dec 22 11:32:10 2011 Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D7D6891C1 for ; Thu, 22 Dec 2011 11:32:09 +0000 (UTC) Received: (qmail 44432 invoked by uid 500); 22 Dec 2011 11:32:09 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 44380 invoked by uid 500); 22 Dec 2011 11:32:09 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 44373 invoked by uid 99); 22 Dec 2011 11:32:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2011 11:32:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2011 11:32:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6077C238890B for ; Thu, 22 Dec 2011 11:31:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1222186 - in /cxf/branches/2.4.x-fixes: ./ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java Date: Thu, 22 Dec 2011 11:31:45 -0000 To: commits@cxf.apache.org From: ay@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111222113145.6077C238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ay Date: Thu Dec 22 11:31:44 2011 New Revision: 1222186 URL: http://svn.apache.org/viewvc?rev=1222186&view=rev Log: Merged revisions 1221825 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1221825 | ay | 2011-12-21 19:01:07 +0100 (Wed, 21 Dec 2011) | 1 line [CXF-3993] ws-rm's blueprint configuration fails to parse RMAssertion entries ........ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ svn:mergeinfo = /cxf/trunk:1221825 Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java?rev=1222186&r1=1222185&r2=1222186&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java (original) +++ cxf/branches/2.4.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/RMBPBeanDefinitionParser.java Thu Dec 22 11:31:44 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, JAXBContext> jaxbContexts = new HashMap, JAXBContext>(); private Class beanClass; @@ -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; }