camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1391380 - in /camel/branches/camel-2.9.x: ./ components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
Date Fri, 28 Sep 2012 09:53:40 GMT
Author: davsclaus
Date: Fri Sep 28 09:53:39 2012
New Revision: 1391380

URL: http://svn.apache.org/viewvc?rev=1391380&view=rev
Log:
CAMEL-5663: camel-blueprint add check for bean scope using blueprint metadata.

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1391378
  Merged /camel/branches/camel-2.10.x:r1391379

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java?rev=1391380&r1=1391379&r2=1391380&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
Fri Sep 28 09:53:39 2012
@@ -735,6 +735,19 @@ public class CamelNamespaceHandler imple
         public void afterDestroy(Object bean, String beanName) {
         }
 
+        @Override
+        protected boolean isSingleton(Object bean, String beanName) {
+            ComponentMetadata meta = blueprintContainer.getComponentMetadata(beanName);
+            if (meta != null && meta instanceof BeanMetadata) {
+                String scope = ((BeanMetadata) meta).getScope();
+                if (scope != null) {
+                    return BeanMetadata.SCOPE_SINGLETON.equals(scope);
+                }
+            }
+            // fallback to super, which will assume singleton
+            // for beans not implementing Camel's IsSingleton interface
+            return super.isSingleton(bean, beanName);
+        }
     }
 
     public static class CamelDependenciesFinder implements ComponentDefinitionRegistryProcessor
{



Mime
View raw message