geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r420791 - /geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/XmlWebApplicationContext.java
Date Tue, 11 Jul 2006 10:32:51 GMT
Author: jstrachan
Date: Tue Jul 11 03:32:51 2006
New Revision: 420791

URL: http://svn.apache.org/viewvc?rev=420791&view=rev
Log:
applied Guillaume's patch for bug XBEAN-21 which fixes the use of XmlWebApplicationContext
(and avoids the need for a custom patch in ServiceMix to work around this issue)

Modified:
    geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/XmlWebApplicationContext.java

Modified: geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/XmlWebApplicationContext.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/XmlWebApplicationContext.java?rev=420791&r1=420790&r2=420791&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/XmlWebApplicationContext.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/XmlWebApplicationContext.java
Tue Jul 11 03:32:51 2006
@@ -18,15 +18,14 @@
 package org.apache.xbean.spring.context;
 
 import java.io.IOException;
-import java.lang.reflect.Constructor;
 import java.util.Collections;
 import java.util.List;
 
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.apache.xbean.spring.context.SpringApplicationContext;
+import org.apache.xbean.spring.context.impl.XBeanHelper;
 import org.springframework.beans.factory.support.DefaultListableBeanFactory;
 import org.springframework.beans.factory.xml.ResourceEntityResolver;
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.core.SpringVersion;
 
 /**
  * An XBean version of the regular Spring class to provide improved XML
@@ -60,7 +59,7 @@
      */
     protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException
{
         // Create a new XmlBeanDefinitionReader for the given BeanFactory.
-        XmlBeanDefinitionReader beanDefinitionReader = createBeanDefinitionReader(beanFactory);
+        XmlBeanDefinitionReader beanDefinitionReader = XBeanHelper.createBeanDefinitionReader(this,
beanFactory, xmlPreprocessors);
 
         // Configure the bean definition reader with this context's
         // resource loading environment.
@@ -73,15 +72,4 @@
         loadBeanDefinitions(beanDefinitionReader);
     }
     
-    protected XmlBeanDefinitionReader createBeanDefinitionReader(DefaultListableBeanFactory
beanFactory) {
-        String version = SpringVersion.getVersion();
-        String className = "org.apache.xbean.spring.v" + version.charAt(0) + ".XBeanXmlBeanDefinitionReader";
-        try {
-            Class cl = Class.forName(className);
-            Constructor cstr = cl.getConstructor(new Class[] { SpringApplicationContext.class,
BeanDefinitionRegistry.class, List.class });
-            return (XmlBeanDefinitionReader) cstr.newInstance(new Object[] { this, beanFactory,
xmlPreprocessors });
-        } catch (Exception e) {
-            throw new IllegalStateException("Could not find valid implementation for: " +
version);
-        }
-    }
 }



Mime
View raw message