You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2013/10/03 00:45:45 UTC

[1/9] Spring Modularization

Updated Branches:
  refs/heads/spring-modularization [created] 8cf00de51


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-network/spring-server-network-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-network/spring-server-network-context.xml b/server/resources/META-INF/cloudstack/server-network/spring-server-network-context.xml
new file mode 100644
index 0000000..553ae44
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-network/spring-server-network-context.xml
@@ -0,0 +1,64 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="StorageNetworkGuru" class="com.cloud.network.guru.StorageNetworkGuru">
+        <property name="name" value="StorageNetworkGuru" />
+    </bean>
+    <bean id="ExternalGuestNetworkGuru" class="com.cloud.network.guru.ExternalGuestNetworkGuru">
+        <property name="name" value="ExternalGuestNetworkGuru" />
+    </bean>
+    <bean id="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru">
+        <property name="name" value="PublicNetworkGuru" />
+    </bean>
+    <bean id="PodBasedNetworkGuru" class="com.cloud.network.guru.PodBasedNetworkGuru">
+        <property name="name" value="PodBasedNetworkGuru" />
+    </bean>
+    <bean id="ControlNetworkGuru" class="com.cloud.network.guru.ControlNetworkGuru">
+        <property name="name" value="ControlNetworkGuru" />
+    </bean>
+    <bean id="DirectNetworkGuru" class="com.cloud.network.guru.DirectNetworkGuru">
+        <property name="name" value="DirectNetworkGuru" />
+    </bean>
+    <bean id="DirectPodBasedNetworkGuru" class="com.cloud.network.guru.DirectPodBasedNetworkGuru">
+        <property name="name" value="DirectPodBasedNetworkGuru" />
+    </bean>
+    <bean id="PrivateNetworkGuru" class="com.cloud.network.guru.PrivateNetworkGuru">
+        <property name="name" value="PrivateNetworkGuru" />
+    </bean>
+
+
+    <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
+        <property name="name" value="SecurityGroupProvider" />
+    </bean>
+
+    <bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
+        <property name="name" value="VirtualRouter" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-planner/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-planner/module.properties b/server/resources/META-INF/cloudstack/server-planner/module.properties
new file mode 100644
index 0000000..fa82ba5
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-planner/module.properties
@@ -0,0 +1,2 @@
+name=server-planner
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-planner/spring-server-planner-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-planner/spring-server-planner-context.xml b/server/resources/META-INF/cloudstack/server-planner/spring-server-planner-context.xml
new file mode 100644
index 0000000..36f3ed0
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-planner/spring-server-planner-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+  <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
+    <property name="name" value="FirstFitPlanner"/>
+  </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-storage/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-storage/module.properties b/server/resources/META-INF/cloudstack/server-storage/module.properties
new file mode 100644
index 0000000..2874a1b
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-storage/module.properties
@@ -0,0 +1,2 @@
+name=server-storage
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-storage/spring-server-storage-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-storage/spring-server-storage-context.xml b/server/resources/META-INF/cloudstack/server-storage/spring-server-storage-context.xml
new file mode 100644
index 0000000..8b90200
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-storage/spring-server-storage-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="secondaryStorageVmDefaultAllocator"
+        class="com.cloud.storage.secondary.SecondaryStorageVmDefaultAllocator" />
+
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-template-adapter/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-template-adapter/module.properties b/server/resources/META-INF/cloudstack/server-template-adapter/module.properties
new file mode 100644
index 0000000..45531d9
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-template-adapter/module.properties
@@ -0,0 +1,2 @@
+name=server-template-adapter
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-template-adapter/spring-server-template-adapter-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-template-adapter/spring-server-template-adapter-context.xml b/server/resources/META-INF/cloudstack/server-template-adapter/spring-server-template-adapter-context.xml
new file mode 100644
index 0000000..1eeb27c
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-template-adapter/spring-server-template-adapter-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index b73045d..fd3492d 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -82,7 +82,6 @@ import org.apache.http.protocol.ResponseDate;
 import org.apache.http.protocol.ResponseServer;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.acl.APIChecker;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiErrorCode;
@@ -186,11 +185,11 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        init();
         return true;
     }
 
-    public void init() {
+    @Override
+    public boolean start() {
         Integer apiPort = null; // api port, null by default
         SearchCriteria<ConfigurationVO> sc = _configDao.createSearchCriteria();
         sc.addAnd("name", SearchCriteria.Op.EQ, Config.IntegrationAPIPort.key());
@@ -245,6 +244,8 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
             ListenerThread listenerThread = new ListenerThread(this, apiPort);
             listenerThread.start();
         }
+        
+        return true;
     }
 
     // NOTE: handle() only handles over the wire (OTW) requests from integration.api.port 8096

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java b/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
index 675ff25..ef16133 100755
--- a/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
+++ b/server/src/com/cloud/consoleproxy/StaticConsoleProxyManager.java
@@ -70,6 +70,9 @@ public class StaticConsoleProxyManager extends AgentBasedConsoleProxyManager imp
     private String _ip = null;
 
 
+    public StaticConsoleProxyManager() {
+        
+    }
 
     @Override
     protected HostVO findHost(VMInstanceVO vm) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/src/com/cloud/event/ActionEventInterceptor.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/event/ActionEventInterceptor.java b/server/src/com/cloud/event/ActionEventInterceptor.java
index 8396512..1820b34 100644
--- a/server/src/com/cloud/event/ActionEventInterceptor.java
+++ b/server/src/com/cloud/event/ActionEventInterceptor.java
@@ -20,14 +20,45 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
 import org.apache.cloudstack.context.CallContext;
 
 import com.cloud.utils.component.ComponentMethodInterceptor;
 
-public class ActionEventInterceptor implements ComponentMethodInterceptor {
+public class ActionEventInterceptor implements ComponentMethodInterceptor, MethodInterceptor {
 
 	public ActionEventInterceptor() {
 	}
+	
+	@Override
+    public Object invoke(MethodInvocation invocation) throws Throwable {
+        Method m = invocation.getMethod();
+        Object target = invocation.getThis();
+        
+        if ( getActionEvents(m).size() == 0 ) {
+            /* Look for annotation on impl class */
+            m = target.getClass().getMethod(m.getName(), m.getParameterTypes());
+        }
+        
+        Object interceptorData = null;
+        
+        boolean success = true;
+        try {
+            interceptorData = interceptStart(m, target);
+            
+            Object result = invocation.proceed();
+            success = true;
+            
+            return result;
+        } finally {
+            if ( success ) {
+                interceptComplete(m, target, interceptorData);
+            } else {
+                interceptException(m, target, interceptorData);
+            }
+        }
+    }
 
 	@Override
     public Object interceptStart(Method method, Object target) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 651e82c..f2fe69f 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -1204,7 +1204,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
     }
 
 
-    protected List<VpcProvider> getVpcElements() {
+    public List<VpcProvider> getVpcElements() {
         if (vpcElements == null) {
             vpcElements = new ArrayList<VpcProvider>();
             vpcElements.add((VpcProvider)_ntwkModel.getElementImplementingProvider(Provider.VPCVirtualRouter.getName()));
@@ -2178,4 +2178,9 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
 
         return new ArrayList<Provider>(providers.values());
     }
+
+    @Inject
+    public void setVpcElements(List<VpcProvider> vpcElements) {
+        this.vpcElements = vpcElements;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 7a9343c..6659109 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -2491,4 +2491,12 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
             return false;
         }
     }
+
+    @Override
+    public boolean start() {
+        // TODO Auto-generated method stub
+        return super.start();
+    }
+    
+    
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/module.properties
----------------------------------------------------------------------
diff --git a/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/module.properties b/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/module.properties
new file mode 100644
index 0000000..31cb715
--- /dev/null
+++ b/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/module.properties
@@ -0,0 +1,2 @@
+name=secondary-storage-discoverer
+parent=discoverer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/spring-secondary-storage-discoverer-context.xml
----------------------------------------------------------------------
diff --git a/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/spring-secondary-storage-discoverer-context.xml b/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/spring-secondary-storage-discoverer-context.xml
new file mode 100644
index 0000000..30521aa
--- /dev/null
+++ b/services/secondary-storage/resources/META-INF/cloudstack/secondary-storage-discoverer/spring-secondary-storage-discoverer-context.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="SecondaryStorageDiscoverer"
+        class="org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer">
+        <property name="name" value="SecondaryStorage" />
+    </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/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 332e4ec..ae2aefe 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 Map<Class<?>, ApplicationContext> s_appContextDelegates;
     private static boolean s_initializeBeans = true;
 
     @Override
@@ -234,11 +235,35 @@ public class ComponentContext implements ApplicationContextAware {
 
     public static <T> T inject(Object instance) {
         // autowire dynamically loaded object
-        AutowireCapableBeanFactory beanFactory = s_appContext.getAutowireCapableBeanFactory();
+        AutowireCapableBeanFactory beanFactory = getApplicationContext(instance).getAutowireCapableBeanFactory();
         beanFactory.autowireBean(instance);
         return (T)instance;
     }
 
+    private static ApplicationContext getApplicationContext(Object instance) {
+        ApplicationContext result = null;
+
+        if (instance != null && s_appContextDelegates != null) {
+            result = s_appContextDelegates.get(instance.getClass());
+        }
+
+        return result == null ? s_appContext : result;
+    }
+
+    public static synchronized void addDelegateContext(Class<?> clazz, ApplicationContext context) {
+        if (s_appContextDelegates == null) {
+            s_appContextDelegates = new HashMap<Class<?>, ApplicationContext>();
+        }
+
+        s_appContextDelegates.put(clazz, context);
+    }
+
+    public static synchronized void removeDelegateContext(Class<?> clazz) {
+        if (s_appContextDelegates != null) {
+            s_appContextDelegates.remove(clazz);
+        }
+    }
+
     public boolean isInitializeBeans() {
         return s_initializeBeans;
     }


[8/9] Configuration to enable Spring Modularization

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/client/tomcatconf/nonossComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in
deleted file mode 100644
index 0502bbc..0000000
--- a/client/tomcatconf/nonossComponentContext.xml.in
+++ /dev/null
@@ -1,421 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-  xmlns:context="http://www.springframework.org/schema/context"
-  xmlns:tx="http://www.springframework.org/schema/tx" 
-  xmlns:aop="http://www.springframework.org/schema/aop"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-                      http://www.springframework.org/schema/tx 
-                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
-                      http://www.springframework.org/schema/aop
-                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
-                      http://www.springframework.org/schema/context
-                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">                     
-
-
-<!--
- 
-  non-OSS deployment configuration
-      
-  OSS/non-OSS counter-exclusive components and related configurations should be put here
-  for example, configurationDaoImpl component, it has exclusive configuration settings in OSS and non-OSS deployment,
-  its component declaration should be put in both componentContext.xml.in and nonossComponentContext.xml.in, each with
-  independent configuration
-    
--->
-  <bean id="DatabaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker"/>
-  <bean id="GlobalLoadBalancingRulesServiceImpl" class ="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" >
-    <property name="GslbServiceProvider">
-      <ref bean="Netscaler"/>
-    </property>
-  </bean>
-
-  <!--
-    DAO with customized configuration under non-OSS deployment
-  -->
-  <bean id="configurationDaoImpl" class="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="premium" value="true" />
-      </map>
-    </property>  
-  </bean>
-
-  <!--
-    VMware support components
-  -->  
-  <bean id="VmwareFencer" class="com.cloud.ha.VmwareFencer">
-    <property name="name" value="VMwareFenceBuilder"/>
-  </bean>
-  <bean id="vmwareServerDiscoverer" class="com.cloud.hypervisor.vmware.VmwareServerDiscoverer">
-    <property name="name" value="VMware Discover"/>
-  </bean>
-  <bean id="VMwareGuru" class="com.cloud.hypervisor.guru.VMwareGuru">
-    <property name="name" value="VMwareGuru"/>
-  </bean>
-  <bean id="VmwareInvestigator" class="com.cloud.ha.VmwareInvestigator">
-    <property name="name" value="VMwareInvestigator"/>
-  </bean>
-  <bean id="VmwareManager" class="com.cloud.hypervisor.vmware.manager.VmwareManagerImpl"/>
-  <bean id="vmwareContextFactory" class="com.cloud.hypervisor.vmware.resource.VmwareContextFactory" />
-  <bean id="VmwareDatacenterDaoImpl" class="com.cloud.hypervisor.vmware.dao.VmwareDatacenterDaoImpl" />
-  <bean id="VmwareDatacenterZoneMapDaoImpl" class="com.cloud.hypervisor.vmware.dao.VmwareDatacenterZoneMapDaoImpl" />
-  <bean id="LegacyZoneDaoImpl" class="com.cloud.hypervisor.vmware.dao.LegacyZoneDaoImpl" />
-
-  <!--
-    Nicira support components
-  -->
-  <bean id="niciraNvpDaoImpl" class="com.cloud.network.dao.NiciraNvpDaoImpl" />
-  <bean id="niciraNvpNicMappingDaoImpl" class="com.cloud.network.dao.NiciraNvpNicMappingDaoImpl" />
-  <bean id="niciraNvpRouterMappingDaoImpl" class="com.cloud.network.dao.NiciraNvpRouterMappingDaoImpl" />
-  <bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
-    <property name="name" value="NiciraNvpGuestNetworkGuru"/>
-  </bean>
-  <bean id="NiciraNvp" class="com.cloud.network.element.NiciraNvpElement">
-    <property name="name" value="NiciraNvp"/>
-  </bean>
-  
-  <!--
-      BigSwitch Components
-  -->
-  <bean id="BigSwitchVns" class="com.cloud.network.element.BigSwitchVnsElement">
-    <property name="name" value="BigSwitchVns"/>
-  </bean>
-
-  <!--
-    Netapp support components
-  -->  
-  <bean id="lunDaoImpl" class="com.cloud.netapp.dao.LunDaoImpl" />
-  <bean id="poolDaoImpl" class="com.cloud.netapp.dao.PoolDaoImpl" />
-  <bean id="netappVolumeDaoImpl" class="com.cloud.netapp.dao.VolumeDaoImpl" />
-  <bean id="NetappManager" class="com.cloud.netapp.NetappManagerImpl"/>
-
-  <!--
-   JuniperSRX support components
-  -->
-  <bean id="JuniperSRX" class="com.cloud.network.element.JuniperSRXExternalFirewallElement">
-    <property name="name" value="JuniperSRX"/>
-  </bean>
-  
-  <!--
-    NetScalar support components
-  -->
-  <bean id="netScalerPodDaoImpl" class="com.cloud.network.dao.NetScalerPodDaoImpl" />
-  <bean id="Netscaler" class="com.cloud.network.element.NetscalerElement">
-    <property name="name" value="Netscaler"/>
-  </bean>
-  
-  <!--
-    F5BigIP support components
-  -->
-  <bean id="F5BigIP" class="com.cloud.network.element.F5ExternalLoadBalancerElement">
-    <property name="name" value="F5BigIP"/>
-  </bean>
-  
-  <!--
-    Cisco Nexus support components
-  -->  
-  <bean id="ciscoNexusVSMDeviceDaoImpl" class="com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl" />
-  <bean id="CiscoNexus1000vVSM" class="com.cloud.network.element.CiscoNexusVSMElement">
-    <property name="name" value="CiscoNexus1000vVSM"/>
-  </bean>
-  
-  <!--
-    Cisco VNMC support components
-  -->
-  <bean id="ciscoVnmcDaoImpl" class="com.cloud.network.dao.CiscoVnmcDaoImpl" />
-  <bean id="ciscoAsa1000vDaoImpl" class="com.cloud.network.dao.CiscoAsa1000vDaoImpl" />
-  <bean id="networkAsa1000vMapDaoImpl" class="com.cloud.network.dao.NetworkAsa1000vMapDaoImpl" />
-  <bean id="CiscoVNMC" class="com.cloud.network.element.CiscoVnmcElement">
-    <property name="name" value="CiscoVNMC"/>
-  </bean>
-  
-  <!--
-    BigSwitch support components
-  -->  
-  <bean id="bigSwitchVnsDaoImpl" class="com.cloud.network.dao.BigSwitchVnsDaoImpl" />
-  <bean id="bigSwitchVnsElement" class="com.cloud.network.element.BigSwitchVnsElement">
-    <property name="name" value="BigSwitchVnsElement"/>
-  </bean>
-
-
-  <!--
-    Midonet support components
-  -->
-  <bean id="MidoNetGuestNetworkGuru" class="com.cloud.network.guru.MidoNetGuestNetworkGuru">
-    <property name="name" value="MidoNetGuestNetworkGuru"/>
-  </bean>
-  <bean id="MidoNetElement" class="com.cloud.network.element.MidoNetElement">
-    <property name="name" value="MidoNetElement"/>
-  </bean>
-
-
-  <!--
-    UCS support components
-  -->
-  <bean id="ucsBladeDaoImpl" class="com.cloud.ucs.database.UcsBladeDaoImpl" />
-  <bean id="ucsManagerDaoImpl" class="com.cloud.ucs.database.UcsManagerDaoImpl" />
-  
-<!--
-
-  Deployment configurations of various adapters
-    
-  It determines whether or not a adapter is activated or how it is loaded in order in its managing provider,
-     
--->
-
-  <!--Motion Strategies-->
-  <bean id="vmwareStorageMotionStrategy" class="org.apache.cloudstack.storage.motion.VmwareStorageMotionStrategy" />
-  <bean id="dataMotionServiceImpl" class="org.apache.cloudstack.storage.motion.DataMotionServiceImpl">
-    <property name="strategies">
-      <list>
-        <ref bean="ancientDataMotionStrategy"/>
-        <ref bean="xenserverStorageMotionStrategy"/>
-        <ref local="vmwareStorageMotionStrategy"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="cloudStackImageStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.CloudStackImageStoreProviderImpl"/>
-  <bean id="s3ImageStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.S3ImageStoreProviderImpl"/>
-  <bean id="swiftImageStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.SwiftImageStoreProviderImpl"/>
-  <bean id="solidFireDataStoreProvider"
-        class="org.apache.cloudstack.storage.datastore.provider.SolidfirePrimaryDataStoreProvider"/>
-
-  <!--Storage Providers-->
-  <bean id="dataStoreProviderManager"
-        class="org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl">
-    <property name="providers">
-      <list merge="true">
-        <ref bean="cloudStackPrimaryDataStoreProviderImpl"/>
-        <ref bean="cloudStackImageStoreProviderImpl"/>
-        <ref bean="s3ImageStoreProviderImpl"/>
-        <ref local="swiftImageStoreProviderImpl"/>
-        <ref bean="solidFireDataStoreProvider"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Security adapters -->
-  <bean id="userAuthenticators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="SHA256SaltedUserAuthenticator"/>
-          <ref bean="MD5UserAuthenticator"/>
-          <ref bean="LdapAuthenticator"/>
-          <ref bean="PlainTextUserAuthenticator"/>
-      </list>
-    </property>
-  </bean>
-  <bean id="userPasswordEncoders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="SHA256SaltedUserAuthenticator"/>
-          <ref bean="MD5UserAuthenticator"/>
-          <ref bean="LdapAuthenticator"/>
-          <ref bean="PlainTextUserAuthenticator"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="securityCheckers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-	      <ref bean="affinityGroupAccessChecker"/>
-          <ref bean="domainChecker"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Resource discoverers -->
-  <bean id="resourceDiscoverers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="XcpServerDiscoverer"/>
-          <ref bean="SecondaryStorageDiscoverer"/>
-          <ref bean="KvmServerDiscoverer"/>
-          <ref bean="BareMetalDiscoverer"/>
-          <ref bean="OvmDiscoverer"/>
-          <ref bean="vmwareServerDiscoverer"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- HA adapters -->
-  <bean id="haInvestigators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="CheckOnAgentInvestigator"/>
-          <ref bean="XenServerInvestigator"/>
-          <ref bean="VmwareInvestigator"/>
-          <ref bean="UserVmDomRInvestigator"/>
-          <ref bean="ManagementIPSystemVMInvestigator"/>
-          <ref bean="KVMInvestigator"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="haFenceBuilders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="XenServerFencer"/>
-          <ref bean="KVMFencer"/>
-          <ref bean="OvmFencer"/>
-          <ref bean="VmwareFencer"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Deployment/allocation adapters -->
-  <bean id="deploymentPlanners" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="FirstFitPlanner" />
-          <ref bean="UserDispersingPlanner" />
-          <ref bean="UserConcentratedPodPlanner" />
-          <ref bean="ImplicitDedicationPlanner" />
-          <ref bean="BareMetalPlanner" />
-      </list>
-    </property>
-  </bean>
-
-  <bean id="podAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="UserConcentratedAllocator"/>
-      </list>
-    </property>
-  </bean>
-  
-  <bean id="hostAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="FirstFitRouting"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="storagePoolAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="LocalStoragePoolAllocator"/>
-          <ref bean="clusterScopeStoragePoolAllocator"/>
-          <ref bean="zoneWideStoragePoolAllocator"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Networking adapters -->
-  <bean id="ipDeployers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="elasticLoadBalancerElement"/>
-          <ref bean="VirtualRouter"/>
-          <ref bean="VpcVirtualRouter"/>
-          <ref bean="NiciraNvp"/>
-          <ref bean="InternalLbVm"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="dhcpProviders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="VirtualRouter"/>
-          <ref bean="VpcVirtualRouter"/>
-          <ref bean="BareMetalDhcp"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="networkGurus" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="StorageNetworkGuru"/>
-          <ref bean="ExternalGuestNetworkGuru"/>
-          <ref bean="PublicNetworkGuru"/>
-          <ref bean="PodBasedNetworkGuru"/>
-          <ref bean="DirectPodBasedNetworkGuru"/>
-          <ref bean="ControlNetworkGuru"/>
-          <ref bean="DirectNetworkGuru"/>
-          <ref bean="OvsGuestNetworkGuru"/>
-          <ref bean="PrivateNetworkGuru"/>
-          <ref bean="NiciraNvpGuestNetworkGuru"/>
-          <ref bean="MidoNetGuestNetworkGuru"/>
-      </list>
-    </property>
-  </bean>
-  
-  <bean id="networkElements" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="JuniperSRX"/>
-          <ref bean="Netscaler"/>
-          <ref bean="F5BigIP"/>
-          <ref bean="CiscoNexus1000vVSM"/>
-          <ref bean="CiscoVNMC"/>
-          <ref bean="NiciraNvp" />
-          <ref bean="MidoNetElement" />
-          <ref bean="bigSwitchVnsElement"/>
-          <ref bean="VirtualRouter"/>
-          <ref bean="Ovs"/>
-          <ref bean="SecurityGroupProvider"/>
-          <ref bean="VpcVirtualRouter"/>
-          <ref bean="InternalLbVm"/>
-          <ref bean="BareMetalDhcp"/>
-          <ref bean="BareMetalPxe"/>
-          <ref bean="BareMetalUserdata"/>
-      </list>
-    </property>
-  </bean>
-  
-  <!--
-   AffinityGroup Processors
-  -->
-  <bean id="HostAntiAffinityProcessor" class="org.apache.cloudstack.affinity.HostAntiAffinityProcessor">
-   	<property name="name" value="HostAntiAffinityProcessor"/>
-   	<property name="type" value="host anti-affinity"/>
-  </bean>
-  
-  <bean id="affinityProcessors" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="HostAntiAffinityProcessor" />
-          <ref bean="ExplicitDedicationProcessor"/>
-      </list>
-    </property>
-  </bean>
-
-  <!--
-    Dedicated Resources components
-  -->
-
-  <bean id="DedicatedResourceManagerImpl" class="org.apache.cloudstack.dedicated.DedicatedResourceManagerImpl"/>
-  <bean id="ExplicitDedicationProcessor" class="org.apache.cloudstack.affinity.ExplicitDedicationProcessor">
-    <property name="name" value="ExplicitDedicationProcessor"/>
-    <property name="type" value="ExplicitDedication"/>
-  </bean>
-
-</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/client/tomcatconf/simulatorComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/simulatorComponentContext.xml.in b/client/tomcatconf/simulatorComponentContext.xml.in
deleted file mode 100644
index 82ff433..0000000
--- a/client/tomcatconf/simulatorComponentContext.xml.in
+++ /dev/null
@@ -1,285 +0,0 @@
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~   http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
-
-  <!--
-    OSS deployment component configuration
-  -->
-  <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker"/>
-  <bean id="configurationDaoImpl" class="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl"/>
-
-  <bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
-    <property name="name" value="Simulator Agent"/>
-  </bean>
-  <bean id="SimulatorSecondaryDiscoverer" class="com.cloud.resource.SimulatorSecondaryDiscoverer">
-  </bean>
-  <bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
-    <property name="name" value="Simulator Guru"/>
-  </bean>
-  <bean id="mockConfigurationDaoImpl" class="com.cloud.simulator.dao.MockConfigurationDaoImpl" />
-  <bean id="mockHostDaoImpl" class="com.cloud.simulator.dao.MockHostDaoImpl" />
-  <bean id="mockSecStorageDaoImpl" class="com.cloud.simulator.dao.MockSecStorageDaoImpl" />
-  <bean id="mockSecurityRulesDaoImpl" class="com.cloud.simulator.dao.MockSecurityRulesDaoImpl" />
-  <bean id="mockStoragePoolDaoImpl" class="com.cloud.simulator.dao.MockStoragePoolDaoImpl" />
-  <bean id="mockVMDaoImpl" class="com.cloud.simulator.dao.MockVMDaoImpl" />
-  <bean id="mockVolumeDaoImpl" class="com.cloud.simulator.dao.MockVolumeDaoImpl" />
-  <bean id="simulatorManagerImpl" class="com.cloud.agent.manager.SimulatorManagerImpl" />
-  <bean id="mockStorageManagerImpl" class="com.cloud.agent.manager.MockStorageManagerImpl" />
-  <bean id="mockVmManagerImpl" class="com.cloud.agent.manager.MockVmManagerImpl" />
-  <bean id="mockNetworkManagerImpl" class="com.cloud.agent.manager.MockNetworkManagerImpl" />
-  <bean id="mockAgentManagerImpl" class="com.cloud.agent.manager.MockAgentManagerImpl" />
-
-  <bean id="SimulatorImageStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.SimulatorImageStoreProviderImpl"/>
-
-  <!--Storage Providers-->
-  <!--<bean id="dataStoreProviderManagerChild" parent="dataStoreProviderManager">-->
-  <bean id="dataStoreProviderManager"
-        class="org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl">
-    <property name="providers">
-      <!--Override the cloudstack default image store provider to use simulator defined provider-->
-      <list>
-        <!--Data Store Providers-->
-        <ref bean="cloudStackPrimaryDataStoreProviderImpl"/>
-        <ref bean="SimulatorImageStoreProviderImpl"/>
-      </list>
-    </property>
-  </bean>
-
-  <!--
-    Managers & pluggable adapters configuration under OSS deployment
-  -->
-  <bean id="userAuthenticators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="SHA256SaltedUserAuthenticator"/>
-        <ref bean="MD5UserAuthenticator"/>
-        <ref bean="LdapAuthenticator"/>
-        <ref bean="PlainTextUserAuthenticator"/>
-      </list>
-    </property>
-  </bean>
-  <bean id="userPasswordEncoders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="SHA256SaltedUserAuthenticator"/>
-        <ref bean="MD5UserAuthenticator"/>
-        <ref bean="LdapAuthenticator"/>
-        <ref bean="PlainTextUserAuthenticator"/>
-      </list>
-    </property>
-  </bean>
-
-
-  <bean id="securityCheckers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-	    <ref bean="affinityGroupAccessChecker"/>
-        <ref bean="domainChecker"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Resource discoverers -->
-  <bean id="resourceDiscoverers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="SimulatorDiscoverer"/>
-        <ref bean="SimulatorSecondaryDiscoverer"/>
-        <ref bean="XcpServerDiscoverer"/>
-        <ref bean="SecondaryStorageDiscoverer"/>
-        <ref bean="KvmServerDiscoverer"/>
-        <ref bean="LxcServerDiscoverer"/>
-        <ref bean="OvmDiscoverer"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- HA adapters -->
-  <bean id="haInvestigators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="CheckOnAgentInvestigator"/>
-        <ref bean="XenServerInvestigator"/>
-        <ref bean="UserVmDomRInvestigator"/>
-        <ref bean="ManagementIPSystemVMInvestigator"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="haFenceBuilders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="XenServerFencer"/>
-        <ref bean="KVMFencer"/>
-        <ref bean="OvmFencer"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Deployment/allocation adapters -->
-  <bean id="deploymentPlanners" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="FirstFitPlanner"/>
-        <ref bean="UserDispersingPlanner"/>
-        <ref bean="UserConcentratedPodPlanner"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="podAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="UserConcentratedAllocator"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="hostAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="FirstFitRouting"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="storagePoolAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="LocalStoragePoolAllocator"/>
-        <ref bean="clusterScopeStoragePoolAllocator"/>
-        <ref bean="zoneWideStoragePoolAllocator"/>
-        <ref bean="garbageCollectingStoragePoolAllocator"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Networking adapters -->
-  <bean id="ipDeployers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="elasticLoadBalancerElement"/>
-        <ref bean="VirtualRouter"/>
-        <ref bean="VpcVirtualRouter"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="dhcpProviders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="VirtualRouter"/>
-        <ref bean="VpcVirtualRouter"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="networkGurus" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="StorageNetworkGuru"/>
-        <ref bean="ExternalGuestNetworkGuru"/>
-        <ref bean="PublicNetworkGuru"/>
-        <ref bean="PodBasedNetworkGuru"/>
-        <ref bean="DirectPodBasedNetworkGuru"/>
-        <ref bean="ControlNetworkGuru"/>
-        <ref bean="DirectNetworkGuru"/>
-        <ref bean="OvsGuestNetworkGuru"/>
-        <ref bean="PrivateNetworkGuru"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="networkElements" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-        <ref bean="VirtualRouter"/>
-        <ref bean="Ovs"/>
-        <ref bean="SecurityGroupProvider"/>
-        <ref bean="VpcVirtualRouter"/>
-        <ref bean="InternalLbVm"/>
-      </list>
-    </property>
-  </bean>
-
-  <!--
-    UCS support components
-  -->
-  <bean id="ucsBladeDaoImpl" class="com.cloud.ucs.database.UcsBladeDaoImpl"/>
-  <bean id="ucsManagerDaoImpl" class="com.cloud.ucs.database.UcsManagerDaoImpl"/>
-
-  <bean id="GlobalLoadBalancingRulesServiceImpl"
-        class="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl"/>
-
-  <!--
-   AffinityGroup Processors
-  -->
-  <bean id="HostAntiAffinityProcessor" class="org.apache.cloudstack.affinity.HostAntiAffinityProcessor">
-    <property name="name" value="HostAntiAffinityProcessor"/>
-    <property name="type" value="host anti-affinity"/>
-  </bean>
-
-  <bean id="affinityProcessors" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="HostAntiAffinityProcessor" />
-      </list>
-    </property>
-  </bean>
-
-  <bean id="DedicatedResourceManagerImpl" class="org.apache.cloudstack.dedicated.DedicatedResourceManagerImpl"/>
-  <bean id="ExplicitDedicationProcessor" class="org.apache.cloudstack.affinity.ExplicitDedicationProcessor">
-    <property name="name" value="ExplicitDedicationProcessor"/>
-    <property name="type" value="ExplicitDedication"/>
-  </bean>
-  <!--
-    RPC/Async/EventBus
-  -->
-
-  <bean id="onwireRegistry" class="org.apache.cloudstack.framework.serializer.OnwireClassRegistry"
-    init-method="scan" >
-    <property name="packages">
-      <list>
-        <value>org.apache.cloudstack.framework</value>
-      </list>
-    </property>
-  </bean>
-  
-  <bean id="messageSerializer" class="org.apache.cloudstack.framework.serializer.JsonMessageSerializer">
-    <property name="onwireClassRegistry" ref="onwireRegistry" />
-  </bean>
-
-  <bean id="transportProvider" class="org.apache.cloudstack.framework.server.ServerTransportProvider"  init-method="initialize">
-    <property name="workerPoolSize" value="5" />
-    <property name="nodeId" value="Node1" />
-    <property name="messageSerializer" ref="messageSerializer" />
-  </bean>
-  
-  <bean id="rpcProvider" class="org.apache.cloudstack.framework.rpc.RpcProviderImpl" init-method="initialize">
-    <constructor-arg ref="transportProvider" />
-    <property name="messageSerializer" ref="messageSerializer" />
-  </bean>
-
-  <bean id="messageBus" class = "org.apache.cloudstack.framework.messagebus.MessageBusBase" />
-  <bean id="configDepot" class = "org.apache.cloudstack.framework.config.ConfigDepotImpl" />
-</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index 17fb2b1..b10a1e4 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -317,7 +317,7 @@ cp awsapi/resource/Axis2/axis2.xml ${RPM_BUILD_ROOT}%{_datadir}/%{name}-bridge/w
 cp awsapi/target/WEB-INF/services/cloud-ec2.aar ${RPM_BUILD_ROOT}%{_datadir}/%{name}-bridge/webapps/awsapi/WEB-INF/services
 
 
-for name in applicationContext.xml cloud-bridge.properties commons-logging.properties ec2-service.properties ; do
+for name in cloud-bridge.properties commons-logging.properties ec2-service.properties ; do
   mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}-bridge/webapps/awsapi/WEB-INF/classes/$name \
     ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/$name
 done
@@ -522,7 +522,6 @@ fi
 %config(noreplace) %{_sysconfdir}/%{name}/management/tomcat-users.xml
 %config(noreplace) %{_sysconfdir}/%{name}/management/web.xml
 %config(noreplace) %{_sysconfdir}/%{name}/management/environment.properties
-%config(noreplace) %{_sysconfdir}/%{name}/management/applicationContext.xml
 %config(noreplace) %{_sysconfdir}/%{name}/management/cloud-bridge.properties
 %config(noreplace) %{_sysconfdir}/%{name}/management/commons-logging.properties
 %config(noreplace) %{_sysconfdir}/%{name}/management/ec2-service.properties

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d8c6f40..76661e5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,7 +73,7 @@
     <cs.jstl.version>1.2</cs.jstl.version>
     <cs.selenium.server.version>1.0-20081010.060147</cs.selenium.server.version>
     <cs.vmware.api.version>5.1</cs.vmware.api.version>
-    <org.springframework.version>3.1.2.RELEASE</org.springframework.version>
+    <org.springframework.version>3.2.4.RELEASE</org.springframework.version>
     <cs.mockito.version>1.9.5</cs.mockito.version>
     <cs.aws.sdk.version>1.3.22</cs.aws.sdk.version>
     <cs.lang.version>2.6</cs.lang.version>
@@ -173,6 +173,7 @@
     <module>client</module>
     <module>services</module>
     <module>maven-standard</module>
+    <module>quickcloud</module>
   </modules>
 
   <dependencyManagement>
@@ -359,7 +360,12 @@
       <dependency>
         <groupId>org.aspectj</groupId>
         <artifactId>aspectjtools</artifactId>
-        <version>1.6.2</version>
+        <version>1.7.0</version>
+      </dependency>
+      <dependency>
+        <groupId>org.aspectj</groupId>
+        <artifactId>aspectjweaver</artifactId>
+        <version>1.7.0</version>
       </dependency>
       <dependency>
         <groupId>org.apache.axis</groupId>
@@ -424,6 +430,11 @@
     <defaultGoal>install</defaultGoal>
     <sourceDirectory>src</sourceDirectory>
     <testSourceDirectory>test</testSourceDirectory>
+    <resources>
+      <resource>
+        <directory>${basedir}/resources</directory>
+      </resource>
+    </resources>
     <testResources>
       <testResource>
         <directory>test/resources</directory>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index 6446b7e..0da2d12 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -128,9 +128,6 @@
     <resources>
       <resource>
         <directory>resources</directory>
-        <includes>
-          <include>**/*.xml</include>
-        </includes>
       </resource>
     </resources>
     <testResources>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/utils/pom.xml
----------------------------------------------------------------------
diff --git a/utils/pom.xml b/utils/pom.xml
index 35012b2..3eea8fe 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -37,6 +37,10 @@
       <artifactId>spring-context</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.aspectj</groupId>
+      <artifactId>aspectjweaver</artifactId>
+    </dependency>
+    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
     </dependency>


[2/9] Spring Modularization

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/module.properties
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/module.properties b/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/module.properties
new file mode 100644
index 0000000..98338c4
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/module.properties
@@ -0,0 +1,2 @@
+name=nvp
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/spring-nvp-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/spring-nvp-context.xml b/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/spring-nvp-context.xml
new file mode 100644
index 0000000..302b072
--- /dev/null
+++ b/plugins/network-elements/nicira-nvp/resources/META-INF/cloudstack/nvp/spring-nvp-context.xml
@@ -0,0 +1,40 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="niciraNvpDaoImpl" class="com.cloud.network.dao.NiciraNvpDaoImpl" />
+    <bean id="niciraNvpNicMappingDaoImpl" class="com.cloud.network.dao.NiciraNvpNicMappingDaoImpl" />
+    <bean id="niciraNvpRouterMappingDaoImpl" class="com.cloud.network.dao.NiciraNvpRouterMappingDaoImpl" />
+    <bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
+        <property name="name" value="NiciraNvpGuestNetworkGuru" />
+    </bean>
+    <bean id="NiciraNvp" class="com.cloud.network.element.NiciraNvpElement">
+        <property name="name" value="NiciraNvp" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/module.properties
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/module.properties b/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/module.properties
new file mode 100644
index 0000000..dac33c6
--- /dev/null
+++ b/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/module.properties
@@ -0,0 +1,2 @@
+name=ovs
+parent=network

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/spring-ovs-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/spring-ovs-context.xml b/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/spring-ovs-context.xml
new file mode 100644
index 0000000..9180eeb
--- /dev/null
+++ b/plugins/network-elements/ovs/resources/META-INF/cloudstack/ovs/spring-ovs-context.xml
@@ -0,0 +1,40 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="Ovs" class="com.cloud.network.element.OvsElement">
+        <property name="name" value="Ovs" />
+    </bean>
+
+    <bean id="OvsGuestNetworkGuru" class="com.cloud.network.guru.OvsGuestNetworkGuru">
+        <property name="name" value="OvsGuestNetworkGuru" />
+    </bean>
+
+    <bean id="ovsTunnelManagerImpl" class="com.cloud.network.ovs.OvsTunnelManagerImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/module.properties
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/module.properties b/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/module.properties
new file mode 100644
index 0000000..2fdde54
--- /dev/null
+++ b/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/module.properties
@@ -0,0 +1,2 @@
+name=ssp
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/spring-ssp-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/spring-ssp-context.xml b/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/spring-ssp-context.xml
new file mode 100644
index 0000000..528f3e3
--- /dev/null
+++ b/plugins/network-elements/stratosphere-ssp/resources/META-INF/cloudstack/ssp/spring-ssp-context.xml
@@ -0,0 +1,42 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="sspCredentialDaoImpl"
+        class="org.apache.cloudstack.network.dao.SspCredentialDaoImpl" />
+    <bean id="sspTenantDaoImpl" class="org.apache.cloudstack.network.dao.SspTenantDaoImpl" />
+    <bean id="sspUuidDaoImpl" class="org.apache.cloudstack.network.dao.SspUuidDaoImpl" />
+    <bean id="SspGuestNetworkGuru"
+        class="org.apache.cloudstack.network.guru.SspGuestNetworkGuru">
+        <property name="name" value="SspGuestNetworkGuru" />
+    </bean>
+    <bean id="StratosphereSsp" class="org.apache.cloudstack.network.element.SspElement">
+        <property name="name" value="StratosphereSsp" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/module.properties
----------------------------------------------------------------------
diff --git a/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/module.properties b/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/module.properties
new file mode 100644
index 0000000..69ce716
--- /dev/null
+++ b/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/module.properties
@@ -0,0 +1,2 @@
+name=vxlan
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/spring-vxlan-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/spring-vxlan-context.xml b/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/spring-vxlan-context.xml
new file mode 100644
index 0000000..fcf0b01
--- /dev/null
+++ b/plugins/network-elements/vxlan/resources/META-INF/cloudstack/vxlan/spring-vxlan-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="VxlanGuestNetworkGuru" class="com.cloud.network.guru.VxlanGuestNetworkGuru">
+        <property name="name" value="VxlanGuestNetworkGuru" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/module.properties
----------------------------------------------------------------------
diff --git a/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/module.properties b/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/module.properties
new file mode 100644
index 0000000..a170698
--- /dev/null
+++ b/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/module.properties
@@ -0,0 +1,2 @@
+name=storage-image-default
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/spring-storage-image-default-context.xml
----------------------------------------------------------------------
diff --git a/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/spring-storage-image-default-context.xml b/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/spring-storage-image-default-context.xml
new file mode 100644
index 0000000..6d3c63c
--- /dev/null
+++ b/plugins/storage/image/default/resources/META-INF/cloudstack/storage-image-default/spring-storage-image-default-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="cloudStackImageStoreProviderImpl"
+        class="org.apache.cloudstack.storage.datastore.provider.CloudStackImageStoreProviderImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/module.properties
----------------------------------------------------------------------
diff --git a/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/module.properties b/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/module.properties
new file mode 100644
index 0000000..e3bc333
--- /dev/null
+++ b/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/module.properties
@@ -0,0 +1,2 @@
+name=storage-image-s3
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/spring-storage-image-s3-context.xml
----------------------------------------------------------------------
diff --git a/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/spring-storage-image-s3-context.xml b/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/spring-storage-image-s3-context.xml
new file mode 100644
index 0000000..6105063
--- /dev/null
+++ b/plugins/storage/image/s3/resources/META-INF/cloudstack/storage-image-s3/spring-storage-image-s3-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="s3ImageStoreProviderImpl"
+        class="org.apache.cloudstack.storage.datastore.provider.S3ImageStoreProviderImpl" />
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/module.properties
----------------------------------------------------------------------
diff --git a/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/module.properties b/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/module.properties
new file mode 100644
index 0000000..c232a63
--- /dev/null
+++ b/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/module.properties
@@ -0,0 +1,2 @@
+name=storage-image-swift
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/spring-storage-image-swift-context.xml
----------------------------------------------------------------------
diff --git a/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/spring-storage-image-swift-context.xml b/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/spring-storage-image-swift-context.xml
new file mode 100644
index 0000000..5e986e8
--- /dev/null
+++ b/plugins/storage/image/swift/resources/META-INF/cloudstack/storage-image-swift/spring-storage-image-swift-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="swiftImageStoreProviderImpl"
+        class="org.apache.cloudstack.storage.datastore.provider.SwiftImageStoreProviderImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/module.properties
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/module.properties b/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/module.properties
new file mode 100644
index 0000000..84405ed
--- /dev/null
+++ b/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/module.properties
@@ -0,0 +1,2 @@
+name=storage-volume-default
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/spring-storage-volume-default-context.xml
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/spring-storage-volume-default-context.xml b/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/spring-storage-volume-default-context.xml
new file mode 100644
index 0000000..8b50455
--- /dev/null
+++ b/plugins/storage/volume/default/resources/META-INF/cloudstack/storage-volume-default/spring-storage-volume-default-context.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="cloudStackPrimaryDataStoreProviderImpl"
+        class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl" />
+
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/module.properties
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/module.properties b/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/module.properties
new file mode 100644
index 0000000..7d3fadc
--- /dev/null
+++ b/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/module.properties
@@ -0,0 +1,2 @@
+name=storage-volume-solidfire
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/spring-storage-volume-solidfire-context.xml
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/spring-storage-volume-solidfire-context.xml b/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/spring-storage-volume-solidfire-context.xml
new file mode 100644
index 0000000..a83e3ca
--- /dev/null
+++ b/plugins/storage/volume/solidfire/resources/META-INF/cloudstack/storage-volume-solidfire/spring-storage-volume-solidfire-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="solidFireDataStoreProvider"
+        class="org.apache.cloudstack.storage.datastore.provider.SolidfirePrimaryDataStoreProvider" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/module.properties
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/module.properties b/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/module.properties
new file mode 100644
index 0000000..b8227ce
--- /dev/null
+++ b/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/module.properties
@@ -0,0 +1,2 @@
+name=ldap
+parent=api
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/spring-ldap-context.xml
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/spring-ldap-context.xml b/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/spring-ldap-context.xml
new file mode 100644
index 0000000..34a2bef
--- /dev/null
+++ b/plugins/user-authenticators/ldap/resources/META-INF/cloudstack/ldap/spring-ldap-context.xml
@@ -0,0 +1,39 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="LdapAuthenticator" class="org.apache.cloudstack.ldap.LdapAuthenticator">
+        <property name="name" value="LDAP" />
+    </bean>
+
+    <bean id="LdapManager" class="org.apache.cloudstack.ldap.LdapManagerImpl" />
+    <bean id="LdapUserManager" class="org.apache.cloudstack.ldap.LdapUserManager" />
+    <bean id="LdapContextFactory" class="org.apache.cloudstack.ldap.LdapContextFactory" />
+    <bean id="LdapConfigurationDao"
+        class="org.apache.cloudstack.ldap.dao.LdapConfigurationDaoImpl" />
+    <bean id="LdapConfiguration" class="org.apache.cloudstack.ldap.LdapConfiguration" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/module.properties
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/module.properties b/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/module.properties
new file mode 100644
index 0000000..97b5b3e
--- /dev/null
+++ b/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/module.properties
@@ -0,0 +1,2 @@
+name=md5
+parent=api
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/spring-md5-context.xml
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/spring-md5-context.xml b/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/spring-md5-context.xml
new file mode 100644
index 0000000..4a8e64d
--- /dev/null
+++ b/plugins/user-authenticators/md5/resources/META-INF/cloudstack/md5/spring-md5-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
+        <property name="name" value="MD5"/>
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/module.properties
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/module.properties b/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/module.properties
new file mode 100644
index 0000000..34a00a4
--- /dev/null
+++ b/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/module.properties
@@ -0,0 +1,2 @@
+name=plaintext
+parent=api
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/spring-plaintext-context.xml
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/spring-plaintext-context.xml b/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/spring-plaintext-context.xml
new file mode 100644
index 0000000..639411a
--- /dev/null
+++ b/plugins/user-authenticators/plain-text/resources/META-INF/cloudstack/plaintext/spring-plaintext-context.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="PlainTextUserAuthenticator" class="com.cloud.server.auth.PlainTextUserAuthenticator">
+        <property name="name" value="PLAINTEXT" />
+    </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/module.properties
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/module.properties b/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/module.properties
new file mode 100644
index 0000000..4431a3d
--- /dev/null
+++ b/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/module.properties
@@ -0,0 +1,2 @@
+name=sha256salted
+parent=api
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/spring-sha256salted-context.xml
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/spring-sha256salted-context.xml b/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/spring-sha256salted-context.xml
new file mode 100644
index 0000000..e379718
--- /dev/null
+++ b/plugins/user-authenticators/sha256salted/resources/META-INF/cloudstack/sha256salted/spring-sha256salted-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="SHA256SaltedUserAuthenticator" class="com.cloud.server.auth.SHA256SaltedUserAuthenticator">
+        <property name="name" value="SHA256SALT"/>
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/quickcloud/pom.xml
----------------------------------------------------------------------
diff --git a/quickcloud/pom.xml b/quickcloud/pom.xml
new file mode 100644
index 0000000..1b9975e
--- /dev/null
+++ b/quickcloud/pom.xml
@@ -0,0 +1,30 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cloud-quickcloud</artifactId>
+  <name>Apache CloudStack Framework - QuickCloud</name>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloud-maven-standard</artifactId>
+    <version>4.3.0-SNAPSHOT</version>
+    <relativePath>../maven-standard/pom.xml</relativePath>
+  </parent>
+</project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/quickcloud/src/main/resources/META-INF/cloudstack/core/spring-quickcloud-core-context-override.xml
----------------------------------------------------------------------
diff --git a/quickcloud/src/main/resources/META-INF/cloudstack/core/spring-quickcloud-core-context-override.xml b/quickcloud/src/main/resources/META-INF/cloudstack/core/spring-quickcloud-core-context-override.xml
new file mode 100644
index 0000000..35e4cbe
--- /dev/null
+++ b/quickcloud/src/main/resources/META-INF/cloudstack/core/spring-quickcloud-core-context-override.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+    <bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.StaticConsoleProxyManager" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
new file mode 100644
index 0000000..11b69d2
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
@@ -0,0 +1,214 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="accountManagerImpl" class="com.cloud.user.AccountManagerImpl">
+        <property name="userAuthenticators"
+            value="#{userAuthenticatorsRegistry.registered}" />
+        <property name="userPasswordEncoders"
+            value="#{userPasswordEncodersRegistry.registered}" />
+        <property name="securityCheckers" value="#{securityCheckersRegistry.registered}" />
+    </bean>
+
+    <bean id="managementServerImpl" class="com.cloud.server.ManagementServerImpl">
+        <property name="userAuthenticators"
+            value="#{userAuthenticatorsRegistry.registered}" />
+        <property name="userPasswordEncoders"
+            value="#{userPasswordEncodersRegistry.registered}" />
+        <property name="hostAllocators" value="#{hostAllocatorsRegistry.registered}" />
+        <property name="affinityGroupProcessors"
+            value="#{affinityProcessorsRegistry.registered}" />
+        <property name="planners"
+            value="#{deploymentPlannersRegistry.registered}" />
+        <property name="storagePoolAllocators"
+            value="#{storagePoolAllocatorsRegistry.registered}" />
+    </bean>
+
+    <bean id="storageManagerImpl" class="com.cloud.storage.StorageManagerImpl" />
+
+    <bean id="resourceManagerImpl" class="com.cloud.resource.ResourceManagerImpl">
+        <property name="discoverers"
+            value="#{resourceDiscoverersRegistry.registered}" />
+    </bean>
+
+    <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl">
+        <property name="investigators" value="#{haInvestigatorsRegistry.registered}" />
+        <property name="fenceBuilders" value="#{haFenceBuildersRegistry.registered}" />
+    </bean>
+
+    <bean id="ipAddressManagerImpl" class="com.cloud.network.IpAddressManagerImpl">
+    </bean>
+
+    <bean id="networkModelImpl" class="com.cloud.network.NetworkModelImpl">
+        <property name="networkElements" value="#{networkElementsRegistry.registered}" />
+    </bean>
+
+    <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
+
+    <bean id="userVmManagerImpl" class="com.cloud.vm.UserVmManagerImpl" />
+
+    <bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.ConsoleProxyManagerImpl">
+        <property name="consoleProxyAllocators"
+            value="#{consoleProxyAllocatorsRegistry.registered}" />
+    </bean>
+
+    <bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
+
+    <bean id="premiumSecondaryStorageManagerImpl"
+        class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl">
+        <property name="secondaryStorageVmAllocators"
+            value="#{secondaryStorageVmAllocatorsRegistry.registered}" />
+    </bean>
+
+    <bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
+
+
+    <bean id="alertManagerImpl" class="com.cloud.alert.AlertManagerImpl" />
+
+    <bean id="autoScaleManagerImpl" class="com.cloud.network.as.AutoScaleManagerImpl" />
+
+    <bean id="capacityManagerImpl" class="com.cloud.capacity.CapacityManagerImpl" />
+
+    <bean id="configurationManagerImpl" class="com.cloud.configuration.ConfigurationManagerImpl" >  
+        <property name="secChecker" value="#{securityCheckersRegistry.registered}" />
+    </bean>
+
+    <bean id="externalDeviceUsageManagerImpl" class="com.cloud.network.ExternalDeviceUsageManagerImpl" />
+
+    <bean id="externalNetworkDeviceManagerImpl" class="com.cloud.network.ExternalNetworkDeviceManagerImpl" />
+
+    <bean id="firewallManagerImpl" class="com.cloud.network.firewall.FirewallManagerImpl" />
+
+    <bean id="hypervisorGuruManagerImpl" class="com.cloud.hypervisor.HypervisorGuruManagerImpl" >
+        <property name="hvGuruList" value="#{hypervisorGurusRegistry.registered}" />
+    </bean>
+
+    <bean id="identityServiceImpl" class="com.cloud.uuididentity.IdentityServiceImpl" />
+
+    <bean id="keystoreManagerImpl" class="com.cloud.keystore.KeystoreManagerImpl" />
+
+    <bean id="loadBalancingRulesManagerImpl" class="com.cloud.network.lb.LoadBalancingRulesManagerImpl" />
+
+    <bean id="networkACLManagerImpl" class="com.cloud.network.vpc.NetworkACLManagerImpl" />
+
+    <bean id="networkACLServiceImpl" class="com.cloud.network.vpc.NetworkACLServiceImpl" />
+
+    <bean id="networkServiceImpl" class="com.cloud.network.NetworkServiceImpl" >
+        <property name="networkGurus" value="#{networkGurusRegistry.registered}" />
+    </bean>
+
+    <bean id="networkUsageManagerImpl" class="com.cloud.network.NetworkUsageManagerImpl" />
+
+    <bean id="oCFS2ManagerImpl" class="com.cloud.storage.OCFS2ManagerImpl" />
+
+    <bean id="projectManagerImpl" class="com.cloud.projects.ProjectManagerImpl" />
+
+    <bean id="queryManagerImpl" class="com.cloud.api.query.QueryManagerImpl" />
+
+    <bean id="regionManagerImpl" class="org.apache.cloudstack.region.RegionManagerImpl" />
+
+    <bean id="regionServiceImpl" class="org.apache.cloudstack.region.RegionServiceImpl" />
+
+    <bean id="remoteAccessVpnManagerImpl" class="com.cloud.network.vpn.RemoteAccessVpnManagerImpl" />
+
+    <bean id="resourceLimitManagerImpl" class="com.cloud.resourcelimit.ResourceLimitManagerImpl" />
+
+    <bean id="rulesManagerImpl" class="com.cloud.network.rules.RulesManagerImpl" />
+
+    <bean id="site2SiteVpnManagerImpl" class="com.cloud.network.vpn.Site2SiteVpnManagerImpl" />
+
+    <bean id="snapshotManagerImpl" class="com.cloud.storage.snapshot.SnapshotManagerImpl" />
+
+    <bean id="snapshotSchedulerImpl" class="com.cloud.storage.snapshot.SnapshotSchedulerImpl" />
+    <bean id="storageNetworkManagerImpl" class="com.cloud.network.StorageNetworkManagerImpl" />
+    <bean id="taggedResourceManagerImpl" class="com.cloud.tags.TaggedResourceManagerImpl" />
+    <bean id="resourceMetaDataManagerImpl" class="com.cloud.metadata.ResourceMetaDataManagerImpl" />
+
+    <bean id="templateManagerImpl" class="com.cloud.template.TemplateManagerImpl">
+        <property name="templateAdapters" value="#{templateAdapterRegistry.registered}" />
+    </bean>
+
+    <bean id="uploadMonitorImpl" class="com.cloud.storage.upload.UploadMonitorImpl" />
+    <bean id="usageServiceImpl" class="com.cloud.usage.UsageServiceImpl" />
+    <bean id="virtualNetworkApplianceManagerImpl"
+        class="com.cloud.network.router.VirtualNetworkApplianceManagerImpl" />
+    <bean id="vpcManagerImpl" class="com.cloud.network.vpc.VpcManagerImpl" >
+        <property name="vpcElements" value="#{vpcProvidersRegistry.registered}"></property>
+    </bean>
+    <bean id="vpcVirtualNetworkApplianceManagerImpl"
+        class="com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl" />
+
+
+    <bean id="ApiAsyncJobDispatcher" class="com.cloud.api.ApiAsyncJobDispatcher">
+        <property name="name" value="ApiAsyncJobDispatcher" />
+    </bean>
+
+
+    <bean id="statsCollector" class="com.cloud.server.StatsCollector" />
+
+    <bean id="storagePoolAutomationImpl" class="com.cloud.storage.StoragePoolAutomationImpl" />
+
+    <bean id="domainManagerImpl" class="com.cloud.user.DomainManagerImpl" />
+
+    <bean id="downloadMonitorImpl" class="com.cloud.storage.download.DownloadMonitorImpl" />
+  
+    <bean id="lBHealthCheckManagerImpl" class="com.cloud.network.lb.LBHealthCheckManagerImpl" />
+
+    <bean id="volumeApiServiceImpl" class="com.cloud.storage.VolumeApiServiceImpl">
+        <property name="storagePoolAllocators"
+            value="#{storagePoolAllocatorsRegistry.registered}" />
+    </bean>
+    
+    <bean id="ApplicationLoadBalancerService" class="org.apache.cloudstack.network.lb.ApplicationLoadBalancerManagerImpl" />
+
+    <bean id="vMSnapshotManagerImpl" class="com.cloud.vm.snapshot.VMSnapshotManagerImpl" />
+
+    <bean id="AffinityGroupServiceImpl"
+        class="org.apache.cloudstack.affinity.AffinityGroupServiceImpl">
+        <property name="affinityGroupProcessors"
+            value="#{affinityProcessorsRegistry.registered}" />
+    </bean>
+
+    <bean id="DeploymentPlanningManager" class="com.cloud.deploy.DeploymentPlanningManagerImpl">
+        <property name="planners"
+            value="#{deploymentPlannersRegistry.registered}" />
+        <property name="affinityGroupProcessors"
+            value="#{affinityProcessorsRegistry.registered}" />
+        <property name="storagePoolAllocators"
+            value="#{storagePoolAllocatorsRegistry.registered}" />
+        <property name="hostAllocators" value="#{hostAllocatorsRegistry.registered}" />
+    </bean>
+
+    <bean id="AffinityGroupJoinDaoImpl" class="com.cloud.api.query.dao.AffinityGroupJoinDaoImpl" />
+
+    <bean id="PlannerHostReservationDaoImpl" class="com.cloud.deploy.dao.PlannerHostReservationDaoImpl" />
+
+    <bean id="GlobalLoadBalancingRulesServiceImpl"
+        class="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/core/spring-server-core-misc-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/core/spring-server-core-misc-context.xml b/server/resources/META-INF/cloudstack/core/spring-server-core-misc-context.xml
new file mode 100644
index 0000000..fd2f5fb
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/core/spring-server-core-misc-context.xml
@@ -0,0 +1,68 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+
+    <bean id="basicAgentAuthManager"
+        class="com.cloud.agent.manager.authn.impl.BasicAgentAuthManager">
+        <property name="name" value="BASIC" />
+    </bean>
+
+    <bean id="VpcVirtualRouter" class="com.cloud.network.element.VpcVirtualRouterElement">
+        <property name="name" value="VpcVirtualRouter" />
+    </bean>
+
+    <bean id="actionEventUtils" class="com.cloud.event.ActionEventUtils" />
+    <bean id="alertGenerator" class="com.cloud.event.AlertGenerator" />
+
+    <bean id="apiDBUtils" class="com.cloud.api.ApiDBUtils" />
+
+    <bean id="apiDiscoveryServiceImpl"
+        class="org.apache.cloudstack.discovery.ApiDiscoveryServiceImpl">
+        <property name="apiAccessCheckers" value="#{apiCheckersRegistry.registered}" />
+        <property name="services" value="#{apiCommandsRegistry.registered}" />
+    </bean>
+
+    <bean id="apiDispatcher" class="com.cloud.api.ApiDispatcher" />
+
+    <bean id="apiResponseHelper" class="com.cloud.api.ApiResponseHelper" />
+
+    <bean id="apiServer" class="com.cloud.api.ApiServer">
+        <property name="apiAccessCheckers" value="#{apiCheckersRegistry.registered}" />
+        <property name="pluggableServices" value="#{apiCommandsRegistry.registered}" />
+    </bean>
+
+    <bean id="cloudZonesStartupProcessor" class="com.cloud.hypervisor.CloudZonesStartupProcessor" />
+    
+    <bean id="managementServerNode" class="org.apache.cloudstack.utils.identity.ManagementServerNode" />
+
+    <bean id="ExternalIpAddressAllocator" class="com.cloud.network.ExternalIpAddressAllocator">
+        <property name="name" value="Basic" />
+    </bean>
+    
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-alert-adapter-backend/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-alert-adapter-backend/module.properties b/server/resources/META-INF/cloudstack/server-alert-adapter-backend/module.properties
new file mode 100644
index 0000000..37176f9
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-alert-adapter-backend/module.properties
@@ -0,0 +1,2 @@
+name=server-alert-adapter-backend
+parent=backend
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-alert-adapter-backend/spring-server-alert-adapter-backend-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-alert-adapter-backend/spring-server-alert-adapter-backend-context.xml b/server/resources/META-INF/cloudstack/server-alert-adapter-backend/spring-server-alert-adapter-backend-context.xml
new file mode 100644
index 0000000..f7670e5
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-alert-adapter-backend/spring-server-alert-adapter-backend-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="clusterAlertAdapter" class="com.cloud.alert.ClusterAlertAdapter" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-alert-adapter-compute/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-alert-adapter-compute/module.properties b/server/resources/META-INF/cloudstack/server-alert-adapter-compute/module.properties
new file mode 100644
index 0000000..ae39622
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-alert-adapter-compute/module.properties
@@ -0,0 +1,2 @@
+name=server-alert-adapter-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-alert-adapter-compute/spring-server-alert-adapter-compute-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-alert-adapter-compute/spring-server-alert-adapter-compute-context.xml b/server/resources/META-INF/cloudstack/server-alert-adapter-compute/spring-server-alert-adapter-compute-context.xml
new file mode 100644
index 0000000..e918ce0
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-alert-adapter-compute/spring-server-alert-adapter-compute-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="consoleProxyAlertAdapter" class="com.cloud.alert.ConsoleProxyAlertAdapter" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-alert-adapter-storage/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-alert-adapter-storage/module.properties b/server/resources/META-INF/cloudstack/server-alert-adapter-storage/module.properties
new file mode 100644
index 0000000..1175d81
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-alert-adapter-storage/module.properties
@@ -0,0 +1,2 @@
+name=server-alert-adapter-storage
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-alert-adapter-storage/spring-server-alert-adapter-storage-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-alert-adapter-storage/spring-server-alert-adapter-storage-context.xml b/server/resources/META-INF/cloudstack/server-alert-adapter-storage/spring-server-alert-adapter-storage-context.xml
new file mode 100644
index 0000000..713d9e3
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-alert-adapter-storage/spring-server-alert-adapter-storage-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="secondaryStorageVmAlertAdapter" class="com.cloud.alert.SecondaryStorageVmAlertAdapter" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-allocator/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-allocator/module.properties b/server/resources/META-INF/cloudstack/server-allocator/module.properties
new file mode 100644
index 0000000..11a66de
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-allocator/module.properties
@@ -0,0 +1,2 @@
+name=server-allocator
+parent=allocator
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-allocator/spring-server-allocator-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-allocator/spring-server-allocator-context.xml b/server/resources/META-INF/cloudstack/server-allocator/spring-server-allocator-context.xml
new file mode 100644
index 0000000..cc2924e
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-allocator/spring-server-allocator-context.xml
@@ -0,0 +1,48 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
+        <property name="name" value="Balance" />
+    </bean>
+
+    <bean id="firstFitAllocator"
+        class="com.cloud.agent.manager.allocator.impl.FirstFitAllocator" />
+
+    <bean id="FirstFitRouting"
+        class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
+        <property name="name" value="FirstFitRouting" />
+    </bean>
+
+    <bean id="recreateHostAllocator"
+        class="com.cloud.agent.manager.allocator.impl.RecreateHostAllocator" />
+
+    <bean id="testingAllocator"
+        class="com.cloud.agent.manager.allocator.impl.TestingAllocator" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-api/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-api/module.properties b/server/resources/META-INF/cloudstack/server-api/module.properties
new file mode 100644
index 0000000..202dd5d
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-api/module.properties
@@ -0,0 +1,2 @@
+name=server-api
+parent=api
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-api/spring-server-api-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-api/spring-server-api-context.xml b/server/resources/META-INF/cloudstack/server-api/spring-server-api-context.xml
new file mode 100644
index 0000000..20e2f46
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-api/spring-server-api-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="domainChecker" class="com.cloud.acl.DomainChecker" />
+    <bean id="affinityGroupAccessChecker" class="com.cloud.acl.AffinityGroupAccessChecker" />
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-compute/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-compute/module.properties b/server/resources/META-INF/cloudstack/server-compute/module.properties
new file mode 100644
index 0000000..6d6737a
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-compute/module.properties
@@ -0,0 +1,2 @@
+name=server-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml b/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
new file mode 100644
index 0000000..1311902
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-compute/spring-server-compute-context.xml
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="KVMGuru" class="com.cloud.hypervisor.KVMGuru">
+        <property name="name" value="KVMGuru" />
+    </bean>
+
+    <bean id="LXCGuru" class="com.cloud.hypervisor.LXCGuru">
+        <property name="name" value="LXCGuru" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-discoverer/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-discoverer/module.properties b/server/resources/META-INF/cloudstack/server-discoverer/module.properties
new file mode 100644
index 0000000..5f39c76
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-discoverer/module.properties
@@ -0,0 +1,2 @@
+name=server-discoverer
+parent=discoverer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml b/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
new file mode 100644
index 0000000..90666d1
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-discoverer/spring-server-discoverer-context.xml
@@ -0,0 +1,45 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+
+    <bean id="KvmServerDiscoverer"
+        class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
+        <property name="name" value="KVM Agent" />
+    </bean>
+
+    <bean id="LxcServerDiscoverer"
+        class="com.cloud.hypervisor.kvm.discoverer.LxcServerDiscoverer">
+        <property name="name" value="Lxc Discover" />
+    </bean>
+
+    <bean id="dummyHostDiscoverer" class="com.cloud.resource.DummyHostDiscoverer">
+        <property name="name" value="dummyHostDiscoverer" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-fencer/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-fencer/module.properties b/server/resources/META-INF/cloudstack/server-fencer/module.properties
new file mode 100644
index 0000000..547d855
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-fencer/module.properties
@@ -0,0 +1,2 @@
+name=server-fencer
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-fencer/spring-server-fencer-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-fencer/spring-server-fencer-context.xml b/server/resources/META-INF/cloudstack/server-fencer/spring-server-fencer-context.xml
new file mode 100644
index 0000000..3312d5f
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-fencer/spring-server-fencer-context.xml
@@ -0,0 +1,37 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+  
+    <bean id="recreatableFencer" class="com.cloud.ha.RecreatableFencer" />
+
+    <bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
+        <property name="name" value="KVMFenceBuilder" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-investigator/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-investigator/module.properties b/server/resources/META-INF/cloudstack/server-investigator/module.properties
new file mode 100644
index 0000000..0752ecb
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-investigator/module.properties
@@ -0,0 +1,2 @@
+name=server-investigator
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-investigator/spring-server-investigator-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-investigator/spring-server-investigator-context.xml b/server/resources/META-INF/cloudstack/server-investigator/spring-server-investigator-context.xml
new file mode 100644
index 0000000..24e6e33
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-investigator/spring-server-investigator-context.xml
@@ -0,0 +1,46 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
+        <property name="name" value="SimpleInvestigator" />
+    </bean>
+
+    <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
+        <property name="name" value="PingInvestigator" />
+    </bean>
+
+    <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
+        <property name="name" value="XenServerInvestigator" />
+    </bean>
+
+    <bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
+        <property name="name" value="ManagementIPSysVMInvestigator" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/server/resources/META-INF/cloudstack/server-network/module.properties
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/server-network/module.properties b/server/resources/META-INF/cloudstack/server-network/module.properties
new file mode 100644
index 0000000..eb5f750
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/server-network/module.properties
@@ -0,0 +1,2 @@
+name=server-network
+parent=network
\ No newline at end of file


[6/9] Spring Modularization

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
----------------------------------------------------------------------
diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
new file mode 100644
index 0000000..cc5af3f
--- /dev/null
+++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
@@ -0,0 +1,321 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+  <!--
+    DAO with customized configuration
+  -->
+  <bean id="serviceOfferingDaoImpl" class="com.cloud.service.dao.ServiceOfferingDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="50" />
+        <entry key="cache.time.to.live" value="600" />
+      </map>
+    </property>  
+  </bean>
+
+  <bean id="diskOfferingDaoImpl" class="com.cloud.storage.dao.DiskOfferingDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="50" />
+        <entry key="cache.time.to.live" value="600" />
+      </map>
+    </property>  
+  </bean>
+
+  <bean id="dataCenterDaoImpl" class="com.cloud.dc.dao.DataCenterDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="50" />
+        <entry key="cache.time.to.live" value="600" />
+      </map>
+    </property>  
+  </bean>
+
+  <bean id="hostPodDaoImpl" class="com.cloud.dc.dao.HostPodDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="50" />
+        <entry key="cache.time.to.live" value="600" />
+      </map>
+    </property>  
+  </bean>
+
+  <bean id="vlanDaoImpl" class="com.cloud.dc.dao.VlanDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="30" />
+        <entry key="cache.time.to.live" value="3600" />
+      </map>
+    </property>  
+  </bean>
+
+  <bean id="userDaoImpl" class="com.cloud.user.dao.UserDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="5000" />
+        <entry key="cache.time.to.live" value="300" />
+      </map>
+    </property>  
+  </bean>
+
+  <bean id="VMTemplateDaoImpl" class="com.cloud.storage.dao.VMTemplateDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="100" />
+        <entry key="cache.time.to.live" value="600" />
+      </map>
+    </property>  
+  </bean>
+
+  <bean id="hypervisorCapabilitiesDaoImpl" class="com.cloud.hypervisor.dao.HypervisorCapabilitiesDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="100" />
+        <entry key="cache.time.to.live" value="600" />
+      </map>
+    </property>  
+  </bean>
+  <bean id="dedicatedResourceDaoImpl" class="com.cloud.dc.dao.DedicatedResourceDaoImpl">
+    <property name="configParams">
+      <map>
+        <entry key="cache.size" value="30" />
+        <entry key="cache.time.to.live" value="3600" />
+      </map>
+    </property>
+  </bean>
+  
+  <!--
+    DAOs with default configuration
+  -->
+  <bean id="accountDaoImpl" class="com.cloud.user.dao.AccountDaoImpl" />
+  <bean id="accountDetailsDaoImpl" class="com.cloud.user.AccountDetailsDaoImpl" />
+  <bean id="accountJoinDaoImpl" class="com.cloud.api.query.dao.AccountJoinDaoImpl" />
+  <bean id="accountGuestVlanMapDaoImpl" class="com.cloud.network.dao.AccountGuestVlanMapDaoImpl" />
+  <bean id="accountVlanMapDaoImpl" class="com.cloud.dc.dao.AccountVlanMapDaoImpl" />
+  <bean id="alertDaoImpl" class="com.cloud.alert.dao.AlertDaoImpl" />
+  <bean id="asyncJobJoinDaoImpl" class="com.cloud.api.query.dao.AsyncJobJoinDaoImpl" />
+  <bean id="autoScalePolicyConditionMapDaoImpl" class="com.cloud.network.as.dao.AutoScalePolicyConditionMapDaoImpl" />
+  <bean id="autoScalePolicyDaoImpl" class="com.cloud.network.as.dao.AutoScalePolicyDaoImpl" />
+  <bean id="autoScaleVmGroupDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmGroupDaoImpl" />
+  <bean id="autoScaleVmGroupPolicyMapDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmGroupPolicyMapDaoImpl" />
+  <bean id="autoScaleVmProfileDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmProfileDaoImpl" />
+  <bean id="capacityDaoImpl" class="com.cloud.capacity.dao.CapacityDaoImpl" />
+  <bean id="certificateDaoImpl" class="com.cloud.certificate.dao.CertificateDaoImpl" />
+  <bean id="clusterDaoImpl" class="com.cloud.dc.dao.ClusterDaoImpl" />
+  <bean id="clusterDetailsDaoImpl" class="com.cloud.dc.ClusterDetailsDaoImpl" />
+  <bean id="clusterVSMMapDaoImpl" class="com.cloud.dc.dao.ClusterVSMMapDaoImpl" />
+  <bean id="commandExecLogDaoImpl" class="com.cloud.secstorage.CommandExecLogDaoImpl" />
+  <bean id="conditionDaoImpl" class="com.cloud.network.as.dao.ConditionDaoImpl" />
+  <bean id="consoleProxyDaoImpl" class="com.cloud.vm.dao.ConsoleProxyDaoImpl" />
+  <bean id="counterDaoImpl" class="com.cloud.network.as.dao.CounterDaoImpl" />
+  <bean id="dataCenterIpAddressDaoImpl" class="com.cloud.dc.dao.DataCenterIpAddressDaoImpl" />
+  <bean id="dataCenterJoinDaoImpl" class="com.cloud.api.query.dao.DataCenterJoinDaoImpl" />
+  <bean id="dataCenterLinkLocalIpAddressDaoImpl" class="com.cloud.dc.dao.DataCenterLinkLocalIpAddressDaoImpl" />
+  <bean id="dataCenterVnetDaoImpl" class="com.cloud.dc.dao.DataCenterVnetDaoImpl" />
+  <bean id="dcDetailsDaoImpl" class="com.cloud.dc.dao.DcDetailsDaoImpl" />
+  <bean id="engineDcDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.DcDetailsDaoImpl" />
+  <bean id="diskOfferingJoinDaoImpl" class="com.cloud.api.query.dao.DiskOfferingJoinDaoImpl" />
+  <bean id="domainDaoImpl" class="com.cloud.domain.dao.DomainDaoImpl" />
+  <bean id="domainRouterDaoImpl" class="com.cloud.vm.dao.DomainRouterDaoImpl" />
+  <bean id="domainRouterJoinDaoImpl" class="com.cloud.api.query.dao.DomainRouterJoinDaoImpl" />
+  <bean id="engineClusterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDaoImpl" />
+  <bean id="engineDataCenterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDaoImpl" />
+  <bean id="engineHostDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDaoImpl" />
+  <bean id="engineHostPodDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDaoImpl" />
+  <bean id="eventDaoImpl" class="com.cloud.event.dao.EventDaoImpl" />
+  <bean id="eventJoinDaoImpl" class="com.cloud.event.dao.EventJoinDaoImpl" />
+  <bean id="externalFirewallDeviceDaoImpl" class="com.cloud.network.dao.ExternalFirewallDeviceDaoImpl" />
+  <bean id="externalLoadBalancerDeviceDaoImpl" class="com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl" />
+  <bean id="externalPublicIpStatisticsDaoImpl" class="com.cloud.usage.dao.ExternalPublicIpStatisticsDaoImpl" />
+  <bean id="firewallRulesCidrsDaoImpl" class="com.cloud.network.dao.FirewallRulesCidrsDaoImpl" />
+  <bean id="firewallRulesDaoImpl" class="com.cloud.network.dao.FirewallRulesDaoImpl" />
+  <bean id="globalLoadBalancerDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerDaoImpl" />
+  <bean id="globalLoadBalancerLbRuleMapDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerLbRuleMapDaoImpl" />
+  <bean id="guestOSCategoryDaoImpl" class="com.cloud.storage.dao.GuestOSCategoryDaoImpl" />
+  <bean id="guestOSDaoImpl" class="com.cloud.storage.dao.GuestOSDaoImpl" />
+  <bean id="guestOSHypervisorDaoImpl" class="com.cloud.storage.dao.GuestOSHypervisorDaoImpl" />
+  <bean id="highAvailabilityDaoImpl" class="com.cloud.ha.dao.HighAvailabilityDaoImpl" />
+  <bean id="hostDaoImpl" class="com.cloud.host.dao.HostDaoImpl" />
+  <bean id="engineHostDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostDetailsDaoImpl" />
+  <bean id="hostDetailsDaoImpl" class="com.cloud.host.dao.HostDetailsDaoImpl" />
+  <bean id="hostJoinDaoImpl" class="com.cloud.api.query.dao.HostJoinDaoImpl" />
+  <bean id="engineHostTagsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostTagsDaoImpl" />
+  <bean id="hostTagsDaoImpl" class="com.cloud.host.dao.HostTagsDaoImpl" />
+  <bean id="hostTransferMapDaoImpl" class="com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl" />
+  <bean id="iPAddressDaoImpl" class="com.cloud.network.dao.IPAddressDaoImpl" />
+  <bean id="identityDaoImpl" class="com.cloud.uuididentity.dao.IdentityDaoImpl" />
+  <bean id="imageStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageStoreDaoImpl" />
+  <bean id="imageStoreDetailsDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageStoreDetailsDaoImpl" /> 
+  <bean id="imageStoreJoinDaoImpl" class="com.cloud.api.query.dao.ImageStoreJoinDaoImpl" />   
+  <bean id="snapshotDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.SnapshotDataStoreDaoImpl" /> 
+  <bean id="templateDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.TemplateDataStoreDaoImpl" /> 
+  <bean id="templateJoinDaoImpl" class="com.cloud.api.query.dao.TemplateJoinDaoImpl" />
+  <bean id="volumeDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.VolumeDataStoreDaoImpl" />   
+  <bean id="inlineLoadBalancerNicMapDaoImpl" class="com.cloud.network.dao.InlineLoadBalancerNicMapDaoImpl" />
+  <bean id="instanceGroupDaoImpl" class="com.cloud.vm.dao.InstanceGroupDaoImpl" />
+  <bean id="instanceGroupJoinDaoImpl" class="com.cloud.api.query.dao.InstanceGroupJoinDaoImpl" />
+  <bean id="instanceGroupVMMapDaoImpl" class="com.cloud.vm.dao.InstanceGroupVMMapDaoImpl" />
+  <bean id="itWorkDaoImpl" class="com.cloud.vm.ItWorkDaoImpl" />
+  <bean id="keystoreDaoImpl" class="com.cloud.keystore.KeystoreDaoImpl" />
+  <bean id="lBHealthCheckPolicyDaoImpl" class="com.cloud.network.dao.LBHealthCheckPolicyDaoImpl" />
+  <bean id="lBStickinessPolicyDaoImpl" class="com.cloud.network.dao.LBStickinessPolicyDaoImpl" />
+  <bean id="launchPermissionDaoImpl" class="com.cloud.storage.dao.LaunchPermissionDaoImpl" />
+  <bean id="loadBalancerDaoImpl" class="com.cloud.network.dao.LoadBalancerDaoImpl" />
+  <bean id="loadBalancerVMMapDaoImpl" class="com.cloud.network.dao.LoadBalancerVMMapDaoImpl" />
+  <bean id="managementServerHostDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostDaoImpl" />
+  <bean id="managementServerHostPeerDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostPeerDaoImpl" />
+  <bean id="networkAccountDaoImpl" class="com.cloud.network.dao.NetworkAccountDaoImpl" />
+  <bean id="networkACLDaoImpl" class="com.cloud.network.vpc.dao.NetworkACLDaoImpl" />
+  <bean id="networkACLItemDaoImpl" class="com.cloud.network.vpc.dao.NetworkACLItemDaoImpl" />
+  <bean id="networkDaoImpl" class="com.cloud.network.dao.NetworkDaoImpl" />
+  <bean id="networkDomainDaoImpl" class="com.cloud.network.dao.NetworkDomainDaoImpl" />
+  <bean id="networkExternalFirewallDaoImpl" class="com.cloud.network.dao.NetworkExternalFirewallDaoImpl" />
+  <bean id="networkExternalLoadBalancerDaoImpl" class="com.cloud.network.dao.NetworkExternalLoadBalancerDaoImpl" />
+  <bean id="networkOfferingDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingDaoImpl" />
+  <bean id="networkOfferingServiceMapDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingServiceMapDaoImpl" />
+  <bean id="networkOpDaoImpl" class="com.cloud.network.dao.NetworkOpDaoImpl" />
+  <bean id="networkRuleConfigDaoImpl" class="com.cloud.network.dao.NetworkRuleConfigDaoImpl" />
+  <bean id="networkServiceMapDaoImpl" class="com.cloud.network.dao.NetworkServiceMapDaoImpl" />
+  <bean id="nicDaoImpl" class="com.cloud.vm.dao.NicDaoImpl" />
+  <bean id="nicDetailDaoImpl" class="com.cloud.vm.dao.NicDetailDaoImpl" />
+  <bean id="nicSecondaryIpDaoImpl" class="com.cloud.vm.dao.NicSecondaryIpDaoImpl" />
+  <bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
+  <bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
+  <bean id="ovsTunnelInterfaceDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl" />
+  <bean id="ovsTunnelNetworkDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl" />
+  <bean id="physicalNetworkDaoImpl" class="com.cloud.network.dao.PhysicalNetworkDaoImpl" />
+  <bean id="physicalNetworkIsolationMethodDaoImpl" class="com.cloud.network.dao.PhysicalNetworkIsolationMethodDaoImpl" />
+  <bean id="physicalNetworkServiceProviderDaoImpl" class="com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl" />
+  <bean id="physicalNetworkTagDaoImpl" class="com.cloud.network.dao.PhysicalNetworkTagDaoImpl" />
+  <bean id="physicalNetworkTrafficTypeDaoImpl" class="com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl" />
+  <bean id="podVlanDaoImpl" class="com.cloud.dc.dao.PodVlanDaoImpl" />
+  <bean id="podVlanMapDaoImpl" class="com.cloud.dc.dao.PodVlanMapDaoImpl" />
+  <bean id="PortableIpDaoImpl" class="org.apache.cloudstack.region.PortableIpDaoImpl" />
+  <bean id="PortableIpRangeDaoImpl" class="org.apache.cloudstack.region.PortableIpRangeDaoImpl" />
+  <bean id="portForwardingRulesDaoImpl" class="com.cloud.network.rules.dao.PortForwardingRulesDaoImpl" />
+  <bean id="portProfileDaoImpl" class="com.cloud.network.dao.PortProfileDaoImpl" />
+  <bean id="primaryDataStoreDaoImpl" class="org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDaoImpl" />
+  <bean id="primaryDataStoreDetailsDaoImpl" class="org.apache.cloudstack.storage.volume.db.PrimaryDataStoreDetailsDaoImpl" />
+  <bean id="privateIpDaoImpl" class="com.cloud.network.vpc.dao.PrivateIpDaoImpl" />
+  <bean id="projectAccountDaoImpl" class="com.cloud.projects.dao.ProjectAccountDaoImpl" />
+  <bean id="projectAccountJoinDaoImpl" class="com.cloud.api.query.dao.ProjectAccountJoinDaoImpl" />
+  <bean id="projectDaoImpl" class="com.cloud.projects.dao.ProjectDaoImpl" />
+  <bean id="projectInvitationDaoImpl" class="com.cloud.projects.dao.ProjectInvitationDaoImpl" />
+  <bean id="projectInvitationJoinDaoImpl" class="com.cloud.api.query.dao.ProjectInvitationJoinDaoImpl" />
+  <bean id="projectJoinDaoImpl" class="com.cloud.api.query.dao.ProjectJoinDaoImpl" />
+  <bean id="regionDaoImpl" class="org.apache.cloudstack.region.dao.RegionDaoImpl" />
+  <bean id="remoteAccessVpnDaoImpl" class="com.cloud.network.dao.RemoteAccessVpnDaoImpl" />
+  <bean id="resourceCountDaoImpl" class="com.cloud.configuration.dao.ResourceCountDaoImpl" />
+  <bean id="resourceLimitDaoImpl" class="com.cloud.configuration.dao.ResourceLimitDaoImpl" />
+  <bean id="resourceTagJoinDaoImpl" class="com.cloud.api.query.dao.ResourceTagJoinDaoImpl" />
+  <bean id="resourceTagsDaoImpl" class="com.cloud.tags.dao.ResourceTagsDaoImpl" />
+  <bean id="routerNetworkDaoImpl" class="com.cloud.network.dao.RouterNetworkDaoImpl" />
+  <bean id="sSHKeyPairDaoImpl" class="com.cloud.user.dao.SSHKeyPairDaoImpl" />
+  <bean id="secondaryStorageVmDaoImpl" class="com.cloud.vm.dao.SecondaryStorageVmDaoImpl" />
+  <bean id="securityGroupDaoImpl" class="com.cloud.network.security.dao.SecurityGroupDaoImpl" />
+  <bean id="securityGroupJoinDaoImpl" class="com.cloud.api.query.dao.SecurityGroupJoinDaoImpl" />
+  <bean id="securityGroupRuleDaoImpl" class="com.cloud.network.security.dao.SecurityGroupRuleDaoImpl" />
+  <bean id="securityGroupRulesDaoImpl" class="com.cloud.network.security.dao.SecurityGroupRulesDaoImpl" />
+  <bean id="securityGroupVMMapDaoImpl" class="com.cloud.network.security.dao.SecurityGroupVMMapDaoImpl" />
+  <bean id="securityGroupWorkDaoImpl" class="com.cloud.network.security.dao.SecurityGroupWorkDaoImpl" />
+  <bean id="serviceOfferingJoinDaoImpl" class="com.cloud.api.query.dao.ServiceOfferingJoinDaoImpl" />
+  <bean id="site2SiteCustomerGatewayDaoImpl" class="com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl" />
+  <bean id="site2SiteVpnConnectionDaoImpl" class="com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl" />
+  <bean id="site2SiteVpnGatewayDaoImpl" class="com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl" />
+  <bean id="snapshotDaoImpl" class="com.cloud.storage.dao.SnapshotDaoImpl" />
+  <bean id="snapshotPolicyDaoImpl" class="com.cloud.storage.dao.SnapshotPolicyDaoImpl" />
+  <bean id="snapshotScheduleDaoImpl" class="com.cloud.storage.dao.SnapshotScheduleDaoImpl" />
+  <bean id="staticRouteDaoImpl" class="com.cloud.network.vpc.dao.StaticRouteDaoImpl" />
+  <bean id="storageNetworkIpAddressDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpAddressDaoImpl" />
+  <bean id="storageNetworkIpRangeDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpRangeDaoImpl" />
+  <bean id="storagePoolDetailsDaoImpl" class="com.cloud.storage.dao.StoragePoolDetailsDaoImpl" />
+  <bean id="storagePoolHostDaoImpl" class="com.cloud.storage.dao.StoragePoolHostDaoImpl" />
+  <bean id="storagePoolJoinDaoImpl" class="com.cloud.api.query.dao.StoragePoolJoinDaoImpl" />
+  <bean id="storagePoolWorkDaoImpl" class="com.cloud.storage.dao.StoragePoolWorkDaoImpl" />
+  <bean id="templatePrimaryDataStoreDaoImpl" class="org.apache.cloudstack.storage.volume.db.TemplatePrimaryDataStoreDaoImpl" />
+  <bean id="uploadDaoImpl" class="com.cloud.storage.dao.UploadDaoImpl" />
+  <bean id="usageDaoImpl" class="com.cloud.usage.dao.UsageDaoImpl" />
+  <bean id="usageEventDaoImpl" class="com.cloud.event.dao.UsageEventDaoImpl" />
+  <bean id="usageIPAddressDaoImpl" class="com.cloud.usage.dao.UsageIPAddressDaoImpl" />
+  <bean id="usageJobDaoImpl" class="com.cloud.usage.dao.UsageJobDaoImpl" />
+  <bean id="usageLoadBalancerPolicyDaoImpl" class="com.cloud.usage.dao.UsageLoadBalancerPolicyDaoImpl" />
+  <bean id="usageNetworkDaoImpl" class="com.cloud.usage.dao.UsageNetworkDaoImpl" />
+  <bean id="usageNetworkOfferingDaoImpl" class="com.cloud.usage.dao.UsageNetworkOfferingDaoImpl" />
+  <bean id="usagePortForwardingRuleDaoImpl" class="com.cloud.usage.dao.UsagePortForwardingRuleDaoImpl" />
+  <bean id="usageSecurityGroupDaoImpl" class="com.cloud.usage.dao.UsageSecurityGroupDaoImpl" />
+  <bean id="usageStorageDaoImpl" class="com.cloud.usage.dao.UsageStorageDaoImpl" />
+  <bean id="usageVMInstanceDaoImpl" class="com.cloud.usage.dao.UsageVMInstanceDaoImpl" />
+  <bean id="usageVPNUserDaoImpl" class="com.cloud.usage.dao.UsageVPNUserDaoImpl" />
+  <bean id="usageVolumeDaoImpl" class="com.cloud.usage.dao.UsageVolumeDaoImpl" />
+  <bean id="usageVmDiskDaoImpl" class="com.cloud.usage.dao.UsageVmDiskDaoImpl" />
+  <bean id="userAccountDaoImpl" class="com.cloud.user.dao.UserAccountDaoImpl" />
+  <bean id="userAccountJoinDaoImpl" class="com.cloud.api.query.dao.UserAccountJoinDaoImpl" />
+  <bean id="userIpv6AddressDaoImpl" class="com.cloud.network.dao.UserIpv6AddressDaoImpl" />
+  <bean id="userStatisticsDaoImpl" class="com.cloud.user.dao.UserStatisticsDaoImpl" />
+  <bean id="userStatsLogDaoImpl" class="com.cloud.user.dao.UserStatsLogDaoImpl" />
+  <bean id="userVmDiskStatsDaoImpl" class="com.cloud.user.dao.VmDiskStatisticsDaoImpl" />
+  <bean id="userVmCloneSettingDaoImpl" class="com.cloud.vm.dao.UserVmCloneSettingDaoImpl" />
+  <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
+  <bean id="userVmDetailsDaoImpl" class="com.cloud.vm.dao.UserVmDetailsDaoImpl" />
+  <bean id="userVmJoinDaoImpl" class="com.cloud.api.query.dao.UserVmJoinDaoImpl" />
+  <bean id="vMComputeTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMComputeTagDaoImpl" />
+  <bean id="vMEntityDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMEntityDaoImpl" />
+  <bean id="vMInstanceDaoImpl" class="com.cloud.vm.dao.VMInstanceDaoImpl" />
+  <bean id="vMNetworkMapDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDaoImpl" />
+  <bean id="vMReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDaoImpl" />
+  <bean id="vMRootDiskTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMRootDiskTagDaoImpl" />
+  <bean id="vMSnapshotDaoImpl" class="com.cloud.vm.snapshot.dao.VMSnapshotDaoImpl" />
+  <bean id="vMTemplateDetailsDaoImpl" class="com.cloud.storage.dao.VMTemplateDetailsDaoImpl" />
+  <bean id="vMTemplateHostDaoImpl" class="com.cloud.storage.dao.VMTemplateHostDaoImpl" />
+  <bean id="vMTemplatePoolDaoImpl" class="com.cloud.storage.dao.VMTemplatePoolDaoImpl" />
+  <bean id="vMTemplateZoneDaoImpl" class="com.cloud.storage.dao.VMTemplateZoneDaoImpl" />
+  <bean id="virtualRouterProviderDaoImpl" class="com.cloud.network.dao.VirtualRouterProviderDaoImpl" />
+  <bean id="vmRulesetLogDaoImpl" class="com.cloud.network.security.dao.VmRulesetLogDaoImpl" />
+  <bean id="volumeDaoImpl" class="com.cloud.storage.dao.VolumeDaoImpl" />
+  <bean id="volumeDetailsDaoImpl" class="com.cloud.storage.dao.VolumeDetailsDaoImpl" />
+  <bean id="volumeHostDaoImpl" class="com.cloud.storage.dao.VolumeHostDaoImpl" />
+  <bean id="volumeJoinDaoImpl" class="com.cloud.api.query.dao.VolumeJoinDaoImpl" />
+  <bean id="volumeReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VolumeReservationDaoImpl" />
+  <bean id="vpcDaoImpl" class="com.cloud.network.vpc.dao.VpcDaoImpl" />
+  <bean id="vpcGatewayDaoImpl" class="com.cloud.network.vpc.dao.VpcGatewayDaoImpl" />
+  <bean id="vpcOfferingDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingDaoImpl" />
+  <bean id="vpcOfferingServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingServiceMapDaoImpl" />
+  <bean id="vpcServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcServiceMapDaoImpl" />
+  <bean id="vpnUserDaoImpl" class="com.cloud.network.dao.VpnUserDaoImpl" />
+  <bean id="applicationLbRuleDaoImpl" class="org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDaoImpl" />
+  <bean id="networkOfferingDetailsDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingDetailsDaoImpl" />
+  <bean id="serviceOfferingDetailsDaoImpl" class="com.cloud.service.dao.ServiceOfferingDetailsDaoImpl"/>
+
+  <bean id="AffinityGroupDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDaoImpl" />
+  <bean id="AffinityGroupVMMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDaoImpl" />
+  <bean id="AffinityGroupDomainMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDomainMapDaoImpl" />
+  
+  <bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml
----------------------------------------------------------------------
diff --git a/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml b/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml
new file mode 100644
index 0000000..2a30887
--- /dev/null
+++ b/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
+
+    <bean id="versionDaoImpl" class="com.cloud.upgrade.dao.VersionDaoImpl" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index c107fa0..1afd056 100755
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -31,6 +31,7 @@ import java.util.List;
 import java.util.TreeMap;
 
 import javax.ejb.Local;
+import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
 
@@ -66,7 +67,6 @@ import com.cloud.upgrade.dao.Upgrade420to430;
 import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
 import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
 import com.cloud.upgrade.dao.VersionDao;
-import com.cloud.upgrade.dao.VersionDaoImpl;
 import com.cloud.upgrade.dao.VersionVO;
 import com.cloud.upgrade.dao.VersionVO.Step;
 import com.cloud.utils.component.SystemIntegrityChecker;
@@ -81,10 +81,10 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
 
     protected HashMap<String, DbUpgrade[]> _upgradeMap = new HashMap<String, DbUpgrade[]>();
 
+    @Inject
     VersionDao _dao;
 
     public DatabaseUpgradeChecker() {
-        _dao = new VersionDaoImpl();
         _upgradeMap.put("2.1.7", new DbUpgrade[] {new Upgrade217to218(), new Upgrade218to22(), new Upgrade221to222(),
                 new UpgradeSnapshot217to224(), new Upgrade222to224(), new Upgrade224to225(), new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml b/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml
new file mode 100644
index 0000000..7b8e2a4
--- /dev/null
+++ b/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="storageCacheRandomAllocator"
+        class="org.apache.cloudstack.storage.cache.allocator.StorageCacheRandomAllocator" />
+    <bean id="storageCacheManagerImpl"
+        class="org.apache.cloudstack.storage.cache.manager.StorageCacheManagerImpl" />
+    <bean id="StorageCacheReplacementAlgorithm"
+        class="org.apache.cloudstack.storage.cache.manager.StorageCacheReplacementAlgorithmLRU" />
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml b/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml
new file mode 100644
index 0000000..822644e
--- /dev/null
+++ b/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml
@@ -0,0 +1,45 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+    <bean id="ancientDataMotionStrategy"
+        class="org.apache.cloudstack.storage.motion.AncientDataMotionStrategy" />
+    <bean id="xenserverStorageMotionStrategy"
+        class="org.apache.cloudstack.storage.motion.XenServerStorageMotionStrategy" />
+
+    <bean id="dataMotionServiceImpl"
+        class="org.apache.cloudstack.storage.motion.DataMotionServiceImpl">
+        <property name="strategies">
+            <list>
+                <ref local="ancientDataMotionStrategy" />
+                <ref local="xenserverStorageMotionStrategy" />
+            </list>
+        </property>
+    </bean>
+    
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml b/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
new file mode 100644
index 0000000..db517db
--- /dev/null
+++ b/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
@@ -0,0 +1,45 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="templateServiceImpl"
+        class="org.apache.cloudstack.storage.image.TemplateServiceImpl"
+        depends-on="dataObjectManagerImpl, dataStoreManagerImpl, dataMotionServiceImpl, objectInDataStoreManagerImpl, defaultEndPointSelector, templateDataFactoryImpl" />
+
+    <bean id="templateDataFactoryImpl"
+        class="org.apache.cloudstack.storage.image.TemplateDataFactoryImpl" />
+
+    <bean id="imageStoreHelper"
+        class="org.apache.cloudstack.storage.image.datastore.ImageStoreHelper" />
+    <bean id="imageFormatHelper"
+        class="org.apache.cloudstack.storage.image.format.ImageFormatHelper" />
+
+    <bean id="imageStoreProviderMgr"
+        class="org.apache.cloudstack.storage.image.manager.ImageStoreProviderManagerImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml b/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
new file mode 100644
index 0000000..29f4fcd
--- /dev/null
+++ b/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
@@ -0,0 +1,63 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <!--Image formats-->
+    <bean id="ISO" class="org.apache.cloudstack.storage.image.format.ISO" />
+    <bean id="OVA" class="org.apache.cloudstack.storage.image.format.OVA" />
+    <bean id="QCOW2" class="org.apache.cloudstack.storage.image.format.QCOW2" />
+    <bean id="VHD" class="org.apache.cloudstack.storage.image.format.VHD" />
+    <bean id="VHDX" class="org.apache.cloudstack.storage.image.format.VHDX" />
+    <bean id="unknown" class="org.apache.cloudstack.storage.image.format.Unknown" />
+    <bean id="BAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
+    
+
+    <bean id="objectInDataStoreManagerImpl"
+        class="org.apache.cloudstack.storage.datastore.ObjectInDataStoreManagerImpl" />
+
+    <bean id="dataObjectManagerImpl"
+        class="org.apache.cloudstack.storage.datastore.DataObjectManagerImpl" />
+
+    <bean id="defaultEndPointSelector"
+        class="org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector" />
+
+    <bean id="dataStoreManagerImpl"
+        class="org.apache.cloudstack.storage.datastore.DataStoreManagerImpl"
+        depends-on="dataStoreProviderManager">
+        <property name="primaryStoreMgr" ref="primaryDataStoreProviderMgr" />
+        <property name="imageDataStoreMgr" ref="imageStoreProviderMgr" />
+    </bean>
+
+    <bean id="dataStoreProviderManager"
+        class="org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl">
+        <property name="providers">
+            <list />
+        </property>
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties
----------------------------------------------------------------------
diff --git a/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties b/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties
new file mode 100644
index 0000000..7a1cd0e
--- /dev/null
+++ b/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties
@@ -0,0 +1,2 @@
+name=storage-allocator
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml b/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml
new file mode 100644
index 0000000..e4e02aa
--- /dev/null
+++ b/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml
@@ -0,0 +1,49 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="LocalStoragePoolAllocator"
+        class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
+        <property name="name" value="LocalStorage" />
+    </bean>
+    
+    <bean id="clusterScopeStoragePoolAllocator"
+        class="org.apache.cloudstack.storage.allocator.ClusterScopeStoragePoolAllocator" />
+    <bean id="zoneWideStoragePoolAllocator"
+        class="org.apache.cloudstack.storage.allocator.ZoneWideStoragePoolAllocator" />
+    <bean id="garbageCollectingStoragePoolAllocator"
+        class="org.apache.cloudstack.storage.allocator.GarbageCollectingStoragePoolAllocator">
+        <property name="name" value="GCStorage" />
+    </bean>
+
+    <bean id="UserConcentratedAllocator"
+        class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
+        <property name="name" value="UserFirst" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml b/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml
new file mode 100644
index 0000000..c9c89e3
--- /dev/null
+++ b/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml
@@ -0,0 +1,44 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="snapshotServiceImpl"
+        class="org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl"
+        depends-on="snapshotStateMachineManagerImpl, snapshotDataFactoryImpl, dataStoreManagerImpl, dataMotionServiceImpl, objectInDataStoreManagerImpl" />
+
+    <bean id="xenserverSnapshotStrategy"
+        class="org.apache.cloudstack.storage.snapshot.XenserverSnapshotStrategy" />
+
+    <bean id="snapshotDataFactoryImpl"
+        class="org.apache.cloudstack.storage.snapshot.SnapshotDataFactoryImpl"
+        depends-on="dataStoreManagerImpl, snapshotDataStoreDaoImpl, volumeDataFactoryImpl" />
+
+    <bean id="snapshotStateMachineManagerImpl"
+        class="org.apache.cloudstack.storage.snapshot.SnapshotStateMachineManagerImpl" />
+    
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
index 92b4e7a..c5d904b 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
@@ -20,6 +20,8 @@ package org.apache.cloudstack.storage.datastore.provider;
 
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.utils.component.ManagerBase;
+import com.cloud.utils.component.Registry;
+
 import org.apache.cloudstack.api.response.StorageProviderResponse;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider.DataStoreProviderType;
@@ -33,18 +35,22 @@ import org.springframework.stereotype.Component;
 
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
+
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 @Component
-public class DataStoreProviderManagerImpl extends ManagerBase implements DataStoreProviderManager {
+public class DataStoreProviderManagerImpl extends ManagerBase implements DataStoreProviderManager, Registry<DataStoreProvider> {
     private static final Logger s_logger = Logger.getLogger(DataStoreProviderManagerImpl.class);
-    @Inject
+    
     List<DataStoreProvider> providers;
-    protected Map<String, DataStoreProvider> providerMap = new HashMap<String, DataStoreProvider>();
+    protected Map<String, DataStoreProvider> providerMap = new ConcurrentHashMap<String, DataStoreProvider>();
     @Inject
     PrimaryDataStoreProviderManager primaryDataStoreProviderMgr;
     @Inject
@@ -96,43 +102,54 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        Map<String, Object> copyParams = new HashMap<String, Object>(params);
 
-        for (DataStoreProvider provider : providers) {
-            String providerName = provider.getName();
-            if (providerMap.get(providerName) != null) {
-                s_logger.debug("Failed to register data store provider, provider name: " + providerName
-                        + " is not unique");
-                return false;
+        if ( providers != null ) {
+            for (DataStoreProvider provider : providers) {
+                registerProvider(provider);
             }
+        }
+
+        providers = new CopyOnWriteArrayList<DataStoreProvider>(providers);
+        
+        return true;
+    }
+
+    protected boolean registerProvider(DataStoreProvider provider) {
+        Map<String, Object> copyParams = new HashMap<String, Object>();
+
+        String providerName = provider.getName();
+        if (providerMap.get(providerName) != null) {
+            s_logger.debug("Did not register data store provider, provider name: " + providerName
+                    + " is not unique");
+            return false;
+        }
 
-            s_logger.debug("registering data store provider:" + provider.getName());
-
-            providerMap.put(providerName, provider);
-            try {
-                boolean registrationResult = provider.configure(copyParams);
-                if (!registrationResult) {
-                    providerMap.remove(providerName);
-                    s_logger.debug("Failed to register data store provider: " + providerName);
-                    return false;
-                }
-
-                Set<DataStoreProviderType> types = provider.getTypes();
-                if (types.contains(DataStoreProviderType.PRIMARY)) {
-                    primaryDataStoreProviderMgr.registerDriver(provider.getName(),
-                            (PrimaryDataStoreDriver) provider.getDataStoreDriver());
-                    primaryDataStoreProviderMgr.registerHostListener(provider.getName(), provider.getHostListener());
-                } else if (types.contains(DataStoreProviderType.IMAGE)) {
-                    imageStoreProviderMgr.registerDriver(provider.getName(),
-                            (ImageStoreDriver) provider.getDataStoreDriver());
-                }
-            } catch (Exception e) {
-                s_logger.debug("configure provider failed", e);
+        s_logger.debug("registering data store provider:" + provider.getName());
+
+        providerMap.put(providerName, provider);
+        try {
+            boolean registrationResult = provider.configure(copyParams);
+            if (!registrationResult) {
                 providerMap.remove(providerName);
+                s_logger.debug("Failed to register data store provider: " + providerName);
                 return false;
             }
-        }
 
+            Set<DataStoreProviderType> types = provider.getTypes();
+            if (types.contains(DataStoreProviderType.PRIMARY)) {
+                primaryDataStoreProviderMgr.registerDriver(provider.getName(),
+                        (PrimaryDataStoreDriver) provider.getDataStoreDriver());
+                primaryDataStoreProviderMgr.registerHostListener(provider.getName(), provider.getHostListener());
+            } else if (types.contains(DataStoreProviderType.IMAGE)) {
+                imageStoreProviderMgr.registerDriver(provider.getName(),
+                        (ImageStoreDriver) provider.getDataStoreDriver());
+            }
+        } catch (Exception e) {
+            s_logger.debug("configure provider failed", e);
+            providerMap.remove(providerName);
+            return false;
+        }
+        
         return true;
     }
 
@@ -167,6 +184,27 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
         }
     }
 
+    @Override
+    public boolean register(DataStoreProvider type) {
+        if ( registerProvider(type) ) {
+            providers.add(type);
+            return true;
+        }
+        
+        return false;
+    }
+
+    @Override
+    public void unregister(DataStoreProvider type) {
+        /* Sorry, no unregister supported... */
+    }
+
+    @Override
+    public List<DataStoreProvider> getRegistered() {
+        return Collections.unmodifiableList(providers);
+    }
+    
+    @Inject
     public void setProviders(List<DataStoreProvider> providers) {
         this.providers = providers;
     }
@@ -178,4 +216,9 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
     public void setImageStoreProviderMgr(ImageStoreProviderManager imageDataStoreProviderMgr) {
         this.imageStoreProviderMgr = imageDataStoreProviderMgr;
     }
+
+    public List<DataStoreProvider> getProviders() {
+        return providers;
+    }
+    
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml b/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml
new file mode 100644
index 0000000..ba9afb5
--- /dev/null
+++ b/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml
@@ -0,0 +1,49 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <!--Filesystem types -->
+    <bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />
+    <bean id="networkFileSystem"
+        class="org.apache.cloudstack.storage.datastore.type.NetworkFileSystem" />
+
+    <bean id="volumeServiceImpl"
+        class="org.apache.cloudstack.storage.volume.VolumeServiceImpl"
+        depends-on="snapshotManagerImpl, dataMotionServiceImpl" />
+
+    <bean id="volumeDataFactoryImpl"
+        class="org.apache.cloudstack.storage.volume.VolumeDataFactoryImpl" />
+
+
+    <bean id="primaryDataStoreHelper"
+        class="org.apache.cloudstack.storage.volume.datastore.PrimaryDataStoreHelper" />
+
+    <bean id="primaryDataStoreProviderMgr"
+        class="org.apache.cloudstack.storage.datastore.manager.PrimaryDataStoreProviderManagerImpl" />
+ 
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml
----------------------------------------------------------------------
diff --git a/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml b/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml
new file mode 100644
index 0000000..13353b0
--- /dev/null
+++ b/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="clusterServiceServletAdapter" class="com.cloud.cluster.ClusterServiceServletAdapter" />
+    
+    <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
+    
+    <bean id="clusterFenceManagerImpl" class="com.cloud.cluster.ClusterFenceManagerImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml
new file mode 100644
index 0000000..c887531
--- /dev/null
+++ b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+  <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle" >
+    <property name="registry" ref="scopedConfigStorageRegistry" />
+    <property name="typeClass" value="org.apache.cloudstack.framework.config.ScopedConfigStorage" />
+  </bean>
+  
+  <bean class="org.apache.cloudstack.spring.lifecycle.ConfigDepotLifeCycle" />
+
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml
----------------------------------------------------------------------
diff --git a/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml
new file mode 100644
index 0000000..8d75d27
--- /dev/null
+++ b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml
@@ -0,0 +1,51 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="configurationDaoImpl"
+        class="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl">
+        <property name="configParams">
+            <map>
+                <entry key="premium" value="${premium}" />
+            </map>
+        </property>
+    </bean>
+
+    <bean id="configDepot"
+        class="org.apache.cloudstack.framework.config.impl.ConfigDepotImpl">
+        <property name="scopedStorages"
+            value="#{scopedConfigStorageRegistry.registered}" />
+        <property name="configurables">
+            <list />
+        </property>
+    </bean>
+
+    <bean id="scopedConfigStorageRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java b/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
index b4d3773..b7fe125 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
@@ -31,6 +31,8 @@ public interface ConfigDepotAdmin {
      * @see Configuration
      */
     void populateConfigurations();
+    
+    void populateConfiguration(Configurable configurable);
 
     List<String> getComponentsInDepot();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
index e402988..43e2cec 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
@@ -128,6 +129,14 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
         return true;
     }
 
+    @PostConstruct
+    public void init() throws ConfigurationException {
+        /* This bean is loaded in bootstrap and beans
+         * in bootstrap don't go through the CloudStackExtendedLifeCycle
+         */
+        configure(getName(), getConfigParams());
+    }
+
     //Use update method with category instead
     @Override
     @Deprecated

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
index 11281bf..254e6d2 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
@@ -17,14 +17,16 @@
 package org.apache.cloudstack.framework.config.impl;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.apache.cloudstack.framework.config.ConfigDepot;
 import org.apache.cloudstack.framework.config.ConfigDepotAdmin;
 import org.apache.cloudstack.framework.config.ConfigKey;
@@ -32,9 +34,9 @@ import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.ScopedConfigStorage;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.commons.lang.ObjectUtils;
+import org.apache.log4j.Logger;
 
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.SystemIntegrityChecker;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 /**
@@ -64,14 +66,13 @@ import com.cloud.utils.exception.CloudRuntimeException;
  *     when constructing a ConfigKey then configuration server should use the
  *     validation class to validate the value the admin input for the key.
  */
-public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin, SystemIntegrityChecker {
+public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin {
     private final static Logger s_logger = Logger.getLogger(ConfigDepotImpl.class);
     @Inject
     ConfigurationDao   _configDao;
-    @Inject
     List<Configurable> _configurables;
-    @Inject
     List<ScopedConfigStorage> _scopedStorages;
+    Set<Configurable> _configured = Collections.synchronizedSet(new HashSet<Configurable>());
 
     HashMap<String, Pair<String, ConfigKey<?>>> _allKeys = new HashMap<String, Pair<String, ConfigKey<?>>>(1007);
 
@@ -85,50 +86,58 @@ public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin, SystemInt
         return value != null ? value.second() : null;
     }
 
+    @PostConstruct
     @Override
     public void populateConfigurations() {
         Date date = new Date();
         for (Configurable configurable : _configurables) {
-            for (ConfigKey<?> key : configurable.getConfigKeys()) {
-                ConfigurationVO vo = _configDao.findById(key.key());
-                if (vo == null) {
-                    vo = new ConfigurationVO(configurable.getConfigComponentName(), key);
+            populateConfiguration(date, configurable);
+        }
+    }
+
+    protected void populateConfiguration(Date date, Configurable configurable) {
+        if ( _configured.contains(configurable) )
+            return;
+        
+        s_logger.debug("Retrieving keys from " + configurable.getClass().getSimpleName());
+
+        for (ConfigKey<?> key : configurable.getConfigKeys()) {
+            Pair<String, ConfigKey<?>> previous = _allKeys.get(key.key());
+            if (previous != null && !previous.first().equals(configurable.getConfigComponentName())) {
+                throw new CloudRuntimeException("Configurable " + configurable.getConfigComponentName() + " is adding a key that has been added before by " + previous.first() +
+                                                ": " + key.toString());
+            }
+            _allKeys.put(key.key(), new Pair<String, ConfigKey<?>>(configurable.getConfigComponentName(), key));
+            
+            ConfigurationVO vo = _configDao.findById(key.key());
+            if (vo == null) {
+                vo = new ConfigurationVO(configurable.getConfigComponentName(), key);
+                vo.setUpdated(date);
+                _configDao.persist(vo);
+            } else {
+                if (vo.isDynamic() != key.isDynamic() ||
+                    !ObjectUtils.equals(vo.getDescription(), key.description()) ||
+                    !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())) {
+                    vo.setDynamic(key.isDynamic());
+                    vo.setDescription(key.description());
+                    vo.setDefaultValue(key.defaultValue());
                     vo.setUpdated(date);
                     _configDao.persist(vo);
-                } else {
-                    if (vo.isDynamic() != key.isDynamic() ||
-                        !ObjectUtils.equals(vo.getDescription(), key.description()) ||
-                        !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())) {
-                        vo.setDynamic(key.isDynamic());
-                        vo.setDescription(key.description());
-                        vo.setDefaultValue(key.defaultValue());
-                        vo.setUpdated(date);
-                        _configDao.persist(vo);
-                    }
                 }
             }
         }
+        
+        _configured.add(configurable);
     }
 
     @Override
-    public List<String> getComponentsInDepot() {
-        return new ArrayList<String>();
+    public void populateConfiguration(Configurable configurable) {
+        populateConfiguration(new Date(), configurable);
     }
-
+    
     @Override
-    @PostConstruct
-    public void check() {
-        for (Configurable configurable : _configurables) {
-            s_logger.debug("Retrieving keys from " + configurable.getClass().getSimpleName());
-            for (ConfigKey<?> key : configurable.getConfigKeys()) {
-                Pair<String, ConfigKey<?>> previous = _allKeys.get(key.key());
-                if (previous != null && !previous.first().equals(configurable.getConfigComponentName())) {
-                    throw new CloudRuntimeException("Configurable " + configurable.getConfigComponentName() + " is adding a key that has been added before by " + previous.first() +
-                                                    ": " + key.toString());
-                }
-                _allKeys.put(key.key(), new Pair<String, ConfigKey<?>>(configurable.getConfigComponentName(), key));
-            }
-        }
+    public List<String> getComponentsInDepot() {
+        return new ArrayList<String>();
     }
 
     public ConfigurationDao global() {
@@ -144,4 +153,23 @@ public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin, SystemInt
 
         throw new CloudRuntimeException("Unable to find config storage for this scope: " + config.scope() + " for " + config.key());
     }
+
+    public List<ScopedConfigStorage> getScopedStorages() {
+        return _scopedStorages;
+    }
+
+    @Inject
+    public void setScopedStorages(List<ScopedConfigStorage> scopedStorages) {
+        this._scopedStorages = scopedStorages;
+    }
+
+    public List<Configurable> getConfigurables() {
+        return _configurables;
+    }
+
+    @Inject
+    public void setConfigurables(List<Configurable> configurables) {
+        this._configurables = configurables;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
----------------------------------------------------------------------
diff --git a/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java b/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
index 1c5fbe5..5a7f176 100644
--- a/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
+++ b/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
@@ -95,6 +95,7 @@ public class ConfigDepotAdminTest extends TestCase {
         verify(_configDao, times(1)).persist(any(ConfigurationVO.class));
 
         when(_configDao.findById(DynamicIntCK.key())).thenReturn(dynamicIntCV);
+        _depotAdmin._configured.clear();
         _depotAdmin.populateConfigurations();
         // This is two because DynamicIntCK also returns null.
         verify(_configDao, times(2)).persist(any(ConfigurationVO.class));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml
----------------------------------------------------------------------
diff --git a/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml b/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml
new file mode 100644
index 0000000..651b874
--- /dev/null
+++ b/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="entityManagerImpl" class="com.cloud.dao.EntityManagerImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/src/com/cloud/utils/db/Transaction.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/Transaction.java b/framework/db/src/com/cloud/utils/db/Transaction.java
index a5da4b3..60baf9e 100755
--- a/framework/db/src/com/cloud/utils/db/Transaction.java
+++ b/framework/db/src/com/cloud/utils/db/Transaction.java
@@ -138,7 +138,9 @@ public class Transaction {
     // the existing DAO features
     //
     public void transitToUserManagedConnection(Connection conn) {
-        assert(_conn == null /*&& _stack.size() <= 1*/) : "Can't change to a user managed connection unless the stack is empty and the db connection is null, you may have forgotten to invoke transitToAutoManagedConnection to close out the DB connection: " + toString();
+        if ( _conn != null )
+            throw new IllegalStateException("Can't change to a user managed connection unless the db connection is null");
+
         _conn = conn;
         _dbId = CONNECTED_DB;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java b/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java
new file mode 100644
index 0000000..9dbbbe1
--- /dev/null
+++ b/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.utils.db;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+
+public class TransactionContextInterceptor implements MethodInterceptor {
+
+    public TransactionContextInterceptor() {
+        
+    }
+    @Override
+    public Object invoke(MethodInvocation m) throws Throwable {
+        Transaction txn = Transaction.open(m.getMethod().getName());
+        try {
+            return m.proceed();
+        } finally {
+            txn.close();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/src/com/cloud/utils/db/TransactionContextListener.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/TransactionContextListener.java b/framework/db/src/com/cloud/utils/db/TransactionContextListener.java
new file mode 100644
index 0000000..30e9e02
--- /dev/null
+++ b/framework/db/src/com/cloud/utils/db/TransactionContextListener.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.utils.db;
+
+import org.apache.cloudstack.managed.context.ManagedContextListener;
+
+public class TransactionContextListener implements ManagedContextListener<Transaction> {
+
+    @Override
+    public Transaction onEnterContext(boolean reentry) {
+        if ( ! reentry ) {
+            return Transaction.open(Thread.currentThread().getName());
+        }
+        
+        return null;
+    }
+
+    @Override
+    public void onLeaveContext(Transaction data, boolean reentry) {
+        if ( ! reentry ) {
+            data.close();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml
----------------------------------------------------------------------
diff --git a/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml b/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml
new file mode 100644
index 0000000..effa23e
--- /dev/null
+++ b/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml
@@ -0,0 +1,59 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+  <!--
+    RPC/Async/EventBus
+  -->
+  <bean id="onwireRegistry" class="org.apache.cloudstack.framework.serializer.OnwireClassRegistry"
+    init-method="scan" >
+    <property name="packages">
+      <list>
+        <value>org.apache.cloudstack.framework</value>
+      </list>
+    </property>
+  </bean>
+  
+  <bean id="messageSerializer" class="org.apache.cloudstack.framework.serializer.JsonMessageSerializer">
+    <property name="onwireClassRegistry" ref="onwireRegistry" />
+  </bean>
+
+  <bean id="transportProvider" class="org.apache.cloudstack.framework.server.ServerTransportProvider"  init-method="initialize">
+    <property name="workerPoolSize" value="5" />
+    <property name="nodeId" value="Node1" />
+    <property name="messageSerializer" ref="messageSerializer" />
+  </bean>
+  
+  <bean id="rpcProvider" class="org.apache.cloudstack.framework.rpc.RpcProviderImpl" init-method="initialize">
+    <constructor-arg ref="transportProvider" />
+    <property name="messageSerializer" ref="messageSerializer" />
+  </bean>
+
+  <bean id="messageBus" class = "org.apache.cloudstack.framework.messagebus.MessageBusBase" />
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml
----------------------------------------------------------------------
diff --git a/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml b/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml
new file mode 100644
index 0000000..85cad02
--- /dev/null
+++ b/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml
@@ -0,0 +1,48 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="asyncJobDaoImpl"
+        class="org.apache.cloudstack.framework.jobs.dao.AsyncJobDaoImpl" />
+    <bean id="asyncJobJournalDaoImpl"
+        class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDaoImpl" />
+    <bean id="asyncJobJoinMapDaoImpl"
+        class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDaoImpl" />
+    <bean id="asyncJobManagerImpl"
+        class="org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl" />
+    <bean id="asyncJobMonitor"
+        class="org.apache.cloudstack.framework.jobs.impl.AsyncJobMonitor" />
+    <bean id="syncQueueDaoImpl"
+        class="org.apache.cloudstack.framework.jobs.dao.SyncQueueDaoImpl" />
+    <bean id="syncQueueItemDaoImpl"
+        class="org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDaoImpl" />
+    <bean id="syncQueueManagerImpl"
+        class="org.apache.cloudstack.framework.jobs.impl.SyncQueueManagerImpl" />
+
+    
+</beans>


[7/9] git commit: updated refs/heads/spring-modularization to 8cf00de

Posted by da...@apache.org.
Spring Modularization

ACS is now comprised of a hierarchy of spring application contexts.
Each plugin can contribute configuration files to add to an existing
module or create it's own module.

Additionally, for the mgmt server, ACS custom AOP is no longer used
and instead we use Spring AOP to manage interceptors.


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

Branch: refs/heads/spring-modularization
Commit: 67186429e14af55172766dd61d978cd47cd52436
Parents: 8466fad
Author: Darren Shepherd <da...@godaddy.com>
Authored: Tue Sep 17 16:26:13 2013 -0700
Committer: Darren Shepherd <da...@gmail.com>
Committed: Wed Oct 2 15:41:04 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/api-planner/module.properties    |   2 +
 .../api-planner/spring-api-planner-context.xml  |  34 ++
 .../apache/cloudstack/context/CallContext.java  |   2 +-
 .../cloudstack/webApplicationContext.xml        |  32 ++
 client/tomcatconf/log4j-cloud.xml.in            |   8 +
 .../cloudstack/allocator/module.properties      |   2 +
 .../allocator/spring-core-allocator-context.xml |  32 ++
 ...-lifecycle-allocator-context-inheritable.xml |  42 +++
 .../META-INF/cloudstack/api/module.properties   |   2 +
 ...g-core-lifecycle-api-context-inheritable.xml |  53 +++
 .../cloudstack/backend/module.properties        |   2 +
 .../cloudstack/bootstrap/module.properties      |   1 +
 .../spring-bootstrap-context-inheritable.xml    |  39 +++
 .../bootstrap/spring-bootstrap-context.xml      |  32 ++
 .../cloudstack/compute/module.properties        |   2 +
 ...re-lifecycle-compute-context-inheritable.xml |  45 +++
 .../META-INF/cloudstack/core/module.properties  |   2 +
 .../cloudstack/core/spring-core-context.xml     |  36 +++
 ...-core-lifecycle-core-context-inheritable.xml |  41 +++
 .../core/spring-core-registry-core-context.xml  | 187 +++++++++++
 .../cloudstack/discoverer/module.properties     |   2 +
 ...lifecycle-discoverer-context-inheritable.xml |  35 ++
 .../cloudstack/network/module.properties        |   2 +
 ...re-lifecycle-network-context-inheritable.xml |  58 ++++
 .../cloudstack/planner/module.properties        |   2 +
 ...re-lifecycle-planner-context-inheritable.xml |  41 +++
 .../cloudstack/storage/module.properties        |   2 +
 ...ng-lifecycle-storage-context-inheritable.xml |  60 ++++
 .../cloudstack/system/module.properties         |   2 +
 .../spring-core-system-context-inheritable.xml  |  54 ++++
 .../system/spring-core-system-context.xml       |  50 +++
 .../core/spring-engine-api-core-context.xml     |  44 +++
 ...pring-engine-components-api-core-context.xml |  30 ++
 ...spring-engine-orchestration-core-context.xml |  71 ++++
 .../spring-engine-schema-core-daos-context.xml  | 321 +++++++++++++++++++
 ...ng-engine-schema-system-checkers-context.xml |  34 ++
 .../cloud/upgrade/DatabaseUpgradeChecker.java   |   4 +-
 ...spring-engine-storage-cache-core-context.xml |  38 +++
 ...g-engine-storage-datamotion-core-context.xml |  45 +++
 ...spring-engine-storage-image-core-context.xml |  45 +++
 .../core/spring-engine-storage-core-context.xml |  63 ++++
 .../storage-allocator/module.properties         |   2 +
 ...engine-storage-storage-allocator-context.xml |  49 +++
 ...ing-engine-storage-snapshot-core-context.xml |  44 +++
 .../provider/DataStoreProviderManagerImpl.java  | 109 +++++--
 ...pring-engine-storage-volume-core-context.xml |  49 +++
 .../spring-framework-cluster-core-context.xml   |  36 +++
 ...ork-config-bootstrap-context-inheritable.xml |  38 +++
 ...pring-framework-config-bootstrap-context.xml |  51 +++
 .../framework/config/ConfigDepotAdmin.java      |   2 +
 .../config/dao/ConfigurationDaoImpl.java        |   9 +
 .../framework/config/impl/ConfigDepotImpl.java  |  98 ++++--
 .../config/impl/ConfigDepotAdminTest.java       |   1 +
 .../spring-framework-db-system-context.xml      |  32 ++
 .../db/src/com/cloud/utils/db/Transaction.java  |   4 +-
 .../utils/db/TransactionContextInterceptor.java |  39 +++
 .../utils/db/TransactionContextListener.java    |  41 +++
 .../core/spring-framework-ipc-core-context.xml  |  59 ++++
 .../core/spring-framework-jobs-core-context.xml |  48 +++
 framework/pom.xml                               |   2 +
 framework/spring/lifecycle/pom.xml              |  34 ++
 .../spring/lifecycle/AbstractBeanCollector.java | 113 +++++++
 .../lifecycle/AbstractSmartLifeCycle.java       |  53 +++
 .../lifecycle/CloudStackExtendedLifeCycle.java  | 169 ++++++++++
 .../CloudStackExtendedLifeCycleStart.java       |  49 +++
 .../spring/lifecycle/CloudStackLog4jSetup.java  |  56 ++++
 .../spring/lifecycle/ConfigDepotLifeCycle.java  |  47 +++
 .../spring/lifecycle/registry/DumpRegistry.java |  77 +++++
 .../lifecycle/registry/ExtensionRegistry.java   | 245 ++++++++++++++
 .../registry/PluggableServiceLifecycle.java     |  53 +++
 .../lifecycle/registry/RegistryLifecycle.java   | 144 +++++++++
 framework/spring/module/pom.xml                 |  50 +++
 .../context/ResourceApplicationContext.java     |  55 ++++
 .../module/factory/CloudStackSpringContext.java | 137 ++++++++
 .../factory/ModuleBasedContextFactory.java      |  84 +++++
 .../module/locator/ModuleDefinitionLocator.java |  36 +++
 .../impl/ClasspathModuleDefinitionLocator.java  |  62 ++++
 .../spring/module/model/ModuleDefinition.java   |  48 +++
 .../module/model/ModuleDefinitionSet.java       |  32 ++
 .../model/impl/DefaultModuleDefinition.java     | 167 ++++++++++
 .../model/impl/DefaultModuleDefinitionSet.java  | 243 ++++++++++++++
 .../cloudstack/spring/module/util/Main.java     |  58 ++++
 .../spring/module/util/ModuleLocationUtils.java |  53 +++
 .../web/CloudStackContextLoaderListener.java    |  75 +++++
 .../module/model/impl/defaults-context.xml      |  28 ++
 .../spring/module/factory/InitTest.java         |  39 +++
 .../factory/ModuleBasedContextFactoryTest.java  | 121 +++++++
 ...ClasspathModuleDefinitionSetLocatorTest.java |  40 +++
 .../model/impl/DefaultModuleDefinitionTest.java | 131 ++++++++
 .../resources/testfiles/all/defaults.properties |  18 ++
 .../testfiles/all/empty-context-inheritable.xml |  26 ++
 .../resources/testfiles/all/empty-context.xml   |  26 ++
 .../all/empty2-context-inheritable.xml          |  26 ++
 .../resources/testfiles/all/empty2-context.xml  |  26 ++
 .../resources/testfiles/all/module.properties   |  17 +
 .../testfiles/all/test2-defaults.properties     |  17 +
 .../testfiles/badname/module.properties         |  17 +
 .../testfiles/blankname/module.properties       |  18 ++
 .../resources/testfiles/good/empty-context.xml  |  26 ++
 .../resources/testfiles/good/module.properties  |  17 +
 .../testfiles/missingname/module.properties     |  17 +
 .../testfiles/wrongname/module.properties       |  17 +
 .../testhierarchy/base/module.properties        |  17 +
 .../base/test-context-inheritable.xml           |  28 ++
 .../testhierarchy/base/test-context.xml         |  34 ++
 .../testhierarchy/child1-1/module.properties    |  18 ++
 .../testhierarchy/child1-1/test-context.xml     |  34 ++
 .../testhierarchy/child1/module.properties      |  18 ++
 .../child1/test-context-override.xml            |  30 ++
 .../testhierarchy/child1/test-context.xml       |  38 +++
 .../testhierarchy/child2/module.properties      |  18 ++
 .../testhierarchy/child2/test-context.xml       |  33 ++
 .../testhierarchy/orphan1/module.properties     |  18 ++
 .../testhierarchy/orphan1/test-context.xml      |  30 ++
 .../acl-static-role-based/module.properties     |   2 +
 .../spring-acl-static-role-based-context.xml    |  34 ++
 .../explicit-dedication/module.properties       |   2 +
 .../spring-explicit-dedication-context.xml      |  36 +++
 .../host-anti-affinity/module.properties        |   2 +
 .../spring-host-anti-affinity-context.xml       |  37 +++
 .../discovery/ApiDiscoveryServiceImpl.java      |  65 +++-
 .../cloudstack/discovery/ApiDiscoveryTest.java  |   2 +-
 .../cloudstack/rate-limit/module.properties     |   2 +
 .../rate-limit/spring-rate-limit-context.xml    |  32 ++
 .../spring-dedicated-resources-core-context.xml |  33 ++
 .../implicit-dedication/module.properties       |   2 +
 .../spring-implicit-dedication-context.xml      |  25 ++
 .../user-concentrated-pod/module.properties     |   2 +
 .../spring-user-concentrated-pod-context.xml    |  35 ++
 .../host-allocator-random/module.properties     |   2 +
 .../spring-host-allocator-random-context.xml    |  34 ++
 .../baremetal-compute/module.properties         |   2 +
 .../spring-baremetal-compute-context.xml        |  35 ++
 .../baremetal-discoverer/module.properties      |   2 +
 .../spring-baremetal-discoverer-context.xml     |  34 ++
 .../baremetal-network/module.properties         |   2 +
 .../spring-baremetal-network-context.xml        |  46 +++
 .../baremetal-planner/module.properties         |   2 +
 .../spring-baremetal-planner-context.xml        |  34 ++
 .../baremetal-storage/module.properties         |   2 +
 .../spring-baremetal-storage-context.xml        |  32 ++
 .../core/spring-baremetal-core-context.xml      |  42 +++
 .../cloudstack/kvm-compute/module.properties    |   2 +
 .../kvm-compute/spring-kvm-compute-context.xml  |  34 ++
 .../cloudstack/ovm-compute/module.properties    |   2 +
 .../ovm-compute/spring-ovm-compute-context.xml  |  39 +++
 .../cloudstack/ovm-discoverer/module.properties |   2 +
 .../spring-ovm-discoverer-context.xml           |  34 ++
 .../core/spring-simulator-core-context.xml      |  45 +++
 .../simulator-compute/module.properties         |   2 +
 .../spring-simulator-compute-context.xml        |  34 ++
 .../simulator-discoverer/module.properties      |   2 +
 .../spring-simulator-discover-context.xml       |  36 +++
 .../simulator-planner/module.properties         |   2 +
 .../simulator-planner/spring-context.xml        |  34 ++
 .../simulator-storage/module.properties         |   2 +
 .../spring-simulator-storage-context.xml        |  33 ++
 .../agent/manager/MockAgentManagerImpl.java     |  70 ++--
 .../cloudstack/core/spring-ucs-core-context.xml |  35 ++
 .../core/spring-vmware-core-context.xml         |  43 +++
 .../cloudstack/vmware-compute/module.properties |   2 +
 .../spring-vmware-compute-context.xml           |  43 +++
 .../vmware-compute/vmware-defaults.properties   |   1 +
 .../vmware-discoverer/module.properties         |   2 +
 .../spring-vmware-discoverer-context.xml        |  35 ++
 .../cloudstack/vmware-network/module.properties |   2 +
 .../spring-vmware-network-context.xml           |  34 ++
 .../cloudstack/vmware-storage/module.properties |   2 +
 .../spring-vmware-storage-context.xml           |  33 ++
 .../vmware/VmwareServerDiscoverer.java          |  33 +-
 .../xenserver-compute/module.properties         |   2 +
 .../spring-xenserver-compute-context.xml        |  28 ++
 .../xenserver-discoverer/module.properties      |   2 +
 .../spring-xenserver-discoverer-context.xml     |  25 ++
 .../META-INF/cloudstack/vns/module.properties   |   2 +
 .../cloudstack/vns/spring-vns-context.xml       |  36 +++
 .../META-INF/cloudstack/elb/module.properties   |   2 +
 .../cloudstack/elb/spring-elb-context.xml       |  34 ++
 .../core/spring-internallb-core-context.xml     |  37 +++
 .../cloudstack/midonet/module.properties        |   2 +
 .../midonet/spring-midonet-context.xml          |  37 +++
 .../META-INF/cloudstack/nvp/module.properties   |   2 +
 .../cloudstack/nvp/spring-nvp-context.xml       |  40 +++
 .../META-INF/cloudstack/ovs/module.properties   |   2 +
 .../cloudstack/ovs/spring-ovs-context.xml       |  40 +++
 .../META-INF/cloudstack/ssp/module.properties   |   2 +
 .../cloudstack/ssp/spring-ssp-context.xml       |  42 +++
 .../META-INF/cloudstack/vxlan/module.properties |   2 +
 .../cloudstack/vxlan/spring-vxlan-context.xml   |  34 ++
 .../storage-image-default/module.properties     |   2 +
 .../spring-storage-image-default-context.xml    |  33 ++
 .../storage-image-s3/module.properties          |   2 +
 .../spring-storage-image-s3-context.xml         |  34 ++
 .../storage-image-swift/module.properties       |   2 +
 .../spring-storage-image-swift-context.xml      |  33 ++
 .../storage-volume-default/module.properties    |   2 +
 .../spring-storage-volume-default-context.xml   |  35 ++
 .../storage-volume-solidfire/module.properties  |   2 +
 .../spring-storage-volume-solidfire-context.xml |  33 ++
 .../META-INF/cloudstack/ldap/module.properties  |   2 +
 .../cloudstack/ldap/spring-ldap-context.xml     |  39 +++
 .../META-INF/cloudstack/md5/module.properties   |   2 +
 .../cloudstack/md5/spring-md5-context.xml       |  34 ++
 .../cloudstack/plaintext/module.properties      |   2 +
 .../plaintext/spring-plaintext-context.xml      |  35 ++
 .../cloudstack/sha256salted/module.properties   |   2 +
 .../spring-sha256salted-context.xml             |  34 ++
 quickcloud/pom.xml                              |  30 ++
 .../spring-quickcloud-core-context-override.xml |  32 ++
 .../spring-server-core-managers-context.xml     | 214 +++++++++++++
 .../core/spring-server-core-misc-context.xml    |  68 ++++
 .../module.properties                           |   2 +
 ...ing-server-alert-adapter-backend-context.xml |  32 ++
 .../module.properties                           |   2 +
 ...ing-server-alert-adapter-compute-context.xml |  32 ++
 .../module.properties                           |   2 +
 ...ing-server-alert-adapter-storage-context.xml |  32 ++
 .../server-allocator/module.properties          |   2 +
 .../spring-server-allocator-context.xml         |  48 +++
 .../cloudstack/server-api/module.properties     |   2 +
 .../server-api/spring-server-api-context.xml    |  33 ++
 .../cloudstack/server-compute/module.properties |   2 +
 .../spring-server-compute-context.xml           |  38 +++
 .../server-discoverer/module.properties         |   2 +
 .../spring-server-discoverer-context.xml        |  45 +++
 .../cloudstack/server-fencer/module.properties  |   2 +
 .../spring-server-fencer-context.xml            |  37 +++
 .../server-investigator/module.properties       |   2 +
 .../spring-server-investigator-context.xml      |  46 +++
 .../cloudstack/server-network/module.properties |   2 +
 .../spring-server-network-context.xml           |  64 ++++
 .../cloudstack/server-planner/module.properties |   2 +
 .../spring-server-planner-context.xml           |  34 ++
 .../cloudstack/server-storage/module.properties |   2 +
 .../spring-server-storage-context.xml           |  34 ++
 .../server-template-adapter/module.properties   |   2 +
 .../spring-server-template-adapter-context.xml  |  32 ++
 server/src/com/cloud/api/ApiServer.java         |   7 +-
 .../consoleproxy/StaticConsoleProxyManager.java |   3 +
 .../com/cloud/event/ActionEventInterceptor.java |  33 +-
 .../com/cloud/network/vpc/VpcManagerImpl.java   |   7 +-
 .../com/cloud/resource/ResourceManagerImpl.java |   8 +
 .../module.properties                           |   2 +
 ...ing-secondary-storage-discoverer-context.xml |  36 +++
 .../cloud/utils/component/ComponentContext.java |  27 +-
 245 files changed, 8195 insertions(+), 117 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/api/resources/META-INF/cloudstack/api-planner/module.properties
----------------------------------------------------------------------
diff --git a/api/resources/META-INF/cloudstack/api-planner/module.properties b/api/resources/META-INF/cloudstack/api-planner/module.properties
new file mode 100644
index 0000000..98f4ffe
--- /dev/null
+++ b/api/resources/META-INF/cloudstack/api-planner/module.properties
@@ -0,0 +1,2 @@
+name=api-planner
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/api/resources/META-INF/cloudstack/api-planner/spring-api-planner-context.xml
----------------------------------------------------------------------
diff --git a/api/resources/META-INF/cloudstack/api-planner/spring-api-planner-context.xml b/api/resources/META-INF/cloudstack/api-planner/spring-api-planner-context.xml
new file mode 100644
index 0000000..2fd34a8
--- /dev/null
+++ b/api/resources/META-INF/cloudstack/api-planner/spring-api-planner-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
+        <property name="name" value="UserDispersingPlanner" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/api/src/org/apache/cloudstack/context/CallContext.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/context/CallContext.java b/api/src/org/apache/cloudstack/context/CallContext.java
index a9867d3..15fbad3 100644
--- a/api/src/org/apache/cloudstack/context/CallContext.java
+++ b/api/src/org/apache/cloudstack/context/CallContext.java
@@ -57,7 +57,7 @@ public class CallContext {
     private User user;
     private final Map<Object, Object> context = new HashMap<Object, Object>();
 
-    private static EntityManager s_entityMgr;
+    static EntityManager s_entityMgr;
 
     public static void init(EntityManager entityMgr) {
         s_entityMgr = entityMgr;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/client/resources/META-INF/cloudstack/webApplicationContext.xml
----------------------------------------------------------------------
diff --git a/client/resources/META-INF/cloudstack/webApplicationContext.xml b/client/resources/META-INF/cloudstack/webApplicationContext.xml
new file mode 100644
index 0000000..fea2709
--- /dev/null
+++ b/client/resources/META-INF/cloudstack/webApplicationContext.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+    <!-- There is no reason to put anything here -->
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/client/tomcatconf/log4j-cloud.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/log4j-cloud.xml.in b/client/tomcatconf/log4j-cloud.xml.in
index d439b77..08021f2 100755
--- a/client/tomcatconf/log4j-cloud.xml.in
+++ b/client/tomcatconf/log4j-cloud.xml.in
@@ -152,6 +152,14 @@ under the License.
       <priority value="INFO"/>
    </category>
    
+   <category name="org.springframework">
+      <priority value="WARN"/>
+   </category>
+   
+   <category name="org.apache.cloudstack.spring.module.context.ResourceApplicationContext">
+      <priority value="WARN"/>
+   </category>
+   
    <category name="net">
      <priority value="INFO"/>
    </category>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/allocator/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/allocator/module.properties b/core/resources/META-INF/cloudstack/allocator/module.properties
new file mode 100644
index 0000000..9ae4d8e
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/allocator/module.properties
@@ -0,0 +1,2 @@
+name=allocator
+parent=core

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/allocator/spring-core-allocator-context.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/allocator/spring-core-allocator-context.xml b/core/resources/META-INF/cloudstack/allocator/spring-core-allocator-context.xml
new file mode 100644
index 0000000..65ebc70
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/allocator/spring-core-allocator-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+    <bean id="usageEventUtils" class="com.cloud.event.UsageEventUtils" />
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/allocator/spring-core-lifecycle-allocator-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/allocator/spring-core-lifecycle-allocator-context-inheritable.xml b/core/resources/META-INF/cloudstack/allocator/spring-core-lifecycle-allocator-context-inheritable.xml
new file mode 100644
index 0000000..ad00de8
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/allocator/spring-core-lifecycle-allocator-context-inheritable.xml
@@ -0,0 +1,42 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="hostAllocatorsRegistry" />
+        <property name="typeClass"
+            value="com.cloud.agent.manager.allocator.HostAllocator" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="consoleProxyAllocatorsRegistry" />
+        <property name="typeClass"
+            value="com.cloud.consoleproxy.ConsoleProxyAllocator" />
+    </bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/api/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/api/module.properties b/core/resources/META-INF/cloudstack/api/module.properties
new file mode 100644
index 0000000..0a08e16
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/api/module.properties
@@ -0,0 +1,2 @@
+name=api
+parent=core

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml b/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml
new file mode 100644
index 0000000..b0ed228
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/api/spring-core-lifecycle-api-context-inheritable.xml
@@ -0,0 +1,53 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="userAuthenticatorsRegistry" />
+        <property name="typeClass"
+            value="com.cloud.server.auth.UserAuthenticator" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="securityCheckersRegistry" />
+        <property name="typeClass"
+            value="org.apache.cloudstack.acl.SecurityChecker" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="apiCheckersRegistry" />
+        <property name="typeClass" value="org.apache.cloudstack.acl.APIChecker" />
+    </bean>
+    
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="userPasswordEncodersRegistry" />
+        <property name="typeClass" value="com.cloud.server.auth.UserAuthenticator" />
+    </bean>
+    
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/backend/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/backend/module.properties b/core/resources/META-INF/cloudstack/backend/module.properties
new file mode 100644
index 0000000..58f0b36
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/backend/module.properties
@@ -0,0 +1,2 @@
+name=backend
+parent=core

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/bootstrap/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/bootstrap/module.properties b/core/resources/META-INF/cloudstack/bootstrap/module.properties
new file mode 100644
index 0000000..fa28ca4
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/bootstrap/module.properties
@@ -0,0 +1 @@
+name=bootstrap

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml b/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml
new file mode 100644
index 0000000..adee3ed
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context-inheritable.xml
@@ -0,0 +1,39 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <context:annotation-config />
+
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+        <property name="order" value="100" />
+        <property name="ignoreResourceNotFound" value="true" />
+        <property name="ignoreUnresolvablePlaceholders" value="true" />
+        <property name="locations" ref="DefaultConfigResources" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context.xml b/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context.xml
new file mode 100644
index 0000000..40fcc71
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/bootstrap/spring-bootstrap-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.CloudStackLog4jSetup" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/compute/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/compute/module.properties b/core/resources/META-INF/cloudstack/compute/module.properties
new file mode 100644
index 0000000..d997f7b
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/compute/module.properties
@@ -0,0 +1,2 @@
+name=compute
+parent=backend

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/compute/spring-core-lifecycle-compute-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/compute/spring-core-lifecycle-compute-context-inheritable.xml b/core/resources/META-INF/cloudstack/compute/spring-core-lifecycle-compute-context-inheritable.xml
new file mode 100644
index 0000000..b57f52f
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/compute/spring-core-lifecycle-compute-context-inheritable.xml
@@ -0,0 +1,45 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="haInvestigatorsRegistry" />
+        <property name="typeClass" value="com.cloud.ha.Investigator" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="haFenceBuildersRegistry" />
+        <property name="typeClass" value="com.cloud.ha.FenceBuilder" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="hypervisorGurusRegistry" />
+        <property name="typeClass" value="com.cloud.hypervisor.HypervisorGuru" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/core/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/core/module.properties b/core/resources/META-INF/cloudstack/core/module.properties
new file mode 100644
index 0000000..b88fe93
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/core/module.properties
@@ -0,0 +1,2 @@
+name=core
+parent=system

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/core/spring-core-context.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/core/spring-core-context.xml b/core/resources/META-INF/cloudstack/core/spring-core-context.xml
new file mode 100644
index 0000000..6cd00a4
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/core/spring-core-context.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="componentContext" class="com.cloud.utils.component.ComponentContext">
+        <property name="initializeBeans" value="false" />
+    </bean>
+
+    <bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/core/spring-core-lifecycle-core-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/core/spring-core-lifecycle-core-context-inheritable.xml b/core/resources/META-INF/cloudstack/core/spring-core-lifecycle-core-context-inheritable.xml
new file mode 100644
index 0000000..06b9f5e
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/core/spring-core-lifecycle-core-context-inheritable.xml
@@ -0,0 +1,41 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="registryRegistry" />
+        <property name="typeClass" value="com.cloud.utils.component.Registry" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.PluggableServiceLifecycle">
+        <property name="registry" ref="apiCommandsRegistry" />
+        <property name="typeClass"
+            value="com.cloud.utils.component.PluggableService" />
+    </bean>
+    
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
new file mode 100644
index 0000000..170d33d
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
@@ -0,0 +1,187 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="userAuthenticatorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="orderConfigKey" value="user.authenticators.order" />
+        <property name="excludeKey" value="user.authenticators.exclude" />
+        <property name="orderConfigDefault" value="SHA256SALT,MD5,LDAP,PLAINTEXT" />
+    </bean>
+
+    <bean id="userPasswordEncodersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="orderConfigKey" value="user.password.encoders.order" />
+        <property name="excludeKey" value="user.password.encoders.exclude" />
+        <property name="orderConfigDefault" value="SHA256SALT,MD5,LDAP,PLAINTEXT" />
+    </bean>
+
+    <bean id="securityCheckersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="orderConfigKey" value="security.checkers.order" />
+        <property name="excludeKey" value="security.checkers.exclude" />
+        <property name="orderConfigDefault"
+            value="AffinityGroupAccessChecker,DomainChecker" />
+    </bean>
+
+    <bean id="resourceDiscoverersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="resource.discoverers.exclude" />
+        <property name="excludeDefault" value="dummyHostDiscoverer" />
+    </bean>
+
+    <bean id="haInvestigatorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="orderConfigKey" value="ha.investigators.order" />
+        <property name="orderConfigDefault"
+            value="SimpleInvestigator,XenServerInvestigator,PingInvestigator,ManagementIPSysVMInvestigator,KVMInvestigator" />
+        <property name="excludeKey" value="ha.investigators.exclude" />
+    </bean>
+
+    <bean id="haFenceBuildersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="ha.fence.builders.exclude" />
+        <property name="excludeDefault" value="RecreatableFencer" />
+    </bean>
+
+    <bean id="deploymentPlannersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="orderConfigKey" value="deployment.planners.order" />
+        <property name="orderConfigDefault"
+            value="FirstFitPlanner,UserDispersingPlanner,UserConcentratedPodPlanner,ImplicitDedicationPlanner,BareMetalPlanner" />
+        <property name="excludeKey" value="deployment.planners.exclude" />
+    </bean>
+
+    <bean id="podAllocatorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="pod.allocators.exclude" />
+    </bean>
+
+    <bean id="hostAllocatorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="host.allocators.exclude" />
+        <property name="excludeDefault"
+            value="RandomAllocator,TestingAllocator,FirstFitAllocator,RecreateHostAllocator" />
+    </bean>
+
+    <bean id="storagePoolAllocatorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="orderConfigKey" value="storage.pool.allocators.order" />
+        <property name="orderConfigDefault"
+            value="LocalStorage,ClusterScopeStoragePoolAllocator,ZoneWideStoragePoolAllocator" />
+        <property name="excludeKey" value="storage.pool.allocators.exclude" />
+        <property name="excludeDefault" value="GCStorage" />
+    </bean>
+
+    <bean id="secondaryStorageVmAllocatorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey"
+            value="secondary.storage.vm.allocators.exclude" />
+    </bean>
+
+    <bean id="consoleProxyAllocatorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="console.proxy.allocator.exclude" />
+    </bean>
+
+    <bean id="templateAdapterRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="template.adapter.exclude" />
+    </bean>
+
+    <bean id="ipDeployersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="ip.deployers.exclude" />
+        <property name="excludeDefault" value="MidoNetElement" />
+    </bean>
+
+    <bean id="dhcpProvidersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="dhcp.providers.exclude" />
+        <property name="excludeDefault" value="MidoNetElement" />
+    </bean>
+
+    <bean id="networkGurusRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="network.gurus.exclude" />
+    </bean>
+
+    <bean id="networkElementsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="network.elements.registry.exclude" />
+        <property name="excludeDefault" value="ElasticLoadBalancerElement" />
+        <property name="preRegistered">
+            <list>
+                <ref bean="VpcVirtualRouter" />
+                <ref bean="InternalLbVm" />
+            </list>
+        </property>
+    </bean>
+
+    <bean id="affinityProcessorsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="orderConfigKey" value="affinity.processors.order" />
+        <property name="orderConfigDefault"
+            value="HostAntiAffinityProcessor,ExplicitDedicationProcessor" />
+        <property name="excludeKey" value="affinity.processors.exclude" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.DumpRegistry" >
+        <property name="registries" value="#{registryRegistry.registered}" />
+    </bean>
+    
+    <bean id="registryRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+    </bean>
+
+    <bean id="apiCheckersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="api.checkers.exclude" />
+    </bean>
+
+    <bean id="apiCommandsRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="api.commands.exclude" />
+    </bean>
+
+    <bean id="hypervisorGurusRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="hypervisor.gurus.exclude" />
+    </bean>
+    
+    <bean id="vpcProvidersRegistry"
+        class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="vpc.providers.exclude" />
+        <property name="preRegistered">
+            <list>
+                <ref bean="VpcVirtualRouter" />
+            </list>
+        </property>
+    </bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/discoverer/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/discoverer/module.properties b/core/resources/META-INF/cloudstack/discoverer/module.properties
new file mode 100644
index 0000000..9fba24c
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/discoverer/module.properties
@@ -0,0 +1,2 @@
+name=discoverer
+parent=core

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/discoverer/spring-core-lifecycle-discoverer-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/discoverer/spring-core-lifecycle-discoverer-context-inheritable.xml b/core/resources/META-INF/cloudstack/discoverer/spring-core-lifecycle-discoverer-context-inheritable.xml
new file mode 100644
index 0000000..2c83a10
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/discoverer/spring-core-lifecycle-discoverer-context-inheritable.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="resourceDiscoverersRegistry" />
+        <property name="typeClass" value="com.cloud.resource.Discoverer" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/network/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/network/module.properties b/core/resources/META-INF/cloudstack/network/module.properties
new file mode 100644
index 0000000..6e5219a
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/network/module.properties
@@ -0,0 +1,2 @@
+name=network
+parent=backend

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/network/spring-core-lifecycle-network-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/network/spring-core-lifecycle-network-context-inheritable.xml b/core/resources/META-INF/cloudstack/network/spring-core-lifecycle-network-context-inheritable.xml
new file mode 100644
index 0000000..b2660fc
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/network/spring-core-lifecycle-network-context-inheritable.xml
@@ -0,0 +1,58 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="ipDeployersRegistry" />
+        <property name="typeClass" value="com.cloud.network.element.IpDeployer" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="dhcpProvidersRegistry" />
+        <property name="typeClass"
+            value="com.cloud.network.element.DhcpServiceProvider" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="networkGurusRegistry" />
+        <property name="typeClass" value="com.cloud.network.guru.NetworkGuru" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="networkElementsRegistry" />
+        <property name="typeClass"
+            value="com.cloud.network.element.NetworkElement" />
+    </bean>
+    
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="vpcProvidersRegistry" />
+        <property name="typeClass"
+            value="com.cloud.network.element.VpcProvider" />
+    </bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/planner/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/planner/module.properties b/core/resources/META-INF/cloudstack/planner/module.properties
new file mode 100644
index 0000000..eea9158
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/planner/module.properties
@@ -0,0 +1,2 @@
+name=planner
+parent=allocator
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml b/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
new file mode 100644
index 0000000..715f86d
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
@@ -0,0 +1,41 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="deploymentPlannersRegistry" />
+        <property name="typeClass" value="com.cloud.deploy.DeploymentPlanner" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="affinityProcessorsRegistry" />
+        <property name="typeClass"
+            value="org.apache.cloudstack.affinity.AffinityGroupProcessor" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/storage/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/storage/module.properties b/core/resources/META-INF/cloudstack/storage/module.properties
new file mode 100644
index 0000000..fe32b10
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/storage/module.properties
@@ -0,0 +1,2 @@
+name=storage
+parent=backend

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/storage/spring-lifecycle-storage-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/storage/spring-lifecycle-storage-context-inheritable.xml b/core/resources/META-INF/cloudstack/storage/spring-lifecycle-storage-context-inheritable.xml
new file mode 100644
index 0000000..617dd21
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/storage/spring-lifecycle-storage-context-inheritable.xml
@@ -0,0 +1,60 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registryBeanName" value="dataStoreProviderManager" />
+        <property name="typeClass"
+            value="org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="storagePoolAllocatorsRegistry" />
+        <property name="typeClass"
+            value="org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="secondaryStorageVmAllocatorsRegistry" />
+        <property name="typeClass"
+            value="com.cloud.storage.secondary.SecondaryStorageVmAllocator" />
+    </bean>
+
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="templateAdapterRegistry" />
+        <property name="typeClass" value="com.cloud.template.TemplateAdapter" />
+    </bean>
+    
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="podAllocatorsRegistry" />
+        <property name="typeClass"
+            value="com.cloud.agent.manager.allocator.PodAllocator" />
+    </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/system/module.properties
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/system/module.properties b/core/resources/META-INF/cloudstack/system/module.properties
new file mode 100644
index 0000000..b86468e
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/system/module.properties
@@ -0,0 +1,2 @@
+name=system
+parent=bootstrap

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/system/spring-core-system-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/system/spring-core-system-context-inheritable.xml b/core/resources/META-INF/cloudstack/system/spring-core-system-context-inheritable.xml
new file mode 100644
index 0000000..80c5da7
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/system/spring-core-system-context-inheritable.xml
@@ -0,0 +1,54 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+  <!--
+    LifeCycle
+  -->
+  <bean id="cloudStackLifeCycle" class="org.apache.cloudstack.spring.lifecycle.CloudStackExtendedLifeCycle" />
+  <bean id="moduleStartup" class="org.apache.cloudstack.spring.lifecycle.CloudStackExtendedLifeCycleStart" >
+    <property name="lifeCycle" ref="cloudStackLifeCycle" />
+  </bean>
+
+  <!--
+    AOP
+  -->
+  <bean id="transactionContextInterceptor" class="com.cloud.utils.db.TransactionContextInterceptor" />
+  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
+  <aop:config>
+    <aop:advisor advice-ref="transactionContextInterceptor" 
+        pointcut="target(com.cloud.utils.db.GenericDaoBase)" />
+    <aop:advisor advice-ref="transactionContextInterceptor" 
+        pointcut="execution(* com.cloud.utils.db.EntityManager.*(..))" />
+    <aop:advisor advice-ref="actionEventInterceptor" 
+        pointcut="execution(* *(..)) &amp;&amp; @annotation(com.cloud.event.ActionEvent)" />
+    <aop:advisor advice-ref="actionEventInterceptor" 
+        pointcut="execution(* *(..)) &amp;&amp; @annotation(com.cloud.event.ActionEvents)" />
+  </aop:config>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/core/resources/META-INF/cloudstack/system/spring-core-system-context.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/system/spring-core-system-context.xml b/core/resources/META-INF/cloudstack/system/spring-core-system-context.xml
new file mode 100644
index 0000000..c2d540c
--- /dev/null
+++ b/core/resources/META-INF/cloudstack/system/spring-core-system-context.xml
@@ -0,0 +1,50 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+  <!--
+    Managed Context
+  -->
+  <bean id="ManagedContext" class="org.apache.cloudstack.managed.context.impl.DefaultManagedContext" >
+    <property name="listeners">
+        <list>
+            <!-- Put CallContext listener first because it will open and then close a DB connection.
+                If you put it after the TransactionContextListener, the thread will hold open a DB 
+                connection for the life of the thread -->
+            <bean class="org.apache.cloudstack.context.CallContextListener" />
+            <bean class="com.cloud.utils.db.TransactionContextListener" />
+        </list>
+    </property>
+  </bean>
+  
+  <bean class="org.apache.cloudstack.managed.context.ManagedContextRunnable" factory-method="initializeGlobalContext" 
+    autowire-candidate="false" >
+    <constructor-arg><ref bean="ManagedContext"/></constructor-arg>
+  </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/api/resources/META-INF/cloudstack/core/spring-engine-api-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/api/resources/META-INF/cloudstack/core/spring-engine-api-core-context.xml b/engine/api/resources/META-INF/cloudstack/core/spring-engine-api-core-context.xml
new file mode 100644
index 0000000..1cb8829
--- /dev/null
+++ b/engine/api/resources/META-INF/cloudstack/core/spring-engine-api-core-context.xml
@@ -0,0 +1,44 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="clusterRestService"
+        class="org.apache.cloudstack.engine.rest.service.api.ClusterRestService" />
+    <bean id="dataDisk"
+        class="org.apache.cloudstack.engine.subsystem.api.storage.type.DataDisk" />
+    <bean id="podRestService" class="org.apache.cloudstack.engine.rest.service.api.PodRestService" />
+    <bean id="iso" class="org.apache.cloudstack.engine.subsystem.api.storage.type.Iso" />
+    <bean id="networkRestService" class="org.apache.cloudstack.engine.rest.service.api.NetworkRestService" />
+    <bean id="provisioningServiceImpl" class="org.apache.cloudstack.engine.service.api.ProvisioningServiceImpl" />
+    <bean id="rootDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.RootDisk" />
+    <bean id="virtualMachineRestService" class="org.apache.cloudstack.engine.rest.service.api.VirtualMachineRestService" />
+    <bean id="volumeRestService" class="org.apache.cloudstack.engine.rest.service.api.VolumeRestService" />
+    <bean id="volumeTypeHelper" class="org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeTypeHelper" />
+    <bean id="zoneRestService" class="org.apache.cloudstack.engine.rest.service.api.ZoneRestService" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/components-api/resources/META-INF/cloudstack/core/spring-engine-components-api-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/components-api/resources/META-INF/cloudstack/core/spring-engine-components-api-core-context.xml b/engine/components-api/resources/META-INF/cloudstack/core/spring-engine-components-api-core-context.xml
new file mode 100644
index 0000000..fd7f967
--- /dev/null
+++ b/engine/components-api/resources/META-INF/cloudstack/core/spring-engine-components-api-core-context.xml
@@ -0,0 +1,30 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/orchestration/resources/META-INF/cloudstack/core/spring-engine-orchestration-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/orchestration/resources/META-INF/cloudstack/core/spring-engine-orchestration-core-context.xml b/engine/orchestration/resources/META-INF/cloudstack/core/spring-engine-orchestration-core-context.xml
new file mode 100644
index 0000000..b5c4254
--- /dev/null
+++ b/engine/orchestration/resources/META-INF/cloudstack/core/spring-engine-orchestration-core-context.xml
@@ -0,0 +1,71 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="clusterBasedAgentLoadBalancerPlanner"
+        class="com.cloud.cluster.agentlb.ClusterBasedAgentLoadBalancerPlanner">
+        <property name="name" value="ClusterBasedAgentLoadBalancerPlanner" />
+    </bean>
+
+    <bean id="volumeOrchestrator"
+        class="org.apache.cloudstack.engine.orchestration.VolumeOrchestrator">
+        <property name="podAllocators" value="#{podAllocatorsRegistry.registered}" />
+        <property name="storagePoolAllocators"
+            value="#{storagePoolAllocatorsRegistry.registered}" />
+    </bean>
+
+    <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl">
+        <property name="hostAllocators" value="#{hostAllocatorsRegistry.registered}" />
+        <property name="storagePoolAllocators"
+            value="#{storagePoolAllocatorsRegistry.registered}" />
+    </bean>
+
+    <bean id="networkOrchestrator"
+        class="org.apache.cloudstack.engine.orchestration.NetworkOrchestrator">
+        <property name="networkGurus" value="#{networkGurusRegistry.registered}" />
+        <property name="networkElements" value="#{networkElementsRegistry.registered}" />
+        <property name="ipDeployers" value="#{ipDeployersRegistry.registered}" />
+        <property name="dhcpProviders" value="#{dhcpProvidersRegistry.registered}" />
+    </bean>
+
+    <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
+
+
+    <bean id="cloudOrchestrator"
+        class="org.apache.cloudstack.engine.orchestration.CloudOrchestrator" />
+    <bean id="dataCenterResourceManagerImpl"
+        class="org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceManagerImpl" />
+    
+    <bean id="vMEntityManagerImpl" class="org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl" >
+        <property name="planners" value="#{deploymentPlannersRegistry.registered}" />
+    </bean>
+    
+    <bean id="virtualMachineEntityImpl" class="org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl" />
+    
+    
+</beans>


[5/9] Spring Modularization

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/pom.xml
----------------------------------------------------------------------
diff --git a/framework/pom.xml b/framework/pom.xml
index 4ea2df1..14e3368 100644
--- a/framework/pom.xml
+++ b/framework/pom.xml
@@ -38,5 +38,7 @@
     <module>db</module>
     <module>config</module>
     <module>managed-context</module>
+    <module>spring/lifecycle</module>
+    <module>spring/module</module>
   </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/pom.xml
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/pom.xml b/framework/spring/lifecycle/pom.xml
new file mode 100644
index 0000000..647101c
--- /dev/null
+++ b/framework/spring/lifecycle/pom.xml
@@ -0,0 +1,34 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    you under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
+    language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>cloud-framework-spring-lifecycle</artifactId>
+    <name>Apache CloudStack Framework - Spring Life Cycle</name>
+    <parent>
+        <groupId>org.apache.cloudstack</groupId>
+        <artifactId>cloud-maven-standard</artifactId>
+        <version>4.3.0-SNAPSHOT</version>
+        <relativePath>../../../maven-standard/pom.xml</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cloudstack</groupId>
+            <artifactId>cloud-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cloudstack</groupId>
+            <artifactId>cloud-framework-config</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractBeanCollector.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractBeanCollector.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractBeanCollector.java
new file mode 100644
index 0000000..a3c0d60
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractBeanCollector.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+
+/**
+ * This class provides a method to do basically the same as @Inject of a type, but
+ * it will only find the types in the current context and not the parent.  This class 
+ * should only be used for very specific Spring bootstrap logic.  In general @Inject 
+ * is infinitely better.  Basically you need a very good reason to use this.
+ *
+ */
+public abstract class AbstractBeanCollector extends AbstractSmartLifeCycle implements BeanPostProcessor {
+
+    Class<?>[] typeClasses = new Class<?>[] {};
+    Map<Class<?>, Set<Object>> beans = new HashMap<Class<?>, Set<Object>>();
+    
+    @Override
+    public int getPhase() {
+        return 2000;
+    }
+
+    @Override
+    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+        for ( Class<?> typeClass : typeClasses ) {
+            if ( typeClass.isAssignableFrom(bean.getClass()) ) {
+                doPostProcessBeforeInitialization(bean, beanName);
+                break;
+            }
+        }
+        
+        return bean;
+    }
+    
+    protected void doPostProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+    }
+
+    protected void doPostProcessAfterInitialization(Object bean, Class<?> typeClass, String beanName) throws BeansException {
+        Set<Object> beansOfType = beans.get(typeClass);
+        
+        if ( beansOfType == null ) {
+            beansOfType = new HashSet<Object>();
+            beans.put(typeClass, beansOfType);
+        }
+        
+        beansOfType.add(bean);
+    }
+
+    @Override
+    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+        for ( Class<?> typeClass : typeClasses ) {
+            if ( typeClass.isAssignableFrom(bean.getClass()) ) {
+                doPostProcessAfterInitialization(bean, typeClass, beanName);
+            }
+        }
+        
+        return bean;
+    }
+
+    protected <T> Set<T> getBeans(Class<T> typeClass) {
+        @SuppressWarnings("unchecked")
+        Set<T> result = (Set<T>) beans.get(typeClass);
+        
+        if ( result == null )
+            return Collections.emptySet();
+        
+        return result;
+    }
+    
+    public Class<?> getTypeClass() {
+        if ( typeClasses == null || typeClasses.length == 0 )
+            return null;
+        
+        return typeClasses[0];
+    }
+
+    public void setTypeClass(Class<?> typeClass) {
+        this.typeClasses = new Class<?>[] { typeClass };
+    }
+
+    public Class<?>[] getTypeClasses() {
+        return typeClasses;
+    }
+
+    public void setTypeClasses(Class<?>[] typeClasses) {
+        this.typeClasses = typeClasses;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractSmartLifeCycle.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractSmartLifeCycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractSmartLifeCycle.java
new file mode 100644
index 0000000..071817b
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/AbstractSmartLifeCycle.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle;
+
+import org.springframework.context.SmartLifecycle;
+
+public abstract class AbstractSmartLifeCycle implements SmartLifecycle {
+
+    boolean running = false;
+    
+    @Override
+    public void start() {
+        running = true;
+    }
+
+    @Override
+    public void stop() {
+        running = false;
+    }
+
+    @Override
+    public boolean isRunning() {
+        return running;
+    }
+
+    @Override
+    public boolean isAutoStartup() {
+        return true;
+    }
+
+    @Override
+    public void stop(Runnable callback) {
+        stop();
+        callback.run();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java
new file mode 100644
index 0000000..1b7ea51
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MalformedObjectNameException;
+import javax.management.NotCompliantMBeanException;
+import javax.naming.ConfigurationException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.cloud.utils.component.ComponentLifecycle;
+import com.cloud.utils.component.SystemIntegrityChecker;
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.mgmt.JmxUtil;
+import com.cloud.utils.mgmt.ManagementBean;
+
+public class CloudStackExtendedLifeCycle extends AbstractBeanCollector {
+
+    private static final Logger log = LoggerFactory.getLogger(CloudStackExtendedLifeCycle.class);
+    
+    Map<Integer, Set<ComponentLifecycle>> sorted = new TreeMap<Integer, Set<ComponentLifecycle>>();
+    
+    public CloudStackExtendedLifeCycle() {
+        super();
+        setTypeClasses(new Class<?>[] {
+            ComponentLifecycle.class,
+            SystemIntegrityChecker.class
+        });
+    }
+    
+    @Override
+    public void start() {
+        sortBeans();
+        checkIntegrity();
+        configure();
+        
+        super.start();
+    }
+
+    protected void checkIntegrity() {
+        for ( SystemIntegrityChecker checker : getBeans(SystemIntegrityChecker.class) ) {
+            log.info("Running system integrity checker {}", checker);
+            
+            checker.check();
+        }
+    }
+    
+    public void startBeans() {
+        log.info("Starting CloudStack Components");
+
+        with(new WithComponentLifeCycle() {
+            @Override
+            public void with(ComponentLifecycle lifecycle) {
+                lifecycle.start();
+                
+                if ( lifecycle instanceof ManagementBean ) {
+                    ManagementBean mbean = (ManagementBean)lifecycle;
+                    try {
+                        JmxUtil.registerMBean(mbean);
+                    } catch (MalformedObjectNameException e) {
+                        log.warn("Unable to register MBean: " + mbean.getName(), e);
+                    } catch (InstanceAlreadyExistsException e) {
+                        log.warn("Unable to register MBean: " + mbean.getName(), e);
+                    } catch (MBeanRegistrationException e) {
+                        log.warn("Unable to register MBean: " + mbean.getName(), e);
+                    } catch (NotCompliantMBeanException e) {
+                        log.warn("Unable to register MBean: " + mbean.getName(), e);
+                    }
+                    log.info("Registered MBean: " + mbean.getName());
+                }
+            }
+        });
+
+        log.info("Done Starting CloudStack Components");
+    }
+    
+    public void stopBeans() {
+        with(new WithComponentLifeCycle() {
+            @Override
+            public void with(ComponentLifecycle lifecycle) {
+                lifecycle.stop();
+            }
+        });
+    }
+
+    private void configure() {
+        log.info("Configuring CloudStack Components");
+        
+        with(new WithComponentLifeCycle() {
+            @Override
+            public void with(ComponentLifecycle lifecycle) {
+                try {
+                    lifecycle.configure(lifecycle.getName(), lifecycle.getConfigParams());
+                } catch (ConfigurationException e) {
+                    log.error("Failed to configure {}", lifecycle.getName(), e);
+                    throw new CloudRuntimeException(e);
+                }
+            }
+        });
+        
+        log.info("Done Configuring CloudStack Components");
+    }
+
+    private void sortBeans() {
+        for ( ComponentLifecycle lifecycle : getBeans(ComponentLifecycle.class) ) {
+            Set<ComponentLifecycle> set = sorted.get(lifecycle.getRunLevel());
+            
+            if ( set == null ) {
+                set = new HashSet<ComponentLifecycle>();
+                sorted.put(lifecycle.getRunLevel(), set);
+            }
+            
+            set.add(lifecycle);
+        }
+    }
+
+    @Override
+    public void stop() {
+        with(new WithComponentLifeCycle() {
+            @Override
+            public void with(ComponentLifecycle lifecycle) {
+                lifecycle.stop();
+            }
+        });
+        
+        super.stop();
+    }
+
+    protected void with(WithComponentLifeCycle with) {
+        for ( Set<ComponentLifecycle> lifecycles : sorted.values() ) {
+            for ( ComponentLifecycle lifecycle : lifecycles ) {
+                with.with(lifecycle);
+            }
+        }
+    }
+    
+    @Override
+    public int getPhase() {
+        return 2000;
+    }
+
+    private static interface WithComponentLifeCycle {
+       public void with(ComponentLifecycle lifecycle);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycleStart.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycleStart.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycleStart.java
new file mode 100644
index 0000000..33d4aea
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycleStart.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle;
+
+public class CloudStackExtendedLifeCycleStart extends AbstractSmartLifeCycle implements Runnable {
+
+    CloudStackExtendedLifeCycle lifeCycle;
+    
+    @Override
+    public void stop() {
+        lifeCycle.stopBeans();
+        super.stop();
+    }
+
+    @Override
+    public int getPhase() {
+        return 3000;
+    }
+
+    public CloudStackExtendedLifeCycle getLifeCycle() {
+        return lifeCycle;
+    }
+
+    public void setLifeCycle(CloudStackExtendedLifeCycle lifeCycle) {
+        this.lifeCycle = lifeCycle;
+    }
+
+    @Override
+    public void run() {
+        lifeCycle.startBeans();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackLog4jSetup.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackLog4jSetup.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackLog4jSetup.java
new file mode 100644
index 0000000..163703d
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackLog4jSetup.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle;
+
+import org.springframework.context.SmartLifecycle;
+
+import com.cloud.utils.LogUtils;
+
+public class CloudStackLog4jSetup implements SmartLifecycle {
+
+    @Override
+    public void start() {
+        LogUtils.initLog4j("log4j-cloud.xml");
+    }
+
+    @Override
+    public void stop() {
+    }
+
+    @Override
+    public boolean isRunning() {
+        return false;
+    }
+
+    @Override
+    public int getPhase() {
+        return 0;
+    }
+
+    @Override
+    public boolean isAutoStartup() {
+        return true;
+    }
+
+    @Override
+    public void stop(Runnable callback) {
+        callback.run();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/ConfigDepotLifeCycle.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/ConfigDepotLifeCycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/ConfigDepotLifeCycle.java
new file mode 100644
index 0000000..b380028
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/ConfigDepotLifeCycle.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.framework.config.ConfigDepotAdmin;
+import org.apache.cloudstack.framework.config.Configurable;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+
+public class ConfigDepotLifeCycle implements BeanPostProcessor {
+
+    @Inject
+    ConfigDepotAdmin configDepotAdmin;
+
+    @Override
+    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+        if ( bean instanceof Configurable ) {
+            configDepotAdmin.populateConfiguration((Configurable)bean);
+        }
+        
+        return bean;
+    }
+
+    @Override
+    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+        return bean;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java
new file mode 100644
index 0000000..5614a32
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/DumpRegistry.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle.registry;
+
+import java.util.List;
+
+import com.cloud.utils.component.ComponentLifecycleBase;
+import com.cloud.utils.component.Named;
+import com.cloud.utils.component.Registry;
+
+import javax.inject.Inject;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DumpRegistry extends ComponentLifecycleBase {
+
+    private static final Logger log = LoggerFactory.getLogger(DumpRegistry.class);
+    
+    List<Registry<?>> registries;
+
+    public List<Registry<?>> getRegistries() {
+        return registries;
+    }
+    
+    @Inject
+    public void setRegistries(List<Registry<?>> registries) {
+        this.registries = registries;
+    }
+
+    @Override
+    public boolean start() {
+        for ( Registry<?> registry : registries ) {
+            StringBuilder buffer = new StringBuilder();
+            
+            for ( Object o : registry.getRegistered() ) {
+                if ( buffer.length() > 0 )
+                    buffer.append(", ");
+                
+                buffer.append(getName(o));
+            }
+            
+            log.info("Registry [{}] contains [{}]", registry.getName(), buffer);
+        }
+        
+        return super.start();
+    }
+    
+    protected String getName(Object o) {
+        String name = null;
+        if (o instanceof Named) {
+            name = ((Named) o).getName();
+        }
+
+        if (name == null) {
+            name = o.getClass().getSimpleName();
+        }
+
+        return name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java
new file mode 100644
index 0000000..2bd362e
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java
@@ -0,0 +1,245 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle.registry;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.BeanNameAware;
+
+import com.cloud.utils.component.Named;
+import com.cloud.utils.component.Registry;
+
+public class ExtensionRegistry implements Registry<Object>, Configurable, BeanNameAware {
+
+    private static final Logger log = LoggerFactory.getLogger(ExtensionRegistry.class);
+    
+    String name;
+    String beanName;
+    
+    String orderConfigKey;
+    String orderConfigDefault;
+    ConfigKey<String> orderConfigKeyObj;
+    
+    String excludeKey;
+    String excludeDefault;
+    ConfigKey<String> excludeKeyObj;
+    
+    String configComponentName;
+    List<Object> preRegistered;
+    List<Object> registered = new CopyOnWriteArrayList<Object>();
+    List<Object> readOnly = Collections.unmodifiableList(registered);
+    
+    @Override
+    public boolean register(Object item) {
+        if ( registered.contains(item) )
+            return false;
+        
+        String[] order = new String[] {};
+        Set<String> exclude = new HashSet<String>();
+        
+        if ( orderConfigKeyObj != null ) {
+            Object value = orderConfigKeyObj.value();
+            if ( value != null && value.toString().trim().length() > 0 ) {
+                order = value.toString().trim().split("\\s*,\\s*");
+            }
+        }
+        
+        if ( excludeKeyObj != null ) {
+            Object value = excludeKeyObj.value();
+            if ( value != null && value.toString().trim().length() > 0 ) {
+                for ( String e : value.toString().trim().split("\\s*,\\s*") ) {
+                    exclude.add(e);
+                }
+            }
+        }
+        
+        String name = getName(item);
+        
+        if ( name != null && exclude.size() > 0 && exclude.contains(name) ) {
+            return false;
+        }
+        
+        if ( name == null && order.length > 0 ) {
+            throw new RuntimeException("getName() is null for [" + item + "]");
+        }
+        
+        int i = 0;
+        for ( String orderTest : order ) {
+            if ( orderTest.equals(name) ) {
+                registered.add(i, item);
+                i = -1;
+                break;
+            }
+            
+            if ( registered.size() <= i ) {
+                break;
+            }
+            
+            if ( getName(registered.get(i)).equals(orderTest) ) {
+                i++;
+            }
+        }
+        
+        if ( i != -1 ) {
+            registered.add(item);
+        }
+
+        log.debug("Registering extension [{}] in [{}]", name, this.name);
+        
+        return true;
+    }
+    
+    protected String getName(Object object) {
+        if ( object instanceof Named ) {
+            String name = ((Named)object).getName();
+            if ( name != null )
+                return name;
+        }
+        
+        return object == null ? null : object.getClass().getSimpleName();
+    }
+
+    @Override
+    public void unregister(Object type) {
+        registered.remove(type);
+    }
+
+    @Override
+    public List<Object> getRegistered() {
+        return readOnly;
+    }
+
+    @Override
+    public String getConfigComponentName() {
+        return configComponentName == null ? this.getClass().getSimpleName() : configComponentName;
+    }
+
+    @Override
+    public ConfigKey<?>[] getConfigKeys() {
+        List<ConfigKey<String>> result = new ArrayList<ConfigKey<String>>();
+        
+        if ( orderConfigKey != null && orderConfigKeyObj == null ) {
+            orderConfigKeyObj = new ConfigKey<String>("Advanced", String.class, orderConfigKey, orderConfigDefault, 
+                    "The order of precedence for the extensions", false);
+        }
+
+        if ( orderConfigKeyObj != null )
+            result.add(orderConfigKeyObj);
+        
+        if ( excludeKey != null && excludeKeyObj == null ) {
+            excludeKeyObj = new ConfigKey<String>("Advanced", String.class, excludeKey, excludeDefault, 
+                    "Extensions to exclude from being registered", false);
+        }
+        
+        if ( excludeKeyObj != null ) {
+            result.add(excludeKeyObj);
+        }
+        
+        return result.toArray(new ConfigKey[result.size()]);
+    }
+
+    @PostConstruct
+    public void init() {
+        if ( name == null ) {
+            for ( String part : beanName.replaceAll("([A-Z])", " $1").split("\\s+") ) {
+                part = StringUtils.capitalize(part.toLowerCase());;
+                
+                name = name == null ? part : name + " " + part;
+            }
+        }
+        
+        if ( preRegistered != null ) {
+            for ( Object o : preRegistered ) {
+                register(o);
+            }
+        }
+    }
+
+
+    public String getOrderConfigKey() {
+        return orderConfigKey;
+    }
+
+    public void setOrderConfigKey(String orderConfigKey) {
+        this.orderConfigKey = orderConfigKey;
+    }
+
+    public void setConfigComponentName(String configComponentName) {
+        this.configComponentName = configComponentName;
+    }
+
+    public String getOrderConfigDefault() {
+        return orderConfigDefault;
+    }
+
+    public void setOrderConfigDefault(String orderConfigDefault) {
+        this.orderConfigDefault = orderConfigDefault;
+    }
+
+    public String getExcludeKey() {
+        return excludeKey;
+    }
+
+    public void setExcludeKey(String excludeKey) {
+        this.excludeKey = excludeKey;
+    }
+
+    public String getExcludeDefault() {
+        return excludeDefault;
+    }
+
+    public void setExcludeDefault(String excludeDefault) {
+        this.excludeDefault = excludeDefault;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public void setBeanName(String name) {
+        this.beanName = name;
+    }
+
+    public List<Object> getPreRegistered() {
+        return preRegistered;
+    }
+
+    public void setPreRegistered(List<Object> preRegistered) {
+        this.preRegistered = preRegistered;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/PluggableServiceLifecycle.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/PluggableServiceLifecycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/PluggableServiceLifecycle.java
new file mode 100644
index 0000000..3eeeed8
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/PluggableServiceLifecycle.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle.registry;
+
+import com.cloud.utils.component.ComponentContext;
+import com.cloud.utils.component.PluggableService;
+
+public class PluggableServiceLifecycle extends RegistryLifecycle {
+
+    @Override
+    public void start() {
+        super.start();
+
+        for (Object obj : beans) {
+            if (obj instanceof PluggableService) {
+                for (Class<?> cmd : ((PluggableService) obj).getCommands()) {
+                    ComponentContext.addDelegateContext(cmd, applicationContext);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void stop() {
+        for (Object obj : beans) {
+            if (obj instanceof PluggableService) {
+                for (Class<?> cmd : ((PluggableService) obj).getCommands()) {
+                    ComponentContext.removeDelegateContext(cmd);
+                }
+            }
+        }
+
+        super.stop();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java
----------------------------------------------------------------------
diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java
new file mode 100644
index 0000000..bd7a033
--- /dev/null
+++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.lifecycle.registry;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.SmartLifecycle;
+
+import com.cloud.utils.component.Registry;
+
+public class RegistryLifecycle implements BeanPostProcessor, SmartLifecycle, ApplicationContextAware {
+
+    private static final Logger log = LoggerFactory.getLogger(RegistryLifecycle.class);
+    
+    Registry<Object> registry;
+    
+    /* The bean name works around circular dependency issues in Spring.  This shouldn't be
+     * needed if your beans are already nicely organized.  If they look like spaghetti, then you
+     * can use this.
+     */
+    String registryBeanName;
+    Set<Object> beans = new HashSet<Object>();
+    Class<?> typeClass;
+    ApplicationContext applicationContext;
+
+    @Override
+    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+        if ( typeClass.isAssignableFrom(bean.getClass()) )
+            beans.add(bean);
+        
+        return bean;
+    }
+
+    @Override
+    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+        return bean;
+    }
+
+    @Override
+    public void start() {
+        Iterator<Object> iter = beans.iterator();
+        Registry<Object> registry = lookupRegistry();
+        
+        while ( iter.hasNext() ) {
+            Object next = iter.next();
+            if ( registry.register(next) ) {
+                log.debug("Registered {}", next);
+            } else {
+                iter.remove();
+            }
+        }
+    }
+
+    @Override
+    public void stop() {
+        Registry<Object> registry = lookupRegistry();
+        
+        for ( Object bean : beans ) {
+            registry.unregister(bean);
+        }
+        
+        beans.clear();
+    }
+
+    @Override
+    public boolean isRunning() {
+        return false;
+    }
+
+    @Override
+    public int getPhase() {
+        return 2000;
+    }
+
+    @Override
+    public boolean isAutoStartup() {
+        return true;
+    }
+
+    @Override
+    public void stop(Runnable callback) {
+        stop();
+        callback.run();
+    }
+    
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.applicationContext = applicationContext;
+    }
+    
+    @SuppressWarnings("unchecked")
+    protected Registry<Object> lookupRegistry() {
+        return registry == null ? applicationContext.getBean(registryBeanName, Registry.class) : registry;
+    }
+
+    public Registry<Object> getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(Registry<Object> registry) {
+        this.registry = registry;
+    }
+
+    public Class<?> getTypeClass() {
+        return typeClass;
+    }
+
+    public void setTypeClass(Class<?> typeClass) {
+        this.typeClass = typeClass;
+    }
+
+    public String getRegistryBeanName() {
+        return registryBeanName;
+    }
+
+    public void setRegistryBeanName(String registryBeanName) {
+        this.registryBeanName = registryBeanName;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/pom.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/pom.xml b/framework/spring/module/pom.xml
new file mode 100644
index 0000000..b9d95a8
--- /dev/null
+++ b/framework/spring/module/pom.xml
@@ -0,0 +1,50 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>cloud-framework-spring-module</artifactId>
+    <parent>
+        <groupId>org.apache.cloudstack</groupId>
+        <artifactId>cloud-maven-standard</artifactId>
+        <version>4.3.0-SNAPSHOT</version>
+        <relativePath>../../../maven-standard/pom.xml</relativePath>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cloudstack</groupId>
+            <artifactId>cloud-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java
new file mode 100644
index 0000000..60d0262
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.context;
+
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.core.io.Resource;
+
+public class ResourceApplicationContext extends AbstractXmlApplicationContext {
+
+    Resource[] configResources;
+    String applicationName = "";
+
+    public ResourceApplicationContext() {
+    }
+
+    public ResourceApplicationContext(Resource... configResources) {
+        super();
+        this.configResources = configResources;
+    }
+
+    @Override
+    protected Resource[] getConfigResources() {
+        return configResources;
+    }
+
+    public void setConfigResources(Resource[] configResources) {
+        this.configResources = configResources;
+    }
+
+    @Override
+    public String getApplicationName() {
+        return applicationName;
+    }
+
+    public void setApplicationName(String applicationName) {
+        this.applicationName = applicationName;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java
new file mode 100644
index 0000000..e624a5b
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.factory;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.cloudstack.spring.module.locator.ModuleDefinitionLocator;
+import org.apache.cloudstack.spring.module.locator.impl.ClasspathModuleDefinitionLocator;
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.io.Resource;
+
+public class CloudStackSpringContext {
+
+    private static final Logger log = LoggerFactory.getLogger(CloudStackSpringContext.class);
+    
+    public static final String CLOUDSTACK_CONTEXT = "META-INF/cloudstack";
+    public static final String CLOUDSTACK_BASE = "bootstrap";
+    
+    ModuleBasedContextFactory factory = new ModuleBasedContextFactory();
+    ModuleDefinitionLocator loader = new ClasspathModuleDefinitionLocator();
+    ModuleDefinitionSet moduleDefinitionSet;
+    String baseName;
+    String contextName;
+    
+    public CloudStackSpringContext(String context, String base) throws IOException {
+        this.baseName = base;
+        this.contextName = context;
+        
+        factory = new ModuleBasedContextFactory();
+        loader = new ClasspathModuleDefinitionLocator();
+        init();
+    }
+    
+    public CloudStackSpringContext() throws IOException {
+        this(CLOUDSTACK_CONTEXT, CLOUDSTACK_BASE);
+    }
+    
+    public void init() throws IOException {
+        Collection<ModuleDefinition> defs = loader.locateModules(contextName);
+        
+        if ( defs.size() == 0 )
+            throw new RuntimeException("No modules found to load for Spring");
+        
+        moduleDefinitionSet = factory.loadModules(defs, baseName);
+    }
+    
+    public void registerShutdownHook() {
+        ApplicationContext base = moduleDefinitionSet.getApplicationContext(baseName);
+        
+        if ( base instanceof ConfigurableApplicationContext ) {
+            ((ConfigurableApplicationContext)base).registerShutdownHook();
+        }
+    }
+    
+    public ModuleDefinition getModuleDefinitionForWeb(String name) {
+        ModuleDefinition def = moduleDefinitionSet.getModuleDefinition(name);
+        
+        if ( def != null ) {
+            return def;
+        }
+        
+        /* Grab farthest descendant that is deterministic */
+        def = moduleDefinitionSet.getModuleDefinition(baseName);
+        
+        if ( def == null ) {
+            throw new RuntimeException("Failed to find base spring module to extend for web");
+        }
+        
+        while ( def.getChildren().size() == 1 ) {
+            def = def.getChildren().iterator().next();
+        }
+        
+        return def;
+    }
+    
+    public ApplicationContext getApplicationContextForWeb(String name) {
+        ModuleDefinition def = getModuleDefinitionForWeb(name);
+        
+        return moduleDefinitionSet.getApplicationContext(def.getName());
+    }
+    
+    public String[] getConfigLocationsForWeb(String name, String[] configured) {
+        if ( configured == null )
+            configured = new String[] {};
+        
+        ModuleDefinition def = getModuleDefinitionForWeb(name);
+        
+        List<Resource> inherited = new ArrayList<Resource>();
+        
+        while ( def != null ) {
+            inherited.addAll(def.getInheritableContextLocations());
+            def = moduleDefinitionSet.getModuleDefinition(def.getParentName());
+        }
+
+        List<String> urlList = new ArrayList<String>();
+        
+        for ( Resource r : inherited ) {
+            try {
+                String urlString = r.getURL().toExternalForm();
+                urlList.add(urlString);
+            } catch (IOException e) {
+                log.error("Failed to create URL for {}", r.getDescription(), e);
+            }
+        }
+        
+        String[] result = new String[urlList.size() + configured.length];
+        result = urlList.toArray(result);
+        
+        System.arraycopy(configured, 0, result, urlList.size(), configured.length);
+        
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactory.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactory.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactory.java
new file mode 100644
index 0000000..3f89d3a
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactory.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.factory;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet;
+import org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinitionSet;
+
+public class ModuleBasedContextFactory {
+
+    public ModuleDefinitionSet loadModules(Collection<ModuleDefinition> defs, String root) throws IOException {
+        
+        Map<String, ModuleDefinition> modules = wireUpModules(root, defs);
+        
+        DefaultModuleDefinitionSet moduleSet = new DefaultModuleDefinitionSet(modules, root);
+        moduleSet.load();
+        
+        return moduleSet;
+    }
+    
+    protected Map<String, ModuleDefinition> wireUpModules(String root, Collection<ModuleDefinition> defs) throws IOException {
+        Map<String, ModuleDefinition> modules = new HashMap<String, ModuleDefinition>();
+        
+        for ( ModuleDefinition def : defs ) {
+            modules.put(def.getName(), def);
+        }
+        
+        ModuleDefinition rootDef = null;
+        Map<String, ModuleDefinition> result = new HashMap<String, ModuleDefinition>();
+        
+        for ( ModuleDefinition def : modules.values() ) {
+            if ( def.getName().equals(root) ) {
+                rootDef = def;
+            }
+            
+            if ( def.getParentName() != null ) {
+                ModuleDefinition parentDef = modules.get(def.getParentName());
+                
+                if ( parentDef != null )
+                    parentDef.addChild(def);
+            }
+        }
+        
+        return traverse(rootDef, result);
+    }
+    
+    protected Map<String, ModuleDefinition> traverse(ModuleDefinition base, Map<String, ModuleDefinition> result) {
+        if ( base == null )
+            return result;
+        
+        if ( result.containsKey(base.getName()) ) {
+            throw new RuntimeException("Circular dependency to [" + base.getName() + "] from current set " +
+                    result.keySet());
+        }
+        
+        result.put(base.getName(), base);
+        
+        for ( ModuleDefinition childDef : base.getChildren() )
+            traverse(childDef, result);
+        
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/ModuleDefinitionLocator.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/ModuleDefinitionLocator.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/ModuleDefinitionLocator.java
new file mode 100644
index 0000000..6b14e0a
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/ModuleDefinitionLocator.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.locator;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+
+/**
+ * Responsible for locating the ModuleDefinition for a given context.  The implementation
+ * of this class should take extra care to set the ClassLoader of the ModuleDefinition
+ * properly.
+ *
+ */
+public interface ModuleDefinitionLocator {
+
+    Collection<ModuleDefinition> locateModules(String context) throws IOException;
+    
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionLocator.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionLocator.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionLocator.java
new file mode 100644
index 0000000..c9deacc
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionLocator.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.locator.impl;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.cloudstack.spring.module.locator.ModuleDefinitionLocator;
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.apache.cloudstack.spring.module.model.impl.DefaultModuleDefinition;
+import org.apache.cloudstack.spring.module.util.ModuleLocationUtils;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.core.io.support.ResourcePatternResolver;
+
+public class ClasspathModuleDefinitionLocator implements ModuleDefinitionLocator {
+    
+    protected ResourcePatternResolver getResolver() {
+        return new PathMatchingResourcePatternResolver();
+    }
+    
+    public Collection<ModuleDefinition> locateModules(String context) throws IOException {
+        ResourcePatternResolver resolver = getResolver();
+        
+        Map<String, ModuleDefinition> allModules = discoverModules(context, resolver);
+        
+        return allModules.values();
+    }
+    
+    protected Map<String, ModuleDefinition> discoverModules(String baseDir, ResourcePatternResolver resolver) throws IOException {
+        Map<String, ModuleDefinition> result = new HashMap<String, ModuleDefinition>();
+        
+        for ( Resource r : resolver.getResources(ModuleLocationUtils.getModulesLocation(baseDir)) ) {
+            DefaultModuleDefinition def = new DefaultModuleDefinition(baseDir, r, resolver);
+            def.init();
+            
+            if ( def.isValid() )
+                result.put(def.getName(), def);
+        }
+        
+        return result;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinition.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinition.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinition.java
new file mode 100644
index 0000000..b3c4647
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinition.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.model;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.springframework.core.io.Resource;
+
+public interface ModuleDefinition {
+    
+    ClassLoader getClassLoader();
+    
+    String getName();
+    
+    String getParentName();
+    
+    List<Resource> getConfigLocations();
+    
+    List<Resource> getContextLocations();
+    
+    List<Resource> getInheritableContextLocations();
+    
+    List<Resource> getOverrideContextLocations();
+    
+    boolean isValid();
+    
+    Collection<ModuleDefinition> getChildren();
+    
+    void addChild(ModuleDefinition childDef);
+    
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinitionSet.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinitionSet.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinitionSet.java
new file mode 100644
index 0000000..635a7a1
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/ModuleDefinitionSet.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.model;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.io.Resource;
+
+public interface ModuleDefinitionSet {
+
+    ModuleDefinition getModuleDefinition(String name);
+    
+    ApplicationContext getApplicationContext(String name);
+    
+    Resource[] getConfigResources(String name);
+    
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java
new file mode 100644
index 0000000..6c51808
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.model.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.TreeMap;
+
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.apache.cloudstack.spring.module.util.ModuleLocationUtils;
+import org.apache.commons.io.IOUtils;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.ResourcePatternResolver;
+import org.springframework.util.StringUtils;
+
+public class DefaultModuleDefinition implements ModuleDefinition {
+
+    public static final String NAME = "name";
+    public static final String PARENT = "parent";
+        
+    String name;
+    String baseDir;
+    String parent;
+    Resource moduleProperties;
+    ResourcePatternResolver resolver;
+    boolean valid;
+    
+    List<Resource> configLocations;
+    List<Resource> contextLocations;
+    List<Resource> inheritableContextLocations;
+    List<Resource> overrideContextLocations;
+    Map<String, ModuleDefinition> children = new TreeMap<String, ModuleDefinition>();
+    
+    public DefaultModuleDefinition(String baseDir, Resource moduleProperties, ResourcePatternResolver resolver) {
+        this.baseDir = baseDir;
+        this.resolver = resolver;
+        this.moduleProperties = moduleProperties;
+    }
+    
+    public void init() throws IOException {
+        
+        if ( ! moduleProperties.exists() ) {
+            return;
+        }
+        
+        resolveNameAndParent();
+        
+        contextLocations = Arrays.asList(resolver.getResources(ModuleLocationUtils.getContextLocation(baseDir, name)));
+        configLocations = Arrays.asList(resolver.getResources(ModuleLocationUtils.getDefaultsLocation(baseDir, name)));
+        inheritableContextLocations = Arrays.asList(resolver.getResources(ModuleLocationUtils.getInheritableContextLocation(baseDir, name)));
+        overrideContextLocations = Arrays.asList(resolver.getResources(ModuleLocationUtils.getOverrideContextLocation(baseDir, name)));
+
+        valid = true;
+    }
+    
+    protected void resolveNameAndParent() throws IOException {
+        InputStream is = null;
+        
+        try {
+            is = moduleProperties.getInputStream();
+            Properties props = new Properties();
+            props.load(is);
+            
+            name = props.getProperty(NAME);
+            parent = props.getProperty(PARENT);
+            
+            if ( ! StringUtils.hasText(name) ) {
+                throw new IOException("Missing name property in [" + location() + "]");
+            }
+            
+            if ( ! StringUtils.hasText(parent) ) {
+                parent = null;
+            }
+            
+            checkNameMatchesSelf();
+        } finally {
+            IOUtils.closeQuietly(is);
+        }
+    }
+    
+    protected void checkNameMatchesSelf() throws IOException {
+        String expectedLocation = ModuleLocationUtils.getModuleLocation(baseDir, name);
+        Resource self = resolver.getResource(expectedLocation);
+        
+        if ( ! self.exists() ) {
+            throw new IOException("Resource [" + location() + "] is expected to exist at [" +
+                    expectedLocation + "] please ensure the name property is correct");
+        }
+        
+        String moduleUrl = moduleProperties.getURL().toExternalForm();
+        String selfUrl = self.getURL().toExternalForm();
+            
+        if ( ! moduleUrl.equals(selfUrl) ) {
+            throw new IOException("Resource [" + location() + "] and [" +
+                    self.getURL() + "] do not appear to be the same resource, " + 
+                    "please ensure the name property is correct");
+        }
+    }
+    
+    private String location() throws IOException {
+        return moduleProperties.getURL().toString();
+    }
+    
+    public void addChild(ModuleDefinition def) {
+        children.put(def.getName(), def);
+    }
+    
+    public Collection<ModuleDefinition> getChildren() {
+        return children.values();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getParentName() {
+        return parent;
+    }
+
+    public List<Resource> getConfigLocations() {
+        return configLocations;
+    }
+
+    public List<Resource> getContextLocations() {
+        return contextLocations;
+    }
+
+    public List<Resource> getInheritableContextLocations() {
+        return inheritableContextLocations;
+    }
+
+    @Override
+    public List<Resource> getOverrideContextLocations() {
+        return overrideContextLocations;
+    }
+
+    public boolean isValid() {
+        return valid;
+    }
+
+    public ClassLoader getClassLoader() {
+        return resolver.getClassLoader();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java
new file mode 100644
index 0000000..15df839
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java
@@ -0,0 +1,243 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.model.impl;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.EmptyStackException;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+
+import org.apache.cloudstack.spring.module.context.ResourceApplicationContext;
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.UrlResource;
+
+public class DefaultModuleDefinitionSet implements ModuleDefinitionSet {
+
+    private static final Logger log = LoggerFactory.getLogger(DefaultModuleDefinitionSet.class);
+    
+    public static final String DEFAULT_CONFIG_RESOURCES = "DefaultConfigResources";
+    public static final String DEFAULT_CONFIG_XML = "defaults-context.xml";
+    
+    String root;
+    Map<String, ModuleDefinition> modules;
+    Map<String, ApplicationContext> contexts = new HashMap<String, ApplicationContext>();
+    ApplicationContext rootContext = null;
+
+    public DefaultModuleDefinitionSet(Map<String, ModuleDefinition> modules, String root) {
+        super();
+        this.root = root;
+        this.modules = modules;
+    }
+
+    public void load() throws IOException {
+        if ( ! loadRootContext() )
+            return;
+        
+        printHierarchy();
+        loadContexts();
+        startContexts();
+    }
+    
+    protected boolean loadRootContext() {
+        ModuleDefinition def = modules.get(root);
+        
+        if ( def == null )
+            return false;
+        
+        ApplicationContext defaultsContext = getDefaultsContext();
+        
+        rootContext = loadContext(def, defaultsContext);
+        
+        return true;
+    }
+    
+    protected void startContexts() {
+        withModule(new WithModule() {
+            public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
+                try {
+                    ApplicationContext context = getApplicationContext(def.getName());
+                    try {
+                        Runnable runnable = context.getBean("moduleStartup", Runnable.class);
+                        log.info("Starting module [{}]", def.getName());
+                        runnable.run();
+                    } catch ( BeansException e ) {
+                       // Ignore 
+                    }
+                } catch ( EmptyStackException e ) {
+                    // The root context is already loaded, so ignore the exception
+                }
+            }
+        });
+    }
+    
+    protected void loadContexts() {
+        withModule(new WithModule() {
+            public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
+                try {
+                    ApplicationContext parent = getApplicationContext(parents.peek().getName());
+                    loadContext(def, parent);
+                } catch ( EmptyStackException e ) {
+                    // The root context is already loaded, so ignore the exception
+                }
+            }
+        });
+    }
+    protected ApplicationContext loadContext(ModuleDefinition def, ApplicationContext parent) {
+        ResourceApplicationContext context = new ResourceApplicationContext();
+        context.setApplicationName("/" + def.getName());
+        
+        Resource[] resources = getConfigResources(def.getName());
+        context.setConfigResources(resources);
+        context.setParent(parent);
+        context.setClassLoader(def.getClassLoader());
+
+        long start = System.currentTimeMillis();
+        if ( log.isInfoEnabled() ) {
+            for ( Resource resource : resources ) {
+                log.info("Loading module context [{}] from {}", def.getName(), resource);
+            }
+        }
+        context.refresh();
+        log.info("Loaded module context [{}] in {} ms", def.getName(), (System.currentTimeMillis() - start));
+        
+        contexts.put(def.getName(), context);
+        
+        return context;
+    }
+    
+    protected boolean shouldLoad(ModuleDefinition def) {
+        return true;
+    }
+    
+    protected ApplicationContext getDefaultsContext() {
+        URL config = DefaultModuleDefinitionSet.class.getResource(DEFAULT_CONFIG_XML);
+        
+        ResourceApplicationContext context = new ResourceApplicationContext(new UrlResource(config));
+        context.setApplicationName("/defaults");
+        context.refresh();
+        
+        @SuppressWarnings("unchecked")
+        final List<Resource> resources = (List<Resource>) context.getBean(DEFAULT_CONFIG_RESOURCES);
+        
+        withModule(new WithModule() {
+            public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
+                for ( Resource defaults : def.getConfigLocations() ) {
+                    resources.add(defaults);
+                }
+            }
+        });
+        
+        return context;
+    }
+    
+    protected void printHierarchy() {
+        withModule(new WithModule() {
+            public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
+                log.info(String.format("Module Hierarchy:%" + ((parents.size() * 2) + 1) + "s%s", "", def.getName()));
+            }
+        });
+    }
+    
+    protected void withModule(WithModule with) {
+        ModuleDefinition rootDef = modules.get(root);
+        withModule(rootDef, new Stack<ModuleDefinition>(), with);
+    }
+    
+    protected void withModule(ModuleDefinition def, Stack<ModuleDefinition> parents, WithModule with) {
+        if ( def == null )
+            return;
+        
+        if ( ! shouldLoad(def) ) {
+            return;
+        }
+        
+        with.with(def, parents);
+        
+        parents.push(def);
+        
+        for ( ModuleDefinition child : def.getChildren() ) {
+            withModule(child, parents, with);
+        }
+        
+        parents.pop();
+    }
+    
+    private static interface WithModule {
+        public void with(ModuleDefinition def, Stack<ModuleDefinition> parents);
+    }
+    
+    @Configuration
+    public static class ConfigContext {
+        
+        List<Resource> resources;
+        
+        public ConfigContext(List<Resource> resources) {
+            super();
+            this.resources = resources;
+        }
+
+        @Bean(name = DEFAULT_CONFIG_RESOURCES)
+        public List<Resource> defaultConfigResources() {
+            return new ArrayList<Resource>();
+        }
+    }
+
+    public ApplicationContext getApplicationContext(String name) {
+        return contexts.get(name);
+    }
+
+    public Resource[] getConfigResources(String name) {
+        Set<Resource> resources = new LinkedHashSet<Resource>();
+        
+        ModuleDefinition original = null;
+        ModuleDefinition def = original = modules.get(name);
+        
+        if ( def == null )
+            return new Resource[] {};
+        
+        resources.addAll(def.getContextLocations());
+        
+        while ( def != null ) {
+            resources.addAll(def.getInheritableContextLocations());
+            def = modules.get(def.getParentName());
+        }
+        
+        resources.addAll(original.getOverrideContextLocations());
+        
+        return resources.toArray(new Resource[resources.size()]);
+    }
+
+    public ModuleDefinition getModuleDefinition(String name) {
+        return modules.get(name);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/Main.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/Main.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/Main.java
new file mode 100644
index 0000000..3a9660c
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/Main.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.util;
+
+import org.apache.cloudstack.spring.module.factory.CloudStackSpringContext;
+
+public class Main {
+
+    long start = System.currentTimeMillis();
+    
+    public Main() {
+        
+    }
+    
+    public void start() throws Exception {
+        CloudStackSpringContext context = new CloudStackSpringContext();
+        context.registerShutdownHook();
+        
+        if ( Boolean.getBoolean("force.exit") ) {
+            System.exit(0);
+        }
+    }
+    
+    public long getTime() {
+        return System.currentTimeMillis() - start;
+    }
+    
+    
+    public static void main(String... args) {
+        Main main = new Main();
+
+        try {
+            main.start();
+            System.out.println("STARTUP COMPLETE [" + main.getTime() + "] ms");
+        } catch ( Exception e ) {
+            e.printStackTrace();
+            System.out.println("STARTUP FAILED [" + main.getTime() + "] ms");
+            System.err.println("STARTUP FAILED [" + main.getTime() + "] ms");
+            System.exit(1);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/ModuleLocationUtils.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/ModuleLocationUtils.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/ModuleLocationUtils.java
new file mode 100644
index 0000000..eeab154
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/util/ModuleLocationUtils.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.util;
+
+public class ModuleLocationUtils {
+
+    private static final String ALL_MODULE_PROPERTIES = "classpath*:%s/*/module.properties";
+    private static final String MODULE_PROPERTIES = "classpath:%s/%s/module.properties";
+    private static final String CONTEXT_LOCATION = "classpath*:%s/%s/*context.xml";
+    private static final String INHERTIABLE_CONTEXT_LOCATION = "classpath*:%s/%s/*context-inheritable.xml";
+    private static final String OVERRIDE_CONTEXT_LOCATION = "classpath*:%s/%s/*context-override.xml";
+    private static final String DEFAULTS_LOCATION = "classpath*:%s/%s/*defaults.properties";
+
+    public static String getModulesLocation(String baseDir) {
+        return String.format(ALL_MODULE_PROPERTIES, baseDir);
+    }
+    
+    public static String getModuleLocation(String baseDir, String name) {
+        return String.format(MODULE_PROPERTIES, baseDir, name);
+    }
+    
+    public static String getContextLocation(String baseDir, String name) {
+        return String.format(CONTEXT_LOCATION, baseDir, name);
+    }
+    
+    public static String getInheritableContextLocation(String baseDir, String name) {
+        return String.format(INHERTIABLE_CONTEXT_LOCATION, baseDir, name);
+    }
+    
+    public static String getOverrideContextLocation(String baseDir, String name) {
+        return String.format(OVERRIDE_CONTEXT_LOCATION, baseDir, name);
+    }
+    
+    public static String getDefaultsLocation(String baseDir, String name) {
+        return String.format(DEFAULTS_LOCATION, baseDir, name);
+    }
+}


[3/9] Spring Modularization

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/spring-host-allocator-random-context.xml
----------------------------------------------------------------------
diff --git a/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/spring-host-allocator-random-context.xml b/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/spring-host-allocator-random-context.xml
new file mode 100644
index 0000000..8df1bdb
--- /dev/null
+++ b/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/spring-host-allocator-random-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="randomAllocator"
+        class="com.cloud.agent.manager.allocator.impl.RandomAllocator" />
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/module.properties b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/module.properties
new file mode 100644
index 0000000..2cbce1c
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/module.properties
@@ -0,0 +1,2 @@
+name=baremetal-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/spring-baremetal-compute-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/spring-baremetal-compute-context.xml b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/spring-baremetal-compute-context.xml
new file mode 100644
index 0000000..cce6805
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-compute/spring-baremetal-compute-context.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
+        <property name="name" value="BaremetalGuru" />
+    </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/module.properties b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/module.properties
new file mode 100644
index 0000000..049ed51
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/module.properties
@@ -0,0 +1,2 @@
+name=baremetal-discoverer
+parent=discoverer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/spring-baremetal-discoverer-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/spring-baremetal-discoverer-context.xml b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/spring-baremetal-discoverer-context.xml
new file mode 100644
index 0000000..8792909
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-discoverer/spring-baremetal-discoverer-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
+        <property name="name" value="Bare Metal Agent" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/module.properties b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/module.properties
new file mode 100644
index 0000000..1de6da3
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/module.properties
@@ -0,0 +1,2 @@
+name=baremetal-network
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/spring-baremetal-network-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/spring-baremetal-network-context.xml b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/spring-baremetal-network-context.xml
new file mode 100644
index 0000000..40d9f50
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-network/spring-baremetal-network-context.xml
@@ -0,0 +1,46 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="BareMetalDhcp"
+        class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
+        <property name="name" value="BareMetalDhcp" />
+    </bean>
+    <bean id="BareMetalPxe"
+        class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
+        <property name="name" value="BareMetalPxe" />
+    </bean>
+    <bean id="BareMetalUserdata"
+        class="com.cloud.baremetal.networkservice.BaremetalUserdataElement">
+        <property name="name" value="BareMetalUserdata" />
+    </bean>
+
+    <bean id="BaremetalDhcpManager"
+        class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/module.properties b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/module.properties
new file mode 100644
index 0000000..2dc88f7
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/module.properties
@@ -0,0 +1,2 @@
+name=baremetal-planner
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/spring-baremetal-planner-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/spring-baremetal-planner-context.xml b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/spring-baremetal-planner-context.xml
new file mode 100644
index 0000000..8c14c3e
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-planner/spring-baremetal-planner-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
+        <property name="name" value="BareMetalPlanner" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/module.properties b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/module.properties
new file mode 100644
index 0000000..b22bc8e
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/module.properties
@@ -0,0 +1,2 @@
+name=baremetal-storage
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/spring-baremetal-storage-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/spring-baremetal-storage-context.xml b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/spring-baremetal-storage-context.xml
new file mode 100644
index 0000000..e0a9e36
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/baremetal-storage/spring-baremetal-storage-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/core/spring-baremetal-core-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/core/spring-baremetal-core-context.xml b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/core/spring-baremetal-core-context.xml
new file mode 100644
index 0000000..11cc6c8
--- /dev/null
+++ b/plugins/hypervisors/baremetal/resources/META-INF/cloudstack/core/spring-baremetal-core-context.xml
@@ -0,0 +1,42 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl" />
+
+    <bean id="BaremetalKickStartPxeService"
+        class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl" />
+    <bean id="BaremetalPingPxeService"
+        class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
+    <bean id="BaremetalPxeManager"
+        class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" />
+
+    <bean id="baremetalDhcpDaoImpl" class="com.cloud.baremetal.database.BaremetalDhcpDaoImpl" />
+    <bean id="baremetalPxeDaoImpl" class="com.cloud.baremetal.database.BaremetalPxeDaoImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/module.properties b/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/module.properties
new file mode 100644
index 0000000..43587c6
--- /dev/null
+++ b/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/module.properties
@@ -0,0 +1,2 @@
+name=kvm-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/spring-kvm-compute-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/spring-kvm-compute-context.xml b/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/spring-kvm-compute-context.xml
new file mode 100644
index 0000000..ce596f2
--- /dev/null
+++ b/plugins/hypervisors/kvm/resources/META-INF/cloudstack/kvm-compute/spring-kvm-compute-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="KVMInvestigator" class="com.cloud.ha.KVMInvestigator">
+        <property name="name" value="KVMInvestigator" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/module.properties b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/module.properties
new file mode 100644
index 0000000..6a74b52
--- /dev/null
+++ b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/module.properties
@@ -0,0 +1,2 @@
+name=ovm-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/spring-ovm-compute-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/spring-ovm-compute-context.xml b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/spring-ovm-compute-context.xml
new file mode 100644
index 0000000..b12672a
--- /dev/null
+++ b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-compute/spring-ovm-compute-context.xml
@@ -0,0 +1,39 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
+        <property name="name" value="OvmFenceBuilder" />
+    </bean>
+
+    <bean id="OvmGuru" class="com.cloud.ovm.hypervisor.OvmGuru">
+        <property name="name" value="OvmGuru" />
+    </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/module.properties b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/module.properties
new file mode 100644
index 0000000..ce2fcbc
--- /dev/null
+++ b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/module.properties
@@ -0,0 +1,2 @@
+name=ovm-discoverer
+parent=discoverer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/spring-ovm-discoverer-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/spring-ovm-discoverer-context.xml b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/spring-ovm-discoverer-context.xml
new file mode 100644
index 0000000..b0f2a15
--- /dev/null
+++ b/plugins/hypervisors/ovm/resources/META-INF/cloudstack/ovm-discoverer/spring-ovm-discoverer-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
+        <property name="name" value="Ovm Discover" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/core/spring-simulator-core-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/core/spring-simulator-core-context.xml b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/core/spring-simulator-core-context.xml
new file mode 100644
index 0000000..4905ae8
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/core/spring-simulator-core-context.xml
@@ -0,0 +1,45 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="mockConfigurationDaoImpl" class="com.cloud.simulator.dao.MockConfigurationDaoImpl" />
+    <bean id="mockHostDaoImpl" class="com.cloud.simulator.dao.MockHostDaoImpl" />
+    <bean id="mockSecStorageDaoImpl" class="com.cloud.simulator.dao.MockSecStorageDaoImpl" />
+    <bean id="mockSecurityRulesDaoImpl" class="com.cloud.simulator.dao.MockSecurityRulesDaoImpl" />
+    <bean id="mockStoragePoolDaoImpl" class="com.cloud.simulator.dao.MockStoragePoolDaoImpl" />
+    <bean id="mockVMDaoImpl" class="com.cloud.simulator.dao.MockVMDaoImpl" />
+    <bean id="mockVolumeDaoImpl" class="com.cloud.simulator.dao.MockVolumeDaoImpl" />
+    <bean id="simulatorManagerImpl" class="com.cloud.agent.manager.SimulatorManagerImpl" />
+    <bean id="mockStorageManagerImpl" class="com.cloud.agent.manager.MockStorageManagerImpl" />
+    <bean id="mockVmManagerImpl" class="com.cloud.agent.manager.MockVmManagerImpl" />
+    <bean id="mockNetworkManagerImpl" class="com.cloud.agent.manager.MockNetworkManagerImpl" />
+    <bean id="mockAgentManagerImpl" class="com.cloud.agent.manager.MockAgentManagerImpl" >
+        <property name="discoverers" value="#{resourceDiscoverersRegistry.registered}" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/module.properties b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/module.properties
new file mode 100644
index 0000000..6a51de9
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/module.properties
@@ -0,0 +1,2 @@
+name=simulator-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/spring-simulator-compute-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/spring-simulator-compute-context.xml b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/spring-simulator-compute-context.xml
new file mode 100644
index 0000000..1146233
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-compute/spring-simulator-compute-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="SimulatorGuru" class="com.cloud.simulator.SimulatorGuru">
+        <property name="name" value="Simulator Guru"/>
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/module.properties b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/module.properties
new file mode 100644
index 0000000..060d9da
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/module.properties
@@ -0,0 +1,2 @@
+name=simulator-discoverer
+parent=discoverer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/spring-simulator-discover-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/spring-simulator-discover-context.xml b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/spring-simulator-discover-context.xml
new file mode 100644
index 0000000..323f64f
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-discoverer/spring-simulator-discover-context.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="SimulatorDiscoverer" class="com.cloud.resource.SimulatorDiscoverer">
+        <property name="name" value="Simulator Agent" />
+    </bean>
+    <bean id="SimulatorSecondaryDiscoverer" class="com.cloud.resource.SimulatorSecondaryDiscoverer">
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/module.properties b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/module.properties
new file mode 100644
index 0000000..e1f6e19
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/module.properties
@@ -0,0 +1,2 @@
+name=simulator-planner
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/spring-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/spring-context.xml b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/spring-context.xml
new file mode 100644
index 0000000..8c14c3e
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-planner/spring-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
+        <property name="name" value="BareMetalPlanner" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/module.properties b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/module.properties
new file mode 100644
index 0000000..f804b87
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/module.properties
@@ -0,0 +1,2 @@
+name=simulator-storage
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/spring-simulator-storage-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/spring-simulator-storage-context.xml b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/spring-simulator-storage-context.xml
new file mode 100644
index 0000000..4cb73e6
--- /dev/null
+++ b/plugins/hypervisors/simulator/resources/META-INF/cloudstack/simulator-storage/spring-simulator-storage-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="SimulatorImageStoreProviderImpl"
+        class="org.apache.cloudstack.storage.datastore.provider.SimulatorImageStoreProviderImpl" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
index fcc1b4f..4075c87 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
@@ -16,6 +16,26 @@
 // under the License.
 package com.cloud.agent.manager;
 
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.PatternSyntaxException;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckHealthCommand;
@@ -31,7 +51,12 @@ import com.cloud.dc.dao.HostPodDao;
 import com.cloud.exception.DiscoveryException;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
-import com.cloud.resource.*;
+import com.cloud.resource.AgentResourceBase;
+import com.cloud.resource.AgentRoutingResource;
+import com.cloud.resource.AgentStorageResource;
+import com.cloud.resource.Discoverer;
+import com.cloud.resource.ResourceManager;
+import com.cloud.resource.SimulatorSecondaryDiscoverer;
 import com.cloud.simulator.MockHost;
 import com.cloud.simulator.MockHostVO;
 import com.cloud.simulator.MockVMVO;
@@ -44,24 +69,6 @@ import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.NetUtils;
-import org.apache.cloudstack.api.command.admin.host.AddSecondaryStorageCmd;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.PatternSyntaxException;
 
 @Component
 @Local(value = { MockAgentManager.class })
@@ -81,10 +88,13 @@ public class MockAgentManagerImpl extends ManagerBase implements MockAgentManage
     MockStorageManager _storageMgr = null;
     @Inject
     ResourceManager _resourceMgr;
-    @Inject
+    
     SimulatorSecondaryDiscoverer discoverer;
     @Inject
     HostDao hostDao;
+    
+    List<Discoverer> discoverers;
+    
     private SecureRandom random;
     private final Map<String, AgentResourceBase> _resources = new ConcurrentHashMap<String, AgentResourceBase>();
     private ThreadPoolExecutor _executor;
@@ -452,6 +462,17 @@ public class MockAgentManagerImpl extends ManagerBase implements MockAgentManage
 
     @Override
     public boolean start() {
+        for ( Discoverer discoverer : discoverers ) {
+            if ( discoverer instanceof SimulatorSecondaryDiscoverer ) {
+                this.discoverer = (SimulatorSecondaryDiscoverer)discoverer;
+                break;
+            }
+        }
+
+        if ( this.discoverer == null ) {
+            throw new IllegalStateException("Failed to find SimulatorSecondaryDiscoverer");
+        }
+
         return true;
     }
 
@@ -477,4 +498,13 @@ public class MockAgentManagerImpl extends ManagerBase implements MockAgentManage
         }
         return new CheckNetworkAnswer(cmd, true, "Network Setup check by names is done");
     }
+
+    public List<Discoverer> getDiscoverers() {
+        return discoverers;
+    }
+
+    @Inject
+    public void setDiscoverers(List<Discoverer> discoverers) {
+        this.discoverers = discoverers;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/ucs/resources/META-INF/cloudstack/core/spring-ucs-core-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ucs/resources/META-INF/cloudstack/core/spring-ucs-core-context.xml b/plugins/hypervisors/ucs/resources/META-INF/cloudstack/core/spring-ucs-core-context.xml
new file mode 100644
index 0000000..47732f4
--- /dev/null
+++ b/plugins/hypervisors/ucs/resources/META-INF/cloudstack/core/spring-ucs-core-context.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="UcsManager" class="com.cloud.ucs.manager.UcsManagerImpl" />
+    <bean id="ucsBladeDaoImpl" class="com.cloud.ucs.database.UcsBladeDaoImpl" />
+    <bean id="ucsManagerDaoImpl" class="com.cloud.ucs.database.UcsManagerDaoImpl" />
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/core/spring-vmware-core-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/core/spring-vmware-core-context.xml b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/core/spring-vmware-core-context.xml
new file mode 100644
index 0000000..406ffe1
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/core/spring-vmware-core-context.xml
@@ -0,0 +1,43 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="VmwareManager"
+        class="com.cloud.hypervisor.vmware.manager.VmwareManagerImpl" />
+    <bean id="vmwareContextFactory"
+        class="com.cloud.hypervisor.vmware.resource.VmwareContextFactory" />
+    <bean id="VmwareDatacenterDaoImpl"
+        class="com.cloud.hypervisor.vmware.dao.VmwareDatacenterDaoImpl" />
+    <bean id="VmwareDatacenterZoneMapDaoImpl"
+        class="com.cloud.hypervisor.vmware.dao.VmwareDatacenterZoneMapDaoImpl" />
+    <bean id="LegacyZoneDaoImpl" class="com.cloud.hypervisor.vmware.dao.LegacyZoneDaoImpl" />
+
+
+    <bean id="ciscoNexusVSMDeviceDaoImpl" class="com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl" />
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/module.properties b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/module.properties
new file mode 100644
index 0000000..88bab99
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/module.properties
@@ -0,0 +1,2 @@
+name=vmware-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/spring-vmware-compute-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/spring-vmware-compute-context.xml b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/spring-vmware-compute-context.xml
new file mode 100644
index 0000000..402640d
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/spring-vmware-compute-context.xml
@@ -0,0 +1,43 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="VmwareFencer" class="com.cloud.ha.VmwareFencer">
+        <property name="name" value="VMwareFenceBuilder" />
+    </bean>
+
+    <bean id="VMwareGuru" class="com.cloud.hypervisor.guru.VMwareGuru">
+        <property name="name" value="VMwareGuru" />
+    </bean>
+
+    <bean id="VmwareInvestigator" class="com.cloud.ha.VmwareInvestigator">
+        <property name="name" value="VMwareInvestigator" />
+    </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/vmware-defaults.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/vmware-defaults.properties b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/vmware-defaults.properties
new file mode 100644
index 0000000..5c7ebe2
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-compute/vmware-defaults.properties
@@ -0,0 +1 @@
+premium=true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/module.properties b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/module.properties
new file mode 100644
index 0000000..463e8b8
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/module.properties
@@ -0,0 +1,2 @@
+name=vmware-discoverer
+parent=discoverer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/spring-vmware-discoverer-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/spring-vmware-discoverer-context.xml b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/spring-vmware-discoverer-context.xml
new file mode 100644
index 0000000..933f0e8
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-discoverer/spring-vmware-discoverer-context.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="vmwareServerDiscoverer" class="com.cloud.hypervisor.vmware.VmwareServerDiscoverer">
+        <property name="name" value="VMware Discover" />
+        <property name="networkElements" value="#{networkElementsRegistry.registered}" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/module.properties b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/module.properties
new file mode 100644
index 0000000..12573df
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/module.properties
@@ -0,0 +1,2 @@
+name=vmware-network
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/spring-vmware-network-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/spring-vmware-network-context.xml b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/spring-vmware-network-context.xml
new file mode 100644
index 0000000..440356b
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-network/spring-vmware-network-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="CiscoNexus1000vVSM" class="com.cloud.network.element.CiscoNexusVSMElement">
+        <property name="name" value="CiscoNexus1000vVSM" />
+    </bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/module.properties b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/module.properties
new file mode 100644
index 0000000..70d5eeb
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/module.properties
@@ -0,0 +1,2 @@
+name=vmware-storage
+parent=storage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/spring-vmware-storage-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/spring-vmware-storage-context.xml b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/spring-vmware-storage-context.xml
new file mode 100644
index 0000000..bb428bf
--- /dev/null
+++ b/plugins/hypervisors/vmware/resources/META-INF/cloudstack/vmware-storage/spring-vmware-storage-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="vmwareStorageMotionStrategy"
+        class="org.apache.cloudstack.storage.motion.VmwareStorageMotionStrategy" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
index fd7b3b4..58255bf 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
@@ -60,10 +60,12 @@ import com.cloud.hypervisor.vmware.resource.VmwareResource;
 import com.cloud.hypervisor.vmware.util.VmwareContext;
 import com.cloud.network.NetworkModel;
 import com.cloud.network.Networks.TrafficType;
+import com.cloud.network.Network;
 import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.VmwareTrafficLabel;
 import com.cloud.network.dao.CiscoNexusVSMDeviceDao;
 import com.cloud.network.element.CiscoNexusVSMElement;
+import com.cloud.network.element.NetworkElement;
 import com.cloud.resource.Discoverer;
 import com.cloud.resource.DiscovererBase;
 import com.cloud.resource.ResourceManager;
@@ -105,8 +107,8 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
 	ResourceManager _resourceMgr;
 	@Inject
 	CiscoNexusVSMDeviceDao _nexusDao;
-	@Inject
 	CiscoNexusVSMElement _nexusElement;
+	List<NetworkElement> networkElements;
 	@Inject
     NetworkModel _netmgr;
     @Inject
@@ -450,6 +452,15 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
             }
 		}
 	}
+	
+	protected CiscoNexusVSMElement getCiscoNexusVSMElement() {
+	    for ( NetworkElement networkElement : networkElements ) {
+	        if ( networkElement instanceof CiscoNexusVSMElement )
+	            return (CiscoNexusVSMElement)networkElement;
+	    }
+	    
+	    throw new IllegalStateException("Failed to CiscoNexusVSMElement");
+	}
 
     private VmwareDatacenterVO fetchVmwareDatacenterByZone(Long dcId) throws DiscoveryException {
         VmwareDatacenterVO vmwareDc;
@@ -640,6 +651,16 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
 
 	}
 
+    @Override
+    public boolean start() {
+        if ( ! super.start() )
+            return false;
+        
+        _nexusElement = getCiscoNexusVSMElement();
+        
+        return true;
+    }
+	
 	@Override
 	public boolean stop() {
 		_resourceMgr.unregisterResourceStateAdapter(this.getClass()
@@ -791,4 +812,14 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
         }
         _urlParams.putAll(params);
     }
+
+    public List<NetworkElement> getNetworkElements() {
+        return networkElements;
+    }
+
+    @Inject
+    public void setNetworkElements(List<NetworkElement> networkElements) {
+        this.networkElements = networkElements;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/module.properties b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/module.properties
new file mode 100644
index 0000000..9dca6f4
--- /dev/null
+++ b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/module.properties
@@ -0,0 +1,2 @@
+name=xenserver-compute
+parent=compute
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/spring-xenserver-compute-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/spring-xenserver-compute-context.xml b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/spring-xenserver-compute-context.xml
new file mode 100644
index 0000000..e024ad8
--- /dev/null
+++ b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-compute/spring-xenserver-compute-context.xml
@@ -0,0 +1,28 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    you under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
+    language governing permissions and limitations under the License. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
+        <property name="name" value="XenServerFenceBuilder" />
+    </bean>
+
+    <bean id="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru">
+        <property name="name" value="XenServerGuru" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/module.properties
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/module.properties b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/module.properties
new file mode 100644
index 0000000..82f40ae
--- /dev/null
+++ b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/module.properties
@@ -0,0 +1,2 @@
+name=xenserver-discoverer
+parent=discoverer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/spring-xenserver-discoverer-context.xml
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/spring-xenserver-discoverer-context.xml b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/spring-xenserver-discoverer-context.xml
new file mode 100644
index 0000000..c301007
--- /dev/null
+++ b/plugins/hypervisors/xen/resources/META-INF/cloudstack/xenserver-discoverer/spring-xenserver-discoverer-context.xml
@@ -0,0 +1,25 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    you under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
+    language governing permissions and limitations under the License. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="XcpServerDiscoverer"
+        class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
+        <property name="name" value="XCP Agent" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/module.properties
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/module.properties b/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/module.properties
new file mode 100644
index 0000000..f0af863
--- /dev/null
+++ b/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/module.properties
@@ -0,0 +1,2 @@
+name=vns
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/spring-vns-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/spring-vns-context.xml b/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/spring-vns-context.xml
new file mode 100644
index 0000000..d5bb92a
--- /dev/null
+++ b/plugins/network-elements/bigswitch-vns/resources/META-INF/cloudstack/vns/spring-vns-context.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="bigSwitchVnsDaoImpl" class="com.cloud.network.dao.BigSwitchVnsDaoImpl" />
+    <bean id="bigSwitchVnsElement" class="com.cloud.network.element.BigSwitchVnsElement">
+        <property name="name" value="BigSwitchVnsElement" />
+    </bean>
+
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/module.properties
----------------------------------------------------------------------
diff --git a/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/module.properties b/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/module.properties
new file mode 100644
index 0000000..afaf712
--- /dev/null
+++ b/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/module.properties
@@ -0,0 +1,2 @@
+name=elb
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/spring-elb-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/spring-elb-context.xml b/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/spring-elb-context.xml
new file mode 100644
index 0000000..247153c
--- /dev/null
+++ b/plugins/network-elements/elastic-loadbalancer/resources/META-INF/cloudstack/elb/spring-elb-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+  <bean id="elasticLoadBalancerManagerImpl" class="com.cloud.network.lb.ElasticLoadBalancerManagerImpl" />
+
+  <bean id="elasticLbVmMapDaoImpl" class="com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/internal-loadbalancer/resources/META-INF/cloudstack/core/spring-internallb-core-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/resources/META-INF/cloudstack/core/spring-internallb-core-context.xml b/plugins/network-elements/internal-loadbalancer/resources/META-INF/cloudstack/core/spring-internallb-core-context.xml
new file mode 100644
index 0000000..c038879
--- /dev/null
+++ b/plugins/network-elements/internal-loadbalancer/resources/META-INF/cloudstack/core/spring-internallb-core-context.xml
@@ -0,0 +1,37 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="InternalLbVm"
+        class="org.apache.cloudstack.network.element.InternalLoadBalancerElement">
+        <property name="name" value="InternalLbVm" />
+    </bean>
+    
+    <bean id="InternalLoadBalancerVMManager" class="org.apache.cloudstack.network.lb.InternalLoadBalancerVMManagerImpl" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/module.properties
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/module.properties b/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/module.properties
new file mode 100644
index 0000000..e5ecddd
--- /dev/null
+++ b/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/module.properties
@@ -0,0 +1,2 @@
+name=midonet
+parent=network
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/spring-midonet-context.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/spring-midonet-context.xml b/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/spring-midonet-context.xml
new file mode 100644
index 0000000..400f7dd
--- /dev/null
+++ b/plugins/network-elements/midonet/resources/META-INF/cloudstack/midonet/spring-midonet-context.xml
@@ -0,0 +1,37 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="MidoNetGuestNetworkGuru" class="com.cloud.network.guru.MidoNetGuestNetworkGuru">
+        <property name="name" value="MidoNetGuestNetworkGuru" />
+    </bean>
+    <bean id="MidoNetElement" class="com.cloud.network.element.MidoNetElement">
+        <property name="name" value="MidoNetElement" />
+    </bean>
+    
+</beans>


[9/9] git commit: updated refs/heads/spring-modularization to 8cf00de

Posted by da...@apache.org.
Configuration to enable Spring Modularization

All of the code changes for the Spring Modularization will work in
a modularized context or a non-modularized context.  This commit
is the final commit to turn modularization on.  Revert this commit
to disable the modularization and go back to monolithic Spring
configuration.


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

Branch: refs/heads/spring-modularization
Commit: 8cf00de51d7b37b03d899be625f120fb0e0e145e
Parents: 6718642
Author: Darren Shepherd <da...@gmail.com>
Authored: Wed Oct 2 13:02:40 2013 -0700
Committer: Darren Shepherd <da...@gmail.com>
Committed: Wed Oct 2 15:43:11 2013 -0700

----------------------------------------------------------------------
 client/WEB-INF/web.xml                          |   6 +-
 client/pom.xml                                  |  56 +-
 client/tomcatconf/applicationContext.xml.in     | 955 -------------------
 client/tomcatconf/componentContext.xml.in       | 324 -------
 client/tomcatconf/nonossComponentContext.xml.in | 421 --------
 .../tomcatconf/simulatorComponentContext.xml.in | 285 ------
 packaging/centos63/cloud.spec                   |   3 +-
 pom.xml                                         |  15 +-
 server/pom.xml                                  |   3 -
 utils/pom.xml                                   |   4 +
 10 files changed, 46 insertions(+), 2026 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/client/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/client/WEB-INF/web.xml b/client/WEB-INF/web.xml
index e5c05d3..1af38e1 100644
--- a/client/WEB-INF/web.xml
+++ b/client/WEB-INF/web.xml
@@ -29,11 +29,11 @@
     </listener>  
     
 	<listener>
-  	  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+      <listener-class>org.apache.cloudstack.spring.module.web.CloudStackContextLoaderListener</listener-class>
 	</listener>
-    <context-param>    
+    <context-param>
         <param-name>contextConfigLocation</param-name>    
-        <param-value>classpath:applicationContext.xml, classpath:componentContext.xml</param-value>    
+        <param-value>classpath:META-INF/cloudstack/webApplicationContext.xml</param-value>    
     </context-param>
           
     <servlet>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index fd1f13a..3e08a9a 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -22,6 +22,16 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-framework-spring-module</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-framework-spring-lifecycle</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-plugin-storage-volume-solidfire</artifactId>
       <version>${project.version}</version>
     </dependency>
@@ -468,21 +478,6 @@
             </configuration>
           </execution>
           <execution>
-            <id>process-simulator-context</id>
-            <phase>process-resources</phase>
-            <goals>
-              <goal>run</goal>
-            </goals>
-            <configuration>
-              <target if="${simulator}">
-                <echo>test</echo>
-                <replaceregexp file="${basedir}/target/generated-webapp/WEB-INF/web.xml"
-                  match="classpath:componentContext.xml"
-                  replace="classpath:simulatorComponentContext.xml" byline="true"/>
-              </target>
-            </configuration>
-          </execution>
-          <execution>
             <id>process-noredist-spring-context</id>
             <phase>process-resources</phase>
             <goals>
@@ -502,22 +497,6 @@
               </target>
             </configuration>
           </execution>
-          <execution>
-            <id>process-quickcloud-spring-context</id>
-            <phase>process-resources</phase>
-            <goals>
-              <goal>run</goal>
-            </goals>
-            <configuration>
-              <target if="${quickcloud}">
-                <echo>quickcloud</echo>
-                <replaceregexp
-                  file="${basedir}/target/generated-webapp/WEB-INF/classes/applicationContext.xml"
-                  match="com.cloud.consoleproxy.ConsoleProxyManagerImpl"
-                  replace="com.cloud.consoleproxy.StaticConsoleProxyManager" byline="true"/>
-              </target>
-            </configuration>
-          </execution>
         </executions>
       </plugin>
       <!-- there are the jasypt libs requires by some of the python scripts -->
@@ -730,5 +709,20 @@
         </dependency>
       </dependencies>
     </profile>
+    <profile>
+      <id>quickcloud</id>
+      <activation>
+        <property>
+          <name>quickcloud</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.cloudstack</groupId>
+          <artifactId>cloud-quickcloud</artifactId>
+          <version>${project.version}</version>
+        </dependency>
+      </dependencies>
+    </profile>
   </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
deleted file mode 100644
index 6dda5c7..0000000
--- a/client/tomcatconf/applicationContext.xml.in
+++ /dev/null
@@ -1,955 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-
-
-
-
-                      http://www.springframework.org/schema/context
-                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">                     
-
-  <context:annotation-config />
-
-<!--=====================================================================================================-->
-<!--                                                                                                     -->
-<!--                           core OSS/non-OSS Common components                                        -->  
-<!--                                                                                                     -->
-<!--=====================================================================================================-->
-
-  <!--
-    @DB support
-  -->
-  <bean id="componentContext" class="com.cloud.utils.component.ComponentContext" />
-  <bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
-  <bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
-
-  <bean id="instantiatePostProcessor" class="com.cloud.utils.component.ComponentInstantiationPostProcessor">
-    <property name="Interceptors">
-        <list>
-            <ref bean="transactionContextBuilder" />
-            <ref bean="actionEventInterceptor" />
-        </list>
-    </property>
-  </bean>
-
-  <!--
-    Managed Context
-  -->
-  <bean id="ManagedContext" class="org.apache.cloudstack.managed.context.impl.DefaultManagedContext" >
-    <property name="listeners">
-        <list>
-            <bean class="org.apache.cloudstack.context.CallContextListener" />
-        </list>
-    </property>
-  </bean>
-
-  <bean class="org.apache.cloudstack.managed.context.ManagedContextRunnable" factory-method="initializeGlobalContext" 
-    autowire-candidate="false" >
-    <constructor-arg><ref bean="ManagedContext"/></constructor-arg>
-  </bean>
-
-  <!--
-    RPC/Async/EventBus
-  -->
-
-  <bean id="onwireRegistry" class="org.apache.cloudstack.framework.serializer.OnwireClassRegistry"
-    init-method="scan" >
-    <property name="packages">
-      <list>
-        <value>org.apache.cloudstack.framework</value>
-      </list>
-    </property>
-  </bean>
-  
-  <bean id="messageSerializer" class="org.apache.cloudstack.framework.serializer.JsonMessageSerializer">
-    <property name="onwireClassRegistry" ref="onwireRegistry" />
-  </bean>
-
-  <bean id="transportProvider" class="org.apache.cloudstack.framework.server.ServerTransportProvider"  init-method="initialize">
-    <property name="workerPoolSize" value="5" />
-    <property name="nodeId" value="Node1" />
-    <property name="messageSerializer" ref="messageSerializer" />
-  </bean>
-  
-  <bean id="rpcProvider" class="org.apache.cloudstack.framework.rpc.RpcProviderImpl" init-method="initialize">
-    <constructor-arg ref="transportProvider" />
-    <property name="messageSerializer" ref="messageSerializer" />
-  </bean>
-
-  <bean id="messageBus" class = "org.apache.cloudstack.framework.messagebus.MessageBusBase" />
-  <bean id="configDepot" class = "org.apache.cloudstack.framework.config.impl.ConfigDepotImpl" />
-
-  <!--
-    DAO with customized configuration
-  -->
-  <bean id="serviceOfferingDaoImpl" class="com.cloud.service.dao.ServiceOfferingDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="50" />
-        <entry key="cache.time.to.live" value="600" />
-      </map>
-    </property>  
-  </bean>
-
-  <bean id="diskOfferingDaoImpl" class="com.cloud.storage.dao.DiskOfferingDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="50" />
-        <entry key="cache.time.to.live" value="600" />
-      </map>
-    </property>  
-  </bean>
-
-  <bean id="dataCenterDaoImpl" class="com.cloud.dc.dao.DataCenterDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="50" />
-        <entry key="cache.time.to.live" value="600" />
-      </map>
-    </property>  
-  </bean>
-
-  <bean id="hostPodDaoImpl" class="com.cloud.dc.dao.HostPodDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="50" />
-        <entry key="cache.time.to.live" value="600" />
-      </map>
-    </property>  
-  </bean>
-
-  <bean id="vlanDaoImpl" class="com.cloud.dc.dao.VlanDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="30" />
-        <entry key="cache.time.to.live" value="3600" />
-      </map>
-    </property>  
-  </bean>
-
-  <bean id="userDaoImpl" class="com.cloud.user.dao.UserDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="5000" />
-        <entry key="cache.time.to.live" value="300" />
-      </map>
-    </property>  
-  </bean>
-
-  <bean id="VMTemplateDaoImpl" class="com.cloud.storage.dao.VMTemplateDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="100" />
-        <entry key="cache.time.to.live" value="600" />
-      </map>
-    </property>  
-  </bean>
-
-  <bean id="hypervisorCapabilitiesDaoImpl" class="com.cloud.hypervisor.dao.HypervisorCapabilitiesDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="100" />
-        <entry key="cache.time.to.live" value="600" />
-      </map>
-    </property>  
-  </bean>
-  <bean id="dedicatedResourceDaoImpl" class="com.cloud.dc.dao.DedicatedResourceDaoImpl">
-    <property name="configParams">
-      <map>
-        <entry key="cache.size" value="30" />
-        <entry key="cache.time.to.live" value="3600" />
-      </map>
-    </property>
-  </bean>
-  
-  <!--
-    DAOs with default configuration
-  -->
-  <bean id="accountDaoImpl" class="com.cloud.user.dao.AccountDaoImpl" />
-  <bean id="accountDetailsDaoImpl" class="com.cloud.user.AccountDetailsDaoImpl" />
-  <bean id="accountJoinDaoImpl" class="com.cloud.api.query.dao.AccountJoinDaoImpl" />
-  <bean id="accountGuestVlanMapDaoImpl" class="com.cloud.network.dao.AccountGuestVlanMapDaoImpl" />
-  <bean id="accountVlanMapDaoImpl" class="com.cloud.dc.dao.AccountVlanMapDaoImpl" />
-  <bean id="alertDaoImpl" class="com.cloud.alert.dao.AlertDaoImpl" />
-  <bean id="asyncJobJoinDaoImpl" class="com.cloud.api.query.dao.AsyncJobJoinDaoImpl" />
-  <bean id="autoScalePolicyConditionMapDaoImpl" class="com.cloud.network.as.dao.AutoScalePolicyConditionMapDaoImpl" />
-  <bean id="autoScalePolicyDaoImpl" class="com.cloud.network.as.dao.AutoScalePolicyDaoImpl" />
-  <bean id="autoScaleVmGroupDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmGroupDaoImpl" />
-  <bean id="autoScaleVmGroupPolicyMapDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmGroupPolicyMapDaoImpl" />
-  <bean id="autoScaleVmProfileDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmProfileDaoImpl" />
-  <bean id="capacityDaoImpl" class="com.cloud.capacity.dao.CapacityDaoImpl" />
-  <bean id="certificateDaoImpl" class="com.cloud.certificate.dao.CertificateDaoImpl" />
-  <bean id="clusterDaoImpl" class="com.cloud.dc.dao.ClusterDaoImpl" />
-  <bean id="clusterDetailsDaoImpl" class="com.cloud.dc.ClusterDetailsDaoImpl" />
-  <bean id="clusterVSMMapDaoImpl" class="com.cloud.dc.dao.ClusterVSMMapDaoImpl" />
-  <bean id="commandExecLogDaoImpl" class="com.cloud.secstorage.CommandExecLogDaoImpl" />
-  <bean id="conditionDaoImpl" class="com.cloud.network.as.dao.ConditionDaoImpl" />
-  <bean id="consoleProxyDaoImpl" class="com.cloud.vm.dao.ConsoleProxyDaoImpl" />
-  <bean id="counterDaoImpl" class="com.cloud.network.as.dao.CounterDaoImpl" />
-  <bean id="dataCenterIpAddressDaoImpl" class="com.cloud.dc.dao.DataCenterIpAddressDaoImpl" />
-  <bean id="dataCenterJoinDaoImpl" class="com.cloud.api.query.dao.DataCenterJoinDaoImpl" />
-  <bean id="dataCenterLinkLocalIpAddressDaoImpl" class="com.cloud.dc.dao.DataCenterLinkLocalIpAddressDaoImpl" />
-  <bean id="dataCenterVnetDaoImpl" class="com.cloud.dc.dao.DataCenterVnetDaoImpl" />
-  <bean id="dcDetailsDaoImpl" class="com.cloud.dc.dao.DcDetailsDaoImpl" />
-  <bean id="engineDcDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.DcDetailsDaoImpl" />
-  <bean id="diskOfferingJoinDaoImpl" class="com.cloud.api.query.dao.DiskOfferingJoinDaoImpl" />
-  <bean id="domainDaoImpl" class="com.cloud.domain.dao.DomainDaoImpl" />
-  <bean id="domainRouterDaoImpl" class="com.cloud.vm.dao.DomainRouterDaoImpl" />
-  <bean id="domainRouterJoinDaoImpl" class="com.cloud.api.query.dao.DomainRouterJoinDaoImpl" />
-  <bean id="elasticLbVmMapDaoImpl" class="com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl" />
-  <bean id="engineClusterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDaoImpl" />
-  <bean id="engineDataCenterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDaoImpl" />
-  <bean id="engineHostDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDaoImpl" />
-  <bean id="engineHostPodDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDaoImpl" />
-  <bean id="eventDaoImpl" class="com.cloud.event.dao.EventDaoImpl" />
-  <bean id="eventJoinDaoImpl" class="com.cloud.event.dao.EventJoinDaoImpl" />
-  <bean id="externalFirewallDeviceDaoImpl" class="com.cloud.network.dao.ExternalFirewallDeviceDaoImpl" />
-  <bean id="externalLoadBalancerDeviceDaoImpl" class="com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl" />
-  <bean id="externalPublicIpStatisticsDaoImpl" class="com.cloud.usage.dao.ExternalPublicIpStatisticsDaoImpl" />
-  <bean id="firewallRulesCidrsDaoImpl" class="com.cloud.network.dao.FirewallRulesCidrsDaoImpl" />
-  <bean id="firewallRulesDaoImpl" class="com.cloud.network.dao.FirewallRulesDaoImpl" />
-  <bean id="globalLoadBalancerDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerDaoImpl" />
-  <bean id="globalLoadBalancerLbRuleMapDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerLbRuleMapDaoImpl" />
-  <bean id="guestOSCategoryDaoImpl" class="com.cloud.storage.dao.GuestOSCategoryDaoImpl" />
-  <bean id="guestOSDaoImpl" class="com.cloud.storage.dao.GuestOSDaoImpl" />
-  <bean id="guestOSHypervisorDaoImpl" class="com.cloud.storage.dao.GuestOSHypervisorDaoImpl" />
-  <bean id="highAvailabilityDaoImpl" class="com.cloud.ha.dao.HighAvailabilityDaoImpl" />
-  <bean id="hostDaoImpl" class="com.cloud.host.dao.HostDaoImpl" />
-  <bean id="engineHostDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostDetailsDaoImpl" />
-  <bean id="hostDetailsDaoImpl" class="com.cloud.host.dao.HostDetailsDaoImpl" />
-  <bean id="hostJoinDaoImpl" class="com.cloud.api.query.dao.HostJoinDaoImpl" />
-  <bean id="engineHostTagsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostTagsDaoImpl" />
-  <bean id="hostTagsDaoImpl" class="com.cloud.host.dao.HostTagsDaoImpl" />
-  <bean id="hostTransferMapDaoImpl" class="com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl" />
-  <bean id="iPAddressDaoImpl" class="com.cloud.network.dao.IPAddressDaoImpl" />
-  <bean id="identityDaoImpl" class="com.cloud.uuididentity.dao.IdentityDaoImpl" />
-  <bean id="imageStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageStoreDaoImpl" />
-  <bean id="imageStoreDetailsDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageStoreDetailsDaoImpl" /> 
-  <bean id="imageStoreJoinDaoImpl" class="com.cloud.api.query.dao.ImageStoreJoinDaoImpl" />   
-  <bean id="snapshotDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.SnapshotDataStoreDaoImpl" /> 
-  <bean id="templateDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.TemplateDataStoreDaoImpl" /> 
-  <bean id="templateJoinDaoImpl" class="com.cloud.api.query.dao.TemplateJoinDaoImpl" />
-  <bean id="volumeDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.VolumeDataStoreDaoImpl" />   
-  <bean id="inlineLoadBalancerNicMapDaoImpl" class="com.cloud.network.dao.InlineLoadBalancerNicMapDaoImpl" />
-  <bean id="instanceGroupDaoImpl" class="com.cloud.vm.dao.InstanceGroupDaoImpl" />
-  <bean id="instanceGroupJoinDaoImpl" class="com.cloud.api.query.dao.InstanceGroupJoinDaoImpl" />
-  <bean id="instanceGroupVMMapDaoImpl" class="com.cloud.vm.dao.InstanceGroupVMMapDaoImpl" />
-  <bean id="itWorkDaoImpl" class="com.cloud.vm.ItWorkDaoImpl" />
-  <bean id="keystoreDaoImpl" class="com.cloud.keystore.KeystoreDaoImpl" />
-  <bean id="lBHealthCheckPolicyDaoImpl" class="com.cloud.network.dao.LBHealthCheckPolicyDaoImpl" />
-  <bean id="lBStickinessPolicyDaoImpl" class="com.cloud.network.dao.LBStickinessPolicyDaoImpl" />
-  <bean id="launchPermissionDaoImpl" class="com.cloud.storage.dao.LaunchPermissionDaoImpl" />
-  <bean id="loadBalancerDaoImpl" class="com.cloud.network.dao.LoadBalancerDaoImpl" />
-  <bean id="loadBalancerVMMapDaoImpl" class="com.cloud.network.dao.LoadBalancerVMMapDaoImpl" />
-  <bean id="managementServerHostDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostDaoImpl" />
-  <bean id="managementServerHostPeerDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostPeerDaoImpl" />
-  <bean id="networkAccountDaoImpl" class="com.cloud.network.dao.NetworkAccountDaoImpl" />
-  <bean id="networkACLDaoImpl" class="com.cloud.network.vpc.dao.NetworkACLDaoImpl" />
-  <bean id="networkACLItemDaoImpl" class="com.cloud.network.vpc.dao.NetworkACLItemDaoImpl" />
-  <bean id="networkDaoImpl" class="com.cloud.network.dao.NetworkDaoImpl" />
-  <bean id="networkDomainDaoImpl" class="com.cloud.network.dao.NetworkDomainDaoImpl" />
-  <bean id="networkExternalFirewallDaoImpl" class="com.cloud.network.dao.NetworkExternalFirewallDaoImpl" />
-  <bean id="networkExternalLoadBalancerDaoImpl" class="com.cloud.network.dao.NetworkExternalLoadBalancerDaoImpl" />
-  <bean id="networkOfferingDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingDaoImpl" />
-  <bean id="networkOfferingServiceMapDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingServiceMapDaoImpl" />
-  <bean id="networkOpDaoImpl" class="com.cloud.network.dao.NetworkOpDaoImpl" />
-  <bean id="networkRuleConfigDaoImpl" class="com.cloud.network.dao.NetworkRuleConfigDaoImpl" />
-  <bean id="networkServiceMapDaoImpl" class="com.cloud.network.dao.NetworkServiceMapDaoImpl" />
-  <bean id="nicDaoImpl" class="com.cloud.vm.dao.NicDaoImpl" />
-  <bean id="nicDetailDaoImpl" class="com.cloud.vm.dao.NicDetailDaoImpl" />
-  <bean id="nicSecondaryIpDaoImpl" class="com.cloud.vm.dao.NicSecondaryIpDaoImpl" />
-  <bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
-  <bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
-  <bean id="ovsTunnelInterfaceDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl" />
-  <bean id="ovsTunnelNetworkDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl" />
-  <bean id="physicalNetworkDaoImpl" class="com.cloud.network.dao.PhysicalNetworkDaoImpl" />
-  <bean id="physicalNetworkIsolationMethodDaoImpl" class="com.cloud.network.dao.PhysicalNetworkIsolationMethodDaoImpl" />
-  <bean id="physicalNetworkServiceProviderDaoImpl" class="com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl" />
-  <bean id="physicalNetworkTagDaoImpl" class="com.cloud.network.dao.PhysicalNetworkTagDaoImpl" />
-  <bean id="physicalNetworkTrafficTypeDaoImpl" class="com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl" />
-  <bean id="podVlanDaoImpl" class="com.cloud.dc.dao.PodVlanDaoImpl" />
-  <bean id="podVlanMapDaoImpl" class="com.cloud.dc.dao.PodVlanMapDaoImpl" />
-  <bean id="PortableIpDaoImpl" class="org.apache.cloudstack.region.PortableIpDaoImpl" />
-  <bean id="PortableIpRangeDaoImpl" class="org.apache.cloudstack.region.PortableIpRangeDaoImpl" />
-  <bean id="portForwardingRulesDaoImpl" class="com.cloud.network.rules.dao.PortForwardingRulesDaoImpl" />
-  <bean id="portProfileDaoImpl" class="com.cloud.network.dao.PortProfileDaoImpl" />
-  <bean id="primaryDataStoreDaoImpl" class="org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDaoImpl" />
-  <bean id="primaryDataStoreDetailsDaoImpl" class="org.apache.cloudstack.storage.volume.db.PrimaryDataStoreDetailsDaoImpl" />
-  <bean id="privateIpDaoImpl" class="com.cloud.network.vpc.dao.PrivateIpDaoImpl" />
-  <bean id="projectAccountDaoImpl" class="com.cloud.projects.dao.ProjectAccountDaoImpl" />
-  <bean id="projectAccountJoinDaoImpl" class="com.cloud.api.query.dao.ProjectAccountJoinDaoImpl" />
-  <bean id="projectDaoImpl" class="com.cloud.projects.dao.ProjectDaoImpl" />
-  <bean id="projectInvitationDaoImpl" class="com.cloud.projects.dao.ProjectInvitationDaoImpl" />
-  <bean id="projectInvitationJoinDaoImpl" class="com.cloud.api.query.dao.ProjectInvitationJoinDaoImpl" />
-  <bean id="projectJoinDaoImpl" class="com.cloud.api.query.dao.ProjectJoinDaoImpl" />
-  <bean id="regionDaoImpl" class="org.apache.cloudstack.region.dao.RegionDaoImpl" />
-  <bean id="remoteAccessVpnDaoImpl" class="com.cloud.network.dao.RemoteAccessVpnDaoImpl" />
-  <bean id="resourceCountDaoImpl" class="com.cloud.configuration.dao.ResourceCountDaoImpl" />
-  <bean id="resourceLimitDaoImpl" class="com.cloud.configuration.dao.ResourceLimitDaoImpl" />
-  <bean id="resourceTagJoinDaoImpl" class="com.cloud.api.query.dao.ResourceTagJoinDaoImpl" />
-  <bean id="resourceTagsDaoImpl" class="com.cloud.tags.dao.ResourceTagsDaoImpl" />
-  <bean id="routerNetworkDaoImpl" class="com.cloud.network.dao.RouterNetworkDaoImpl" />
-  <bean id="sSHKeyPairDaoImpl" class="com.cloud.user.dao.SSHKeyPairDaoImpl" />
-  <bean id="secondaryStorageVmDaoImpl" class="com.cloud.vm.dao.SecondaryStorageVmDaoImpl" />
-  <bean id="securityGroupDaoImpl" class="com.cloud.network.security.dao.SecurityGroupDaoImpl" />
-  <bean id="securityGroupJoinDaoImpl" class="com.cloud.api.query.dao.SecurityGroupJoinDaoImpl" />
-  <bean id="securityGroupRuleDaoImpl" class="com.cloud.network.security.dao.SecurityGroupRuleDaoImpl" />
-  <bean id="securityGroupRulesDaoImpl" class="com.cloud.network.security.dao.SecurityGroupRulesDaoImpl" />
-  <bean id="securityGroupVMMapDaoImpl" class="com.cloud.network.security.dao.SecurityGroupVMMapDaoImpl" />
-  <bean id="securityGroupWorkDaoImpl" class="com.cloud.network.security.dao.SecurityGroupWorkDaoImpl" />
-  <bean id="serviceOfferingJoinDaoImpl" class="com.cloud.api.query.dao.ServiceOfferingJoinDaoImpl" />
-  <bean id="site2SiteCustomerGatewayDaoImpl" class="com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl" />
-  <bean id="site2SiteVpnConnectionDaoImpl" class="com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl" />
-  <bean id="site2SiteVpnGatewayDaoImpl" class="com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl" />
-  <bean id="snapshotDaoImpl" class="com.cloud.storage.dao.SnapshotDaoImpl" />
-  <bean id="snapshotPolicyDaoImpl" class="com.cloud.storage.dao.SnapshotPolicyDaoImpl" />
-  <bean id="snapshotScheduleDaoImpl" class="com.cloud.storage.dao.SnapshotScheduleDaoImpl" />
-  <bean id="staticRouteDaoImpl" class="com.cloud.network.vpc.dao.StaticRouteDaoImpl" />
-  <bean id="storageNetworkIpAddressDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpAddressDaoImpl" />
-  <bean id="storageNetworkIpRangeDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpRangeDaoImpl" />
-  <bean id="storagePoolDetailsDaoImpl" class="com.cloud.storage.dao.StoragePoolDetailsDaoImpl" />
-  <bean id="storagePoolHostDaoImpl" class="com.cloud.storage.dao.StoragePoolHostDaoImpl" />
-  <bean id="storagePoolJoinDaoImpl" class="com.cloud.api.query.dao.StoragePoolJoinDaoImpl" />
-  <bean id="storagePoolWorkDaoImpl" class="com.cloud.storage.dao.StoragePoolWorkDaoImpl" />
-  <bean id="templatePrimaryDataStoreDaoImpl" class="org.apache.cloudstack.storage.volume.db.TemplatePrimaryDataStoreDaoImpl" />
-  <bean id="uploadDaoImpl" class="com.cloud.storage.dao.UploadDaoImpl" />
-  <bean id="usageDaoImpl" class="com.cloud.usage.dao.UsageDaoImpl" />
-  <bean id="usageEventDaoImpl" class="com.cloud.event.dao.UsageEventDaoImpl" />
-  <bean id="usageIPAddressDaoImpl" class="com.cloud.usage.dao.UsageIPAddressDaoImpl" />
-  <bean id="usageJobDaoImpl" class="com.cloud.usage.dao.UsageJobDaoImpl" />
-  <bean id="usageLoadBalancerPolicyDaoImpl" class="com.cloud.usage.dao.UsageLoadBalancerPolicyDaoImpl" />
-  <bean id="usageNetworkDaoImpl" class="com.cloud.usage.dao.UsageNetworkDaoImpl" />
-  <bean id="usageNetworkOfferingDaoImpl" class="com.cloud.usage.dao.UsageNetworkOfferingDaoImpl" />
-  <bean id="usagePortForwardingRuleDaoImpl" class="com.cloud.usage.dao.UsagePortForwardingRuleDaoImpl" />
-  <bean id="usageSecurityGroupDaoImpl" class="com.cloud.usage.dao.UsageSecurityGroupDaoImpl" />
-  <bean id="usageStorageDaoImpl" class="com.cloud.usage.dao.UsageStorageDaoImpl" />
-  <bean id="usageVMInstanceDaoImpl" class="com.cloud.usage.dao.UsageVMInstanceDaoImpl" />
-  <bean id="usageVPNUserDaoImpl" class="com.cloud.usage.dao.UsageVPNUserDaoImpl" />
-  <bean id="usageVolumeDaoImpl" class="com.cloud.usage.dao.UsageVolumeDaoImpl" />
-  <bean id="usageVmDiskDaoImpl" class="com.cloud.usage.dao.UsageVmDiskDaoImpl" />
-  <bean id="userAccountDaoImpl" class="com.cloud.user.dao.UserAccountDaoImpl" />
-  <bean id="userAccountJoinDaoImpl" class="com.cloud.api.query.dao.UserAccountJoinDaoImpl" />
-  <bean id="userIpv6AddressDaoImpl" class="com.cloud.network.dao.UserIpv6AddressDaoImpl" />
-  <bean id="userStatisticsDaoImpl" class="com.cloud.user.dao.UserStatisticsDaoImpl" />
-  <bean id="userStatsLogDaoImpl" class="com.cloud.user.dao.UserStatsLogDaoImpl" />
-  <bean id="userVmDiskStatsDaoImpl" class="com.cloud.user.dao.VmDiskStatisticsDaoImpl" />
-  <bean id="userVmCloneSettingDaoImpl" class="com.cloud.vm.dao.UserVmCloneSettingDaoImpl" />
-  <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
-  <bean id="userVmDetailsDaoImpl" class="com.cloud.vm.dao.UserVmDetailsDaoImpl" />
-  <bean id="userVmJoinDaoImpl" class="com.cloud.api.query.dao.UserVmJoinDaoImpl" />
-  <bean id="vMComputeTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMComputeTagDaoImpl" />
-  <bean id="vMEntityDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMEntityDaoImpl" />
-  <bean id="vMInstanceDaoImpl" class="com.cloud.vm.dao.VMInstanceDaoImpl" />
-  <bean id="vMNetworkMapDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDaoImpl" />
-  <bean id="vMReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDaoImpl" />
-  <bean id="vMRootDiskTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMRootDiskTagDaoImpl" />
-  <bean id="vMSnapshotDaoImpl" class="com.cloud.vm.snapshot.dao.VMSnapshotDaoImpl" />
-  <bean id="vMTemplateDetailsDaoImpl" class="com.cloud.storage.dao.VMTemplateDetailsDaoImpl" />
-  <bean id="vMTemplateHostDaoImpl" class="com.cloud.storage.dao.VMTemplateHostDaoImpl" />
-  <bean id="vMTemplatePoolDaoImpl" class="com.cloud.storage.dao.VMTemplatePoolDaoImpl" />
-  <bean id="vMTemplateZoneDaoImpl" class="com.cloud.storage.dao.VMTemplateZoneDaoImpl" />
-  <bean id="versionDaoImpl" class="com.cloud.upgrade.dao.VersionDaoImpl" />
-  <bean id="virtualRouterProviderDaoImpl" class="com.cloud.network.dao.VirtualRouterProviderDaoImpl" />
-  <bean id="vmRulesetLogDaoImpl" class="com.cloud.network.security.dao.VmRulesetLogDaoImpl" />
-  <bean id="volumeDaoImpl" class="com.cloud.storage.dao.VolumeDaoImpl" />
-  <bean id="volumeDetailsDaoImpl" class="com.cloud.storage.dao.VolumeDetailsDaoImpl" />
-  <bean id="volumeHostDaoImpl" class="com.cloud.storage.dao.VolumeHostDaoImpl" />
-  <bean id="volumeJoinDaoImpl" class="com.cloud.api.query.dao.VolumeJoinDaoImpl" />
-  <bean id="volumeReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VolumeReservationDaoImpl" />
-  <bean id="vpcDaoImpl" class="com.cloud.network.vpc.dao.VpcDaoImpl" />
-  <bean id="vpcGatewayDaoImpl" class="com.cloud.network.vpc.dao.VpcGatewayDaoImpl" />
-  <bean id="vpcOfferingDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingDaoImpl" />
-  <bean id="vpcOfferingServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingServiceMapDaoImpl" />
-  <bean id="vpcServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcServiceMapDaoImpl" />
-  <bean id="vpnUserDaoImpl" class="com.cloud.network.dao.VpnUserDaoImpl" />
-  <bean id="applicationLbRuleDaoImpl" class="org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDaoImpl" />
-  <bean id="networkOfferingDetailsDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingDetailsDaoImpl" />
-  <bean id="serviceOfferingDetailsDaoImpl" class="com.cloud.service.dao.ServiceOfferingDetailsDaoImpl"/>
-
-  <!--
-    Checkers
-  -->
-  <bean id="encryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker" />
-  <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
-  <bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker" />
-  <bean id="domainChecker" class="com.cloud.acl.DomainChecker" />
-  <bean id="affinityGroupAccessChecker" class="com.cloud.acl.AffinityGroupAccessChecker" />
-  
-  <!--
-    Authenticators
-  --> 
-  <bean id="basicAgentAuthManager" class="com.cloud.agent.manager.authn.impl.BasicAgentAuthManager">
-    <property name="name" value="BASIC"/>
-  </bean>
-  <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
-    <property name="name" value="MD5"/>
-  </bean>
-  <bean id="LdapAuthenticator" class="org.apache.cloudstack.ldap.LdapAuthenticator">
-    <property name="name" value="LDAP"/>
-  </bean>
-  <bean id="SHA256SaltedUserAuthenticator" class="com.cloud.server.auth.SHA256SaltedUserAuthenticator">
-    <property name="name" value="SHA256SALT"/>
-  </bean>
-  <bean id="PlainTextUserAuthenticator" class="com.cloud.server.auth.PlainTextUserAuthenticator">
-    <property name="name" value="PLAINTEXT"/>
-  </bean>
-  <bean id="LdapManager" class="org.apache.cloudstack.ldap.LdapManagerImpl" />
-  <bean id="LdapUserManager" class="org.apache.cloudstack.ldap.LdapUserManager" />
-  <bean id="LdapContextFactory" class="org.apache.cloudstack.ldap.LdapContextFactory" />
-  <bean id="LdapConfigurationDao" class="org.apache.cloudstack.ldap.dao.LdapConfigurationDaoImpl" />
-  <bean id="LdapConfiguration" class="org.apache.cloudstack.ldap.LdapConfiguration" />
-
-  <!--
-      Network Elements
-  -->
-  <bean id="Ovs" class="com.cloud.network.element.OvsElement">
-    <property name="name" value="Ovs"/>
-  </bean>
-  <bean id="SecurityGroupProvider" class="com.cloud.network.element.SecurityGroupElement">
-    <property name="name" value="SecurityGroupProvider"/>
-  </bean>
-  <bean id="VirtualRouter" class="com.cloud.network.element.VirtualRouterElement">
-    <property name="name" value="VirtualRouter"/>
-  </bean>
-  <bean id="VpcVirtualRouter" class="com.cloud.network.element.VpcVirtualRouterElement">
-    <property name="name" value="VpcVirtualRouter"/>
-  </bean>
-  <bean id="elasticLoadBalancerElement" class="com.cloud.network.element.ElasticLoadBalancerElement">
-    <property name="name" value="ElasticLoadBalancerElement"/>
-  </bean>
-  <bean id="InternalLbVm" class="org.apache.cloudstack.network.element.InternalLoadBalancerElement">
-    <property name="name" value="InternalLbVm"/>
-  </bean>
-
-  <!-- 
-    General allocators
-  -->             
-  <bean id="firstFitAllocator" class="com.cloud.agent.manager.allocator.impl.FirstFitAllocator" />
-  <bean id="randomAllocator" class="com.cloud.agent.manager.allocator.impl.RandomAllocator" />
-
-  <!--
-     Host Allocators
-  -->
-  <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
-    <property name="name" value="FirstFitRouting"/>
-  </bean>
-  
-  <!--
-    Storage pool allocators
-  -->
-  <bean id="LocalStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
-    <property name="name" value="LocalStorage"/>
-  </bean>
-  <bean id="clusterScopeStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.ClusterScopeStoragePoolAllocator" />
-  <bean id="zoneWideStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.ZoneWideStoragePoolAllocator" />
-  <bean id="garbageCollectingStoragePoolAllocator" class="org.apache.cloudstack.storage.allocator.GarbageCollectingStoragePoolAllocator">
-    <property name="name" value="GCStorage"/>
-  </bean>
-
-  <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
-    <property name="name" value="UserFirst"/>
-  </bean>
-  
-  
-  <bean id="recreatableFencer" class="com.cloud.ha.RecreatableFencer" />
-  <bean id="recreateHostAllocator" class="com.cloud.agent.manager.allocator.impl.RecreateHostAllocator" />
-  <bean id="secondaryStorageVmDefaultAllocator" class="com.cloud.storage.secondary.SecondaryStorageVmDefaultAllocator" />
-
-
-  <!--
-    Misc allocator & Adapters
-  -->
-  <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
-    <property name="name" value="Balance"/>
-  </bean>
-
-  <bean id="ExternalIpAddressAllocator" class="com.cloud.network.ExternalIpAddressAllocator">
-    <property name="name" value="Basic"/>
-  </bean>
-
-  <bean id="hypervisorTemplateAdapter" class="com.cloud.template.HypervisorTemplateAdapter" />
-  <bean id="clusterAlertAdapter" class="com.cloud.alert.ClusterAlertAdapter" />
-  <bean id="consoleProxyAlertAdapter" class="com.cloud.alert.ConsoleProxyAlertAdapter" />
-  <bean id="secondaryStorageVmAlertAdapter" class="com.cloud.alert.SecondaryStorageVmAlertAdapter" />
-  <bean id="clusterServiceServletAdapter" class="com.cloud.cluster.ClusterServiceServletAdapter" />
-
-  <!--
-    Investigators
-  -->
-  <bean id="CheckOnAgentInvestigator" class="com.cloud.ha.CheckOnAgentInvestigator">
-    <property name="name" value="SimpleInvestigator"/>
-  </bean>
-
-  <bean id="XenServerInvestigator" class="com.cloud.ha.XenServerInvestigator">
-    <property name="name" value="XenServerInvestigator"/>
-  </bean>
-  
-  <bean id="KVMInvestigator" class="com.cloud.ha.KVMInvestigator">
-    <property name="name" value="KVMInvestigator"/>
-  </bean>
-
-  <bean id="UserVmDomRInvestigator" class="com.cloud.ha.UserVmDomRInvestigator">
-    <property name="name" value="PingInvestigator"/>
-  </bean>
-
-  <bean id="ManagementIPSystemVMInvestigator" class="com.cloud.ha.ManagementIPSystemVMInvestigator">
-    <property name="name" value="ManagementIPSysVMInvestigator"/>
-  </bean>
-
-  <!--
-    Fencers
-  -->
-  <bean id="XenServerFencer" class="com.cloud.ha.XenServerFencer">
-    <property name="name" value="XenServerFenceBuilder"/>
-  </bean>
-  <bean id="KVMFencer" class="com.cloud.ha.KVMFencer">
-    <property name="name" value="KVMFenceBuilder"/>
-  </bean>
-  <bean id="OvmFencer" class="com.cloud.ovm.hypervisor.OvmFencer">
-    <property name="name" value="OvmFenceBuilder"/>
-  </bean>
-
-  <!--
-    Discovers
-  -->
-  <bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
-    <property name="name" value="XCP Agent"/>
-  </bean>
-
-  <bean id="SecondaryStorageDiscoverer" class="org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer">
-    <property name="name" value="SecondaryStorage"/>
-  </bean>
-
-  <bean id="KvmServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.KvmServerDiscoverer">
-    <property name="name" value="KVM Agent"/>
-  </bean>
-
-  <bean id="LxcServerDiscoverer" class="com.cloud.hypervisor.kvm.discoverer.LxcServerDiscoverer">
-    <property name="name" value="Lxc Discover"/>
-  </bean>
-
-  <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
-    <property name="name" value="Ovm Discover"/>
-  </bean>
-
-  <bean id="dummyHostDiscoverer" class="com.cloud.resource.DummyHostDiscoverer">
-    <property name="name" value="dummyHostDiscoverer" />
-  </bean>
-
-  <!--
-    Deployment planners
-  -->
-  <bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
-    <property name="name" value="UserDispersingPlanner"/>
-  </bean>
-  
-  <bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
-    <property name="name" value="UserConcentratedPodPlanner"/>
-  </bean>
-
-  <bean id="ImplicitDedicationPlanner" class="com.cloud.deploy.ImplicitDedicationPlanner">
-    <property name="name" value="ImplicitDedicationPlanner"/>
-  </bean>
-
-  <bean id="clusterBasedAgentLoadBalancerPlanner" class="com.cloud.cluster.agentlb.ClusterBasedAgentLoadBalancerPlanner">
-    <property name="name" value="ClusterBasedAgentLoadBalancerPlanner"/>
-  </bean>
-
-  <!--
-    Network Gurus
-  -->
-  <bean id="StorageNetworkGuru" class="com.cloud.network.guru.StorageNetworkGuru">
-    <property name="name" value="StorageNetworkGuru"/>
-  </bean>
-  <bean id="ExternalGuestNetworkGuru" class="com.cloud.network.guru.ExternalGuestNetworkGuru">
-    <property name="name" value="ExternalGuestNetworkGuru"/>
-  </bean>
-  <bean id="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru">
-    <property name="name" value="PublicNetworkGuru"/>
-  </bean>
-  <bean id="PodBasedNetworkGuru" class="com.cloud.network.guru.PodBasedNetworkGuru">
-    <property name="name" value="PodBasedNetworkGuru"/>
-  </bean>
-  <bean id="ControlNetworkGuru" class="com.cloud.network.guru.ControlNetworkGuru">
-    <property name="name" value="ControlNetworkGuru"/>
-  </bean>
-  <bean id="DirectNetworkGuru" class="com.cloud.network.guru.DirectNetworkGuru">
-    <property name="name" value="DirectNetworkGuru"/>
-  </bean>
-  <bean id="DirectPodBasedNetworkGuru" class="com.cloud.network.guru.DirectPodBasedNetworkGuru">
-    <property name="name" value="DirectPodBasedNetworkGuru"/>
-  </bean>
-  <bean id="OvsGuestNetworkGuru" class="com.cloud.network.guru.OvsGuestNetworkGuru">
-    <property name="name" value="OvsGuestNetworkGuru"/>
-  </bean>
-  <bean id="PrivateNetworkGuru" class="com.cloud.network.guru.PrivateNetworkGuru">
-    <property name="name" value="PrivateNetworkGuru"/>
-  </bean>
- 
-  <!--
-   Hypervisor Gurus
-  -->
-  <bean id="XenServerGuru" class="com.cloud.hypervisor.XenServerGuru">
-    <property name="name" value="XenServerGuru"/>
-  </bean>
-  
-  <bean id="KVMGuru" class="com.cloud.hypervisor.KVMGuru">
-    <property name="name" value="KVMGuru"/>
-  </bean>
-
-  <bean id="LXCGuru" class="com.cloud.hypervisor.LXCGuru">
-    <property name="name" value="LXCGuru"/>
-  </bean>
-
-  <bean id="OvmGuru" class="com.cloud.ovm.hypervisor.OvmGuru">
-    <property name="name" value="OvmGuru"/>
-  </bean>
-
-  <!--=====================================================================================================-->
-  <!--                                                                                                     -->
-  <!--                           Storage Subsystem Components and Helpers                                  -->
-  <!--                                                                                                     -->
-  <!--=====================================================================================================-->
-
-  <!--Filesystem types-->
-  <bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />
-  <bean id="networkFileSystem" class="org.apache.cloudstack.storage.datastore.type.NetworkFileSystem" />
-
-  <!--Image formats-->
-  <bean id="ISO" class="org.apache.cloudstack.storage.image.format.ISO" />
-  <bean id="OVA" class="org.apache.cloudstack.storage.image.format.OVA" />
-  <bean id="QCOW2" class="org.apache.cloudstack.storage.image.format.QCOW2" />
-  <bean id="VHD" class="org.apache.cloudstack.storage.image.format.VHD" />
-  <bean id="VHDX" class="org.apache.cloudstack.storage.image.format.VHDX" />
-  <bean id="unknown" class="org.apache.cloudstack.storage.image.format.Unknown" />
-
-  <!--Data Store Services -->
-  <bean id="snapshotServiceImpl" class="org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl"
-        depends-on="snapshotStateMachineManagerImpl, snapshotDataFactoryImpl, dataStoreManagerImpl, dataMotionServiceImpl, objectInDataStoreManagerImpl"/>
-  <bean id="templateServiceImpl" class="org.apache.cloudstack.storage.image.TemplateServiceImpl"
-        depends-on="dataObjectManagerImpl, dataStoreManagerImpl, dataMotionServiceImpl, objectInDataStoreManagerImpl, defaultEndPointSelector, templateDataFactoryImpl"/>
-  <bean id="volumeServiceImpl" class="org.apache.cloudstack.storage.volume.VolumeServiceImpl"
-        depends-on="snapshotManagerImpl, dataMotionServiceImpl"/>
-
-  <bean id="xenserverSnapshotStrategy" class="org.apache.cloudstack.storage.snapshot.XenserverSnapshotStrategy" />
-
-  <!--Data Store Factory-->
-  <bean id="templateDataFactoryImpl" class="org.apache.cloudstack.storage.image.TemplateDataFactoryImpl" />
-  <bean id="snapshotDataFactoryImpl" class="org.apache.cloudstack.storage.snapshot.SnapshotDataFactoryImpl"
-        depends-on="dataStoreManagerImpl, snapshotDataStoreDaoImpl, volumeDataFactoryImpl"/>
-  <bean id="volumeDataFactoryImpl" class="org.apache.cloudstack.storage.volume.VolumeDataFactoryImpl" />
-
-  <bean id="objectInDataStoreManagerImpl" class="org.apache.cloudstack.storage.datastore.ObjectInDataStoreManagerImpl" />
-  <bean id="dataObjectManagerImpl" class="org.apache.cloudstack.storage.datastore.DataObjectManagerImpl" />
-
-  <!--Data Store Helpers-->
-  <bean id="primaryDataStoreHelper" class="org.apache.cloudstack.storage.volume.datastore.PrimaryDataStoreHelper" />
-  <bean id="imageStoreHelper" class="org.apache.cloudstack.storage.image.datastore.ImageStoreHelper" />
-  <bean id="imageFormatHelper" class="org.apache.cloudstack.storage.image.format.ImageFormatHelper" />
-
-  <bean id="storageCacheRandomAllocator" class="org.apache.cloudstack.storage.cache.allocator.StorageCacheRandomAllocator" />
-  <bean id="storageCacheManagerImpl" class="org.apache.cloudstack.storage.cache.manager.StorageCacheManagerImpl"  />
-  <bean id="StorageCacheReplacementAlgorithm" class="org.apache.cloudstack.storage.cache.manager.StorageCacheReplacementAlgorithmLRU" />
-
-  <bean id="snapshotStateMachineManagerImpl" class="org.apache.cloudstack.storage.snapshot.SnapshotStateMachineManagerImpl" />
-  <bean id="defaultEndPointSelector" class="org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector" />
-
-
-  <bean id="ancientDataMotionStrategy" class="org.apache.cloudstack.storage.motion.AncientDataMotionStrategy" />
-  <bean id="xenserverStorageMotionStrategy" class="org.apache.cloudstack.storage.motion.XenServerStorageMotionStrategy" />
-
-  <!--Data Motion Services-->
-  <bean id="dataMotionServiceImpl" class="org.apache.cloudstack.storage.motion.DataMotionServiceImpl">
-    <property name="strategies">
-      <list>
-        <ref local="ancientDataMotionStrategy"/>
-        <ref local="xenserverStorageMotionStrategy"/>
-      </list>
-    </property>
-  </bean>
-
-  <!--
-    Data Store Provider Manager
-  -->
-  <bean id="primaryDataStoreProviderMgr"
-        class="org.apache.cloudstack.storage.datastore.manager.PrimaryDataStoreProviderManagerImpl"/>
-  <bean id="imageStoreProviderMgr" class="org.apache.cloudstack.storage.image.manager.ImageStoreProviderManagerImpl"/>
-
-  <bean id="dataStoreManagerImpl" class="org.apache.cloudstack.storage.datastore.DataStoreManagerImpl"
-        depends-on="dataStoreProviderManager">
-    <property name="primaryStoreMgr" ref="primaryDataStoreProviderMgr"/>
-    <property name="imageDataStoreMgr" ref="imageStoreProviderMgr"/>
-  </bean>
-
-  <bean id="cloudStackPrimaryDataStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl"/>
-
-  <bean id="dataStoreProviderManager"
-        class="org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl">
-    <property name="providers">
-      <list>
-        <!--Data Store Providers-->
-        <ref bean="cloudStackPrimaryDataStoreProviderImpl"/>
-      </list>
-    </property>
-  </bean>
-
-  <!--
-    Managers
-  -->
-  <bean id="accountManagerImpl" class="com.cloud.user.AccountManagerImpl" >
-    <property name="UserAuthenticators" value="#{userAuthenticators.Adapters}" />
-    <property name="UserPasswordEncoders" value="#{userPasswordEncoders.Adapters}" />
-    <property name="SecurityCheckers" value="#{securityCheckers.Adapters}" />
-  </bean>
-
-  <bean id="managementServerImpl" class ="com.cloud.server.ManagementServerImpl">
-    <property name="UserAuthenticators" value="#{userAuthenticators.Adapters}" />
-    <property name="UserPasswordEncoders" value="#{userPasswordEncoders.Adapters}" />
-    <property name="HostAllocators" value="#{hostAllocators.Adapters}" />
-    <property name="AffinityGroupProcessors" value="#{affinityProcessors.Adapters}" />
-    <property name="Planners" value="#{deploymentPlanners.Adapters}" />
-  </bean>
-
-  <bean id="storageManagerImpl" class="com.cloud.storage.StorageManagerImpl"/>
-  
-  <bean id="volumeOrchestrator" class="org.apache.cloudstack.engine.orchestration.VolumeOrchestrator">
-    <property name="PodAllocators" value="#{podAllocators.Adapters}" />
-    <property name="StoragePoolAllocators" value="#{storagePoolAllocators.Adapters}" />
-  </bean>
-
-  <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
-    <property name="name" value="FirstFitPlanner"/>
-  </bean>
-
-  <bean id="resourceManagerImpl" class="com.cloud.resource.ResourceManagerImpl" >
-    <property name="Discoverers" value="#{resourceDiscoverers.Adapters}" />
-  </bean>
-
-  <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl" >
-    <property name="Investigators" value="#{haInvestigators.Adapters}" />
-    <property name="FenceBuilders" value="#{haFenceBuilders.Adapters}" />
-  </bean>
-
-  <bean id="clusteredVirtualMachineManagerImpl" class="com.cloud.vm.ClusteredVirtualMachineManagerImpl" >
-    <property name="HostAllocators" value="#{hostAllocators.Adapters}" />
-  </bean>
-
-  <bean id="networkOrchestrator" class="org.apache.cloudstack.engine.orchestration.NetworkOrchestrator" >
-    <property name="NetworkGurus" value="#{networkGurus.Adapters}" />
-    <property name="NetworkElements" value="#{networkElements.Adapters}" />
-    <property name="IpDeployers" value="#{ipDeployers.Adapters}" />
-    <property name="DhcpProviders" value="#{dhcpProviders.Adapters}" />
-  </bean>
-
-  <bean id="ipAddressManagerImpl" class="com.cloud.network.IpAddressManagerImpl" >
-  </bean>
-  <bean id="networkModelImpl" class="com.cloud.network.NetworkModelImpl">
-    <property name="NetworkElements" value="#{networkElements.Adapters}" />
-  </bean>
-
-  <bean id="configurationServerImpl" class="com.cloud.server.ConfigurationServerImpl" />
-
-  <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
-  <bean id="clusteredAgentManagerImpl" class="com.cloud.agent.manager.ClusteredAgentManagerImpl" />
-
-  <bean id="userVmManagerImpl" class="com.cloud.vm.UserVmManagerImpl" />
-  <bean id="consoleProxyManagerImpl" class="com.cloud.consoleproxy.ConsoleProxyManagerImpl" />
-  <bean id="securityGroupManagerImpl2" class="com.cloud.network.security.SecurityGroupManagerImpl2" />
-  <bean id="premiumSecondaryStorageManagerImpl" class="com.cloud.secstorage.PremiumSecondaryStorageManagerImpl" />
-
-  <bean id="ipv6AddressManagerImpl" class="com.cloud.network.Ipv6AddressManagerImpl" />
-
-  <bean id="apiRateLimitServiceImpl" class="org.apache.cloudstack.ratelimit.ApiRateLimitServiceImpl"/>
-  <bean id="alertManagerImpl" class="com.cloud.alert.AlertManagerImpl" />
-  <bean id="autoScaleManagerImpl" class="com.cloud.network.as.AutoScaleManagerImpl" />
-  <bean id="capacityManagerImpl" class="com.cloud.capacity.CapacityManagerImpl" />
-  <bean id="clusterFenceManagerImpl" class="com.cloud.cluster.ClusterFenceManagerImpl" />
-  <bean id="configurationManagerImpl" class="com.cloud.configuration.ConfigurationManagerImpl" />
-
-  <bean id="elasticLoadBalancerManagerImpl" class="com.cloud.network.lb.ElasticLoadBalancerManagerImpl" />
-  <bean id="entityManagerImpl" class="com.cloud.dao.EntityManagerImpl" />
-  <bean id="externalDeviceUsageManagerImpl" class="com.cloud.network.ExternalDeviceUsageManagerImpl" />
-  <bean id="externalNetworkDeviceManagerImpl" class="com.cloud.network.ExternalNetworkDeviceManagerImpl" />
-  <bean id="firewallManagerImpl" class="com.cloud.network.firewall.FirewallManagerImpl" />
-  <bean id="hypervisorGuruManagerImpl" class="com.cloud.hypervisor.HypervisorGuruManagerImpl" />
-  <bean id="identityServiceImpl" class="com.cloud.uuididentity.IdentityServiceImpl" />
-  <bean id="keystoreManagerImpl" class="com.cloud.keystore.KeystoreManagerImpl" />
-  <bean id="loadBalancingRulesManagerImpl" class="com.cloud.network.lb.LoadBalancingRulesManagerImpl" />
-  <bean id="networkACLManagerImpl" class="com.cloud.network.vpc.NetworkACLManagerImpl" />
-  <bean id="networkACLServiceImpl" class="com.cloud.network.vpc.NetworkACLServiceImpl" />
-  <bean id="networkServiceImpl" class="com.cloud.network.NetworkServiceImpl" />
-  <bean id="networkUsageManagerImpl" class="com.cloud.network.NetworkUsageManagerImpl" />
-  <bean id="oCFS2ManagerImpl" class="com.cloud.storage.OCFS2ManagerImpl" />
-  <bean id="ovsTunnelManagerImpl" class="com.cloud.network.ovs.OvsTunnelManagerImpl" />
-  <bean id="projectManagerImpl" class="com.cloud.projects.ProjectManagerImpl" />
-  <bean id="queryManagerImpl" class="com.cloud.api.query.QueryManagerImpl" />
-  <bean id="regionManagerImpl" class="org.apache.cloudstack.region.RegionManagerImpl" />
-  <bean id="regionServiceImpl" class="org.apache.cloudstack.region.RegionServiceImpl" />
-  <bean id="remoteAccessVpnManagerImpl" class="com.cloud.network.vpn.RemoteAccessVpnManagerImpl" />
-  <bean id="resourceLimitManagerImpl" class="com.cloud.resourcelimit.ResourceLimitManagerImpl" />
-  <bean id="rulesManagerImpl" class="com.cloud.network.rules.RulesManagerImpl" />
-    <bean id="site2SiteVpnManagerImpl" class="com.cloud.network.vpn.Site2SiteVpnManagerImpl" />
-  <bean id="snapshotManagerImpl" class="com.cloud.storage.snapshot.SnapshotManagerImpl" />
-  <bean id="snapshotSchedulerImpl" class="com.cloud.storage.snapshot.SnapshotSchedulerImpl" />
-  <bean id="storageNetworkManagerImpl" class="com.cloud.network.StorageNetworkManagerImpl" />
-  <bean id="taggedResourceManagerImpl" class="com.cloud.tags.TaggedResourceManagerImpl" />
-  <bean id="resourceMetaDataManagerImpl" class="com.cloud.metadata.ResourceMetaDataManagerImpl" />
-  <bean id="templateManagerImpl" class="com.cloud.template.TemplateManagerImpl" />
-  <bean id="uploadMonitorImpl" class="com.cloud.storage.upload.UploadMonitorImpl" />
-  <bean id="usageServiceImpl" class="com.cloud.usage.UsageServiceImpl" />
-  <bean id="virtualNetworkApplianceManagerImpl" class="com.cloud.network.router.VirtualNetworkApplianceManagerImpl" />
-  <bean id="vpcManagerImpl" class="com.cloud.network.vpc.VpcManagerImpl" />
-  <bean id="vpcVirtualNetworkApplianceManagerImpl" class="com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl" />
-
-  <!-- Async management -->
-  <bean id="asyncJobDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.AsyncJobDaoImpl" />
-  <bean id="asyncJobJournalDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDaoImpl" />
-  <bean id="asyncJobJoinMapDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDaoImpl" />
-  <bean id="asyncJobManagerImpl" class="org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl"/>
-  <bean id="asyncJobMonitor" class="org.apache.cloudstack.framework.jobs.impl.AsyncJobMonitor"/>
-  <bean id="syncQueueDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.SyncQueueDaoImpl" />
-  <bean id="syncQueueItemDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDaoImpl" />
-  <bean id="syncQueueManagerImpl" class="org.apache.cloudstack.framework.jobs.impl.SyncQueueManagerImpl" />
-
-  <bean id="ApiAsyncJobDispatcher" class="com.cloud.api.ApiAsyncJobDispatcher">
-    <property name="name" value="ApiAsyncJobDispatcher" />
-  </bean>
-
-
-  <!--
-    Misc components
-  -->
-  <bean id="actionEventUtils" class="com.cloud.event.ActionEventUtils" />
-  <bean id="alertGenerator" class="com.cloud.event.AlertGenerator" />
-  <bean id="apiDBUtils" class="com.cloud.api.ApiDBUtils" />
-  <bean id="apiDiscoveryServiceImpl" class="org.apache.cloudstack.discovery.ApiDiscoveryServiceImpl" />
-  <bean id="apiDispatcher" class="com.cloud.api.ApiDispatcher" />
-  <bean id="apiResponseHelper" class="com.cloud.api.ApiResponseHelper" />
-  <bean id="apiServer" class="com.cloud.api.ApiServer" />
-  <bean id="apiServlet" class="com.cloud.api.ApiServlet" />
-  <bean id="bAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
-  <bean id="cloudOrchestrator" class="org.apache.cloudstack.engine.orchestration.CloudOrchestrator" />
-  <bean id="clusterRestService" class="org.apache.cloudstack.engine.rest.service.api.ClusterRestService" />
-  <bean id="consoleProxyServlet" class="com.cloud.servlet.ConsoleProxyServlet" />
-  <bean id="dataCenterResourceManagerImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceManagerImpl" />
-  <bean id="dataDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.DataDisk" />
-
-
-  <bean id="podRestService" class="org.apache.cloudstack.engine.rest.service.api.PodRestService" />
-  <bean id="iso" class="org.apache.cloudstack.engine.subsystem.api.storage.type.Iso" />
-  <bean id="networkRestService" class="org.apache.cloudstack.engine.rest.service.api.NetworkRestService" />
-  <bean id="provisioningServiceImpl" class="org.apache.cloudstack.engine.service.api.ProvisioningServiceImpl" />
-  <bean id="rootDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.RootDisk" />
-  <bean id="registerCompleteServlet" class="com.cloud.servlet.RegisterCompleteServlet" />
-  <bean id="statsCollector" class="com.cloud.server.StatsCollector" />
-  <bean id="storagePoolAutomationImpl" class="com.cloud.storage.StoragePoolAutomationImpl" />
-  <bean id="usageEventUtils" class="com.cloud.event.UsageEventUtils" />
-  <bean id="vMEntityManagerImpl" class="org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl" />
-  <bean id="virtualMachineEntityImpl" class="org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl" />
-  <bean id="virtualMachineRestService" class="org.apache.cloudstack.engine.rest.service.api.VirtualMachineRestService" />
-  <bean id="volumeRestService" class="org.apache.cloudstack.engine.rest.service.api.VolumeRestService" />
-  <bean id="volumeTypeHelper" class="org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeTypeHelper" />
-  <bean id="zoneRestService" class="org.apache.cloudstack.engine.rest.service.api.ZoneRestService" />
-  <bean id="cloudZonesStartupProcessor" class="com.cloud.hypervisor.CloudZonesStartupProcessor" />
-  <bean id="managementServerNode" class="org.apache.cloudstack.utils.identity.ManagementServerNode" />
-  <bean id="testingAllocator" class="com.cloud.agent.manager.allocator.impl.TestingAllocator" />
-  <bean id="domainManagerImpl" class="com.cloud.user.DomainManagerImpl" />
-  <bean id="downloadMonitorImpl" class="com.cloud.storage.download.DownloadMonitorImpl" />
-  <bean id="lBHealthCheckManagerImpl" class="com.cloud.network.lb.LBHealthCheckManagerImpl" />
-  <bean id="volumeApiServiceImpl" class="com.cloud.storage.VolumeApiServiceImpl"/>
-  <bean id="ApplicationLoadBalancerService" class="org.apache.cloudstack.network.lb.ApplicationLoadBalancerManagerImpl" />
-  <bean id="InternalLoadBalancerVMManager" class="org.apache.cloudstack.network.lb.InternalLoadBalancerVMManagerImpl" />
-
-  <bean id="vMSnapshotManagerImpl" class="com.cloud.vm.snapshot.VMSnapshotManagerImpl" />
-
-
-<!--=======================================================================================================-->
-<!--                                                                                                       -->
-<!--                           Module-basis OSS/non-OSS Common components                                  -->
-<!--                                                                                                       -->
-<!--=======================================================================================================-->
-
-  <!--
-    Baremetal components
-  -->
-  
-  <bean id="BareMetalDhcp" class="com.cloud.baremetal.networkservice.BaremetalDhcpElement">
-    <property name="name" value="BareMetalDhcp"/>
-  </bean>
-  <bean id="BareMetalPxe" class="com.cloud.baremetal.networkservice.BaremetalPxeElement">
-    <property name="name" value="BareMetalPxe"/>
-  </bean>
-  <bean id="BareMetalUserdata" class="com.cloud.baremetal.networkservice.BaremetalUserdataElement">
-      <property name="name" value="BareMetalUserdata"/>
-  </bean>
-
-  <bean id="BareMetalTemplateAdapter" class="com.cloud.baremetal.manager.BareMetalTemplateAdapter" />
-
-  <bean id="BareMetalDiscoverer" class="com.cloud.baremetal.manager.BareMetalDiscoverer">
-    <property name="name" value="Bare Metal Agent"/>
-  </bean>
-
-  <bean id="BareMetalPlanner" class="com.cloud.baremetal.manager.BareMetalPlanner">
-    <property name="name" value="BareMetalPlanner"/>
-  </bean>
-  
-  <bean id="BaremetalGuru" class="com.cloud.baremetal.manager.BareMetalGuru">
-    <property name="name" value="BaremetalGuru"/>
-  </bean>
-
-  <bean id="BaremetalManager" class="com.cloud.baremetal.manager.BaremetalManagerImpl"/>
-  <bean id="BaremetalDhcpManager" class="com.cloud.baremetal.networkservice.BaremetalDhcpManagerImpl"/>
-  <bean id="BaremetalKickStartPxeService" class="com.cloud.baremetal.networkservice.BaremetalKickStartServiceImpl"/>
-  <bean id="BaremetalPingPxeService" class="com.cloud.baremetal.networkservice.BareMetalPingServiceImpl" />
-  <bean id="BaremetalPxeManager" class="com.cloud.baremetal.networkservice.BaremetalPxeManagerImpl" /> 
-    
-  <bean id="BAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
-  <bean id="baremetalDhcpDaoImpl" class="com.cloud.baremetal.database.BaremetalDhcpDaoImpl" />
-  <bean id="baremetalPxeDaoImpl" class="com.cloud.baremetal.database.BaremetalPxeDaoImpl" />
-
-  <bean id="UcsManager" class="com.cloud.ucs.manager.UcsManagerImpl" />
-
-  <bean id="AffinityGroupServiceImpl" class="org.apache.cloudstack.affinity.AffinityGroupServiceImpl">
-  	<property name="AffinityGroupProcessors" value="#{affinityProcessors.Adapters}" />
-  </bean>
-  <bean id="DeploymentPlanningManager" class="com.cloud.deploy.DeploymentPlanningManagerImpl">
-    <property name="Planners" value="#{deploymentPlanners.Adapters}" />
-	<property name="AffinityGroupProcessors" value="#{affinityProcessors.Adapters}" />
-    <property name="StoragePoolAllocators" value="#{storagePoolAllocators.Adapters}" />
-    <property name="HostAllocators" value="#{hostAllocators.Adapters}" />
-  </bean>
-  
-  <bean id="AffinityGroupJoinDaoImpl" class="com.cloud.api.query.dao.AffinityGroupJoinDaoImpl">
-  </bean>
-  <bean id="AffinityGroupDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDaoImpl">
-  </bean>
-  <bean id="AffinityGroupVMMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDaoImpl">
-  </bean>
-  <bean id="AffinityGroupDomainMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDomainMapDaoImpl">
-  </bean>
-  
-  <bean id="PlannerHostReservationDaoImpl" class="com.cloud.deploy.dao.PlannerHostReservationDaoImpl">
-  </bean>
-  
-</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8cf00de5/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
deleted file mode 100644
index df5b002..0000000
--- a/client/tomcatconf/componentContext.xml.in
+++ /dev/null
@@ -1,324 +0,0 @@
-
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xmlns:tx="http://www.springframework.org/schema/tx"
-  xmlns:aop="http://www.springframework.org/schema/aop"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-                      http://www.springframework.org/schema/tx
-                      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
-                      http://www.springframework.org/schema/aop
-                      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
-                      http://www.springframework.org/schema/context
-                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-  <context:annotation-config />
-
-
-<!--
-
-  OSS deployment configuration
-
-  OSS/non-OSS counter-exclusive components and related configurations should be put here
-  for example, configurationDaoImpl component, it has exclusive configuration settings in OSS and non-OSS deployment,
-  its component declaration should be put in both componentContext.xml.in and nonossComponentContext.xml.in, each with
-  independent configuration
-
--->
-  
-  <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
-  <bean id="configurationDaoImpl" class="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl" />
-  <bean id="GlobalLoadBalancingRulesServiceImpl" class ="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
-
-  <!--
-    Nicira support components
-  -->
-  <bean id="niciraNvpDaoImpl" class="com.cloud.network.dao.NiciraNvpDaoImpl" />
-  <bean id="niciraNvpNicMappingDaoImpl" class="com.cloud.network.dao.NiciraNvpNicMappingDaoImpl" />
-  <bean id="niciraNvpRouterMappingDaoImpl" class="com.cloud.network.dao.NiciraNvpRouterMappingDaoImpl" />
-  <bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
-    <property name="name" value="NiciraNvpGuestNetworkGuru"/>
-  </bean>
-  <bean id="NiciraNvp" class="com.cloud.network.element.NiciraNvpElement">
-    <property name="name" value="NiciraNvp"/>
-  </bean>
-
-  <!-- 
-    Midonet support components
-  -->
-  <bean id="MidoNetGuestNetworkGuru" class="com.cloud.network.guru.MidoNetGuestNetworkGuru">
-    <property name="name" value="MidoNetGuestNetworkGuru"/>
-  </bean>
-  <bean id="MidoNetElement" class="com.cloud.network.element.MidoNetElement">
-    <property name="name" value="MidoNetElement"/>
-  </bean>
-
-  <!--
-    Stratosphere SSP support components
-  -->
-  <bean id="sspCredentialDaoImpl" class="org.apache.cloudstack.network.dao.SspCredentialDaoImpl"/>
-  <bean id="sspTenantDaoImpl" class="org.apache.cloudstack.network.dao.SspTenantDaoImpl"/>
-  <bean id="sspUuidDaoImpl" class="org.apache.cloudstack.network.dao.SspUuidDaoImpl"/>
-  <bean id="SspGuestNetworkGuru" class="org.apache.cloudstack.network.guru.SspGuestNetworkGuru">
-    <property name="name" value="SspGuestNetworkGuru"/>
-  </bean>
-  <bean id="StratosphereSsp" class="org.apache.cloudstack.network.element.SspElement">
-    <property name="name" value="StratosphereSsp"/>
-  </bean>
-
-  <!--
-    UCS support components
-  -->
-  <bean id="ucsBladeDaoImpl" class="com.cloud.ucs.database.UcsBladeDaoImpl" />
-  <bean id="ucsManagerDaoImpl" class="com.cloud.ucs.database.UcsManagerDaoImpl" />
-
-  <!--
-      VXLAN support components
-  -->
-  <bean id="VxlanGuestNetworkGuru" class="com.cloud.network.guru.VxlanGuestNetworkGuru">
-    <property name="name" value="VxlanGuestNetworkGuru"/>
-  </bean>
-
-<!--
-
-  Deployment configurations of various adapters
-
-  It determines whether or not a adapter is activated or how it is loaded in order in its managing provider,
-
--->
-  <bean id="cloudStackImageStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.CloudStackImageStoreProviderImpl"/>
-  <bean id="s3ImageStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.S3ImageStoreProviderImpl"/>
-  <bean id="swiftImageStoreProviderImpl"
-        class="org.apache.cloudstack.storage.datastore.provider.SwiftImageStoreProviderImpl"/>
-  <bean id="solidFireDataStoreProvider"
-        class="org.apache.cloudstack.storage.datastore.provider.SolidfirePrimaryDataStoreProvider"/>
-
-  <!--Storage Providers-->
-  <bean id="dataStoreProviderManager"
-        class="org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl">
-    <property name="providers">
-      <list merge="true">
-        <ref bean="cloudStackPrimaryDataStoreProviderImpl"/>
-        <ref local="cloudStackImageStoreProviderImpl"/>
-        <ref local="s3ImageStoreProviderImpl"/>
-        <ref local="swiftImageStoreProviderImpl"/>
-        <ref local="solidFireDataStoreProvider"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Security adapters -->
-  <bean id="userAuthenticators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="SHA256SaltedUserAuthenticator"/>
-          <ref bean="MD5UserAuthenticator"/>
-          <ref bean="LdapAuthenticator"/>
-          <ref bean="PlainTextUserAuthenticator"/>
-      </list>
-    </property>
-  </bean>
-  <bean id="userPasswordEncoders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="SHA256SaltedUserAuthenticator"/>
-          <ref bean="MD5UserAuthenticator"/>
-          <ref bean="LdapAuthenticator"/>
-          <ref bean="PlainTextUserAuthenticator"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="securityCheckers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-		  <ref bean="affinityGroupAccessChecker"/>
-          <ref bean="domainChecker"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Resource discoverers -->
-  <bean id="resourceDiscoverers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="XcpServerDiscoverer"/>
-          <ref bean="SecondaryStorageDiscoverer"/>
-          <ref bean="KvmServerDiscoverer"/>
-          <ref bean="LxcServerDiscoverer"/>
-          <ref bean="BareMetalDiscoverer"/>
-          <ref bean="OvmDiscoverer"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- HA adapters -->
-  <bean id="haInvestigators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="CheckOnAgentInvestigator"/>
-          <ref bean="XenServerInvestigator"/>
-          <ref bean="UserVmDomRInvestigator"/>
-          <ref bean="ManagementIPSystemVMInvestigator"/>
-          <ref bean="KVMInvestigator"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="haFenceBuilders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="XenServerFencer"/>
-          <ref bean="KVMFencer"/>
-          <ref bean="OvmFencer"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Deployment/allocation adapters -->
-  <bean id="deploymentPlanners" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="FirstFitPlanner" />
-          <ref bean="UserDispersingPlanner" />
-          <ref bean="UserConcentratedPodPlanner" />
-          <ref bean="ImplicitDedicationPlanner" />
-          <ref bean="BareMetalPlanner" />
-      </list>
-    </property>
-  </bean>
-
-  <bean id="podAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="UserConcentratedAllocator"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="hostAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="FirstFitRouting"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="storagePoolAllocators" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="LocalStoragePoolAllocator"/>
-          <ref bean="clusterScopeStoragePoolAllocator"/>
-          <ref bean="zoneWideStoragePoolAllocator"/>
-      </list>
-    </property>
-  </bean>
-
-  <!-- Networking adapters -->
-  <bean id="ipDeployers" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="elasticLoadBalancerElement"/>
-          <ref bean="VirtualRouter"/>
-          <ref bean="VpcVirtualRouter"/>
-          <ref bean="NiciraNvp"/>
-          <ref bean="InternalLbVm"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="dhcpProviders" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="VirtualRouter"/>
-          <ref bean="VpcVirtualRouter"/>
-          <ref bean="BareMetalDhcp"/>
-      </list>
-    </property>
-  </bean>
-
-  <bean id="networkGurus" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="StorageNetworkGuru"/>
-          <ref bean="ExternalGuestNetworkGuru"/>
-          <ref bean="PublicNetworkGuru"/>
-          <ref bean="PodBasedNetworkGuru"/>
-          <ref bean="DirectPodBasedNetworkGuru"/>
-          <ref bean="ControlNetworkGuru"/>
-          <ref bean="DirectNetworkGuru"/>
-          <ref bean="OvsGuestNetworkGuru"/>
-          <ref bean="PrivateNetworkGuru"/>
-          <ref bean="NiciraNvpGuestNetworkGuru"/>
-          <ref bean="MidoNetGuestNetworkGuru"/>
-          <ref bean="SspGuestNetworkGuru"/>
-          <ref bean="VxlanGuestNetworkGuru"/>
-      </list>
-    </property>
-  </bean>
-  
-  <bean id="networkElements" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="VirtualRouter"/>
-          <ref bean="Ovs"/>
-          <ref bean="SecurityGroupProvider"/>
-          <ref bean="VpcVirtualRouter"/>
-          <ref bean="NiciraNvp" />
-          <ref bean="MidoNetElement"/>
-          <ref bean="StratosphereSsp"/>
-          <ref bean="InternalLbVm"/>
-          <ref bean="BareMetalDhcp"/>
-          <ref bean="BareMetalPxe"/>
-          <ref bean="BareMetalUserdata"/>
-      </list>
-    </property>
-  </bean>
-
-  <!--
-   AffinityGroup Processors
-  -->
-  <bean id="HostAntiAffinityProcessor" class="org.apache.cloudstack.affinity.HostAntiAffinityProcessor">
-   	<property name="name" value="HostAntiAffinityProcessor"/>
-   	<property name="type" value="host anti-affinity"/>
-  </bean>
-
-  <bean id="affinityProcessors" class="com.cloud.utils.component.AdapterList">
-    <property name="Adapters">
-      <list>
-          <ref bean="HostAntiAffinityProcessor" />
-          <ref bean="ExplicitDedicationProcessor"/>
-      </list>
-    </property>
-  </bean>
-
-  <!--
-    Dedicated Resources components
-  -->
-  <bean id="DedicatedResourceManagerImpl" class="org.apache.cloudstack.dedicated.DedicatedResourceManagerImpl"/>
-  <bean id="ExplicitDedicationProcessor" class="org.apache.cloudstack.affinity.ExplicitDedicationProcessor">
-    <property name="name" value="ExplicitDedicationProcessor"/>
-    <property name="type" value="ExplicitDedication"/>
-  </bean>
-</beans>


[4/9] Spring Modularization

Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java
new file mode 100644
index 0000000..e704437
--- /dev/null
+++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.web;
+
+import java.io.IOException;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+
+import org.apache.cloudstack.spring.module.factory.CloudStackSpringContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.context.ConfigurableWebApplicationContext;
+import org.springframework.web.context.ContextLoaderListener;
+
+public class CloudStackContextLoaderListener extends ContextLoaderListener {
+
+    public static final String WEB_PARENT_MODULE = "parentModule";
+    public static final String WEB_PARENT_MODULE_DEFAULT = "web";
+    
+    private static final Logger log = LoggerFactory.getLogger(CloudStackContextLoaderListener.class);
+    
+    CloudStackSpringContext cloudStackContext;
+    String configuredParentName;
+    
+    @Override
+    protected ApplicationContext loadParentContext(ServletContext servletContext) {
+        return cloudStackContext.getApplicationContextForWeb(configuredParentName);
+    }
+
+    @Override
+    public void contextInitialized(ServletContextEvent event) {
+        try {
+            cloudStackContext = new CloudStackSpringContext();
+        } catch (IOException e) {
+            log.error("Failed to start CloudStack", e);
+            throw new RuntimeException("Failed to initialize CloudStack Spring modules", e);
+        }
+        
+        configuredParentName = event.getServletContext().getInitParameter(WEB_PARENT_MODULE);
+        if ( configuredParentName == null ) {
+            configuredParentName = WEB_PARENT_MODULE_DEFAULT;
+        }
+        
+        super.contextInitialized(event);
+    }
+
+    @Override
+    protected void customizeContext(ServletContext servletContext, ConfigurableWebApplicationContext applicationContext) {
+        super.customizeContext(servletContext, applicationContext);
+        
+        String[] newLocations = cloudStackContext.getConfigLocationsForWeb(configuredParentName, 
+                applicationContext.getConfigLocations());
+        
+        applicationContext.setConfigLocations(newLocations);
+    }
+   
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml b/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml
new file mode 100644
index 0000000..b19833a
--- /dev/null
+++ b/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml
@@ -0,0 +1,28 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="DefaultConfigResources" class="java.util.ArrayList" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/InitTest.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/InitTest.java b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/InitTest.java
new file mode 100644
index 0000000..db3549b
--- /dev/null
+++ b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/InitTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.factory;
+
+import javax.annotation.PostConstruct;
+
+public class InitTest {
+
+    public static boolean initted = false;
+    
+    @PostConstruct
+    public void init() {
+        setInitted(true);
+    }
+
+    public boolean isInitted() {
+        return initted;
+    }
+
+    public void setInitted(boolean initted) {
+        InitTest.initted = initted;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java
new file mode 100644
index 0000000..2947615
--- /dev/null
+++ b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.factory;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import org.apache.cloudstack.spring.module.locator.impl.ClasspathModuleDefinitionLocator;
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.context.ApplicationContext;
+
+public class ModuleBasedContextFactoryTest {
+
+    Collection<ModuleDefinition> defs;
+    
+    @Before
+    public void setUp() throws IOException {
+        InstantiationCounter.count = 0;
+
+        ClasspathModuleDefinitionLocator locator = new ClasspathModuleDefinitionLocator();
+        defs = locator.locateModules("testhierarchy");
+    }
+
+    @Test
+    public void testLoad() throws IOException {
+        
+        ModuleBasedContextFactory factory = new ModuleBasedContextFactory();
+        
+        ModuleDefinitionSet set = factory.loadModules(defs, "base");
+        
+        assertNotNull(set.getApplicationContext("base"));
+    }
+    
+    @Test
+    public void testOverride() throws IOException {
+        
+        InitTest.initted = false;
+        
+        ModuleBasedContextFactory factory = new ModuleBasedContextFactory();
+        
+        ModuleDefinitionSet set = factory.loadModules(defs, "base");
+        
+        assertTrue(!InitTest.initted);
+        assertEquals("a string", set.getApplicationContext("child1").getBean("override", String.class));
+    }
+    
+    @Test
+    public void testBeans() throws IOException {
+        ModuleBasedContextFactory factory = new ModuleBasedContextFactory();
+        ModuleDefinitionSet set = factory.loadModules(defs, "base");
+        
+        testBeansInContext(set, "base", 1, new String[] { "base" }, new String[] { "child1", "child2", "child1-1" });
+        testBeansInContext(set, "child1", 2, new String[] { "base", "child1" }, new String[] { "child2", "child1-1" });
+        testBeansInContext(set, "child2", 4, new String[] { "base", "child2" }, new String[] { "child1", "child1-1" });
+        testBeansInContext(set, "child1-1", 3, new String[] { "base", "child1", "child1-1" }, new String[] { "child2" });
+    }
+    
+    protected void testBeansInContext(ModuleDefinitionSet set, String name, int order, String[] parents, String[] notTheres) {
+        ApplicationContext context = set.getApplicationContext(name);
+        
+        String nameBean = context.getBean("name", String.class);
+        assertEquals(name, nameBean);
+        
+        for ( String parent : parents ) {
+            String parentBean = context.getBean(parent, String.class);
+            assertEquals(parent, parentBean);
+        }
+        
+        for ( String notThere : notTheres ) {
+            try {
+                context.getBean(notThere, String.class);
+                fail();
+            } catch ( NoSuchBeanDefinitionException e ) {
+            }
+        }
+        
+        int count = context.getBean("count", InstantiationCounter.class).getCount();
+        
+        assertEquals(order, count);
+    }
+    
+    public static class InstantiationCounter {
+        public static Integer count = 0;
+        
+        int myCount;
+        
+        public InstantiationCounter() {
+            synchronized (count) {
+                myCount = count + 1;
+                count = myCount;
+            }
+        }
+        
+        public int getCount() {
+            return myCount;
+        }
+        
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java
new file mode 100644
index 0000000..5114187
--- /dev/null
+++ b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.locator.impl;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import org.apache.cloudstack.spring.module.model.ModuleDefinition;
+import org.junit.Test;
+
+public class ClasspathModuleDefinitionSetLocatorTest {
+    
+    @Test
+    public void testDiscover() throws IOException {
+        ClasspathModuleDefinitionLocator factory = new ClasspathModuleDefinitionLocator();
+        
+        Collection<ModuleDefinition> modules = factory.locateModules("testhierarchy");
+        
+        assertEquals(5, modules.size());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionTest.java
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionTest.java b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionTest.java
new file mode 100644
index 0000000..31a82ba
--- /dev/null
+++ b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionTest.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.spring.module.model.impl;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.cloudstack.spring.module.util.ModuleLocationUtils;
+import org.junit.Test;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.core.io.support.ResourcePatternResolver;
+
+public class DefaultModuleDefinitionTest {
+
+    ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
+    
+    protected DefaultModuleDefinition createDef(String name) {
+        Resource resource = 
+                resolver.getResource(ModuleLocationUtils.getModuleLocation("testfiles", name));
+        
+        return new DefaultModuleDefinition("testfiles", resource, resolver);
+    }
+    
+    @Test
+    public void testBlankName() {
+        DefaultModuleDefinition def = createDef("blankname");
+        
+        try {
+            def.init();
+            fail();
+        } catch ( IOException e ) {
+            assertTrue(e.getMessage().contains("Missing name property"));
+        }
+        
+    }
+    
+    @Test
+    public void testMissingName() {
+        DefaultModuleDefinition def = createDef("missingname");
+        
+        try {
+            def.init();
+            fail();
+        } catch ( IOException e ) {
+            assertTrue(e.getMessage().contains("Missing name property"));
+        }
+        
+    }
+    
+    @Test
+    public void testBadName() {
+        DefaultModuleDefinition def = createDef("badname");
+        
+        try {
+            def.init();
+            fail();
+        } catch ( IOException e ) {
+            assertTrue(e.getMessage().contains("is expected to exist at"));
+        }
+    }
+
+    @Test
+    public void testGood() throws IOException {
+        DefaultModuleDefinition def = createDef("good");
+        def.init();
+        assertTrue(def.isValid());
+    }
+    
+    @Test
+    public void testWrongName() {
+        DefaultModuleDefinition def = createDef("wrongname");
+        
+        try {
+            def.init();
+            fail();
+        } catch ( IOException e ) {
+            assertTrue(e.getMessage().contains("do not appear to be the same resource"));
+        }
+    }
+    
+    @Test
+    public void testAllFiles() throws IOException {
+        DefaultModuleDefinition def = createDef("all");
+        
+        def.init();
+        
+        assertEquals(2, def.getContextLocations().size());
+        has(def.getContextLocations(), "empty-context.xml", "empty2-context.xml");
+        
+        assertEquals(2, def.getConfigLocations().size());
+        has(def.getConfigLocations(), "test2-defaults.properties", "defaults.properties");
+        
+        assertEquals(2, def.getInheritableContextLocations().size());
+        has(def.getInheritableContextLocations(), "empty-context-inheritable.xml", "empty2-context-inheritable.xml");
+    }
+    
+    protected void has(List<Resource> resources, String... files) throws IOException {
+        int count = 0;
+        
+        for ( Resource r : resources ) {
+            for ( String file : files ) {
+                if ( r.getURL().toExternalForm().contains(file) ) {
+                    count++;
+                    break;
+                }
+            }
+        }
+        
+        assertEquals(resources + " does not contain " + Arrays.toString(files), files.length, count);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/all/defaults.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/all/defaults.properties b/framework/spring/module/src/test/resources/testfiles/all/defaults.properties
new file mode 100644
index 0000000..c08d10b
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/all/defaults.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+blah=1

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/all/empty-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/all/empty-context-inheritable.xml b/framework/spring/module/src/test/resources/testfiles/all/empty-context-inheritable.xml
new file mode 100644
index 0000000..7c6b8fd
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/all/empty-context-inheritable.xml
@@ -0,0 +1,26 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/all/empty-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/all/empty-context.xml b/framework/spring/module/src/test/resources/testfiles/all/empty-context.xml
new file mode 100644
index 0000000..7c6b8fd
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/all/empty-context.xml
@@ -0,0 +1,26 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/all/empty2-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/all/empty2-context-inheritable.xml b/framework/spring/module/src/test/resources/testfiles/all/empty2-context-inheritable.xml
new file mode 100644
index 0000000..7c6b8fd
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/all/empty2-context-inheritable.xml
@@ -0,0 +1,26 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/all/empty2-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/all/empty2-context.xml b/framework/spring/module/src/test/resources/testfiles/all/empty2-context.xml
new file mode 100644
index 0000000..7c6b8fd
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/all/empty2-context.xml
@@ -0,0 +1,26 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/all/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/all/module.properties b/framework/spring/module/src/test/resources/testfiles/all/module.properties
new file mode 100644
index 0000000..3faaf94
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/all/module.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=all

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/all/test2-defaults.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/all/test2-defaults.properties b/framework/spring/module/src/test/resources/testfiles/all/test2-defaults.properties
new file mode 100644
index 0000000..00ae6c0
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/all/test2-defaults.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/badname/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/badname/module.properties b/framework/spring/module/src/test/resources/testfiles/badname/module.properties
new file mode 100644
index 0000000..354accf
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/badname/module.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=what

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/blankname/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/blankname/module.properties b/framework/spring/module/src/test/resources/testfiles/blankname/module.properties
new file mode 100644
index 0000000..b11279b
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/blankname/module.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# A bunch of whitespace is after name
+name=           

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/good/empty-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/good/empty-context.xml b/framework/spring/module/src/test/resources/testfiles/good/empty-context.xml
new file mode 100644
index 0000000..7c6b8fd
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/good/empty-context.xml
@@ -0,0 +1,26 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/good/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/good/module.properties b/framework/spring/module/src/test/resources/testfiles/good/module.properties
new file mode 100644
index 0000000..47e60ec
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/good/module.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=good

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/missingname/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/missingname/module.properties b/framework/spring/module/src/test/resources/testfiles/missingname/module.properties
new file mode 100644
index 0000000..00ae6c0
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/missingname/module.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testfiles/wrongname/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testfiles/wrongname/module.properties b/framework/spring/module/src/test/resources/testfiles/wrongname/module.properties
new file mode 100644
index 0000000..47e60ec
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testfiles/wrongname/module.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=good

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/base/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/base/module.properties b/framework/spring/module/src/test/resources/testhierarchy/base/module.properties
new file mode 100644
index 0000000..955a32c
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/base/module.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=base

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/base/test-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/base/test-context-inheritable.xml b/framework/spring/module/src/test/resources/testhierarchy/base/test-context-inheritable.xml
new file mode 100644
index 0000000..188301e
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/base/test-context-inheritable.xml
@@ -0,0 +1,28 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="count" class="org.apache.cloudstack.spring.module.factory.ModuleBasedContextFactoryTest.InstantiationCounter" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/base/test-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/base/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/base/test-context.xml
new file mode 100644
index 0000000..a72d8c6
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/base/test-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="name" class="java.lang.String" >
+        <constructor-arg value="base" />
+    </bean>
+    
+    <bean id="base" class="java.lang.String" >
+        <constructor-arg value="base" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/child1-1/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/child1-1/module.properties b/framework/spring/module/src/test/resources/testhierarchy/child1-1/module.properties
new file mode 100644
index 0000000..4abe53f
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/child1-1/module.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=child1-1
+parent=child1

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/child1-1/test-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/child1-1/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/child1-1/test-context.xml
new file mode 100644
index 0000000..7a2a9ad
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/child1-1/test-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="name" class="java.lang.String" >
+        <constructor-arg value="child1-1" />
+    </bean>
+    
+    <bean id="child1-1" class="java.lang.String" >
+        <constructor-arg value="child1-1" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/child1/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/child1/module.properties b/framework/spring/module/src/test/resources/testhierarchy/child1/module.properties
new file mode 100644
index 0000000..9f4df48
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/child1/module.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=child1
+parent=base

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/child1/test-context-override.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/child1/test-context-override.xml b/framework/spring/module/src/test/resources/testhierarchy/child1/test-context-override.xml
new file mode 100644
index 0000000..ceffeb5
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/child1/test-context-override.xml
@@ -0,0 +1,30 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+    
+    <bean id="override" class="java.lang.String" >
+        <constructor-arg value="a string" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/child1/test-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/child1/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/child1/test-context.xml
new file mode 100644
index 0000000..f906183
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/child1/test-context.xml
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <context:annotation-config/>
+
+    <bean id="name" class="java.lang.String" >
+        <constructor-arg value="child1" />
+    </bean>
+    
+    <bean id="child1" class="java.lang.String" >
+        <constructor-arg value="child1" />
+    </bean>
+    
+    <bean id="override" class="org.apache.cloudstack.spring.module.factory.InitTest" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/child2/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/child2/module.properties b/framework/spring/module/src/test/resources/testhierarchy/child2/module.properties
new file mode 100644
index 0000000..f03edfc
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/child2/module.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=child2
+parent=base

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/child2/test-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/child2/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/child2/test-context.xml
new file mode 100644
index 0000000..24bac54
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/child2/test-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="name" class="java.lang.String" >
+        <constructor-arg value="child2" />
+    </bean>
+    
+    <bean id="child2" class="java.lang.String" >
+        <constructor-arg value="child2" />
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/orphan1/module.properties
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/orphan1/module.properties b/framework/spring/module/src/test/resources/testhierarchy/orphan1/module.properties
new file mode 100644
index 0000000..d4a0e6c
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/orphan1/module.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+name=orphan1
+parent=missing1

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/spring/module/src/test/resources/testhierarchy/orphan1/test-context.xml
----------------------------------------------------------------------
diff --git a/framework/spring/module/src/test/resources/testhierarchy/orphan1/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/orphan1/test-context.xml
new file mode 100644
index 0000000..658beea
--- /dev/null
+++ b/framework/spring/module/src/test/resources/testhierarchy/orphan1/test-context.xml
@@ -0,0 +1,30 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="name" class="java.lang.String" >
+        <constructor-arg value="orphan1" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/module.properties
----------------------------------------------------------------------
diff --git a/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/module.properties b/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/module.properties
new file mode 100644
index 0000000..28c79d3
--- /dev/null
+++ b/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/module.properties
@@ -0,0 +1,2 @@
+name=acl-static-role-based
+parent=api
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/spring-acl-static-role-based-context.xml
----------------------------------------------------------------------
diff --git a/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/spring-acl-static-role-based-context.xml b/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/spring-acl-static-role-based-context.xml
new file mode 100644
index 0000000..f13acc1
--- /dev/null
+++ b/plugins/acl/static-role-based/resources/META-INF/cloudstack/acl-static-role-based/spring-acl-static-role-based-context.xml
@@ -0,0 +1,34 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >                     
+
+    <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker" >
+        <property name="services" value="#{apiCommandsRegistry.registered}" />
+    </bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/module.properties
----------------------------------------------------------------------
diff --git a/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/module.properties b/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/module.properties
new file mode 100644
index 0000000..bd19e52
--- /dev/null
+++ b/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/module.properties
@@ -0,0 +1,2 @@
+name=explicit-dedication
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/spring-explicit-dedication-context.xml
----------------------------------------------------------------------
diff --git a/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/spring-explicit-dedication-context.xml b/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/spring-explicit-dedication-context.xml
new file mode 100644
index 0000000..5864f94
--- /dev/null
+++ b/plugins/affinity-group-processors/explicit-dedication/resources/META-INF/cloudstack/explicit-dedication/spring-explicit-dedication-context.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="ExplicitDedicationProcessor"
+        class="org.apache.cloudstack.affinity.ExplicitDedicationProcessor">
+        <property name="name" value="ExplicitDedicationProcessor" />
+        <property name="type" value="ExplicitDedication" />
+    </bean>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/module.properties
----------------------------------------------------------------------
diff --git a/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/module.properties b/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/module.properties
new file mode 100644
index 0000000..80f912d
--- /dev/null
+++ b/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/module.properties
@@ -0,0 +1,2 @@
+name=host-anti-affinity
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/spring-host-anti-affinity-context.xml
----------------------------------------------------------------------
diff --git a/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/spring-host-anti-affinity-context.xml b/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/spring-host-anti-affinity-context.xml
new file mode 100644
index 0000000..bc09cc3
--- /dev/null
+++ b/plugins/affinity-group-processors/host-anti-affinity/resources/META-INF/cloudstack/host-anti-affinity/spring-host-anti-affinity-context.xml
@@ -0,0 +1,37 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="HostAntiAffinityProcessor"
+        class="org.apache.cloudstack.affinity.HostAntiAffinityProcessor">
+        <property name="name" value="HostAntiAffinityProcessor" />
+        <property name="type" value="host anti-affinity" />
+    </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
index 860240f..5be109e 100755
--- a/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
+++ b/plugins/api/discovery/src/org/apache/cloudstack/discovery/ApiDiscoveryServiceImpl.java
@@ -16,14 +16,24 @@
 // under the License.
 package org.apache.cloudstack.discovery;
 
-import com.cloud.serializer.Param;
-import com.cloud.user.User;
-import com.cloud.utils.ReflectUtil;
-import com.cloud.utils.StringUtils;
-import com.cloud.utils.component.PluggableService;
-import com.google.gson.annotations.SerializedName;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+
 import org.apache.cloudstack.acl.APIChecker;
-import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.command.user.discovery.ListApisCmd;
 import org.apache.cloudstack.api.response.ApiDiscoveryResponse;
 import org.apache.cloudstack.api.response.ApiParameterResponse;
@@ -32,27 +42,29 @@ import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.PostConstruct;
-import javax.ejb.Local;
-import javax.inject.Inject;
-import java.lang.reflect.Field;
-import java.util.*;
+import com.cloud.serializer.Param;
+import com.cloud.user.User;
+import com.cloud.utils.ReflectUtil;
+import com.cloud.utils.StringUtils;
+import com.cloud.utils.component.ComponentLifecycleBase;
+import com.cloud.utils.component.PluggableService;
+import com.google.gson.annotations.SerializedName;
 
 @Component
 @Local(value = ApiDiscoveryService.class)
-public class ApiDiscoveryServiceImpl implements ApiDiscoveryService {
+public class ApiDiscoveryServiceImpl extends ComponentLifecycleBase implements ApiDiscoveryService {
     private static final Logger s_logger = Logger.getLogger(ApiDiscoveryServiceImpl.class);
 
-    @Inject protected List<APIChecker> _apiAccessCheckers = null;
-    @Inject protected List<PluggableService> _services = null;
+    List<APIChecker> _apiAccessCheckers = null;
+    List<PluggableService> _services = null;
     private static Map<String, ApiDiscoveryResponse> s_apiNameDiscoveryResponseMap = null;
 
     protected ApiDiscoveryServiceImpl() {
         super();
     }
 
-    @PostConstruct
-    void init() {
+    @Override
+    public boolean start() {
         if (s_apiNameDiscoveryResponseMap == null) {
             long startTime = System.nanoTime();
             s_apiNameDiscoveryResponseMap = new HashMap<String, ApiDiscoveryResponse>();
@@ -66,6 +78,8 @@ public class ApiDiscoveryServiceImpl implements ApiDiscoveryService {
             long endTime = System.nanoTime();
             s_logger.info("Api Discovery Service: Annotation, docstrings, api relation graph processed in " + (endTime - startTime) / 1000000.0 + " ms");
         }
+        
+        return true;
     }
 
     protected Map<String, List<String>> cacheResponseMap(Set<Class<?>> cmdClasses) {
@@ -249,4 +263,21 @@ public class ApiDiscoveryServiceImpl implements ApiDiscoveryService {
         cmdList.add(ListApisCmd.class);
         return cmdList;
     }
+
+    public List<APIChecker> getApiAccessCheckers() {
+        return _apiAccessCheckers;
+    }
+
+    public void setApiAccessCheckers(List<APIChecker> _apiAccessCheckers) {
+        this._apiAccessCheckers = _apiAccessCheckers;
+    }
+
+    public List<PluggableService> getServices() {
+        return _services;
+    }
+
+    @Inject
+    public void setServices(List<PluggableService> _services) {
+        this._services = _services;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/api/discovery/test/org/apache/cloudstack/discovery/ApiDiscoveryTest.java
----------------------------------------------------------------------
diff --git a/plugins/api/discovery/test/org/apache/cloudstack/discovery/ApiDiscoveryTest.java b/plugins/api/discovery/test/org/apache/cloudstack/discovery/ApiDiscoveryTest.java
index afff746..a34484b 100644
--- a/plugins/api/discovery/test/org/apache/cloudstack/discovery/ApiDiscoveryTest.java
+++ b/plugins/api/discovery/test/org/apache/cloudstack/discovery/ApiDiscoveryTest.java
@@ -65,7 +65,7 @@ public class ApiDiscoveryTest {
 
         Set<Class<?>> cmdClasses = new HashSet<Class<?>>();
         cmdClasses.add(ListApisCmd.class);
-        _discoveryService.init();
+        _discoveryService.start();
         _discoveryService.cacheResponseMap(cmdClasses);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/module.properties
----------------------------------------------------------------------
diff --git a/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/module.properties b/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/module.properties
new file mode 100644
index 0000000..4b8fbdb
--- /dev/null
+++ b/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/module.properties
@@ -0,0 +1,2 @@
+name=rate-limit
+parent=api
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/spring-rate-limit-context.xml
----------------------------------------------------------------------
diff --git a/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/spring-rate-limit-context.xml b/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/spring-rate-limit-context.xml
new file mode 100644
index 0000000..17153cf
--- /dev/null
+++ b/plugins/api/rate-limit/resources/META-INF/cloudstack/rate-limit/spring-rate-limit-context.xml
@@ -0,0 +1,32 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+      <bean id="apiRateLimitServiceImpl" class="org.apache.cloudstack.ratelimit.ApiRateLimitServiceImpl"/>
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/dedicated-resources/resources/META-INF/cloudstack/core/spring-dedicated-resources-core-context.xml
----------------------------------------------------------------------
diff --git a/plugins/dedicated-resources/resources/META-INF/cloudstack/core/spring-dedicated-resources-core-context.xml b/plugins/dedicated-resources/resources/META-INF/cloudstack/core/spring-dedicated-resources-core-context.xml
new file mode 100644
index 0000000..e2879f7
--- /dev/null
+++ b/plugins/dedicated-resources/resources/META-INF/cloudstack/core/spring-dedicated-resources-core-context.xml
@@ -0,0 +1,33 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="DedicatedResourceManagerImpl"
+        class="org.apache.cloudstack.dedicated.DedicatedResourceManagerImpl" />
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/module.properties
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/module.properties b/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/module.properties
new file mode 100644
index 0000000..a7dc458
--- /dev/null
+++ b/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/module.properties
@@ -0,0 +1,2 @@
+name=implicit-dedication
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/spring-implicit-dedication-context.xml
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/spring-implicit-dedication-context.xml b/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/spring-implicit-dedication-context.xml
new file mode 100644
index 0000000..d14b450
--- /dev/null
+++ b/plugins/deployment-planners/implicit-dedication/resources/META-INF/cloudstack/implicit-dedication/spring-implicit-dedication-context.xml
@@ -0,0 +1,25 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    you under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
+    language governing permissions and limitations under the License. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="ImplicitDedicationPlanner" class="com.cloud.deploy.ImplicitDedicationPlanner">
+        <property name="name" value="ImplicitDedicationPlanner" />
+    </bean>
+
+
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/module.properties
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/module.properties b/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/module.properties
new file mode 100644
index 0000000..f685b9c
--- /dev/null
+++ b/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/module.properties
@@ -0,0 +1,2 @@
+name=user-concentrated-pod
+parent=planner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/spring-user-concentrated-pod-context.xml
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/spring-user-concentrated-pod-context.xml b/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/spring-user-concentrated-pod-context.xml
new file mode 100644
index 0000000..e26cb2b
--- /dev/null
+++ b/plugins/deployment-planners/user-concentrated-pod/resources/META-INF/cloudstack/user-concentrated-pod/spring-user-concentrated-pod-context.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+  <bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
+    <property name="name" value="UserConcentratedPodPlanner"/>
+  </bean>
+
+    
+</beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/module.properties
----------------------------------------------------------------------
diff --git a/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/module.properties b/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/module.properties
new file mode 100644
index 0000000..95231f5
--- /dev/null
+++ b/plugins/host-allocators/random/resources/META-INF/cloudstack/host-allocator-random/module.properties
@@ -0,0 +1,2 @@
+name=host-allocator-random
+parent=allocator
\ No newline at end of file