incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject git commit: Separate loadable components like Gurus, Elements, Adapters to componentContext.xml
Date Thu, 17 Jan 2013 00:34:20 GMT
Updated Branches:
  refs/heads/javelin 727fab71c -> 2be270de8


Separate loadable components like Gurus, Elements, Adapters to componentContext.xml


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

Branch: refs/heads/javelin
Commit: 2be270de89f1063cf0630ad4a23c23d5cd3599ba
Parents: 727fab7
Author: Kelven Yang <kelveny@gmail.com>
Authored: Wed Jan 16 16:33:59 2013 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Wed Jan 16 16:33:59 2013 -0800

----------------------------------------------------------------------
 client/tomcatconf/componentContext.xml.in          |  163 ++++++++++++++-
 .../acl/StaticRoleBasedAPIAccessChecker.java       |    1 -
 .../cloud/deploy/UserConcentratedPodPlanner.java   |    2 -
 .../com/cloud/deploy/UserDispersingPlanner.java    |    2 -
 .../com/cloud/ovm/hypervisor/OvmDiscoverer.java    |    2 -
 .../src/com/cloud/ovm/hypervisor/OvmFencer.java    |   14 +-
 .../ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java  |    3 -
 .../xen/src/com/cloud/ha/XenServerFencer.java      |    5 +-
 .../src/com/cloud/hypervisor/XenServerGuru.java    |    5 -
 .../xen/discoverer/XcpServerDiscoverer.java        |    2 -
 .../network/guru/NiciraNvpGuestNetworkGuru.java    |    3 -
 .../cloud/network/guru/OvsGuestNetworkGuru.java    |    9 -
 .../cloud/server/auth/LDAPUserAuthenticator.java   |    3 -
 .../cloud/server/auth/MD5UserAuthenticator.java    |    4 -
 .../manager/allocator/impl/FirstFitAllocator.java  |   10 +-
 .../allocator/impl/FirstFitRoutingAllocator.java   |    2 -
 .../allocator/impl/UserConcentratedAllocator.java  |   14 +-
 .../com/cloud/baremetal/BareMetalDiscoverer.java   |    2 -
 server/src/com/cloud/baremetal/BareMetalGuru.java  |    4 -
 .../consoleproxy/ConsoleProxyBalanceAllocator.java |   13 +-
 server/src/com/cloud/deploy/BareMetalPlanner.java  |   12 +-
 server/src/com/cloud/deploy/FirstFitPlanner.java   |    2 -
 .../src/com/cloud/ha/AbstractInvestigatorImpl.java |   10 +-
 .../src/com/cloud/ha/CheckOnAgentInvestigator.java |    2 -
 server/src/com/cloud/ha/KVMFencer.java             |   12 +-
 .../cloud/ha/ManagementIPSystemVMInvestigator.java |    2 -
 .../src/com/cloud/ha/UserVmDomRInvestigator.java   |    2 -
 server/src/com/cloud/ha/XenServerInvestigator.java |    2 -
 server/src/com/cloud/hypervisor/KVMGuru.java       |    3 -
 .../src/com/cloud/hypervisor/guru/HypervGuru.java  |    1 -
 .../hypervisor/hyperv/HypervServerDiscoverer.java  |    2 -
 .../kvm/discoverer/KvmServerDiscoverer.java        |    2 -
 .../cloud/network/ExteralIpAddressAllocator.java   |    5 +-
 .../com/cloud/network/guru/ControlNetworkGuru.java |    2 -
 .../com/cloud/network/guru/DirectNetworkGuru.java  |    2 -
 .../network/guru/DirectPodBasedNetworkGuru.java    |    2 -
 .../network/guru/ExternalGuestNetworkGuru.java     |    5 -
 .../cloud/network/guru/PodBasedNetworkGuru.java    |    2 -
 .../com/cloud/network/guru/PrivateNetworkGuru.java |    2 -
 .../com/cloud/network/guru/PublicNetworkGuru.java  |    2 -
 .../com/cloud/network/guru/StorageNetworkGuru.java |    5 -
 server/src/com/cloud/resource/DiscovererBase.java  |   10 +-
 .../server/auth/DefaultUserAuthenticator.java      |    4 +-
 .../allocator/FirstFitStoragePoolAllocator.java    |    2 -
 .../allocator/LocalStoragePoolAllocator.java       |    2 -
 .../secondary/SecondaryStorageDiscoverer.java      |    2 -
 .../src/com/cloud/utils/component/AdapterBase.java |    3 +
 47 files changed, 188 insertions(+), 177 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index 5f2b6d6..49eb55b 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -65,12 +65,173 @@
   <!--
      Adapters
   -->
+  <bean id="FirstFitRouting" class="com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator">
+    <property name="name" value="FirstFitRouting"/>
+  </bean>
+  
+  <!--
+    Storage pool allocators
+  -->
+  <bean id="LocalStoragePoolAllocator" class="com.cloud.storage.allocator.LocalStoragePoolAllocator">
+    <property name="name" value="LocalStorage"/>
+  </bean>
+  <bean id="FirstFitStoragePoolAllocator" class="com.cloud.storage.allocator.FirstFitStoragePoolAllocator">
+    <property name="name" value="Storage"/>
+  </bean>
+
+  <bean id="UserConcentratedAllocator" class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
+    <property name="name" value="User First"/>
+  </bean>
+
+  <bean id="ConsoleProxyAllocator" class="com.cloud.consoleproxy.ConsoleProxyBalanceAllocator">
+    <property name="name" value="Balance"/>
+  </bean>
+
   <bean id="StaticRoleBasedAPIAccessChecker" class="org.apache.cloudstack.acl.StaticRoleBasedAPIAccessChecker"/>
+
+  <bean id="ExteralIpAddressAllocator" class="com.cloud.network.ExteralIpAddressAllocator">
+    <property name="name" value="Basic"/>
+  </bean>
+
+  <!--
+    Authenticators
+  -->
+  <bean id="MD5UserAuthenticator" class="com.cloud.server.auth.MD5UserAuthenticator">
+    <property name="name" value="MD5"/>
+  </bean>
+
+  <bean id="LDAPUserAuthenticator" class="com.cloud.server.auth.LDAPUserAuthenticator">
+    <property name="name" value="LDAP"/>
+  </bean>
+
+  <!--
+    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="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>
+
+  <bean id="XcpServerDiscoverer" class="com.cloud.hypervisor.xen.discoverer.XcpServerDiscoverer">
+    <property name="name" value="XCP Agent"/>
+  </bean>
+
+  <bean id="SecondaryStorageDiscoverer" class="com.cloud.storage.secondary.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="BareMetalDiscoverer" class="com.cloud.baremetal.BareMetalDiscoverer">
+    <property name="name" value="Bare Metal Agent"/>
+  </bean>
+
+  <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.HypervServerDiscoverer">
+    <property name="name" value="SCVMMServer"/>
+  </bean>
+
+  <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
+    <property name="name" value="Ovm Discover"/>
+  </bean>
+
+  <bean id="FirstFitPlanner" class="com.cloud.deploy.FirstFitPlanner">
+    <property name="name" value="First Fit"/>
+  </bean>
+
+  <bean id="UserDispersingPlanner" class="com.cloud.deploy.UserDispersingPlanner">
+    <property name="name" value="UserDispersing"/>
+  </bean>
   
+  <bean id="UserConcentratedPodPlanner" class="com.cloud.deploy.UserConcentratedPodPlanner">
+    <property name="name" value="UserConcentratedPod"/>
+  </bean>
+
+  <bean id="BareMetalPlanner" class="com.cloud.deploy.BareMetalPlanner">
+    <property name="name" value="BareMetal Fit"/>
+  </bean>
+    
+   
   <!--
-    Gurus
+    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>
+  <bean id="NiciraNvpGuestNetworkGuru" class="com.cloud.network.guru.NiciraNvpGuestNetworkGuru">
+    <property name="name" value="NiciraNvpGuestNetworkGuru"/>
+  </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="BareMetalGuru" class="com.cloud.baremetal.BareMetalGuru">
+    <property name="name" value="BareMetalGuru"/>
+  </bean>
+
+  <bean id="HypervGuru" class="com.cloud.hypervisor.guru.HypervGuru">
+    <property name="name" value="HypervGuru"/>
+  </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/incubator-cloudstack/blob/2be270de/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
----------------------------------------------------------------------
diff --git a/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java b/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
index 2eaa6b0..f51a63a 100644
--- a/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
+++ b/plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
@@ -43,7 +43,6 @@ import com.cloud.utils.component.PluggableService;
 
 // This is the default API access checker that grab's the user's account
 // based on the account type, access is granted
-@Component
 @Local(value=APIChecker.class)
 public class StaticRoleBasedAPIAccessChecker extends AdapterBase implements APIChecker {
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java
index 9e2d08a..2ab9856 100644
--- a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java
+++ b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java
@@ -23,14 +23,12 @@ import java.util.Map;
 import javax.ejb.Local;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.utils.Pair;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=DeploymentPlanner.class)
 public class UserConcentratedPodPlanner extends FirstFitPlanner implements DeploymentPlanner {
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java
index 0f94003..2db2051 100755
--- a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java
+++ b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java
@@ -27,7 +27,6 @@ import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.Config;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -36,7 +35,6 @@ import com.cloud.utils.Pair;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=DeploymentPlanner.class)
 public class UserDispersingPlanner extends FirstFitPlanner implements DeploymentPlanner {
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java
index b883cca..1d8f4f0 100755
--- a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java
+++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java
@@ -30,7 +30,6 @@ import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
 import org.apache.xmlrpc.XmlRpcException;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.Config;
 import com.cloud.agent.api.StartupCommand;
@@ -54,7 +53,6 @@ import com.cloud.utils.db.SearchCriteria2;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.ssh.SSHCmdHelper;
 
-@Component
 @Local(value = Discoverer.class)
 public class OvmDiscoverer extends DiscovererBase implements Discoverer,
 		ResourceStateAdapter {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java
index 3a47499..7aefcaa 100755
--- a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java
+++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmFencer.java
@@ -24,7 +24,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.FenceAnswer;
@@ -34,32 +33,23 @@ import com.cloud.exception.OperationTimedoutException;
 import com.cloud.ha.FenceBuilder;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
-import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.resource.ResourceManager;
 
-@Component
 @Local(value=FenceBuilder.class)
-public class OvmFencer implements FenceBuilder {
+public class OvmFencer extends AdapterBase implements FenceBuilder {
 	private static final Logger s_logger = Logger.getLogger(OvmFencer.class);
-	String _name;
 	@Inject AgentManager _agentMgr;
     @Inject ResourceManager _resourceMgr;
 	
 	@Override
 	public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-		_name = name;
 		return true;
 	}
 
 	@Override
-	public String getName() {
-		// TODO Auto-generated method stub
-		return _name;
-	}
-
-	@Override
 	public boolean start() {
 		// TODO Auto-generated method stub
 		return true;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
index 4ded83e..cb2cb13 100755
--- a/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
+++ b/plugins/hypervisors/ovm/src/com/cloud/ovm/hypervisor/OvmGuru.java
@@ -19,8 +19,6 @@ package com.cloud.ovm.hypervisor;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.springframework.stereotype.Component;
-
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.hypervisor.HypervisorGuru;
 import com.cloud.hypervisor.HypervisorGuruBase;
@@ -30,7 +28,6 @@ import com.cloud.storage.dao.GuestOSDao;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=HypervisorGuru.class)
 public class OvmGuru extends HypervisorGuruBase implements HypervisorGuru {
 	@Inject GuestOSDao _guestOsDao;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java b/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java
index e70b7cf..737b3b2 100755
--- a/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java
+++ b/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java
@@ -24,7 +24,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -37,11 +36,11 @@ import com.cloud.host.Status;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.resource.ResourceManager;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.VMInstanceVO;
 
-@Component
 @Local(value=FenceBuilder.class)
-public class XenServerFencer implements FenceBuilder {
+public class XenServerFencer extends AdapterBase implements FenceBuilder {
     private static final Logger s_logger = Logger.getLogger(XenServerFencer.class);
     String _name;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
index 9fc77a9..8c38a69 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java
@@ -19,19 +19,14 @@ package com.cloud.hypervisor;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.springframework.stereotype.Component;
-
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.GuestOSVO;
-import com.cloud.storage.Storage;
 import com.cloud.storage.dao.GuestOSDao;
-import com.cloud.template.VirtualMachineTemplate;
 import com.cloud.template.VirtualMachineTemplate.BootloaderType;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=HypervisorGuru.class)
 public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru {
     @Inject GuestOSDao _guestOsDao;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
index 46eaa72..65a97a8 100755
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
@@ -33,7 +33,6 @@ import javax.persistence.EntityExistsException;
 
 import org.apache.log4j.Logger;
 import org.apache.xmlrpc.XmlRpcException;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -99,7 +98,6 @@ import com.xensource.xenapi.Session;
 import com.xensource.xenapi.Types.SessionAuthenticationFailed;
 import com.xensource.xenapi.Types.XenAPIException;
 
-@Component
 @Local(value=Discoverer.class)
 public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter {
     private static final Logger s_logger = Logger.getLogger(XcpServerDiscoverer.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
index fa0667b..cdf8edf 100644
--- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
+++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/guru/NiciraNvpGuestNetworkGuru.java
@@ -24,7 +24,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.CreateLogicalSwitchAnswer;
@@ -54,7 +53,6 @@ import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.PhysicalNetwork.IsolationMethod;
 import com.cloud.network.PhysicalNetworkVO;
 import com.cloud.network.dao.NetworkDao;
-import com.cloud.network.dao.NetworkServiceMapDao;
 import com.cloud.network.dao.NiciraNvpDao;
 import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.offering.NetworkOffering;
@@ -67,7 +65,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=NetworkGuru.class)
 public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru {
     private static final Logger s_logger = Logger.getLogger(NiciraNvpGuestNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
index 418d607..4591d9e 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java
@@ -16,13 +16,10 @@
 // under the License.
 package com.cloud.network.guru;
 
-import java.util.List;
-
 import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
@@ -31,7 +28,6 @@ import com.cloud.deploy.DeploymentPlan;
 import com.cloud.event.EventTypes;
 import com.cloud.event.EventUtils;
 import com.cloud.event.EventVO;
-import com.cloud.exception.InsufficientAddressCapacityException;
 import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
 import com.cloud.network.Network;
 import com.cloud.network.NetworkManager;
@@ -40,18 +36,13 @@ import com.cloud.network.ovs.OvsTunnelManager;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.user.Account;
 import com.cloud.user.UserContext;
-import com.cloud.vm.Nic.ReservationStrategy;
-import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.Network.GuestType;
 import com.cloud.network.Network.State;
 import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.PhysicalNetwork.IsolationMethod;
 
-@Component
 @Local(value=NetworkGuru.class)
 public class OvsGuestNetworkGuru extends GuestNetworkGuru {
 	private static final Logger s_logger = Logger.getLogger(OvsGuestNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java b/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java
index 23b7a85..fb0273e 100644
--- a/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java
+++ b/plugins/user-authenticators/ldap/src/com/cloud/server/auth/LDAPUserAuthenticator.java
@@ -34,15 +34,12 @@ import javax.naming.directory.SearchResult;
 import org.apache.cloudstack.api.ApiConstants.LDAPParams;
 import org.apache.log4j.Logger;
 import org.bouncycastle.util.encoders.Base64;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.user.UserAccount;
 import com.cloud.user.dao.UserAccountDao;
 import com.cloud.utils.exception.CloudRuntimeException;
 
-
-@Component
 @Local(value={UserAuthenticator.class})
 public class LDAPUserAuthenticator extends DefaultUserAuthenticator {
     public static final Logger s_logger = Logger.getLogger(LDAPUserAuthenticator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java b/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
index 43d3566..026125e 100644
--- a/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
+++ b/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
@@ -25,9 +25,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-import com.cloud.server.ManagementServer;
 import com.cloud.user.UserAccount;
 import com.cloud.user.dao.UserAccountDao;
 
@@ -38,7 +35,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
  * comparing it against the local database.
  * 
  */
-@Component
 @Local(value={UserAuthenticator.class})
 public class MD5UserAuthenticator extends DefaultUserAuthenticator {
 	public static final Logger s_logger = Logger.getLogger(MD5UserAuthenticator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
index c43f8ea..a25e401 100755
--- a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
+++ b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
@@ -50,6 +50,7 @@ import com.cloud.storage.dao.GuestOSCategoryDao;
 import com.cloud.storage.dao.GuestOSDao;
 import com.cloud.user.Account;
 import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.ConsoleProxyDao;
@@ -63,9 +64,8 @@ import com.cloud.vm.dao.VMInstanceDao;
  */
 @Component
 @Local(value={HostAllocator.class})
-public class FirstFitAllocator implements HostAllocator {
+public class FirstFitAllocator extends AdapterBase implements HostAllocator {
     private static final Logger s_logger = Logger.getLogger(FirstFitAllocator.class);
-    private String _name;
     @Inject HostDao _hostDao = null;
     @Inject HostDetailsDao _hostDetailsDao = null;
     @Inject UserVmDao _vmDao = null;
@@ -392,7 +392,6 @@ public class FirstFitAllocator implements HostAllocator {
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
     	if (_configDao != null) {
     		Map<String, String> configs = _configDao.getConfiguration(params);
             String opFactor = configs.get("cpu.overprovisioning.factor");
@@ -409,11 +408,6 @@ public class FirstFitAllocator implements HostAllocator {
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java
index 73155fd..102c6a5 100644
--- a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java
+++ b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitRoutingAllocator.java
@@ -20,7 +20,6 @@ import java.util.ArrayList;
 import java.util.List;
 import javax.ejb.Local;
 import org.apache.log4j.NDC;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.manager.allocator.HostAllocator;
 import com.cloud.deploy.DeploymentPlan;
@@ -30,7 +29,6 @@ import com.cloud.host.Host.Type;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value={HostAllocator.class})
 public class FirstFitRoutingAllocator extends FirstFitAllocator {
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java
index 5f7bc09..29e1be9 100755
--- a/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java
+++ b/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java
@@ -28,7 +28,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.manager.allocator.PodAllocator;
 import com.cloud.capacity.CapacityVO;
@@ -50,6 +49,7 @@ import com.cloud.template.VirtualMachineTemplate;
 import com.cloud.utils.DateUtil;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VMInstanceVO;
@@ -59,13 +59,10 @@ import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
-@Component
 @Local(value = PodAllocator.class)
-public class UserConcentratedAllocator implements PodAllocator {
+public class UserConcentratedAllocator extends AdapterBase implements PodAllocator {
     private final static Logger s_logger = Logger.getLogger(UserConcentratedAllocator.class);
 
-    String _name;
-
     @Inject
     UserVmDao _vmDao;
     @Inject
@@ -294,11 +291,6 @@ public class UserConcentratedAllocator implements PodAllocator {
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         return true;
     }
@@ -310,8 +302,6 @@ public class UserConcentratedAllocator implements PodAllocator {
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
-
         Map<String, String> configs = _configDao.getConfiguration("management-server", params);
         String stoppedValue = configs.get("vm.resource.release.interval");
         // String destroyedValue = configs.get("capacity.skipcounting.destroyed.hours");

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/baremetal/BareMetalDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/baremetal/BareMetalDiscoverer.java b/server/src/com/cloud/baremetal/BareMetalDiscoverer.java
index eb168da..e751885 100755
--- a/server/src/com/cloud/baremetal/BareMetalDiscoverer.java
+++ b/server/src/com/cloud/baremetal/BareMetalDiscoverer.java
@@ -28,7 +28,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
@@ -58,7 +57,6 @@ import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.dao.VMInstanceDao;
 
-@Component
 @Local(value=Discoverer.class)
 public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter {
 	private static final Logger s_logger = Logger.getLogger(BareMetalDiscoverer.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/baremetal/BareMetalGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/baremetal/BareMetalGuru.java b/server/src/com/cloud/baremetal/BareMetalGuru.java
index 0ed7719..9268415 100755
--- a/server/src/com/cloud/baremetal/BareMetalGuru.java
+++ b/server/src/com/cloud/baremetal/BareMetalGuru.java
@@ -19,10 +19,7 @@ package com.cloud.baremetal;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.springframework.stereotype.Component;
-
 import com.cloud.agent.api.to.VirtualMachineTO;
-import com.cloud.hypervisor.Hypervisor;
 import com.cloud.hypervisor.HypervisorGuru;
 import com.cloud.hypervisor.HypervisorGuruBase;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -31,7 +28,6 @@ import com.cloud.storage.dao.GuestOSDao;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=HypervisorGuru.class)
 public class BareMetalGuru extends HypervisorGuruBase implements HypervisorGuru {
 	@Inject GuestOSDao _guestOsDao;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/consoleproxy/ConsoleProxyBalanceAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyBalanceAllocator.java b/server/src/com/cloud/consoleproxy/ConsoleProxyBalanceAllocator.java
index 0a045eb..45f0faa 100644
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyBalanceAllocator.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyBalanceAllocator.java
@@ -25,17 +25,14 @@ import java.util.Random;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
-import org.springframework.stereotype.Component;
-
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.ConsoleProxyVO;
 
 import edu.emory.mathcs.backport.java.util.Collections;
 
-@Component
 @Local(value={ConsoleProxyAllocator.class})
-public class ConsoleProxyBalanceAllocator implements ConsoleProxyAllocator {
+public class ConsoleProxyBalanceAllocator extends AdapterBase implements ConsoleProxyAllocator {
 
-    private String _name;
     private final Random _rand = new Random(System.currentTimeMillis());
 
     @Override
@@ -77,16 +74,10 @@ public class ConsoleProxyBalanceAllocator implements ConsoleProxyAllocator {
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
         return true;
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/deploy/BareMetalPlanner.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/BareMetalPlanner.java b/server/src/com/cloud/deploy/BareMetalPlanner.java
index 5d0bd76..b06e637 100755
--- a/server/src/com/cloud/deploy/BareMetalPlanner.java
+++ b/server/src/com/cloud/deploy/BareMetalPlanner.java
@@ -24,7 +24,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.capacity.CapacityManager;
 import com.cloud.configuration.Config;
@@ -44,12 +43,12 @@ import com.cloud.offering.ServiceOffering;
 import com.cloud.org.Cluster;
 import com.cloud.resource.ResourceManager;
 import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=DeploymentPlanner.class)
-public class BareMetalPlanner implements DeploymentPlanner {
+public class BareMetalPlanner extends AdapterBase implements DeploymentPlanner {
 	private static final Logger s_logger = Logger.getLogger(BareMetalPlanner.class);
 	@Inject protected DataCenterDao _dcDao;
 	@Inject protected HostPodDao _podDao;
@@ -58,7 +57,6 @@ public class BareMetalPlanner implements DeploymentPlanner {
 	@Inject protected ConfigurationDao _configDao;
 	@Inject protected CapacityManager _capacityMgr;
 	@Inject protected ResourceManager _resourceMgr;
-	String _name;
 	
 	@Override
 	public DeployDestination plan(VirtualMachineProfile<? extends VirtualMachine> vmProfile, DeploymentPlan plan, ExcludeList avoid) throws InsufficientServerCapacityException {
@@ -144,16 +142,10 @@ public class BareMetalPlanner implements DeploymentPlanner {
 
 	@Override
 	public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-		_name = name;
 		return true;
 	}
 
 	@Override
-	public String getName() {
-		return _name;
-	}
-
-	@Override
 	public boolean start() {
 		return true;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/deploy/FirstFitPlanner.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java
index 3517bf8..c0b72e7 100755
--- a/server/src/com/cloud/deploy/FirstFitPlanner.java
+++ b/server/src/com/cloud/deploy/FirstFitPlanner.java
@@ -28,7 +28,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.manager.allocator.HostAllocator;
 import com.cloud.api.ApiDBUtils;
@@ -80,7 +79,6 @@ import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
-@Component
 @Local(value=DeploymentPlanner.class)
 public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
     private static final Logger s_logger = Logger.getLogger(FirstFitPlanner.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
index a6b9652..73fab30 100755
--- a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
+++ b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
@@ -37,14 +37,14 @@ import com.cloud.host.HostVO;
 import com.cloud.host.Status;
 import com.cloud.host.dao.HostDao;
 import com.cloud.resource.ResourceManager;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.db.SearchCriteria2;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.db.SearchCriteriaService;
 
-public abstract class AbstractInvestigatorImpl implements Investigator {
+public abstract class AbstractInvestigatorImpl extends AdapterBase implements Investigator {
     private static final Logger s_logger = Logger.getLogger(AbstractInvestigatorImpl.class);
 
-    private String _name = null;
     @Inject private HostDao _hostDao = null;
     @Inject private AgentManager _agentMgr = null;
     @Inject private ResourceManager _resourceMgr = null;
@@ -52,17 +52,11 @@ public abstract class AbstractInvestigatorImpl implements Investigator {
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
 
         return true;
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/ha/CheckOnAgentInvestigator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/CheckOnAgentInvestigator.java b/server/src/com/cloud/ha/CheckOnAgentInvestigator.java
index 86662a3..2971910 100644
--- a/server/src/com/cloud/ha/CheckOnAgentInvestigator.java
+++ b/server/src/com/cloud/ha/CheckOnAgentInvestigator.java
@@ -20,7 +20,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.CheckVirtualMachineAnswer;
@@ -33,7 +32,6 @@ import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine.State;
 
-@Component
 @Local(value=Investigator.class)
 public class CheckOnAgentInvestigator extends AdapterBase implements Investigator {
     private final static Logger s_logger = Logger.getLogger(CheckOnAgentInvestigator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/ha/KVMFencer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/KVMFencer.java b/server/src/com/cloud/ha/KVMFencer.java
index b4d58a1..9fcacd7 100755
--- a/server/src/com/cloud/ha/KVMFencer.java
+++ b/server/src/com/cloud/ha/KVMFencer.java
@@ -25,7 +25,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.FenceAnswer;
@@ -37,13 +36,12 @@ import com.cloud.host.Status;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.resource.ResourceManager;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.VMInstanceVO;
 
-@Component
 @Local(value=FenceBuilder.class)
-public class KVMFencer implements FenceBuilder {
+public class KVMFencer extends AdapterBase implements FenceBuilder {
 	private static final Logger s_logger = Logger.getLogger(KVMFencer.class);
-	String _name;
 
 	@Inject HostDao _hostDao;
 	@Inject AgentManager _agentMgr;
@@ -52,16 +50,10 @@ public class KVMFencer implements FenceBuilder {
 	public boolean configure(String name, Map<String, Object> params)
 			throws ConfigurationException {
 		// TODO Auto-generated method stub
-		  _name = name;
 		 return true;
 	}
 
 	@Override
-	public String getName() {
-		 return _name;
-	}
-
-	@Override
 	public boolean start() {
 		// TODO Auto-generated method stub
 		return true;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
index 1d9b265..81bdc73 100644
--- a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
+++ b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java
@@ -24,7 +24,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
@@ -35,7 +34,6 @@ import com.cloud.vm.Nic;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 
-@Component
 @Local(value={Investigator.class})
 public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl {
     private static final Logger s_logger = Logger.getLogger(ManagementIPSystemVMInvestigator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/ha/UserVmDomRInvestigator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/UserVmDomRInvestigator.java b/server/src/com/cloud/ha/UserVmDomRInvestigator.java
index 8e54206..742dc57 100644
--- a/server/src/com/cloud/ha/UserVmDomRInvestigator.java
+++ b/server/src/com/cloud/ha/UserVmDomRInvestigator.java
@@ -25,7 +25,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -43,7 +42,6 @@ import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.dao.UserVmDao;
 
-@Component
 @Local(value={Investigator.class})
 public class UserVmDomRInvestigator extends AbstractInvestigatorImpl {
     private static final Logger s_logger = Logger.getLogger(UserVmDomRInvestigator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/ha/XenServerInvestigator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/XenServerInvestigator.java b/server/src/com/cloud/ha/XenServerInvestigator.java
index 9537340..6cbd22f 100755
--- a/server/src/com/cloud/ha/XenServerInvestigator.java
+++ b/server/src/com/cloud/ha/XenServerInvestigator.java
@@ -22,7 +22,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckOnHostAnswer;
@@ -36,7 +35,6 @@ import com.cloud.resource.ResourceManager;
 import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.VMInstanceVO;
 
-@Component
 @Local(value=Investigator.class)
 public class XenServerInvestigator extends AdapterBase implements Investigator {
     private final static Logger s_logger = Logger.getLogger(XenServerInvestigator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/hypervisor/KVMGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/KVMGuru.java b/server/src/com/cloud/hypervisor/KVMGuru.java
index e3207d0..662ee3e 100644
--- a/server/src/com/cloud/hypervisor/KVMGuru.java
+++ b/server/src/com/cloud/hypervisor/KVMGuru.java
@@ -19,8 +19,6 @@ package com.cloud.hypervisor;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.springframework.stereotype.Component;
-
 import com.cloud.agent.api.to.VirtualMachineTO;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.GuestOSVO;
@@ -28,7 +26,6 @@ import com.cloud.storage.dao.GuestOSDao;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=HypervisorGuru.class)
 public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
     @Inject GuestOSDao _guestOsDao;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/hypervisor/guru/HypervGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/guru/HypervGuru.java b/server/src/com/cloud/hypervisor/guru/HypervGuru.java
index fbded66..630080e 100644
--- a/server/src/com/cloud/hypervisor/guru/HypervGuru.java
+++ b/server/src/com/cloud/hypervisor/guru/HypervGuru.java
@@ -21,7 +21,6 @@ import javax.inject.Inject;
 
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.to.VirtualMachineTO;
-import com.cloud.host.dao.HostDetailsDao;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.HypervisorGuru;
 import com.cloud.hypervisor.HypervisorGuruBase;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/hypervisor/hyperv/HypervServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/hyperv/HypervServerDiscoverer.java b/server/src/com/cloud/hypervisor/hyperv/HypervServerDiscoverer.java
index 8fbca29..06658b7 100755
--- a/server/src/com/cloud/hypervisor/hyperv/HypervServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/hyperv/HypervServerDiscoverer.java
@@ -29,7 +29,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.StartupVMMAgentCommand;
@@ -55,7 +54,6 @@ import com.cloud.utils.nio.NioClient;
 import com.cloud.utils.nio.Task;
 import com.cloud.utils.nio.Task.Type;
 
-@Component
 @Local(value=Discoverer.class)
 public class HypervServerDiscoverer extends DiscovererBase implements Discoverer, HandlerFactory{
     private static final Logger s_logger = Logger.getLogger(HypervServerDiscoverer.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
index 599222a..84bb4ba 100644
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
@@ -28,7 +28,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -63,7 +62,6 @@ import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
 import com.cloud.utils.ssh.SSHCmdHelper;
 
-@Component
 @Local(value=Discoverer.class)
 public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
 Listener, ResourceStateAdapter {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/ExteralIpAddressAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExteralIpAddressAllocator.java b/server/src/com/cloud/network/ExteralIpAddressAllocator.java
index eca5ff6..2b78712 100644
--- a/server/src/com/cloud/network/ExteralIpAddressAllocator.java
+++ b/server/src/com/cloud/network/ExteralIpAddressAllocator.java
@@ -29,16 +29,15 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.network.dao.IPAddressDao;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.exception.CloudRuntimeException;
 
-@Component
 @Local(value=IpAddrAllocator.class)
-public class ExteralIpAddressAllocator implements IpAddrAllocator{
+public class ExteralIpAddressAllocator extends AdapterBase implements IpAddrAllocator{
     private static final Logger s_logger = Logger.getLogger(ExteralIpAddressAllocator.class);
     String _name;
     @Inject ConfigurationDao _configDao = null;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/ControlNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/ControlNetworkGuru.java b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
index 469a08b..3132ffd 100755
--- a/server/src/com/cloud/network/guru/ControlNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
@@ -23,7 +23,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.Config;
 import com.cloud.configuration.dao.ConfigurationDao;
@@ -55,7 +54,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value={NetworkGuru.class})
 public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGuru {
     private static final Logger s_logger = Logger.getLogger(ControlNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/DirectNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
index a9ee069..f498957 100755
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@ -20,7 +20,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
@@ -56,7 +55,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value = { NetworkGuru.class })
 public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
     private static final Logger s_logger = Logger.getLogger(DirectNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
index 513d2cd..6c305ec 100755
--- a/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectPodBasedNetworkGuru.java
@@ -22,7 +22,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.ZoneConfig;
 import com.cloud.dc.DataCenter;
@@ -57,7 +56,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value = NetworkGuru.class)
 public class DirectPodBasedNetworkGuru extends DirectNetworkGuru {
     private static final Logger s_logger = Logger.getLogger(DirectPodBasedNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
index 31bbd9c..8188eb9 100644
--- a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
@@ -22,10 +22,8 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.Config;
-import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.dao.DataCenterDao;
@@ -44,9 +42,7 @@ import com.cloud.network.NetworkVO;
 import com.cloud.network.Networks.BroadcastDomainType;
 import com.cloud.network.PhysicalNetwork;
 import com.cloud.network.PhysicalNetwork.IsolationMethod;
-import com.cloud.network.PhysicalNetworkVO;
 import com.cloud.network.dao.NetworkDao;
-import com.cloud.network.dao.PhysicalNetworkDao;
 import com.cloud.network.rules.PortForwardingRuleVO;
 import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.offering.NetworkOffering;
@@ -63,7 +59,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value = NetworkGuru.class)
 public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
     private static final Logger s_logger = Logger.getLogger(ExternalGuestNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java b/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
index 65bdceb..fd70689 100755
--- a/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
@@ -22,7 +22,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.dc.Pod;
 import com.cloud.dc.dao.DataCenterDao;
@@ -50,7 +49,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value={NetworkGuru.class})
 public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru {
     private static final Logger s_logger = Logger.getLogger(PodBasedNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/PrivateNetworkGuru.java b/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
index 73b75df..e958f74 100644
--- a/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
@@ -20,7 +20,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.dc.DataCenter;
@@ -55,7 +54,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value = NetworkGuru.class)
 public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
     private static final Logger s_logger = Logger.getLogger(PrivateNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/PublicNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/PublicNetworkGuru.java b/server/src/com/cloud/network/guru/PublicNetworkGuru.java
index ea9f275..52e1662 100755
--- a/server/src/com/cloud/network/guru/PublicNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PublicNetworkGuru.java
@@ -20,7 +20,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Vlan.VlanType;
@@ -56,7 +55,6 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value = { NetworkGuru.class })
 public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
     private static final Logger s_logger = Logger.getLogger(PublicNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/network/guru/StorageNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/StorageNetworkGuru.java b/server/src/com/cloud/network/guru/StorageNetworkGuru.java
index b55246a..092ae7c 100755
--- a/server/src/com/cloud/network/guru/StorageNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/StorageNetworkGuru.java
@@ -20,13 +20,11 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.dc.Pod;
 import com.cloud.dc.StorageNetworkIpAddressVO;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.deploy.DeploymentPlan;
-import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.InsufficientAddressCapacityException;
 import com.cloud.exception.InsufficientVirtualNetworkCapcityException;
 import com.cloud.network.Network;
@@ -40,8 +38,6 @@ import com.cloud.network.StorageNetworkManager;
 import com.cloud.network.dao.NetworkDao;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.user.Account;
-import com.cloud.utils.component.AdapterBase;
-import com.cloud.utils.net.Ip4Address;
 import com.cloud.utils.net.NetUtils;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
@@ -49,7 +45,6 @@ import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.Nic.ReservationStrategy;
 
-@Component
 @Local(value = NetworkGuru.class)
 public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGuru {
 	private static final Logger s_logger = Logger.getLogger(StorageNetworkGuru.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/resource/DiscovererBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/DiscovererBase.java b/server/src/com/cloud/resource/DiscovererBase.java
index 8bf599b..3d45799 100644
--- a/server/src/com/cloud/resource/DiscovererBase.java
+++ b/server/src/com/cloud/resource/DiscovererBase.java
@@ -35,10 +35,10 @@ import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.network.NetworkManager;
 
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.net.UrlUtil;
 
-public abstract class DiscovererBase implements Discoverer {
-    protected String _name;
+public abstract class DiscovererBase extends AdapterBase implements Discoverer {
     protected Map<String, String> _params;
     private static final Logger s_logger = Logger.getLogger(DiscovererBase.class);
     @Inject protected ClusterDao _clusterDao;
@@ -49,7 +49,6 @@ public abstract class DiscovererBase implements Discoverer {
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
         _params = _configDao.getConfiguration(params);
-        _name = name;
         
         return true;
     }
@@ -69,11 +68,6 @@ public abstract class DiscovererBase implements Discoverer {
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/server/auth/DefaultUserAuthenticator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/auth/DefaultUserAuthenticator.java b/server/src/com/cloud/server/auth/DefaultUserAuthenticator.java
index 25fa802..347b9c0 100644
--- a/server/src/com/cloud/server/auth/DefaultUserAuthenticator.java
+++ b/server/src/com/cloud/server/auth/DefaultUserAuthenticator.java
@@ -23,13 +23,15 @@ import javax.naming.ConfigurationException;
 
 import org.springframework.stereotype.Component;
 
+import com.cloud.utils.component.AdapterBase;
+
 /**
  * Use this UserAuthenticator if users are already authenticated outside
  * 
  */
 @Component
 @Local(value={UserAuthenticator.class})
-public abstract class DefaultUserAuthenticator implements UserAuthenticator {
+public abstract class DefaultUserAuthenticator extends AdapterBase implements UserAuthenticator {
 	private String _name = null;
 	
 	@Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/storage/allocator/FirstFitStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/allocator/FirstFitStoragePoolAllocator.java b/server/src/com/cloud/storage/allocator/FirstFitStoragePoolAllocator.java
index bd9dab8..13a0107 100644
--- a/server/src/com/cloud/storage/allocator/FirstFitStoragePoolAllocator.java
+++ b/server/src/com/cloud/storage/allocator/FirstFitStoragePoolAllocator.java
@@ -28,7 +28,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.deploy.DeploymentPlan;
 import com.cloud.deploy.DeploymentPlanner.ExcludeList;
@@ -45,7 +44,6 @@ import com.cloud.vm.DiskProfile;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachineProfile;
 
-@Component
 @Local(value=StoragePoolAllocator.class)
 public class FirstFitStoragePoolAllocator extends AbstractStoragePoolAllocator {
     private static final Logger s_logger = Logger.getLogger(FirstFitStoragePoolAllocator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/storage/allocator/LocalStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/allocator/LocalStoragePoolAllocator.java b/server/src/com/cloud/storage/allocator/LocalStoragePoolAllocator.java
index 05c23a8..b6b8e8e 100644
--- a/server/src/com/cloud/storage/allocator/LocalStoragePoolAllocator.java
+++ b/server/src/com/cloud/storage/allocator/LocalStoragePoolAllocator.java
@@ -26,7 +26,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.capacity.CapacityVO;
 import com.cloud.capacity.dao.CapacityDao;
@@ -62,7 +61,6 @@ import com.cloud.vm.dao.VMInstanceDao;
 // Rush to make LocalStoragePoolAllocator use static allocation status, we should revisit the overall
 // allocation process to make it more reliable in next release. The code put in here is pretty ugly
 //
-@Component
 @Local(value = StoragePoolAllocator.class)
 public class LocalStoragePoolAllocator extends FirstFitStoragePoolAllocator {
     private static final Logger s_logger = Logger.getLogger(LocalStoragePoolAllocator.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java b/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
index aa37d7f..12db88c 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageDiscoverer.java
@@ -31,7 +31,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.configuration.dao.ConfigurationDao;
@@ -58,7 +57,6 @@ import com.cloud.utils.script.Script;
  * storage servers and make sure everything it can do is
  * correct.
  */
-@Component
 @Local(value=Discoverer.class)
 public class SecondaryStorageDiscoverer extends DiscovererBase implements Discoverer {
     private static final Logger s_logger = Logger.getLogger(SecondaryStorageDiscoverer.class);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2be270de/utils/src/com/cloud/utils/component/AdapterBase.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/component/AdapterBase.java b/utils/src/com/cloud/utils/component/AdapterBase.java
index a735d85..1640ee1 100644
--- a/utils/src/com/cloud/utils/component/AdapterBase.java
+++ b/utils/src/com/cloud/utils/component/AdapterBase.java
@@ -33,6 +33,9 @@ public class AdapterBase implements Adapter {
 
     @Override
     public String getName() {
+    	if(_name == null)
+    		return this.getClass().getSimpleName();
+    	
         return _name;
     }
     


Mime
View raw message