incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [3/5] Improve component lifecycle management with system run-level concept
Date Wed, 30 Jan 2013 23:23:53 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
index e446366..a24300e 100644
--- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
+++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java
@@ -70,6 +70,7 @@ import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
 import com.cloud.utils.Ternary;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.JoinBuilder;
@@ -81,7 +82,7 @@ import com.cloud.vm.DomainRouterVO;
 
 @Component
 @Local(value = { Site2SiteVpnManager.class, Site2SiteVpnService.class } )
-public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager {
+public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpnManager {
     private static final Logger s_logger = Logger.getLogger(Site2SiteVpnManagerImpl.class);
 
     @Inject List<Site2SiteVpnServiceProvider> _s2sProviders;
@@ -101,8 +102,6 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager {
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
-
         Map<String, String> configs = _configDao.getConfiguration(params);
         _connLimit = NumbersUtil.parseInt(configs.get(Config.Site2SiteVpnConnectionPerVpnGatewayLimit.key()), 4);
         _subnetsLimit = NumbersUtil.parseInt(configs.get(Config.Site2SiteVpnSubnetsPerCustomerGatewayLimit.key()), 10);
@@ -111,21 +110,6 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager {
     }
 
     @Override
-    public boolean start() {
-        return true;
-    }
-
-    @Override
-    public boolean stop() {
-        return true;
-    }
-
-    @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_GATEWAY_CREATE, eventDescription = "creating s2s vpn gateway", create=true)
     public Site2SiteVpnGateway createVpnGateway(CreateVpnGatewayCmd cmd) {
         Account caller = UserContext.current().getCaller();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/projects/ProjectManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/projects/ProjectManagerImpl.java b/server/src/com/cloud/projects/ProjectManagerImpl.java
index ebe6d0c..72ed940 100755
--- a/server/src/com/cloud/projects/ProjectManagerImpl.java
+++ b/server/src/com/cloud/projects/ProjectManagerImpl.java
@@ -74,6 +74,7 @@ import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.DateUtil;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
@@ -84,9 +85,8 @@ import com.sun.mail.smtp.SMTPTransport;
 
 @Component
 @Local(value = { ProjectService.class, ProjectManager.class })
-public class ProjectManagerImpl implements ProjectManager, Manager{
+public class ProjectManagerImpl extends ManagerBase implements ProjectManager {
     public static final Logger s_logger = Logger.getLogger(ProjectManagerImpl.class);
-    private String _name;
     private EmailInvite _emailInvite;
 
     @Inject
@@ -127,8 +127,7 @@ public class ProjectManagerImpl implements ProjectManager, Manager{
 
     @Override
     public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
-        _name = name;
-
+ 
         Map<String, String> configs = _configDao.getConfiguration(params);
         _invitationRequired = Boolean.valueOf(configs.get(Config.ProjectInviteRequired.key()));
         
@@ -170,11 +169,6 @@ public class ProjectManagerImpl implements ProjectManager, Manager{
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     @ActionEvent(eventType = EventTypes.EVENT_PROJECT_CREATE, eventDescription = "creating project", create=true)
     @DB
     public Project createProject(String name, String displayText, String accountName, Long domainId) throws ResourceAllocationException{

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/resource/DummyHostDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/DummyHostDiscoverer.java b/server/src/com/cloud/resource/DummyHostDiscoverer.java
index 905fccf..800c1948 100755
--- a/server/src/com/cloud/resource/DummyHostDiscoverer.java
+++ b/server/src/com/cloud/resource/DummyHostDiscoverer.java
@@ -30,14 +30,13 @@ import org.springframework.stereotype.Component;
 
 import com.cloud.host.HostVO;
 import com.cloud.hypervisor.Hypervisor;
+import com.cloud.utils.component.AdapterBase;
 
 @Component
 @Local(value=Discoverer.class)
-public class DummyHostDiscoverer implements Discoverer {
+public class DummyHostDiscoverer extends AdapterBase implements Discoverer {
     private static final Logger s_logger = Logger.getLogger(DummyHostDiscoverer.class);
     
-    private String _name;
-
     @Override
     public Map<ServerResource, Map<String, String>> find(long dcId, Long podId, Long clusterId, URI url, String username, String password, List<String> hostTags) {
         if (!url.getScheme().equals("dummy")) {
@@ -71,26 +70,6 @@ public class DummyHostDiscoverer implements Discoverer {
     }
     
     @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-    	return true;
-    }
-    
-    @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
-    public boolean start() {
-        return true;
-    }
-
-    @Override
-    public boolean stop() {
-        return true;
-    }
-    
-    @Override
 	public boolean matchHypervisor(String hypervisor) {
     	return false;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/resource/DummyHostServerResource.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/DummyHostServerResource.java b/server/src/com/cloud/resource/DummyHostServerResource.java
index d300f6b..977dbbf 100644
--- a/server/src/com/cloud/resource/DummyHostServerResource.java
+++ b/server/src/com/cloud/resource/DummyHostServerResource.java
@@ -164,4 +164,34 @@ public class DummyHostServerResource extends ServerResourceBase {
 			String.valueOf((id >> 8) & 0xff) + "." +
 			String.valueOf((id) & 0xff);
 	}
+
+	@Override
+	public void setName(String name) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setConfigParams(Map<String, Object> params) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public Map<String, Object> getConfigParams() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public int getRunLevel() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public void setRunLevel(int level) {
+		// TODO Auto-generated method stub
+		
+	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/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 a67cc4a..8b74ee1 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -137,6 +137,7 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.StringUtils;
 import com.cloud.utils.UriUtils;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.SearchCriteria.Op;
@@ -156,13 +157,11 @@ import com.cloud.vm.dao.VMInstanceDao;
 
 @Component
 @Local({ ResourceManager.class, ResourceService.class })
-public class ResourceManagerImpl implements ResourceManager, ResourceService,
+public class ResourceManagerImpl extends ManagerBase implements ResourceManager, ResourceService,
 		Manager {
 	private static final Logger s_logger = Logger
 			.getLogger(ResourceManagerImpl.class);
 
-	private String _name;
-
 	@Inject
 	AccountManager _accountMgr;
 	@Inject
@@ -1482,27 +1481,11 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService,
 	@Override
 	public boolean configure(String name, Map<String, Object> params)
 			throws ConfigurationException {
-		_name = name;
 		_defaultSystemVMHypervisor = HypervisorType.getType(_configDao
 				.getValue(Config.SystemVMDefaultHypervisor.toString()));
 		return true;
 	}
-
-	@Override
-	public boolean start() {
-		return true;
-	}
-
-	@Override
-	public boolean stop() {
-		return true;
-	}
-
-	@Override
-	public String getName() {
-		return _name;
-	}
-
+	
 	@Override
 	public List<HypervisorType> getSupportedHypervisorTypes(long zoneId,
 			boolean forVirtualRouter, Long podId) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
index 3566834..7419690 100755
--- a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
+++ b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
@@ -70,6 +70,7 @@ import com.cloud.user.UserContext;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Filter;
@@ -84,10 +85,9 @@ import edu.emory.mathcs.backport.java.util.Arrays;
 
 @Component
 @Local(value = { ResourceLimitService.class })
-public class ResourceLimitManagerImpl implements ResourceLimitService, Manager {
+public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLimitService {
     public static final Logger s_logger = Logger.getLogger(ResourceLimitManagerImpl.class);
 
-    private String _name;
     @Inject
     private DomainDao _domainDao;
     @Inject
@@ -132,11 +132,6 @@ public class ResourceLimitManagerImpl implements ResourceLimitService, Manager {
     Map<ResourceType, Long> projectResourceLimitMap = new EnumMap<ResourceType, Long>(ResourceType.class);
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         if (_resourceCountCheckInterval > 0) {
             _rcExecutor.scheduleAtFixedRate(new ResourceCountCheckTask(), _resourceCountCheckInterval, _resourceCountCheckInterval, TimeUnit.SECONDS);
@@ -151,7 +146,6 @@ public class ResourceLimitManagerImpl implements ResourceLimitService, Manager {
 
     @Override
     public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
-        _name = name;
 
         ResourceCountSearch = _resourceCountDao.createSearchBuilder();
         ResourceCountSearch.and("id", ResourceCountSearch.entity().getId(), SearchCriteria.Op.IN);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java
index 75a2af7..b55e949 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -40,6 +40,7 @@ import java.util.regex.Pattern;
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
 import javax.inject.Inject;
+import javax.naming.ConfigurationException;
 
 import org.apache.commons.codec.binary.Base64;
 import org.apache.log4j.Logger;
@@ -96,6 +97,8 @@ import com.cloud.user.User;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.PasswordGenerator;
 import com.cloud.utils.PropertiesUtil;
+import com.cloud.utils.component.ComponentLifecycle;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.crypt.DBEncryptionUtil;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
@@ -104,8 +107,8 @@ import com.cloud.utils.net.NetUtils;
 import com.cloud.utils.script.Script;
 import com.cloud.uuididentity.dao.IdentityDao;
 
-//@Component
-public class ConfigurationServerImpl implements ConfigurationServer {
+@Component
+public class ConfigurationServerImpl extends ManagerBase implements ConfigurationServer {
     public static final Logger s_logger = Logger.getLogger(ConfigurationServerImpl.class.getName());
 
     @Inject private ConfigurationDao _configDao;
@@ -125,7 +128,20 @@ public class ConfigurationServerImpl implements ConfigurationServer {
     @Inject private IdentityDao _identityDao;
 
     public ConfigurationServerImpl() {
+    	setRunLevel(ComponentLifecycle.RUN_LEVEL_FRAMEWORK_BOOTSTRAP);
     }
+    
+	@Override
+	public boolean configure(String name, Map<String, Object> params)
+			throws ConfigurationException {
+		
+		try {
+			persistDefaultValues();
+		} catch (InternalErrorException e) {
+			throw new RuntimeException("Unhandled configuration exception", e);
+		}
+		return true;
+	}
 
     @Override
     @DB

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/server/ManagementServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServer.java b/server/src/com/cloud/server/ManagementServer.java
index 8655d15..5c34dee 100755
--- a/server/src/com/cloud/server/ManagementServer.java
+++ b/server/src/com/cloud/server/ManagementServer.java
@@ -39,8 +39,6 @@ public interface ManagementServer extends ManagementService, PluggableService  {
      */
     long getId();
     
-    void startup();
-    
     /**
      * Fetches the version of cloud stack
     */

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/server/ManagementServerExtImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerExtImpl.java b/server/src/com/cloud/server/ManagementServerExtImpl.java
index c9ef91d..52ad3df 100644
--- a/server/src/com/cloud/server/ManagementServerExtImpl.java
+++ b/server/src/com/cloud/server/ManagementServerExtImpl.java
@@ -23,8 +23,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
 
-import javax.annotation.PostConstruct;
 import javax.inject.Inject;
+import javax.naming.ConfigurationException;
 
 import com.cloud.api.commands.GenerateUsageRecordsCmd;
 import com.cloud.api.commands.GetUsageRecordsCmd;
@@ -32,7 +32,6 @@ import com.cloud.domain.dao.DomainDao;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.PermissionDeniedException;
 import com.cloud.projects.Project;
-import com.cloud.utils.PropertiesUtil;
 import org.apache.cloudstack.api.response.UsageTypeResponse;
 
 import com.cloud.usage.UsageJobVO;
@@ -58,16 +57,16 @@ public class ManagementServerExtImpl extends ManagementServerImpl implements Man
     public ManagementServerExtImpl() {
     }
     
-    @PostConstruct
-    void init() {
-    	super.init();
-    	
+    @Override
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+    	super.configure(name,  params);
         Map<String, String> configs = getConfigs();
-       String timeZoneStr = configs.get("usage.aggregation.timezone");
-       if (timeZoneStr == null) {
+        String timeZoneStr = configs.get("usage.aggregation.timezone");
+        if (timeZoneStr == null) {
            timeZoneStr = "GMT";
-       }
-       _usageTimezone = TimeZone.getTimeZone(timeZoneStr);
+        }
+        _usageTimezone = TimeZone.getTimeZone(timeZoneStr);
+        return true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 556f3f0..b6bc062 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -46,6 +46,7 @@ import javax.management.InstanceAlreadyExistsException;
 import javax.management.MBeanRegistrationException;
 import javax.management.MalformedObjectNameException;
 import javax.management.NotCompliantMBeanException;
+import javax.naming.ConfigurationException;
 
 import com.cloud.storage.dao.*;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -142,6 +143,7 @@ import com.cloud.event.EventUtils;
 import com.cloud.event.EventVO;
 import com.cloud.event.dao.EventDao;
 import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InternalErrorException;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.OperationTimedoutException;
 import com.cloud.exception.PermissionDeniedException;
@@ -218,7 +220,9 @@ import com.cloud.utils.PasswordGenerator;
 import com.cloud.utils.Ternary;
 import com.cloud.utils.component.Adapter;
 import com.cloud.utils.component.ComponentContext;
+import com.cloud.utils.component.ComponentLifecycle;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.component.SystemIntegrityChecker;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.crypt.DBEncryptionUtil;
@@ -258,7 +262,7 @@ import com.cloud.vm.dao.VMInstanceDao;
 import edu.emory.mathcs.backport.java.util.Arrays;
 import edu.emory.mathcs.backport.java.util.Collections;
 
-public class ManagementServerImpl implements ManagementServer {
+public class ManagementServerImpl extends ManagerBase implements ManagementServer {
     public static final Logger s_logger = Logger.getLogger(ManagementServerImpl.class.getName());
 
     @Inject
@@ -372,12 +376,13 @@ public class ManagementServerImpl implements ManagementServer {
     @Inject
     S3Manager _s3Mgr;
 
+/*   
     @Inject
     ComponentContext _forceContextRef;			// create a dependency to ComponentContext so that it can be loaded beforehead
 
     @Inject
     EventUtils	_forceEventUtilsRef;
-
+*/
     private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("EventChecker"));
     private KeystoreManager _ksMgr;
 
@@ -391,11 +396,14 @@ public class ManagementServerImpl implements ManagementServer {
     private String _hashKey = null;
 
     public ManagementServerImpl() {
+    	setRunLevel(ComponentLifecycle.RUN_LEVEL_APPLICATION_MAINLOOP);
     }
 
-    @PostConstruct
-    void init() {
-        _configs = _configDao.getConfiguration();
+	@Override
+	public boolean configure(String name, Map<String, Object> params)
+			throws ConfigurationException {
+
+		_configs = _configDao.getConfiguration();
 
         String value = _configs.get("event.purge.interval");
         int cleanup = NumbersUtil.parseInt(value, 60 * 60 * 24); // 1 day.
@@ -410,142 +418,16 @@ public class ManagementServerImpl implements ManagementServer {
         for (String id : availableIds) {
             _availableIdsMap.put(id, true);
         }
-    }
-
+		
+		return true;
+	}
+   
     @Override
-    public void startup() {
+    public boolean start() {
         s_logger.info("Startup CloudStack management server...");
-        initCloudStackComponents();
-    }
-
-    private void initCloudStackComponents() {
-        runCheckers();
-        startDaos(); // daos should not be using managers and adapters.
-
-        Map<String, Object> avoidMap = new HashMap<String, Object>();
-        startManagers(avoidMap);
-        startAdapters(avoidMap);
-    }
-
-    private void runCheckers() {
-        Map<String, SystemIntegrityChecker> checkers = ComponentContext.getApplicationContext().getBeansOfType(
-                SystemIntegrityChecker.class);
-
-        for (SystemIntegrityChecker checker : checkers.values()) {
-            try {
-                checker.check();
-            } catch (Exception e) {
-                s_logger.error("Problems with running checker:" + ComponentContext.getTargetClass(checker).getName(), e);
-                System.exit(1);
-            }
-        }
-    }
-
-    private void startDaos() {
-        @SuppressWarnings("rawtypes")
-        Map<String, GenericDaoBase> daos = ComponentContext.getApplicationContext().getBeansOfType(
-                GenericDaoBase.class);
-
-        for (GenericDaoBase dao : daos.values()) {
-            try {
-                s_logger.info("Starting dao " + ComponentContext.getTargetClass(dao).getName());
-                dao.configure(dao.getClass().getSimpleName(), dao.getConfigParams());
-            } catch (Exception e) {
-                s_logger.error("Problems with running checker:" + ComponentContext.getTargetClass(dao).getName(), e);
-                System.exit(1);
-            }
-        }
-    }
-
-    private void startManagers(Map<String, Object> avoidMap) {
-        Map<String, Object> params = new HashMap<String, Object>();
-
-        // make sure startup sequence is maintained
-        try {
-            _clusterMgr.configure("ClusterMgr", params);
-            _clusterMgr.start();
-
-            avoidMap.put(ComponentContext.getTargetClass(_clusterMgr).getName(), _clusterMgr);
-        } catch(Exception e) {
-            s_logger.error("Problems to start manager:" + ComponentContext.getTargetClass(_clusterMgr).getName(), e);
-            System.exit(1);
-        }
-
-        for(Manager manager : ComponentContext.getComponentsOfType(Manager.class).values()) {
-            s_logger.info("Start manager: " + ComponentContext.getTargetClass(manager).getName() + "...");
-            try {
-                if(avoidMap.get(ComponentContext.getTargetClass(manager).getName()) != null) {
-                    s_logger.info("Skip manager: " + ComponentContext.getTargetClass(manager).getName() + " as it is already started");
-                    continue;
-                }
-
-                if(!manager.configure(manager.getClass().getSimpleName(), params)) {
-                    throw new CloudRuntimeException("Failed to start manager: " + ComponentContext.getTargetClass(manager).getName());
-                }
-
-                if (!manager.start()) {
-                    throw new CloudRuntimeException("Failed to start manager: " + ComponentContext.getTargetClass(manager).getName());
-                }
-                avoidMap.put(ComponentContext.getTargetClass(manager).getName(), manager);
-
-                if (manager instanceof ManagementBean) {
-                    registerMBean((ManagementBean) manager);
-                }
-            } catch (Exception e) {
-                s_logger.error("Problems to start manager:" + ComponentContext.getTargetClass(manager).getName(), e);
-                System.exit(1);
-            }
-        }
-    }
-
-    private void startAdapters(Map<String, Object> avoidMap) {
-        @SuppressWarnings("rawtypes")
-        Map<String, Adapter> adapters = ComponentContext.getApplicationContext().getBeansOfType(
-                Adapter.class);
-
-        Map<String, Object> params = new HashMap<String, Object>();
-
-        for(Adapter adapter : adapters.values()) {
-            try {
-                s_logger.info("Start adapter: " + ComponentContext.getTargetClass(adapter).getName() + "...");
-
-                if(avoidMap.get(ComponentContext.getTargetClass(adapter).getName()) != null) {
-                    s_logger.info("Skip adapter: " + ComponentContext.getTargetClass(adapter).getName() + " as it is already started");
-                    continue;
-                }
-
-                if(!adapter.configure(adapter.getName(), params)) {
-                    throw new CloudRuntimeException("Failed to configure adapter: " + ComponentContext.getTargetClass(adapter).getName());
-                }
-                if (!adapter.start()) {
-                    throw new CloudRuntimeException("Failed to start adapter: " + ComponentContext.getTargetClass(adapter).getName());
-                }
-
-                avoidMap.put(ComponentContext.getTargetClass(adapter).getName(), adapter);
-
-                if (adapter instanceof ManagementBean) {
-                    registerMBean((ManagementBean) adapter);
-                }
-            } catch (Exception e) {
-                s_logger.error("Problems to start adapter:" + ComponentContext.getTargetClass(adapter).getName(), e);
-                System.exit(1);
-            }
-        }
-    }
-
-    protected void registerMBean(ManagementBean mbean) {
-        try {
-            JmxUtil.registerMBean(mbean);
-        } catch (MalformedObjectNameException e) {
-            s_logger.warn("Unable to register MBean: " + mbean.getName(), e);
-        } catch (InstanceAlreadyExistsException e) {
-            s_logger.warn("Unable to register MBean: " + mbean.getName(), e);
-        } catch (MBeanRegistrationException e) {
-            s_logger.warn("Unable to register MBean: " + mbean.getName(), e);
-        } catch (NotCompliantMBeanException e) {
-            s_logger.warn("Unable to register MBean: " + mbean.getName(), e);
-        }
-        s_logger.info("Registered MBean: " + mbean.getName());
+    	
+        enableAdminUser("password");
+        return true;
     }
 
     protected Map<String, String> getConfigs() {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/servlet/CloudStartupServlet.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/servlet/CloudStartupServlet.java b/server/src/com/cloud/servlet/CloudStartupServlet.java
index 6401ff1..46be093 100755
--- a/server/src/com/cloud/servlet/CloudStartupServlet.java
+++ b/server/src/com/cloud/servlet/CloudStartupServlet.java
@@ -16,57 +16,25 @@
 // under the License.
 package com.cloud.servlet;
 
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 
 import org.apache.log4j.Logger;
 import org.springframework.web.context.support.SpringBeanAutowiringSupport;
 
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.server.ConfigurationServer;
-import com.cloud.server.ManagementServer;
 import com.cloud.utils.LogUtils;
 import com.cloud.utils.SerialVersionUID;
 import com.cloud.utils.component.ComponentContext;
 
-public class CloudStartupServlet extends HttpServlet implements ServletContextListener {
+public class CloudStartupServlet extends HttpServlet {
     public static final Logger s_logger = Logger.getLogger(CloudStartupServlet.class.getName());
-
     static final long serialVersionUID = SerialVersionUID.CloudStartupServlet;
-
+    
     @Override
-    public void init() throws ServletException {
+    public void init(ServletConfig config) throws ServletException {
     	LogUtils.initLog4j("log4j-cloud.xml");
-        ConfigurationServer c = (ConfigurationServer)ComponentContext.getComponent(ConfigurationServer.Name);
-        try {
-            c.persistDefaultValues();
-            ManagementServer ms = (ManagementServer)ComponentContext.getComponent(ManagementServer.Name);
-            ms.startup();
-            ms.enableAdminUser("password");
-            //ApiServer.initApiServer();
-        } catch (InvalidParameterValueException ipve) {
-            s_logger.error("Exception starting management server ", ipve);
-            throw new ServletException (ipve.getMessage());
-        } catch (Exception e) {
-            s_logger.error("Exception starting management server ", e);
-            throw new ServletException (e.getMessage());
-        }
-    }
-
-    @Override
-    public void contextInitialized(ServletContextEvent sce) {
-        try {
-        	SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, sce.getServletContext());       	
-            init();
-        } catch (ServletException e) {
-            s_logger.error("Exception starting management server ", e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    public void contextDestroyed(ServletContextEvent sce) {
+    	SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());       	
+    	ComponentContext.initComponentsLifeCycle();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/OCFS2ManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/OCFS2ManagerImpl.java b/server/src/com/cloud/storage/OCFS2ManagerImpl.java
index fb73dc4..6bbeec4 100755
--- a/server/src/com/cloud/storage/OCFS2ManagerImpl.java
+++ b/server/src/com/cloud/storage/OCFS2ManagerImpl.java
@@ -45,6 +45,7 @@ import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.dao.StoragePoolDao;
 import com.cloud.storage.dao.StoragePoolHostDao;
 import com.cloud.utils.Ternary;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.db.SearchCriteria2;
 import com.cloud.utils.db.SearchCriteriaService;
@@ -52,8 +53,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
 
 @Component
 @Local(value ={OCFS2Manager.class})
-public class OCFS2ManagerImpl implements OCFS2Manager, ResourceListener {
-    String _name;
+public class OCFS2ManagerImpl extends ManagerBase implements OCFS2Manager, ResourceListener {
     private static final Logger s_logger = Logger.getLogger(OCFS2ManagerImpl.class);
     
     @Inject ClusterDetailsDao _clusterDetailsDao;
@@ -66,7 +66,6 @@ public class OCFS2ManagerImpl implements OCFS2Manager, ResourceListener {
     
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
         return true;
     }
 
@@ -82,11 +81,6 @@ public class OCFS2ManagerImpl implements OCFS2Manager, ResourceListener {
         return true;
     }
 
-    @Override
-    public String getName() {
-        return _name;
-    }
-
     private List<Ternary<Integer, String, String>> marshalNodes(List<HostVO> hosts) {
         Integer i = 0;
         List<Ternary<Integer, String, String>> lst = new ArrayList<Ternary<Integer, String, String>>();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index fc5c135..2c59739 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -177,6 +177,7 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.UriUtils;
 import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericSearchBuilder;
@@ -211,7 +212,7 @@ import com.cloud.vm.dao.VMInstanceDao;
 
 @Component
 @Local(value = { StorageManager.class, StorageService.class })
-public class StorageManagerImpl implements StorageManager, Manager, ClusterManagerListener {
+public class StorageManagerImpl extends ManagerBase implements StorageManager, ClusterManagerListener {
     private static final Logger s_logger = Logger.getLogger(StorageManagerImpl.class);
 
     protected String _name;
@@ -941,7 +942,6 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
 
         Map<String, String> configs = _configDao.getConfiguration("management-server", params);
 
@@ -1201,11 +1201,6 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         if (_storageCleanupEnabled) {
             Random generator = new Random();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
index 3c3bace..2f8d757 100755
--- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
+++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
@@ -93,6 +93,7 @@ import com.cloud.storage.template.TemplateConstants;
 import com.cloud.storage.template.TemplateInfo;
 import com.cloud.user.Account;
 import com.cloud.user.ResourceLimitService;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.JoinBuilder;
 import com.cloud.utils.db.SearchBuilder;
@@ -110,7 +111,7 @@ import edu.emory.mathcs.backport.java.util.Collections;
 
 @Component
 @Local(value={DownloadMonitor.class})
-public class DownloadMonitorImpl implements  DownloadMonitor {
+public class DownloadMonitorImpl extends ManagerBase implements  DownloadMonitor {
     static final Logger s_logger = Logger.getLogger(DownloadMonitorImpl.class);
 	
     @Inject 
@@ -165,7 +166,6 @@ public class DownloadMonitorImpl implements  DownloadMonitor {
     @Inject
     protected ResourceLimitService _resourceLimitMgr;
 
-	private String _name;
 	private Boolean _sslCopy = new Boolean(false);
 	private String _copyAuthPasswd;
 	private String _proxy = null;
@@ -183,7 +183,6 @@ public class DownloadMonitorImpl implements  DownloadMonitor {
 
 	@Override
 	public boolean configure(String name, Map<String, Object> params) {
-		_name = name;
         final Map<String, String> configs = _configDao.getConfiguration("ManagementServer", params);
         _sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
         _proxy = configs.get(Config.SecStorageProxy.key());
@@ -214,11 +213,6 @@ public class DownloadMonitorImpl implements  DownloadMonitor {
 	}
 
 	@Override
-	public String getName() {
-		return _name;
-	}
-
-	@Override
 	public boolean start() {
 		_timer = new Timer();
 		return true;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java b/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
index 9e76e8a..877b97c 100644
--- a/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
+++ b/server/src/com/cloud/storage/resource/DummySecondaryStorageResource.java
@@ -184,4 +184,34 @@ public class DummySecondaryStorageResource extends ServerResourceBase implements
         }
         return tmpltInfo;
     }
+
+	@Override
+	public void setName(String name) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setConfigParams(Map<String, Object> params) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public Map<String, Object> getConfigParams() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public int getRunLevel() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public void setRunLevel(int level) {
+		// TODO Auto-generated method stub
+		
+	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/s3/S3ManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/s3/S3ManagerImpl.java b/server/src/com/cloud/storage/s3/S3ManagerImpl.java
index 16e2ad9..13fe2b7 100644
--- a/server/src/com/cloud/storage/s3/S3ManagerImpl.java
+++ b/server/src/com/cloud/storage/s3/S3ManagerImpl.java
@@ -78,18 +78,17 @@ import com.cloud.storage.dao.VMTemplateS3Dao;
 import com.cloud.storage.dao.VMTemplateZoneDao;
 import com.cloud.storage.secondary.SecondaryStorageVmManager;
 import com.cloud.utils.S3Utils.ClientOptions;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 @Component
 @Local(value = { S3Manager.class })
-public class S3ManagerImpl implements S3Manager {
+public class S3ManagerImpl extends ManagerBase implements S3Manager {
 
     private static final Logger LOGGER = Logger.getLogger(S3ManagerImpl.class);
 
-    private String name;
-
     @Inject 
     private AgentManager agentManager;
 
@@ -474,10 +473,7 @@ public class S3ManagerImpl implements S3Manager {
             LOGGER.info(format("Configuring S3 Manager %1$s", name));
         }
 
-        this.name = name;
-
         return true;
-
     }
 
     @Override
@@ -493,11 +489,6 @@ public class S3ManagerImpl implements S3Manager {
     }
 
     @Override
-    public String getName() {
-        return this.name;
-    }
-
-    @Override
     public void propagateTemplateToAllZones(final VMTemplateS3VO vmTemplateS3VO) {
 
         final long templateId = vmTemplateS3VO.getId();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index 5a5e2fd..fca89dc 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -114,6 +114,7 @@ import com.cloud.user.UserContext;
 import com.cloud.utils.DateUtil;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.GlobalLock;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.db.SearchCriteria2;
@@ -158,7 +159,7 @@ import com.cloud.vm.dao.VMInstanceDao;
 // because sooner or later, it will be driven into Running state
 //
 @Local(value = { SecondaryStorageVmManager.class })
-public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, VirtualMachineGuru<SecondaryStorageVmVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
+public class SecondaryStorageManagerImpl extends ManagerBase implements SecondaryStorageVmManager, VirtualMachineGuru<SecondaryStorageVmVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
     private static final Logger s_logger = Logger.getLogger(SecondaryStorageManagerImpl.class);
 
     private static final int DEFAULT_CAPACITY_SCAN_INTERVAL = 30000; // 30
@@ -171,7 +172,6 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
     private String _mgmt_host;
     private int _mgmt_port = 8250;
 
-    private String _name;
     @Inject
     private List<SecondaryStorageVmAllocator> _ssVmAllocators;
 
@@ -768,10 +768,6 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
         return aggregator.getZoneHostInfoMap();
     }
 
-    @Override
-    public String getName() {
-        return _name;
-    }
 
     @Override
     public boolean start() {
@@ -796,8 +792,6 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
             s_logger.info("Start configuring secondary storage vm manager : " + name);
         }
 
-        _name = name;
-
         Map<String, String> configs = _configDao.getConfiguration("management-server", params);
         
         _secStorageVmMtuSize = NumbersUtil.parseInt(configs.get("secstorage.vm.mtu.size"), DEFAULT_SS_VM_MTUSIZE);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/secondary/SecondaryStorageVmDefaultAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageVmDefaultAllocator.java b/server/src/com/cloud/storage/secondary/SecondaryStorageVmDefaultAllocator.java
index 635f664..7bc80a0 100644
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageVmDefaultAllocator.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageVmDefaultAllocator.java
@@ -25,11 +25,12 @@ import javax.naming.ConfigurationException;
 
 import org.springframework.stereotype.Component;
 
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.vm.SecondaryStorageVmVO;
 
 @Component
 @Local(value={SecondaryStorageVmAllocator.class})
-public class SecondaryStorageVmDefaultAllocator implements SecondaryStorageVmAllocator {
+public class SecondaryStorageVmDefaultAllocator extends AdapterBase implements SecondaryStorageVmAllocator {
 	
     private String _name;
     private Random _rand = new Random(System.currentTimeMillis());
@@ -40,32 +41,4 @@ public class SecondaryStorageVmDefaultAllocator implements SecondaryStorageVmAll
 			return candidates.get(_rand.nextInt(candidates.size()));
     	return null;
     }
-
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-      /*  _name = name;
-        ComponentLocator locator = ComponentLocator.getCurrentLocator();
-        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
-        if (configDao == null) {
-            throw new ConfigurationException("Unable to get the configuration dao.");
-        }
-               */
-        
-        return true;
-    }
-	
-    @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
-    public boolean start() {
-        return true;
-    }
-
-    @Override
-    public boolean stop() {
-        return true;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
index 1209d5c..4ad43cc 100755
--- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
@@ -117,6 +117,7 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.Ternary;
 
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.JoinBuilder;
@@ -132,7 +133,7 @@ import com.cloud.vm.dao.UserVmDao;
 
 @Component
 @Local(value = { SnapshotManager.class, SnapshotService.class })
-public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Manager {
+public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager, SnapshotService {
     private static final Logger s_logger = Logger.getLogger(SnapshotManagerImpl.class);
     @Inject
     protected VMTemplateDao _templateDao;
@@ -193,7 +194,6 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
     @Inject
     private ConfigurationDao _configDao;
     
-    String _name;
     private int _totalRetries;
     private int _pauseInterval;
     private int _deltaSnapshotMax;
@@ -1434,8 +1434,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
-
+ 
         String value = _configDao.getValue(Config.BackupSnapshotWait.toString());
         _backupsnapshotwait = NumbersUtil.parseInt(value, Integer.parseInt(Config.BackupSnapshotWait.getDefaultValue()));
 
@@ -1453,11 +1452,6 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
index 18dc1f9..cbd2933 100644
--- a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
@@ -56,6 +56,7 @@ import com.cloud.utils.DateUtil;
 import com.cloud.utils.DateUtil.IntervalType;
 import com.cloud.utils.NumbersUtil;
 
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.TestClock;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GlobalLock;
@@ -64,10 +65,9 @@ import com.cloud.utils.db.SearchCriteria;
 
 @Component
 @Local(value={SnapshotScheduler.class})
-public class SnapshotSchedulerImpl implements SnapshotScheduler {
+public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotScheduler {
     private static final Logger s_logger = Logger.getLogger(SnapshotSchedulerImpl.class);
 
-    private String _name = null;
     @Inject protected AsyncJobDao             _asyncJobDao;
     @Inject protected SnapshotDao             _snapshotDao;
     @Inject protected SnapshotScheduleDao     _snapshotScheduleDao;
@@ -335,7 +335,6 @@ public class SnapshotSchedulerImpl implements SnapshotScheduler {
     @Override
     public boolean configure(String name, Map<String, Object> params)
     throws ConfigurationException {
-        _name = name;
 
      _snapshotPollInterval = NumbersUtil.parseInt(_configDao.getValue("snapshot.poll.interval"), 300);
         boolean snapshotsRecurringTest = Boolean.parseBoolean(_configDao.getValue("snapshot.recurring.test"));
@@ -357,11 +356,6 @@ public class SnapshotSchedulerImpl implements SnapshotScheduler {
         return true;
     }
 
-    @Override
-    public String getName() {
-        return _name;
-    }
-
     @Override @DB
     public boolean start() {
         // reschedule all policies after management restart

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/swift/SwiftManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/swift/SwiftManagerImpl.java b/server/src/com/cloud/storage/swift/SwiftManagerImpl.java
index 01e2955..5a7f01a 100644
--- a/server/src/com/cloud/storage/swift/SwiftManagerImpl.java
+++ b/server/src/com/cloud/storage/swift/SwiftManagerImpl.java
@@ -53,6 +53,7 @@ import com.cloud.storage.dao.VMTemplateHostDao;
 import com.cloud.storage.dao.VMTemplateSwiftDao;
 import com.cloud.storage.dao.VMTemplateZoneDao;
 import com.cloud.utils.Pair;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.SearchCriteria.Op;
@@ -62,10 +63,9 @@ import com.cloud.utils.exception.CloudRuntimeException;
 
 @Component
 @Local(value = { SwiftManager.class })
-public class SwiftManagerImpl implements SwiftManager {
+public class SwiftManagerImpl extends ManagerBase implements SwiftManager {
     private static final Logger s_logger = Logger.getLogger(SwiftManagerImpl.class);
 
-    private String _name;
     @Inject
     private SwiftDao _swiftDao;
     @Inject
@@ -121,11 +121,6 @@ public class SwiftManagerImpl implements SwiftManager {
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         if (s_logger.isInfoEnabled()) {
             s_logger.info("Start Swift Manager");
@@ -288,8 +283,6 @@ public class SwiftManagerImpl implements SwiftManager {
             s_logger.info("Start configuring Swift Manager : " + name);
         }
 
-        _name = name;
-
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
index 8052287..77f0d20 100755
--- a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
@@ -65,6 +65,7 @@ import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VMTemplateHostDao;
 import com.cloud.storage.secondary.SecondaryStorageVmManager;
 import com.cloud.utils.NumbersUtil;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.GlobalLock;
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -78,7 +79,7 @@ import com.cloud.vm.dao.SecondaryStorageVmDao;
  */
 @Component
 @Local(value={UploadMonitor.class})
-public class UploadMonitorImpl implements UploadMonitor {
+public class UploadMonitorImpl extends ManagerBase implements UploadMonitor {
 
 	static final Logger s_logger = Logger.getLogger(UploadMonitorImpl.class);
 	
@@ -343,7 +344,6 @@ public class UploadMonitorImpl implements UploadMonitor {
 	@Override
 	public boolean configure(String name, Map<String, Object> params)
 			throws ConfigurationException {
-		_name = name;
         final Map<String, String> configs = _configDao.getConfiguration("ManagementServer", params);
         _sslCopy = Boolean.parseBoolean(configs.get("secstorage.encrypt.copy"));
         
@@ -366,11 +366,6 @@ public class UploadMonitorImpl implements UploadMonitor {
 	}
 
 	@Override
-	public String getName() {
-		return _name;
-	}
-
-	@Override
 	public boolean start() {	    
 	    _executor.scheduleWithFixedDelay(new StorageGarbageCollector(), _cleanupInterval, _cleanupInterval, TimeUnit.SECONDS);
 		_timer = new Timer();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
index a5fb8a0..e44343d 100644
--- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
+++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
@@ -62,6 +62,7 @@ import com.cloud.user.UserContext;
 import com.cloud.utils.Pair;
 import com.cloud.utils.Ternary;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.DbUtil;
 import com.cloud.utils.db.Filter;
@@ -76,9 +77,8 @@ import com.cloud.vm.dao.UserVmDao;
 
 @Component
 @Local(value = { TaggedResourceService.class})
-public class TaggedResourceManagerImpl implements TaggedResourceService, Manager{
+public class TaggedResourceManagerImpl extends ManagerBase implements TaggedResourceService {
     public static final Logger s_logger = Logger.getLogger(TaggedResourceManagerImpl.class);
-    private String _name;
     
     private static Map<TaggedResourceType, GenericDao<?, Long>> _daoMap= 
             new HashMap<TaggedResourceType, GenericDao<?, Long>>();
@@ -124,7 +124,6 @@ public class TaggedResourceManagerImpl implements TaggedResourceService, Manager
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name; 
         _daoMap.put(TaggedResourceType.UserVm, _userVmDao);
         _daoMap.put(TaggedResourceType.Volume, _volumeDao);
         _daoMap.put(TaggedResourceType.Template, _templateDao);
@@ -154,12 +153,6 @@ public class TaggedResourceManagerImpl implements TaggedResourceService, Manager
         return true;
     }
 
-    @Override
-    public String getName() {
-        return _name;
-    }
-
-    
     private Long getResourceId(String resourceId, TaggedResourceType resourceType) {   
         GenericDao<?, Long> dao = _daoMap.get(resourceType);
         if (dao == null) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java b/server/src/com/cloud/template/TemplateAdapterBase.java
index d97f05d..fa677ac 100755
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -58,12 +58,12 @@ import com.cloud.user.UserVO;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.user.dao.UserDao;
 import com.cloud.utils.EnumUtils;
+import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.UserVmVO;
 
-public abstract class TemplateAdapterBase implements TemplateAdapter {
+public abstract class TemplateAdapterBase extends AdapterBase implements TemplateAdapter {
 	private final static Logger s_logger = Logger.getLogger(TemplateAdapterBase.class);
-	protected String _name;
 	protected @Inject DomainDao _domainDao;
 	protected @Inject AccountDao _accountDao;
 	protected @Inject ConfigurationDao _configDao;
@@ -78,26 +78,6 @@ public abstract class TemplateAdapterBase implements TemplateAdapter {
 	protected @Inject ResourceLimitService _resourceLimitMgr;
 	
 	@Override
-	public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-		_name = name;
-		return true;
-	}
-
-	@Override
-	public String getName() {
-		return _name;
-	}
-	
-	public void setName(String name) {
-		_name = name;
-	}
-
-	@Override
-	public boolean start() {
-		return true;
-	}
-
-	@Override
 	public boolean stop() {
 		return true;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 1ce9578..0a46414 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -131,6 +131,7 @@ import com.cloud.user.dao.UserDao;
 import com.cloud.uservm.UserVm;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.component.AdapterBase;
+import com.cloud.utils.component.ManagerBase;
 
 import com.cloud.utils.component.Manager;
 import com.cloud.utils.concurrency.NamedThreadFactory;
@@ -150,9 +151,8 @@ import com.cloud.vm.dao.VMInstanceDao;
 
 @Component
 @Local(value={TemplateManager.class, TemplateService.class})
-public class TemplateManagerImpl implements TemplateManager, Manager, TemplateService {
+public class TemplateManagerImpl extends ManagerBase implements TemplateManager, TemplateService {
     private final static Logger s_logger = Logger.getLogger(TemplateManagerImpl.class);
-    String _name;
     @Inject VMTemplateDao _tmpltDao;
     @Inject VMTemplateHostDao _tmpltHostDao;
     @Inject VMTemplatePoolDao _tmpltPoolDao;
@@ -1010,11 +1010,6 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
         }
     }
 
-    @Override
-    public String getName() {
-        return _name;
-    }
-
     private Runnable getSwiftTemplateSyncTask() {
         return new Runnable() {
             @Override
@@ -1064,7 +1059,6 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        _name = name;
         
         final Map<String, String> configs = _configDao.getConfiguration("AgentManager", params);
         _routerTemplateId = NumbersUtil.parseInt(configs.get("router.template.id"), 1);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java b/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
index 1905bb3..50eb47b 100755
--- a/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
+++ b/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java
@@ -29,8 +29,9 @@ import org.springframework.stereotype.Component;
 
 import com.cloud.maint.Version;
 import com.cloud.upgrade.dao.VersionDao;
-import com.cloud.upgrade.dao.VersionDaoImpl;
 
+import com.cloud.utils.component.AdapterBase;
+import com.cloud.utils.component.ComponentLifecycle;
 import com.cloud.utils.component.SystemIntegrityChecker;
 import com.cloud.utils.db.GlobalLock;
 import com.cloud.utils.db.Transaction;
@@ -38,12 +39,13 @@ import com.cloud.utils.exception.CloudRuntimeException;
 
 @Component
 @Local(value = {SystemIntegrityChecker.class})
-public class DatabaseIntegrityChecker implements SystemIntegrityChecker {
+public class DatabaseIntegrityChecker extends AdapterBase implements SystemIntegrityChecker {
 	private final Logger s_logger = Logger.getLogger(DatabaseIntegrityChecker.class);
 	
     @Inject VersionDao _dao;
     
     public DatabaseIntegrityChecker() {
+    	setRunLevel(ComponentLifecycle.RUN_LEVEL_FRAMEWORK_BOOTSTRAP);
     }
 	
 	/*
@@ -248,4 +250,15 @@ public class DatabaseIntegrityChecker implements SystemIntegrityChecker {
             lock.releaseRef();
         }
 	}
+	
+	@Override
+	public boolean start() {
+		try {
+			check();
+		} catch(Exception e) {
+			s_logger.error("System integrity check exception", e);
+			System.exit(1);
+		}
+		return true;
+	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java
index 09cd8df..eceeb84 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -116,6 +116,7 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.Ternary;
 
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GlobalLock;
@@ -140,10 +141,9 @@ import com.cloud.vm.dao.VMInstanceDao;
 
 @Component
 @Local(value = { AccountManager.class, AccountService.class })
-public class AccountManagerImpl implements AccountManager, AccountService, Manager {
+public class AccountManagerImpl extends ManagerBase implements AccountManager, AccountService {
     public static final Logger s_logger = Logger.getLogger(AccountManagerImpl.class);
 
-    private String _name;
     @Inject
     private AccountDao _accountDao;
     @Inject
@@ -237,8 +237,6 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
 
     @Override
     public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
-        _name = name;
-
         _systemAccount = _accountDao.findById(AccountVO.ACCOUNT_ID_SYSTEM);
         if (_systemAccount == null) {
             throw new ConfigurationException("Unable to find the system account using " + Account.ACCOUNT_ID_SYSTEM);
@@ -269,11 +267,6 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
     public boolean start() {
         _executor.scheduleAtFixedRate(new AccountCleanupTask(), _cleanupInterval, _cleanupInterval, TimeUnit.SECONDS);
         return true;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/DomainManagerImpl.java b/server/src/com/cloud/user/DomainManagerImpl.java
index 9df34d1..5d39360 100644
--- a/server/src/com/cloud/user/DomainManagerImpl.java
+++ b/server/src/com/cloud/user/DomainManagerImpl.java
@@ -51,6 +51,7 @@ import com.cloud.storage.dao.DiskOfferingDao;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.SearchBuilder;
@@ -61,10 +62,9 @@ import com.cloud.utils.net.NetUtils;
 
 @Component
 @Local(value = { DomainManager.class, DomainService.class })
-public class DomainManagerImpl implements DomainManager, DomainService, Manager {
+public class DomainManagerImpl extends ManagerBase implements DomainManager, DomainService {
     public static final Logger s_logger = Logger.getLogger(DomainManagerImpl.class);
 
-    private String _name;
     @Inject
     private DomainDao _domainDao;
     @Inject
@@ -93,28 +93,6 @@ public class DomainManagerImpl implements DomainManager, DomainService, Manager
     }
 
     @Override
-    public String getName() {
-        return _name;
-    }
-
-    @Override
-    public boolean start() {
-        return true;
-    }
-
-    @Override
-    public boolean stop() {
-        return true;
-    }
-
-    @Override
-    public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
-        _name = name;
-
-        return true;
-    }
-
-    @Override
     public Set<Long> getDomainChildrenIds(String parentDomainPath) {
         Set<Long> childDomains = new HashSet<Long>();
         SearchCriteria<DomainVO> sc = _domainDao.createSearchCriteria();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/uuididentity/IdentityServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/uuididentity/IdentityServiceImpl.java b/server/src/com/cloud/uuididentity/IdentityServiceImpl.java
index 2a93627..dd9a462 100644
--- a/server/src/com/cloud/uuididentity/IdentityServiceImpl.java
+++ b/server/src/com/cloud/uuididentity/IdentityServiceImpl.java
@@ -26,13 +26,12 @@ import org.apache.cloudstack.api.IdentityService;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.uuididentity.dao.IdentityDao;
 
 @Component
 @Local(value = { IdentityService.class })
-public class IdentityServiceImpl implements Manager, IdentityService {
-    private String _name;
-
+public class IdentityServiceImpl extends ManagerBase implements IdentityService {
     @Inject	private IdentityDao _identityDao;
 
     @Override
@@ -44,27 +43,4 @@ public class IdentityServiceImpl implements Manager, IdentityService {
     public String getIdentityUuid(String tableName, String identityString) {
         return _identityDao.getIdentityUuid(tableName, identityString);
     }
-
-    @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;
-    }
-
-    @Override
-    public boolean stop() {
-        return true;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index bd0733f..8dd83c6 100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -218,6 +218,7 @@ import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
 import com.cloud.utils.PasswordGenerator;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.crypt.RSAHelper;
 import com.cloud.utils.db.DB;
@@ -240,7 +241,7 @@ import com.cloud.vm.dao.UserVmDetailsDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
 @Local(value = { UserVmManager.class, UserVmService.class })
-public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager {
+public class UserVmManagerImpl extends ManagerBase implements UserVmManager, UserVmService {
     private static final Logger s_logger = Logger
             .getLogger(UserVmManagerImpl.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 4f15cc5..9b00d7a 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -140,6 +140,7 @@ import com.cloud.utils.Journal;
 import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.Pair;
 import com.cloud.utils.Ternary;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GlobalLock;
@@ -159,10 +160,9 @@ import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
 @Local(value = VirtualMachineManager.class)
-public class VirtualMachineManagerImpl implements VirtualMachineManager, Listener {
+public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMachineManager, Listener {
     private static final Logger s_logger = Logger.getLogger(VirtualMachineManagerImpl.class);
 
-    String _name;
     @Inject
     protected StorageManager _storageMgr;
     @Inject
@@ -427,8 +427,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
 
     @Override
     public boolean configure(String name, Map<String, Object> xmlParams) throws ConfigurationException {
-        _name = name;
-
         Map<String, String> params = _configDao.getConfiguration(xmlParams);
 
         _retry = NumbersUtil.parseInt(params.get(Config.StartRetry.key()), 10);
@@ -452,11 +450,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
         return true;
     }
 
-    @Override
-    public String getName() {
-        return _name;
-    }
-
     protected VirtualMachineManagerImpl() {
         setStateMachine();
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/agent/MockAgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/agent/MockAgentManagerImpl.java b/server/test/com/cloud/agent/MockAgentManagerImpl.java
index f16f50b..bdacf68 100755
--- a/server/test/com/cloud/agent/MockAgentManagerImpl.java
+++ b/server/test/com/cloud/agent/MockAgentManagerImpl.java
@@ -35,10 +35,11 @@ import com.cloud.host.HostVO;
 import com.cloud.host.Status.Event;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.resource.ServerResource;
+import com.cloud.utils.component.ManagerBase;
 
 @Component
 @Local(value = { AgentManager.class })
-public class MockAgentManagerImpl implements AgentManager {
+public class MockAgentManagerImpl extends ManagerBase implements AgentManager {
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/alert/MockAlertManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/alert/MockAlertManagerImpl.java b/server/test/com/cloud/alert/MockAlertManagerImpl.java
index 3f87193..f0c67f9 100644
--- a/server/test/com/cloud/alert/MockAlertManagerImpl.java
+++ b/server/test/com/cloud/alert/MockAlertManagerImpl.java
@@ -22,8 +22,10 @@ import java.util.Map;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
+import com.cloud.utils.component.ManagerBase;
+
 @Local(value = {AlertManager.class})
-public class MockAlertManagerImpl implements AlertManager {
+public class MockAlertManagerImpl extends ManagerBase implements AlertManager {
 
     /* (non-Javadoc)
      * @see com.cloud.utils.component.Manager#configure(java.lang.String, java.util.Map)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/network/MockFirewallManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockFirewallManagerImpl.java b/server/test/com/cloud/network/MockFirewallManagerImpl.java
index c7d4e86..76dc843 100644
--- a/server/test/com/cloud/network/MockFirewallManagerImpl.java
+++ b/server/test/com/cloud/network/MockFirewallManagerImpl.java
@@ -36,10 +36,11 @@ import com.cloud.network.rules.FirewallRule.Purpose;
 import com.cloud.user.Account;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 
 @Local(value = {FirewallManager.class, FirewallService.class})
-public class MockFirewallManagerImpl implements FirewallManager,
-		FirewallService, Manager {
+public class MockFirewallManagerImpl extends ManagerBase implements FirewallManager,
+		FirewallService {
 
 	@Override
 	public boolean configure(String name, Map<String, Object> params)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/network/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java
index c24493a..6621d1d 100755
--- a/server/test/com/cloud/network/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/network/MockNetworkManagerImpl.java
@@ -61,6 +61,7 @@ import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
@@ -71,7 +72,7 @@ import com.cloud.vm.VirtualMachineProfileImpl;
 
 @Component
 @Local(value = { NetworkManager.class, NetworkService.class })
-public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkService {
+public class MockNetworkManagerImpl extends ManagerBase implements NetworkManager, NetworkService {
 
     @Override
     public List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/network/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java
index 003b718..50af796 100644
--- a/server/test/com/cloud/network/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/network/MockNetworkModelImpl.java
@@ -43,12 +43,13 @@ import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.user.Account;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.VirtualMachine;
 
 @Local(value = {NetworkModel.class})
-public class MockNetworkModelImpl implements NetworkModel, Manager {
+public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
 
     /* (non-Javadoc)
      * @see com.cloud.utils.component.Manager#configure(java.lang.String, java.util.Map)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/network/MockRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/MockRulesManagerImpl.java b/server/test/com/cloud/network/MockRulesManagerImpl.java
index 3687e9c..ba3dd41 100644
--- a/server/test/com/cloud/network/MockRulesManagerImpl.java
+++ b/server/test/com/cloud/network/MockRulesManagerImpl.java
@@ -38,10 +38,11 @@ import com.cloud.user.Account;
 import com.cloud.uservm.UserVm;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.VirtualMachine;
 
 @Local(value = {RulesManager.class, RulesService.class})
-public class MockRulesManagerImpl implements RulesManager,  Manager, RulesService {
+public class MockRulesManagerImpl extends ManagerBase implements RulesManager, RulesService {
 
 	@Override
 	public Pair<List<? extends FirewallRule>, Integer> searchStaticNatRules(

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java b/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
index 1a01681..1dde4a8 100644
--- a/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
+++ b/server/test/com/cloud/network/vpn/MockRemoteAccessVPNServiceProvider.java
@@ -27,9 +27,10 @@ import com.cloud.network.Network;
 import com.cloud.network.RemoteAccessVpn;
 import com.cloud.network.VpnUser;
 import com.cloud.network.element.RemoteAccessVPNServiceProvider;
+import com.cloud.utils.component.ManagerBase;
 
 @Local (value = RemoteAccessVPNServiceProvider.class)
-public class MockRemoteAccessVPNServiceProvider implements
+public class MockRemoteAccessVPNServiceProvider extends ManagerBase implements
 		RemoteAccessVPNServiceProvider {
 
 	@Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/projects/MockProjectManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/projects/MockProjectManagerImpl.java b/server/test/com/cloud/projects/MockProjectManagerImpl.java
index 309fa45..f588381 100644
--- a/server/test/com/cloud/projects/MockProjectManagerImpl.java
+++ b/server/test/com/cloud/projects/MockProjectManagerImpl.java
@@ -32,11 +32,12 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.projects.ProjectAccount.Role;
 import com.cloud.user.Account;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.Pair;
 
 
 @Local(value = { ProjectManager.class })
-public class MockProjectManagerImpl implements ProjectManager, Manager {
+public class MockProjectManagerImpl extends ManagerBase implements ProjectManager {
 
     @Override
     public Project createProject(String name, String displayText,

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/resource/MockResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/resource/MockResourceManagerImpl.java b/server/test/com/cloud/resource/MockResourceManagerImpl.java
index a0dad47..889318b 100644
--- a/server/test/com/cloud/resource/MockResourceManagerImpl.java
+++ b/server/test/com/cloud/resource/MockResourceManagerImpl.java
@@ -54,10 +54,11 @@ import com.cloud.storage.Swift;
 import com.cloud.template.VirtualMachineTemplate;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.fsm.NoTransitionException;
 
 @Local(value = {ResourceManager.class})
-public class MockResourceManagerImpl implements ResourceManager, Manager {
+public class MockResourceManagerImpl extends ManagerBase implements ResourceManager {
 
     /* (non-Javadoc)
      * @see com.cloud.resource.ResourceService#updateHost(com.cloud.api.commands.UpdateHostCmd)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/user/MockAccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/user/MockAccountManagerImpl.java b/server/test/com/cloud/user/MockAccountManagerImpl.java
index bc81a6f..e5a7ada 100644
--- a/server/test/com/cloud/user/MockAccountManagerImpl.java
+++ b/server/test/com/cloud/user/MockAccountManagerImpl.java
@@ -40,13 +40,14 @@ import com.cloud.projects.Project.ListProjectResourcesCriteria;
 import com.cloud.utils.Pair;
 import com.cloud.utils.Ternary;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
 
 
 @Component
 @Local(value = { AccountManager.class, AccountService.class })
-public class MockAccountManagerImpl implements Manager, AccountManager, AccountService {
+public class MockAccountManagerImpl extends ManagerBase implements AccountManager, AccountService {
 
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/user/MockDomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/user/MockDomainManagerImpl.java b/server/test/com/cloud/user/MockDomainManagerImpl.java
index 0f572d8..d249c80 100644
--- a/server/test/com/cloud/user/MockDomainManagerImpl.java
+++ b/server/test/com/cloud/user/MockDomainManagerImpl.java
@@ -32,10 +32,11 @@ import com.cloud.domain.DomainVO;
 import com.cloud.exception.PermissionDeniedException;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 
 @Component
 @Local(value = { DomainManager.class, DomainService.class })
-public class MockDomainManagerImpl implements  Manager, DomainManager, DomainService {
+public class MockDomainManagerImpl extends ManagerBase implements DomainManager, DomainService {
 
     @Override
     public Domain createDomain(String name, Long parentId, String networkDomain) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vm/MockUserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/MockUserVmManagerImpl.java b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
index c2d6825..0b17d6e 100644
--- a/server/test/com/cloud/vm/MockUserVmManagerImpl.java
+++ b/server/test/com/cloud/vm/MockUserVmManagerImpl.java
@@ -68,11 +68,12 @@ import com.cloud.user.Account;
 import com.cloud.uservm.UserVm;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.exception.ExecutionException;
 
 @Component
 @Local(value = { UserVmManager.class, UserVmService.class })
-public class MockUserVmManagerImpl implements UserVmManager, UserVmService, Manager {
+public class MockUserVmManagerImpl extends ManagerBase implements UserVmManager, UserVmService {
 
     @Override
     public UserVmVO findByName(String name) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vm/MockVirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/MockVirtualMachineManagerImpl.java b/server/test/com/cloud/vm/MockVirtualMachineManagerImpl.java
index 71005c7..cdf7be2 100755
--- a/server/test/com/cloud/vm/MockVirtualMachineManagerImpl.java
+++ b/server/test/com/cloud/vm/MockVirtualMachineManagerImpl.java
@@ -48,6 +48,7 @@ import com.cloud.storage.VMTemplateVO;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.vm.VirtualMachine.Event;
 import com.cloud.vm.VirtualMachine.Type;
@@ -55,7 +56,7 @@ import com.cloud.vm.VirtualMachineProfile.Param;
 
 @Component
 @Local(value = VirtualMachineManager.class)
-public class MockVirtualMachineManagerImpl implements VirtualMachineManager {
+public class MockVirtualMachineManagerImpl extends ManagerBase implements VirtualMachineManager {
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index 8b16c3d..0af9f16 100644
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -79,11 +79,12 @@ import com.cloud.service.ServiceOfferingVO;
 import com.cloud.storage.DiskOfferingVO;
 import com.cloud.user.Account;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.VirtualMachine.Type;
 
 @Component
 @Local(value = { ConfigurationManager.class, ConfigurationService.class })
-public class MockConfigurationManagerImpl implements ConfigurationManager, ConfigurationService, Manager{
+public class MockConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, ConfigurationService {
     @Inject
     NetworkOfferingDaoImpl _ntwkOffDao;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
index cd9bec7..c1aacff 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -76,6 +76,7 @@ import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
@@ -86,7 +87,7 @@ import com.cloud.vm.VirtualMachineProfileImpl;
 
 @Component
 @Local(value = { NetworkManager.class, NetworkService.class })
-public class MockNetworkManagerImpl implements NetworkManager, NetworkService, Manager{
+public class MockNetworkManagerImpl extends ManagerBase implements NetworkManager, NetworkService {
     @Inject
     NetworkServiceMapDao  _ntwkSrvcDao;
     @Inject

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vpc/MockNetworkModelImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
index ddffa01..312f9e6 100644
--- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java
@@ -51,12 +51,13 @@ import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.user.Account;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.Nic;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.VirtualMachine;
 
 @Local(value = {NetworkModel.class})
-public class MockNetworkModelImpl implements NetworkModel, Manager {
+public class MockNetworkModelImpl extends ManagerBase implements NetworkModel {
 
     @Inject
     NetworkOfferingServiceMapDao _ntwkOfferingSrvcDao;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java
index deb20b0..690aed6 100644
--- a/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java
@@ -32,10 +32,11 @@ import com.cloud.exception.ResourceAllocationException;
 import com.cloud.user.Account;
 import com.cloud.user.ResourceLimitService;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 
 @Component
 @Local(value = { ResourceLimitService.class })
-public class MockResourceLimitManagerImpl implements ResourceLimitService, Manager{
+public class MockResourceLimitManagerImpl extends ManagerBase implements ResourceLimitService {
 
     /* (non-Javadoc)
      * @see com.cloud.user.ResourceLimitService#updateResourceLimit(java.lang.Long, java.lang.Long, java.lang.Integer, java.lang.Long)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java b/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
index 14b7c60..133f344 100644
--- a/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java
@@ -45,11 +45,12 @@ import com.cloud.network.vpn.Site2SiteVpnManager;
 import com.cloud.network.vpn.Site2SiteVpnService;
 import com.cloud.utils.Pair;
 import com.cloud.utils.component.Manager;
+import com.cloud.utils.component.ManagerBase;
 import com.cloud.vm.DomainRouterVO;
 
 @Component
 @Local(value = { Site2SiteVpnManager.class, Site2SiteVpnService.class } )
-public class MockSite2SiteVpnManagerImpl implements Site2SiteVpnManager, Site2SiteVpnService, Manager{
+public class MockSite2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpnManager, Site2SiteVpnService {
 
     /* (non-Javadoc)
      * @see com.cloud.network.vpn.Site2SiteVpnService#createVpnGateway(org.apache.cloudstack.api.commands.CreateVpnGatewayCmd)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/17652325/server/test/com/cloud/vpc/MockSite2SiteVpnServiceProvider.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockSite2SiteVpnServiceProvider.java b/server/test/com/cloud/vpc/MockSite2SiteVpnServiceProvider.java
index d5c39e4..f13c2d1 100644
--- a/server/test/com/cloud/vpc/MockSite2SiteVpnServiceProvider.java
+++ b/server/test/com/cloud/vpc/MockSite2SiteVpnServiceProvider.java
@@ -27,10 +27,11 @@ import org.springframework.stereotype.Component;
 import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.Site2SiteVpnConnection;
 import com.cloud.network.element.Site2SiteVpnServiceProvider;
+import com.cloud.utils.component.ManagerBase;
 
 @Component
 @Local({Site2SiteVpnServiceProvider.class})
-public class MockSite2SiteVpnServiceProvider implements Site2SiteVpnServiceProvider {
+public class MockSite2SiteVpnServiceProvider extends ManagerBase implements Site2SiteVpnServiceProvider {
 
     /* (non-Javadoc)
      * @see com.cloud.utils.component.Adapter#configure(java.lang.String, java.util.Map)


Mime
View raw message