cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r639692 - in /incubator/cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Date Fri, 21 Mar 2008 16:13:42 GMT
Author: dkulp
Date: Fri Mar 21 09:13:20 2008
New Revision: 639692

URL: http://svn.apache.org/viewvc?rev=639692&view=rev
Log:
Merged revisions 638963 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r638963 | bimargulies | 2008-03-19 14:28:38 -0400 (Wed, 19 Mar 2008) | 2 lines
  
  A small but measurable speedup in spring initialization.
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=639692&r1=639691&r2=639692&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Fri Mar 21 09:13:20 2008
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.configuration.spring;
 
+import java.util.Map;
 import java.util.StringTokenizer;
 
 import javax.xml.bind.JAXBContext;
@@ -32,6 +33,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.apache.cxf.common.util.CacheMap;
 import org.apache.cxf.helpers.DOMUtils;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
 import org.springframework.beans.factory.config.BeanDefinition;
@@ -44,9 +46,9 @@
 
 public abstract class AbstractBeanDefinitionParser 
     extends org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser {
-
+    private static Map<String, JAXBContext> packageContextCache = new CacheMap<String,
JAXBContext>(); 
     private Class beanClass;
-
+    
     @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{
         boolean setBus = parseAttributes(element, ctx, bean);        
@@ -255,7 +257,11 @@
             if (null != c && c.getPackage() != null) {
                 pkg = c.getPackage().getName();
             }
-            context = JAXBContext.newInstance(pkg, getClass().getClassLoader());
+            context = packageContextCache.get(pkg);
+            if (context == null) {
+                context = JAXBContext.newInstance(pkg, getClass().getClassLoader());
+                packageContextCache.put(pkg, context);
+            }
             Unmarshaller u = context.createUnmarshaller();
             if (c != null) {
                 obj = u.unmarshal(data, c);



Mime
View raw message