geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r790318 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
Date Wed, 01 Jul 2009 19:14:36 GMT
Author: gnodet
Date: Wed Jul  1 19:14:35 2009
New Revision: 790318

URL: http://svn.apache.org/viewvc?rev=790318&view=rev
Log:
Fix activation / scope parsing

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java?rev=790318&r1=790317&r2=790318&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
Wed Jul  1 19:14:35 2009
@@ -452,10 +452,20 @@
             metadata.setId(getId(element));
             if (element.hasAttribute(SCOPE_ATTRIBUTE)) {
                 metadata.setScope(element.getAttribute(SCOPE_ATTRIBUTE));
+                if (metadata.getScope().equals(BeanMetadata.SCOPE_PROTOTYPE)) {
+                    if (element.hasAttribute(ACTIVATION_ATTRIBUTE)) {
+                        if (element.getAttribute(ACTIVATION_ATTRIBUTE).equals(ACTIVATION_EAGER))
{
+                            throw new ComponentDefinitionException("A <bean> with a
prototype scope can not have an eager activation");
+                        }
+                    }
+                    metadata.setActivation(ComponentMetadata.ACTIVATION_LAZY);
+                } else {
+                    metadata.setActivation(parseActivation(element));
+                }
             } else {
                 metadata.setScope(BeanMetadata.SCOPE_SINGLETON);
+                metadata.setActivation(parseActivation(element));
             }
-            metadata.setActivation(parseActivation(element));
         } else {
             metadata.setScope(BeanMetadata.SCOPE_PROTOTYPE);
             metadata.setActivation(ComponentMetadata.ACTIVATION_LAZY);



Mime
View raw message