geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1393007 - /geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanNamespaceHandler.java
Date Tue, 02 Oct 2012 16:17:31 GMT
Author: gnodet
Date: Tue Oct  2 16:17:31 2012
New Revision: 1393007

URL: http://svn.apache.org/viewvc?rev=1393007&view=rev
Log:
[XBEAN-227] Add support for Spring 3.1 bean profiles

Modified:
    geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanNamespaceHandler.java

Modified: geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanNamespaceHandler.java?rev=1393007&r1=1393006&r2=1393007&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanNamespaceHandler.java
(original)
+++ geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanNamespaceHandler.java
Tue Oct  2 16:17:31 2012
@@ -154,9 +154,11 @@ public class XBeanNamespaceHandler imple
         this.parserContext = parserContext;
         this.qnameHelper = new XBeanQNameHelper(parserContext.getReaderContext());
         BeanDefinitionHolder holder = parseBeanFromExtensionElement(element);
-        // Only register components: i.e. first level beans (or root element if no <beans>
element
-        if (element.getParentNode() == element.getOwnerDocument() || 
-            element.getParentNode().getParentNode() == element.getOwnerDocument()) {
+        // Only register components: i.e. first or seconds level beans (or root element if
no <beans> element)
+        // a 2nd level could be a nested <beans> from Spring 3.1 onwards
+        if (element.getParentNode() == element.getOwnerDocument() ||
+                element.getParentNode().getParentNode() == element.getOwnerDocument() ||
+                element.getParentNode().getParentNode().getParentNode() == element.getOwnerDocument())
{
             BeanDefinitionReaderUtils.registerBeanDefinition(holder, parserContext.getRegistry());
             BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);
             parserContext.getReaderContext().fireComponentRegistered(componentDefinition);



Mime
View raw message