incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: Remove final modifer to ListS3Cmd class as it conflicts with Spring injection
Date Thu, 24 Jan 2013 02:33:09 GMT
Updated Branches:
  refs/heads/javelin d182e6489 -> a26e075f0


Remove final modifer to ListS3Cmd class as it conflicts with Spring injection


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

Branch: refs/heads/javelin
Commit: a26e075f0eed3eb86ffd83d9d7f4ae70e46133d1
Parents: d182e64
Author: Kelven Yang <kelveny@gmail.com>
Authored: Wed Jan 23 18:23:48 2013 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Wed Jan 23 18:24:03 2013 -0800

----------------------------------------------------------------------
 .../api/command/admin/storage/ListS3sCmd.java      |    2 +-
 .../cloud/utils/component/ComponentContext.java    |   24 ++++++++-------
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a26e075f/api/src/org/apache/cloudstack/api/command/admin/storage/ListS3sCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListS3sCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListS3sCmd.java
index a496861..4ab71de 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListS3sCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListS3sCmd.java
@@ -35,7 +35,7 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.storage.S3;
 
 @APICommand(name = "listS3s", description = "Lists S3s", responseObject = S3Response.class,
since = "4.0.0")
-public final class ListS3sCmd extends BaseListCmd {
+public class ListS3sCmd extends BaseListCmd {
 
     private static final String COMMAND_NAME = "lists3sresponse";
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a26e075f/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 7516442..f86c6e5 100644
--- a/utils/src/com/cloud/utils/component/ComponentContext.java
+++ b/utils/src/com/cloud/utils/component/ComponentContext.java
@@ -18,11 +18,12 @@
 package com.cloud.utils.component;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.inject.Inject;
+import javax.annotation.PostConstruct;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
@@ -50,22 +51,23 @@ import com.cloud.utils.db.TransactionContextBuilder;
 public class ComponentContext implements ApplicationContextAware {
     private static final Logger s_logger = Logger.getLogger(ComponentContext.class);
 
-    private static ApplicationContext s_appContext;
+    private static ApplicationContext s_appContext;  
 
-	@Inject List<GenericDao> daos;
-    @Inject List<Manager>  mgrs;
-    @Inject List<Adapter>  adapters;
-    
     @Override
     public void setApplicationContext(ApplicationContext applicationContext) {  
-        s_appContext = applicationContext;
+        s_appContext = applicationContext;  
     }  
 
     public static ApplicationContext getApplicationContext() {  
         return s_appContext;  
-    }
-    
-    public void init() {
+    }  
+
+    public void initComponentsLifeCycle() {
+        @SuppressWarnings("rawtype")
+        Collection<GenericDao> daos = ComponentContext.getApplicationContext().getBeansOfType(GenericDao.class).values();
+        Collection<Manager> mgrs = ComponentContext.getApplicationContext().getBeansOfType(Manager.class).values();
+        Collection<Adapter> adapters = ComponentContext.getApplicationContext().getBeansOfType(Adapter.class).values();
+
         Map<String, Object> params = new HashMap<String, Object>();
         for (GenericDao dao : daos) {
             try {
@@ -77,7 +79,7 @@ public class ComponentContext implements ApplicationContextAware {
             }
         }
 
-       	List<String> avoidMap = new ArrayList<String>();
+        List<String> avoidMap = new ArrayList<String>();
         for (Manager manager : mgrs) {
             if (avoidMap.contains(manager.getName())) {
                 s_logger.info("Skip manager: " + ComponentContext.getTargetClass(manager).getName()
+ " as it is already started");


Mime
View raw message