cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [25/31] git commit: updated refs/heads/ui-restyle to ef74127
Date Mon, 30 Sep 2013 21:52:24 GMT
Add ability to programatically disable CloudStack ComponentConext intialization

As we moved to a more Spring managed lifecycle, the lifecycle management
in ComponentContext is not needed.  The transition to fully spring managed
will not happen all at once.  The management server will be done first and
then AWSAPI and UsageServer will come later.  This change allows the
ComponentContext in the context of the management server to be bypassed.
Note, by default, the ComponentContext will run its initialization.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/766a0a22
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/766a0a22
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/766a0a22

Branch: refs/heads/ui-restyle
Commit: 766a0a2229e270e964adc9801eccd010475d0b9a
Parents: 78040f8
Author: Darren Shepherd <darren.s.shepherd@gmail.com>
Authored: Mon Sep 30 09:30:54 2013 -0700
Committer: Darren Shepherd <darren.s.shepherd@gmail.com>
Committed: Mon Sep 30 09:30:54 2013 -0700

----------------------------------------------------------------------
 .../src/com/cloud/utils/component/ComponentContext.java | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/766a0a22/utils/src/com/cloud/utils/component/ComponentContext.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/ComponentContext.java b/utils/src/com/cloud/utils/component/ComponentContext.java
index 065fd3b..332e4ec 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -49,6 +49,7 @@ public class ComponentContext implements ApplicationContextAware {
     private static final Logger s_logger = Logger.getLogger(ComponentContext.class);
 
     private static ApplicationContext s_appContext;
+    private static boolean s_initializeBeans = true;
 
     @Override
     public void setApplicationContext(ApplicationContext applicationContext) {
@@ -61,6 +62,9 @@ public class ComponentContext implements ApplicationContextAware {
     }
 
     public static void initComponentsLifeCycle() {
+        if ( ! s_initializeBeans )
+            return;
+
         AutowireCapableBeanFactory beanFactory = s_appContext.getAutowireCapableBeanFactory();
 
         Map<String, ComponentMethodInterceptable> interceptableComponents = getApplicationContext().getBeansOfType(ComponentMethodInterceptable.class);
@@ -234,4 +238,12 @@ public class ComponentContext implements ApplicationContextAware {
         beanFactory.autowireBean(instance);
         return (T)instance;
     }
+
+    public boolean isInitializeBeans() {
+        return s_initializeBeans;
+    }
+
+    public void setInitializeBeans(boolean initializeBeans) {
+        s_initializeBeans = initializeBeans;
+    }
 }


Mime
View raw message