incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [4/4] git commit: Fix issues after another round of merge
Date Sat, 12 Jan 2013 00:55:01 GMT
Updated Branches:
  refs/heads/javelin 757e1a931 -> 6fb1a1e6f


Fix issues after another round of merge


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

Branch: refs/heads/javelin
Commit: 6fb1a1e6f113a3714c5abb314be91cc56195145e
Parents: f57dcaa
Author: Kelven Yang <kelveny@gmail.com>
Authored: Fri Jan 11 16:54:32 2013 -0800
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Fri Jan 11 16:54:32 2013 -0800

----------------------------------------------------------------------
 .../configuration/CloudZonesComponentLibrary.java  |   37 --
 .../configuration/DefaultComponentLibrary.java     |  495 ---------------
 .../configuration/PremiumComponentLibrary.java     |   72 ---
 .../cloud/server/CloudStackComponentComposer.java  |    5 +-
 .../src/com/cloud/servlet/ConsoleProxyServlet.java |   14 +-
 .../com/cloud/servlet/RegisterCompleteServlet.java |    3 +-
 server/src/com/cloud/test/DatabaseConfig.java      |    2 +-
 .../test/com/cloud/async/TestAsyncJobManager.java  |    5 +-
 .../test/com/cloud/async/TestSyncQueueManager.java |    8 +-
 .../security/SecurityGroupManagerImpl2Test.java    |   12 +-
 .../test/com/cloud/snapshot/SnapshotDaoTest.java   |    7 +-
 .../com/cloud/storage/dao/StoragePoolDaoTest.java  |    4 +-
 .../upgrade/AdvanceZone217To224UpgradeTest.java    |    9 +-
 .../upgrade/AdvanceZone223To224UpgradeTest.java    |    6 +-
 .../upgrade/BasicZone218To224UpgradeTest.java      |    8 +-
 .../com/cloud/upgrade/HostCapacity218to22Test.java |    8 +-
 .../upgrade/InstanceGroup218To224UpgradeTest.java  |    8 +-
 .../upgrade/PortForwarding218To224UpgradeTest.java |    8 +-
 .../cloud/upgrade/Sanity220To224UpgradeTest.java   |    8 +-
 .../cloud/upgrade/Sanity222To224UpgradeTest.java   |    7 +-
 .../cloud/upgrade/Sanity223To225UpgradeTest.java   |    8 +-
 .../cloud/upgrade/Sanity224To225UpgradeTest.java   |    8 +-
 .../cloud/upgrade/Template2214To30UpgradeTest.java |    5 +-
 .../com/cloud/upgrade/Test2214To30DBUpgrade.java   |    8 +-
 .../cloud/upgrade/Usage217To224UpgradeTest.java    |    7 +-
 .../upgrade/UsageEvents218To224UpgradeTest.java    |    8 +-
 .../test/com/cloud/vm/dao/UserVmDaoImplTest.java   |    7 +-
 .../test/com/cloud/vpc/MockNetworkManagerImpl.java |    1 -
 server/test/com/cloud/vpc/MockVpcManagerImpl.java  |    3 +-
 server/test/com/cloud/vpc/VpcApiUnitTest.java      |   39 +-
 usage/src/com/cloud/usage/UsageManagerImpl.java    |   40 +-
 usage/src/com/cloud/usage/UsageServer.java         |    4 +-
 .../cloud/usage/parser/IPAddressUsageParser.java   |   20 +-
 .../usage/parser/LoadBalancerUsageParser.java      |   20 +-
 .../usage/parser/NetworkOfferingUsageParser.java   |   17 +-
 .../com/cloud/usage/parser/NetworkUsageParser.java |   19 +-
 .../usage/parser/PortForwardingUsageParser.java    |   17 +-
 .../usage/parser/SecurityGroupUsageParser.java     |   17 +-
 .../com/cloud/usage/parser/StorageUsageParser.java |   17 +-
 .../cloud/usage/parser/VMInstanceUsageParser.java  |   17 +-
 .../com/cloud/usage/parser/VPNUserUsageParser.java |   17 +-
 .../com/cloud/usage/parser/VolumeUsageParser.java  |   17 +-
 42 files changed, 277 insertions(+), 765 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/src/com/cloud/configuration/CloudZonesComponentLibrary.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/CloudZonesComponentLibrary.java b/server/src/com/cloud/configuration/CloudZonesComponentLibrary.java
deleted file mode 100644
index 13bb16f..0000000
--- a/server/src/com/cloud/configuration/CloudZonesComponentLibrary.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.configuration;
-
-import com.cloud.agent.StartupCommandProcessor;
-import com.cloud.agent.manager.authn.impl.BasicAgentAuthManager;
-
-import com.cloud.hypervisor.CloudZonesStartupProcessor;
-import com.cloud.network.element.CloudZonesNetworkElement;
-import com.cloud.network.element.NetworkElement;
-
-
-
-public class CloudZonesComponentLibrary extends PremiumComponentLibrary {
-
-    @Override
-    protected void populateAdapters() {
-        super.populateAdapters();
-        addAdapter(NetworkElement.class, "CloudZones", CloudZonesNetworkElement.class);
-        addAdapter(StartupCommandProcessor.class, "BasicAgentAuthorizer", BasicAgentAuthManager.class);
-        addAdapter(StartupCommandProcessor.class, "CloudZonesStartupProcessor", CloudZonesStartupProcessor.class);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/src/com/cloud/configuration/DefaultComponentLibrary.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/DefaultComponentLibrary.java b/server/src/com/cloud/configuration/DefaultComponentLibrary.java
deleted file mode 100755
index 2bb5409..0000000
--- a/server/src/com/cloud/configuration/DefaultComponentLibrary.java
+++ /dev/null
@@ -1,495 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-// 
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.configuration;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.cloud.agent.manager.ClusteredAgentManagerImpl;
-import com.cloud.alert.AlertManagerImpl;
-import com.cloud.alert.dao.AlertDaoImpl;
-import com.cloud.api.query.QueryManagerImpl;
-import com.cloud.api.query.dao.AccountJoinDaoImpl;
-import com.cloud.api.query.dao.AsyncJobJoinDaoImpl;
-import com.cloud.api.query.dao.DomainRouterJoinDaoImpl;
-import com.cloud.api.query.dao.InstanceGroupJoinDaoImpl;
-import com.cloud.api.query.dao.ProjectAccountJoinDaoImpl;
-import com.cloud.api.query.dao.ProjectInvitationJoinDaoImpl;
-import com.cloud.api.query.dao.ProjectJoinDaoImpl;
-import com.cloud.api.query.dao.ResourceTagJoinDaoImpl;
-import com.cloud.api.query.dao.SecurityGroupJoinDaoImpl;
-import com.cloud.api.query.dao.StoragePoolJoinDaoImpl;
-import com.cloud.api.query.dao.UserAccountJoinDaoImpl;
-import com.cloud.api.query.dao.UserVmJoinDaoImpl;
-import com.cloud.api.query.dao.HostJoinDaoImpl;
-import com.cloud.api.query.dao.VolumeJoinDaoImpl;
-import com.cloud.async.AsyncJobExecutorContextImpl;
-import com.cloud.async.AsyncJobManagerImpl;
-import com.cloud.async.SyncQueueManagerImpl;
-import com.cloud.async.dao.AsyncJobDaoImpl;
-import com.cloud.async.dao.SyncQueueDaoImpl;
-import com.cloud.async.dao.SyncQueueItemDaoImpl;
-import com.cloud.capacity.CapacityManagerImpl;
-import com.cloud.capacity.dao.CapacityDaoImpl;
-import com.cloud.certificate.dao.CertificateDaoImpl;
-import com.cloud.cluster.CheckPointManagerImpl;
-import com.cloud.cluster.ClusterFenceManagerImpl;
-import com.cloud.cluster.ClusterManagerImpl;
-import com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl;
-import com.cloud.cluster.dao.ManagementServerHostDaoImpl;
-import com.cloud.cluster.dao.ManagementServerHostPeerDaoImpl;
-import com.cloud.cluster.dao.StackMaidDaoImpl;
-import com.cloud.configuration.dao.ConfigurationDaoImpl;
-import com.cloud.configuration.dao.ResourceCountDaoImpl;
-import com.cloud.configuration.dao.ResourceLimitDaoImpl;
-import com.cloud.consoleproxy.ConsoleProxyManagerImpl;
-import com.cloud.dao.EntityManager;
-import com.cloud.dao.EntityManagerImpl;
-import com.cloud.dc.ClusterDetailsDaoImpl;
-import com.cloud.dc.dao.AccountVlanMapDaoImpl;
-import com.cloud.dc.dao.ClusterDaoImpl;
-import com.cloud.dc.dao.ClusterVSMMapDaoImpl;
-import com.cloud.dc.dao.DataCenterDaoImpl;
-import com.cloud.dc.dao.DataCenterIpAddressDaoImpl;
-import com.cloud.dc.dao.DcDetailsDaoImpl;
-import com.cloud.dc.dao.HostPodDaoImpl;
-import com.cloud.dc.dao.PodVlanMapDaoImpl;
-import com.cloud.dc.dao.StorageNetworkIpAddressDaoImpl;
-import com.cloud.dc.dao.StorageNetworkIpRangeDaoImpl;
-import com.cloud.dc.dao.VlanDaoImpl;
-import com.cloud.domain.dao.DomainDaoImpl;
-import com.cloud.event.dao.EventDaoImpl;
-import com.cloud.event.dao.UsageEventDaoImpl;
-import com.cloud.ha.HighAvailabilityManagerImpl;
-import com.cloud.ha.dao.HighAvailabilityDaoImpl;
-import com.cloud.host.dao.HostDaoImpl;
-import com.cloud.host.dao.HostDetailsDaoImpl;
-import com.cloud.host.dao.HostTagsDaoImpl;
-import com.cloud.hypervisor.HypervisorGuruManagerImpl;
-import com.cloud.hypervisor.dao.HypervisorCapabilitiesDaoImpl;
-import com.cloud.keystore.KeystoreDaoImpl;
-import com.cloud.keystore.KeystoreManagerImpl;
-import com.cloud.maint.UpgradeManagerImpl;
-import com.cloud.maint.dao.AgentUpgradeDaoImpl;
-import com.cloud.network.ExternalLoadBalancerUsageManagerImpl;
-import com.cloud.network.NetworkManagerImpl;
-import com.cloud.network.StorageNetworkManagerImpl;
-import com.cloud.network.as.AutoScaleManagerImpl;
-import com.cloud.network.as.dao.AutoScalePolicyConditionMapDaoImpl;
-import com.cloud.network.as.dao.AutoScalePolicyDaoImpl;
-import com.cloud.network.as.dao.AutoScaleVmGroupDaoImpl;
-import com.cloud.network.as.dao.AutoScaleVmGroupPolicyMapDaoImpl;
-import com.cloud.network.as.dao.AutoScaleVmProfileDaoImpl;
-import com.cloud.network.as.dao.ConditionDaoImpl;
-import com.cloud.network.as.dao.CounterDaoImpl;
-import com.cloud.network.dao.ExternalFirewallDeviceDaoImpl;
-import com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl;
-import com.cloud.network.dao.FirewallRulesCidrsDaoImpl;
-import com.cloud.network.dao.FirewallRulesDaoImpl;
-import com.cloud.network.dao.IPAddressDaoImpl;
-import com.cloud.network.dao.InlineLoadBalancerNicMapDaoImpl;
-import com.cloud.network.dao.LBStickinessPolicyDaoImpl;
-import com.cloud.network.dao.LoadBalancerDaoImpl;
-import com.cloud.network.dao.LoadBalancerVMMapDaoImpl;
-import com.cloud.network.dao.NetworkDaoImpl;
-import com.cloud.network.dao.NetworkDomainDaoImpl;
-import com.cloud.network.dao.NetworkExternalFirewallDaoImpl;
-import com.cloud.network.dao.NetworkExternalLoadBalancerDaoImpl;
-import com.cloud.network.dao.NetworkRuleConfigDaoImpl;
-import com.cloud.network.dao.NetworkServiceMapDaoImpl;
-import com.cloud.network.dao.PhysicalNetworkDaoImpl;
-import com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl;
-import com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl;
-import com.cloud.network.dao.PortProfileDaoImpl;
-import com.cloud.network.dao.RemoteAccessVpnDaoImpl;
-import com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl;
-import com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl;
-import com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl;
-import com.cloud.network.dao.VirtualRouterProviderDaoImpl;
-import com.cloud.network.dao.VpnUserDaoImpl;
-import com.cloud.network.element.VirtualRouterElement;
-import com.cloud.network.element.VirtualRouterElementService;
-import com.cloud.network.firewall.FirewallManagerImpl;
-import com.cloud.network.lb.LoadBalancingRulesManagerImpl;
-import com.cloud.network.router.VpcVirtualNetworkApplianceManagerImpl;
-import com.cloud.network.rules.RulesManagerImpl;
-import com.cloud.network.rules.dao.PortForwardingRulesDaoImpl;
-import com.cloud.network.security.SecurityGroupManagerImpl2;
-import com.cloud.network.security.dao.SecurityGroupDaoImpl;
-import com.cloud.network.security.dao.SecurityGroupRuleDaoImpl;
-import com.cloud.network.security.dao.SecurityGroupRulesDaoImpl;
-import com.cloud.network.security.dao.SecurityGroupVMMapDaoImpl;
-import com.cloud.network.security.dao.SecurityGroupWorkDaoImpl;
-import com.cloud.network.security.dao.VmRulesetLogDaoImpl;
-import com.cloud.network.vpc.NetworkACLManagerImpl;
-import com.cloud.network.vpc.VpcManagerImpl;
-import com.cloud.network.vpc.dao.PrivateIpDaoImpl;
-import com.cloud.network.vpc.dao.StaticRouteDaoImpl;
-import com.cloud.network.vpc.dao.VpcDaoImpl;
-import com.cloud.network.vpc.dao.VpcGatewayDaoImpl;
-import com.cloud.network.vpc.dao.VpcOfferingDaoImpl;
-import com.cloud.network.vpc.dao.VpcOfferingServiceMapDaoImpl;
-import com.cloud.network.vpn.RemoteAccessVpnManagerImpl;
-import com.cloud.network.vpn.Site2SiteVpnManagerImpl;
-import com.cloud.offerings.dao.NetworkOfferingDaoImpl;
-import com.cloud.offerings.dao.NetworkOfferingServiceMapDaoImpl;
-import com.cloud.projects.ProjectManagerImpl;
-import com.cloud.projects.dao.ProjectAccountDaoImpl;
-import com.cloud.projects.dao.ProjectDaoImpl;
-import com.cloud.projects.dao.ProjectInvitationDaoImpl;
-import com.cloud.resource.ResourceManagerImpl;
-import com.cloud.resourcelimit.ResourceLimitManagerImpl;
-import com.cloud.service.dao.ServiceOfferingDaoImpl;
-import com.cloud.storage.OCFS2ManagerImpl;
-import com.cloud.storage.StorageManagerImpl;
-import com.cloud.storage.dao.DiskOfferingDaoImpl;
-import com.cloud.storage.dao.GuestOSCategoryDaoImpl;
-import com.cloud.storage.dao.GuestOSDaoImpl;
-import com.cloud.storage.dao.LaunchPermissionDaoImpl;
-import com.cloud.storage.dao.S3DaoImpl;
-import com.cloud.storage.dao.SnapshotDaoImpl;
-import com.cloud.storage.dao.SnapshotPolicyDaoImpl;
-import com.cloud.storage.dao.SnapshotScheduleDaoImpl;
-import com.cloud.storage.dao.StoragePoolDaoImpl;
-import com.cloud.storage.dao.StoragePoolHostDaoImpl;
-import com.cloud.storage.dao.StoragePoolWorkDaoImpl;
-import com.cloud.storage.dao.SwiftDaoImpl;
-import com.cloud.storage.dao.UploadDaoImpl;
-import com.cloud.storage.dao.VMTemplateDaoImpl;
-import com.cloud.storage.dao.VMTemplateDetailsDaoImpl;
-import com.cloud.storage.dao.VMTemplateHostDaoImpl;
-import com.cloud.storage.dao.VMTemplatePoolDaoImpl;
-import com.cloud.storage.dao.VMTemplateS3DaoImpl;
-import com.cloud.storage.dao.VMTemplateSwiftDaoImpl;
-import com.cloud.storage.dao.VMTemplateZoneDaoImpl;
-import com.cloud.storage.dao.VolumeDaoImpl;
-import com.cloud.storage.dao.VolumeHostDaoImpl;
-import com.cloud.storage.download.DownloadMonitorImpl;
-import com.cloud.storage.s3.S3ManagerImpl;
-import com.cloud.storage.secondary.SecondaryStorageManagerImpl;
-import com.cloud.storage.snapshot.SnapshotManagerImpl;
-import com.cloud.storage.snapshot.SnapshotSchedulerImpl;
-import com.cloud.storage.swift.SwiftManagerImpl;
-import com.cloud.storage.upload.UploadMonitorImpl;
-import com.cloud.tags.TaggedResourceManagerImpl;
-import com.cloud.tags.dao.ResourceTagsDaoImpl;
-import com.cloud.template.HyervisorTemplateAdapter;
-import com.cloud.template.TemplateAdapter;
-import com.cloud.template.TemplateAdapter.TemplateAdapterType;
-import com.cloud.template.TemplateManagerImpl;
-import com.cloud.user.AccountDetailsDaoImpl;
-import com.cloud.user.AccountManagerImpl;
-import com.cloud.user.DomainManagerImpl;
-import com.cloud.user.dao.AccountDaoImpl;
-import com.cloud.user.dao.SSHKeyPairDaoImpl;
-import com.cloud.user.dao.UserAccountDaoImpl;
-import com.cloud.user.dao.UserDaoImpl;
-import com.cloud.user.dao.UserStatisticsDaoImpl;
-import com.cloud.user.dao.UserStatsLogDaoImpl;
-import com.cloud.utils.component.Adapter;
-import com.cloud.utils.component.ComponentLibrary;
-import com.cloud.utils.component.ComponentLibraryBase;
-import com.cloud.utils.component.LegacyComponentLocator.ComponentInfo;
-import com.cloud.utils.component.Manager;
-import com.cloud.utils.component.PluggableService;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.uuididentity.IdentityServiceImpl;
-import com.cloud.uuididentity.dao.IdentityDaoImpl;
-import com.cloud.vm.ClusteredVirtualMachineManagerImpl;
-import com.cloud.vm.ItWorkDaoImpl;
-import com.cloud.vm.UserVmManagerImpl;
-import com.cloud.vm.dao.ConsoleProxyDaoImpl;
-import com.cloud.vm.dao.DomainRouterDaoImpl;
-import com.cloud.vm.dao.InstanceGroupDaoImpl;
-import com.cloud.vm.dao.InstanceGroupVMMapDaoImpl;
-import com.cloud.vm.dao.NicDaoImpl;
-import com.cloud.vm.dao.SecondaryStorageVmDaoImpl;
-import com.cloud.vm.dao.UserVmDaoImpl;
-import com.cloud.vm.dao.UserVmDetailsDaoImpl;
-import com.cloud.vm.dao.VMInstanceDaoImpl;
-import com.cloud.event.dao.EventJoinDaoImpl;
-
-
-
-public class DefaultComponentLibrary extends ComponentLibraryBase implements ComponentLibrary {
-    protected void populateDaos() {
-        addDao("StackMaidDao", StackMaidDaoImpl.class);
-        addDao("VMTemplateZoneDao", VMTemplateZoneDaoImpl.class);
-        addDao("VMTemplateDetailsDao", VMTemplateDetailsDaoImpl.class);
-        addDao("DomainRouterDao", DomainRouterDaoImpl.class);
-        addDao("HostDao", HostDaoImpl.class);
-        addDao("VMInstanceDao", VMInstanceDaoImpl.class);
-        addDao("UserVmDao", UserVmDaoImpl.class);
-        ComponentInfo<? extends GenericDao<?, ? extends Serializable>> info = addDao("ServiceOfferingDao", ServiceOfferingDaoImpl.class);
-        info.addParameter("cache.size", "50");
-        info.addParameter("cache.time.to.live", "600");
-        info = addDao("DiskOfferingDao", DiskOfferingDaoImpl.class);
-        info.addParameter("cache.size", "50");
-        info.addParameter("cache.time.to.live", "600");
-        info = addDao("DataCenterDao", DataCenterDaoImpl.class);
-        info.addParameter("cache.size", "50");
-        info.addParameter("cache.time.to.live", "600");
-        info = addDao("HostPodDao", HostPodDaoImpl.class);
-        info.addParameter("cache.size", "50");
-        info.addParameter("cache.time.to.live", "600");
-        addDao("IPAddressDao", IPAddressDaoImpl.class);
-        info = addDao("VlanDao", VlanDaoImpl.class);
-        info.addParameter("cache.size", "30");
-        info.addParameter("cache.time.to.live", "3600");
-        addDao("PodVlanMapDao", PodVlanMapDaoImpl.class);
-        addDao("AccountVlanMapDao", AccountVlanMapDaoImpl.class);
-        addDao("VolumeDao", VolumeDaoImpl.class);
-        addDao("EventDao", EventDaoImpl.class);
-        info = addDao("UserDao", UserDaoImpl.class);
-        info.addParameter("cache.size", "5000");
-        info.addParameter("cache.time.to.live", "300");
-        addDao("UserStatisticsDao", UserStatisticsDaoImpl.class);
-        addDao("UserStatsLogDao", UserStatsLogDaoImpl.class);
-        addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
-        addDao("LoadBalancerDao", LoadBalancerDaoImpl.class);
-        addDao("NetworkRuleConfigDao", NetworkRuleConfigDaoImpl.class);
-        addDao("LoadBalancerVMMapDao", LoadBalancerVMMapDaoImpl.class);
-        addDao("LBStickinessPolicyDao", LBStickinessPolicyDaoImpl.class);
-        addDao("CounterDao", CounterDaoImpl.class);
-        addDao("ConditionDao", ConditionDaoImpl.class);
-        addDao("AutoScalePolicyDao", AutoScalePolicyDaoImpl.class);
-        addDao("AutoScalePolicyConditionMapDao", AutoScalePolicyConditionMapDaoImpl.class);
-        addDao("AutoScaleVmProfileDao", AutoScaleVmProfileDaoImpl.class);
-        addDao("AutoScaleVmGroupDao", AutoScaleVmGroupDaoImpl.class);
-        addDao("AutoScaleVmGroupPolicyMapDao", AutoScaleVmGroupPolicyMapDaoImpl.class);
-        addDao("DataCenterIpAddressDao", DataCenterIpAddressDaoImpl.class);
-        addDao("SecurityGroupDao", SecurityGroupDaoImpl.class);
-        addDao("SecurityGroupRuleDao", SecurityGroupRuleDaoImpl.class);
-        addDao("SecurityGroupVMMapDao", SecurityGroupVMMapDaoImpl.class);
-        addDao("SecurityGroupRulesDao", SecurityGroupRulesDaoImpl.class);
-        addDao("SecurityGroupWorkDao", SecurityGroupWorkDaoImpl.class);
-        addDao("VmRulesetLogDao", VmRulesetLogDaoImpl.class);
-        addDao("AlertDao", AlertDaoImpl.class);
-        addDao("CapacityDao", CapacityDaoImpl.class);
-        addDao("DomainDao", DomainDaoImpl.class);
-        addDao("AccountDao", AccountDaoImpl.class);
-        addDao("ResourceLimitDao", ResourceLimitDaoImpl.class);
-        addDao("ResourceCountDao", ResourceCountDaoImpl.class);
-        addDao("UserAccountDao", UserAccountDaoImpl.class);
-        addDao("VMTemplateHostDao", VMTemplateHostDaoImpl.class);
-        addDao("VolumeHostDao", VolumeHostDaoImpl.class);
-        addDao("VMTemplateSwiftDao", VMTemplateSwiftDaoImpl.class);
-        addDao("VMTemplateS3Dao", VMTemplateS3DaoImpl.class);
-        addDao("UploadDao", UploadDaoImpl.class);
-        addDao("VMTemplatePoolDao", VMTemplatePoolDaoImpl.class);
-        addDao("LaunchPermissionDao", LaunchPermissionDaoImpl.class);
-        addDao("ConfigurationDao", ConfigurationDaoImpl.class);
-        info = addDao("VMTemplateDao", VMTemplateDaoImpl.class);
-        info.addParameter("cache.size", "100");
-        info.addParameter("cache.time.to.live", "600");
-        info.addParameter("routing.uniquename", "routing");
-        addDao("HighAvailabilityDao", HighAvailabilityDaoImpl.class);
-        addDao("ConsoleProxyDao", ConsoleProxyDaoImpl.class);
-        addDao("SecondaryStorageVmDao", SecondaryStorageVmDaoImpl.class);
-        addDao("ManagementServerHostDao", ManagementServerHostDaoImpl.class);
-        addDao("ManagementServerHostPeerDao", ManagementServerHostPeerDaoImpl.class);
-        addDao("AgentUpgradeDao", AgentUpgradeDaoImpl.class);
-        addDao("SnapshotDao", SnapshotDaoImpl.class);
-        addDao("AsyncJobDao", AsyncJobDaoImpl.class);
-        addDao("SyncQueueDao", SyncQueueDaoImpl.class);
-        addDao("SyncQueueItemDao", SyncQueueItemDaoImpl.class);
-        addDao("GuestOSDao", GuestOSDaoImpl.class);
-        addDao("GuestOSCategoryDao", GuestOSCategoryDaoImpl.class);
-        addDao("StoragePoolDao", StoragePoolDaoImpl.class);
-        addDao("StoragePoolHostDao", StoragePoolHostDaoImpl.class);
-        addDao("DetailsDao", HostDetailsDaoImpl.class);
-        addDao("SnapshotPolicyDao", SnapshotPolicyDaoImpl.class);
-        addDao("SnapshotScheduleDao", SnapshotScheduleDaoImpl.class);
-        addDao("ClusterDao", ClusterDaoImpl.class);
-        addDao("CertificateDao", CertificateDaoImpl.class);
-        addDao("NetworkConfigurationDao", NetworkDaoImpl.class);
-        addDao("NetworkOfferingDao", NetworkOfferingDaoImpl.class);
-        addDao("NicDao", NicDaoImpl.class);
-        addDao("InstanceGroupDao", InstanceGroupDaoImpl.class);
-        addDao("InstanceGroupJoinDao", InstanceGroupJoinDaoImpl.class);
-        addDao("InstanceGroupVMMapDao", InstanceGroupVMMapDaoImpl.class);
-        addDao("RemoteAccessVpnDao", RemoteAccessVpnDaoImpl.class);
-        addDao("VpnUserDao", VpnUserDaoImpl.class);
-        addDao("ItWorkDao", ItWorkDaoImpl.class);
-        addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
-        addDao("PortForwardingRulesDao", PortForwardingRulesDaoImpl.class);
-        addDao("FirewallRulesCidrsDao", FirewallRulesCidrsDaoImpl.class);
-        addDao("SSHKeyPairDao", SSHKeyPairDaoImpl.class);
-        addDao("UsageEventDao", UsageEventDaoImpl.class);
-        addDao("ClusterDetailsDao", ClusterDetailsDaoImpl.class);
-        addDao("UserVmDetailsDao", UserVmDetailsDaoImpl.class);
-        addDao("StoragePoolWorkDao", StoragePoolWorkDaoImpl.class);
-        addDao("HostTagsDao", HostTagsDaoImpl.class);
-        addDao("NetworkDomainDao", NetworkDomainDaoImpl.class);
-        addDao("KeystoreDao", KeystoreDaoImpl.class);
-        addDao("DcDetailsDao", DcDetailsDaoImpl.class);
-        addDao("SwiftDao", SwiftDaoImpl.class);
-        addDao("S3Dao", S3DaoImpl.class);
-        addDao("AgentTransferMapDao", HostTransferMapDaoImpl.class);
-        addDao("ProjectDao", ProjectDaoImpl.class);
-        addDao("InlineLoadBalancerNicMapDao", InlineLoadBalancerNicMapDaoImpl.class);
-        addDao("ProjectsAccountDao", ProjectAccountDaoImpl.class);
-        addDao("ProjectInvitationDao", ProjectInvitationDaoImpl.class);
-        addDao("IdentityDao", IdentityDaoImpl.class);
-        addDao("AccountDetailsDao", AccountDetailsDaoImpl.class);
-        addDao("NetworkOfferingServiceMapDao", NetworkOfferingServiceMapDaoImpl.class);
-        info = addDao("HypervisorCapabilitiesDao",HypervisorCapabilitiesDaoImpl.class);
-        info.addParameter("cache.size", "100");
-        info.addParameter("cache.time.to.live", "600");
-        addDao("PhysicalNetworkDao", PhysicalNetworkDaoImpl.class);
-        addDao("PhysicalNetworkServiceProviderDao", PhysicalNetworkServiceProviderDaoImpl.class);
-        addDao("VirtualRouterProviderDao", VirtualRouterProviderDaoImpl.class);
-        addDao("ExternalLoadBalancerDeviceDao", ExternalLoadBalancerDeviceDaoImpl.class);
-        addDao("ExternalFirewallDeviceDao", ExternalFirewallDeviceDaoImpl.class);
-        addDao("NetworkExternalLoadBalancerDao", NetworkExternalLoadBalancerDaoImpl.class);
-        addDao("NetworkExternalFirewallDao", NetworkExternalFirewallDaoImpl.class);
-        addDao("ClusterVSMMapDao", ClusterVSMMapDaoImpl.class);
-        addDao("PortProfileDao", PortProfileDaoImpl.class);
-        addDao("PhysicalNetworkTrafficTypeDao", PhysicalNetworkTrafficTypeDaoImpl.class);
-        addDao("NetworkServiceMapDao", NetworkServiceMapDaoImpl.class);
-        addDao("StorageNetworkIpAddressDao", StorageNetworkIpAddressDaoImpl.class);
-        addDao("StorageNetworkIpRangeDao", StorageNetworkIpRangeDaoImpl.class);
-        addDao("VpcDao", VpcDaoImpl.class);
-        addDao("VpcOfferingDao", VpcOfferingDaoImpl.class);
-        addDao("VpcOfferingServiceMapDao", VpcOfferingServiceMapDaoImpl.class);
-        addDao("PrivateIpDao", PrivateIpDaoImpl.class);
-        addDao("VpcGatewayDao", VpcGatewayDaoImpl.class);
-        addDao("StaticRouteDao", StaticRouteDaoImpl.class);
-        addDao("TagsDao", ResourceTagsDaoImpl.class);
-        addDao("Site2SiteVpnGatewayDao", Site2SiteVpnGatewayDaoImpl.class);
-        addDao("Site2SiteCustomerGatewayDao", Site2SiteCustomerGatewayDaoImpl.class);
-        addDao("Site2SiteVpnConnnectionDao", Site2SiteVpnConnectionDaoImpl.class);
-
-        addDao("UserVmJoinDao", UserVmJoinDaoImpl.class);
-        addDao("DomainRouterJoinDao", DomainRouterJoinDaoImpl.class);
-        addDao("SecurityGroupJoinDao", SecurityGroupJoinDaoImpl.class);
-        addDao("ResourceTagJoinDao", ResourceTagJoinDaoImpl.class);
-        addDao("EventJoinDao", EventJoinDaoImpl.class);
-        addDao("UserAccountJoinDao", UserAccountJoinDaoImpl.class);
-        addDao("ProjectJoinDao", ProjectJoinDaoImpl.class);
-        addDao("ProjectAccountJoinDao", ProjectAccountJoinDaoImpl.class);
-        addDao("ProjectInvitationJoinDao", ProjectInvitationJoinDaoImpl.class);
-        addDao("HostJoinDao", HostJoinDaoImpl.class);
-        addDao("VolumeJoinDao", VolumeJoinDaoImpl.class);
-        addDao("AccountJoinDao", AccountJoinDaoImpl.class);
-        addDao("AsyncJobJoinDao", AsyncJobJoinDaoImpl.class);
-        addDao("StoragePoolJoinDao", StoragePoolJoinDaoImpl.class);
-    }
-
-    @Override
-    public synchronized Map<String, ComponentInfo<GenericDao<?, ?>>> getDaos() {
-        if (_daos.size() == 0) {
-            populateDaos();
-        }
-        //FIXME: Incorrect method return definition
-        return _daos;
-    }
-
-    protected void populateManagers() {
-        addManager("StackMaidManager", CheckPointManagerImpl.class);
-        addManager("Cluster Manager", ClusterManagerImpl.class);
-        addManager("ClusterFenceManager", ClusterFenceManagerImpl.class);
-        addManager("ClusteredAgentManager", ClusteredAgentManagerImpl.class);
-        addManager("SyncQueueManager", SyncQueueManagerImpl.class);
-        addManager("AsyncJobManager", AsyncJobManagerImpl.class);
-        addManager("AsyncJobExecutorContext", AsyncJobExecutorContextImpl.class);
-        addManager("configuration manager", ConfigurationManagerImpl.class);
-        addManager("account manager", AccountManagerImpl.class);
-        addManager("domain manager", DomainManagerImpl.class);
-        addManager("resource limit manager", ResourceLimitManagerImpl.class);
-        addManager("network manager", NetworkManagerImpl.class);
-        addManager("download manager", DownloadMonitorImpl.class);
-        addManager("upload manager", UploadMonitorImpl.class);
-        addManager("keystore manager", KeystoreManagerImpl.class);
-        addManager("secondary storage vm manager", SecondaryStorageManagerImpl.class);
-        addManager("vm manager", UserVmManagerImpl.class);
-        addManager("upgrade manager", UpgradeManagerImpl.class);
-        addManager("StorageManager", StorageManagerImpl.class);
-        addManager("Alert Manager", AlertManagerImpl.class);
-        addManager("Template Manager", TemplateManagerImpl.class);
-        addManager("Snapshot Manager", SnapshotManagerImpl.class);
-        addManager("SnapshotScheduler", SnapshotSchedulerImpl.class);
-        addManager("SecurityGroupManager", SecurityGroupManagerImpl2.class);
-        addManager("EntityManager", EntityManagerImpl.class);
-        addManager("LoadBalancingRulesManager", LoadBalancingRulesManagerImpl.class);
-        addManager("AutoScaleManager", AutoScaleManagerImpl.class);
-        addManager("RulesManager", RulesManagerImpl.class);
-        addManager("RemoteAccessVpnManager", RemoteAccessVpnManagerImpl.class);
-        addManager("Capacity Manager", CapacityManagerImpl.class);
-        addManager("VirtualMachineManager", ClusteredVirtualMachineManagerImpl.class);
-        addManager("HypervisorGuruManager", HypervisorGuruManagerImpl.class);
-        addManager("ResourceManager", ResourceManagerImpl.class);
-        addManager("IdentityManager", IdentityServiceImpl.class);
-        addManager("OCFS2Manager", OCFS2ManagerImpl.class);
-        addManager("FirewallManager", FirewallManagerImpl.class);
-        ComponentInfo<? extends Manager> info = addManager("ConsoleProxyManager", ConsoleProxyManagerImpl.class);
-        info.addParameter("consoleproxy.sslEnabled", "true");
-        addManager("ProjectManager", ProjectManagerImpl.class);
-        addManager("SwiftManager", SwiftManagerImpl.class);
-        addManager("S3Manager", S3ManagerImpl.class);
-        addManager("StorageNetworkManager", StorageNetworkManagerImpl.class);
-        addManager("ExternalLoadBalancerUsageManager", ExternalLoadBalancerUsageManagerImpl.class);
-        addManager("HA Manager", HighAvailabilityManagerImpl.class);
-        addManager("VPC Manager", VpcManagerImpl.class);
-        addManager("VpcVirtualRouterManager", VpcVirtualNetworkApplianceManagerImpl.class);
-        addManager("NetworkACLManager", NetworkACLManagerImpl.class);
-        addManager("TaggedResourcesManager", TaggedResourceManagerImpl.class);
-        addManager("Site2SiteVpnManager", Site2SiteVpnManagerImpl.class);
-        addManager("QueryManager", QueryManagerImpl.class);
-    }
-
-    @Override
-    public synchronized Map<String, ComponentInfo<Manager>> getManagers() {
-        if (_managers.size() == 0) {
-            populateManagers();
-        }
-        return _managers;
-    }
-
-    protected void populateAdapters() {
-        addAdapter(TemplateAdapter.class, TemplateAdapterType.Hypervisor.getName(), HyervisorTemplateAdapter.class);
-    }
-
-    @Override
-    public synchronized Map<String, List<ComponentInfo<Adapter>>> getAdapters() {
-        if (_adapters.size() == 0) {
-            populateAdapters();
-        }
-        return _adapters;
-    }
-
-    @Override
-    public synchronized Map<Class<?>, Class<?>> getFactories() {
-        HashMap<Class<?>, Class<?>> factories = new HashMap<Class<?>, Class<?>>();
-        factories.put(EntityManager.class, EntityManagerImpl.class);
-        return factories;
-    }
-
-    protected void populateServices() {
-        addService("VirtualRouterElementService", VirtualRouterElementService.class, VirtualRouterElement.class);
-    }
-
-    @Override
-    public synchronized Map<String, ComponentInfo<PluggableService>> getPluggableServices() {
-        if (_pluggableServices.size() == 0) {
-            populateServices();
-        }
-        return _pluggableServices;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/src/com/cloud/configuration/PremiumComponentLibrary.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/PremiumComponentLibrary.java b/server/src/com/cloud/configuration/PremiumComponentLibrary.java
deleted file mode 100755
index b25f462..0000000
--- a/server/src/com/cloud/configuration/PremiumComponentLibrary.java
+++ /dev/null
@@ -1,72 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.configuration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.cloud.baremetal.BareMetalPingServiceImpl;
-import com.cloud.baremetal.BareMetalTemplateAdapter;
-import com.cloud.baremetal.BareMetalVmManagerImpl;
-import com.cloud.baremetal.ExternalDhcpManagerImpl;
-import com.cloud.baremetal.PxeServerManager.PxeServerType;
-import com.cloud.baremetal.PxeServerManagerImpl;
-import com.cloud.baremetal.PxeServerService;
-import com.cloud.ha.HighAvailabilityManagerExtImpl;
-import com.cloud.network.ExternalNetworkDeviceManagerImpl;
-import com.cloud.network.NetworkUsageManagerImpl;
-import com.cloud.secstorage.CommandExecLogDaoImpl;
-import com.cloud.secstorage.PremiumSecondaryStorageManagerImpl;
-import com.cloud.template.TemplateAdapter;
-import com.cloud.template.TemplateAdapter.TemplateAdapterType;
-import com.cloud.upgrade.PremiumDatabaseUpgradeChecker;
-import com.cloud.usage.dao.UsageDaoImpl;
-import com.cloud.usage.dao.UsageIPAddressDaoImpl;
-import com.cloud.usage.dao.UsageJobDaoImpl;
-import com.cloud.utils.component.SystemIntegrityChecker;
-
-public class PremiumComponentLibrary extends DefaultComponentLibrary {
-    @Override
-    protected void populateDaos() {
-    	super.populateDaos();
-        addDao("UsageJobDao", UsageJobDaoImpl.class);
-        addDao("UsageDao", UsageDaoImpl.class);
-        addDao("UsageIpAddressDao", UsageIPAddressDaoImpl.class);
-        addDao("CommandExecLogDao", CommandExecLogDaoImpl.class);
-    }
-
-    @Override
-    protected void populateManagers() {
-    	// override FOSS SSVM manager
-    	super.populateManagers();
-        addManager("secondary storage vm manager", PremiumSecondaryStorageManagerImpl.class);
-	
-        addManager("HA Manager", HighAvailabilityManagerExtImpl.class);
-        addManager("ExternalNetworkManager", ExternalNetworkDeviceManagerImpl.class);
-        addManager("BareMetalVmManager", BareMetalVmManagerImpl.class);
-        addManager("ExternalDhcpManager", ExternalDhcpManagerImpl.class);
-        addManager("PxeServerManager", PxeServerManagerImpl.class);
-        addManager("NetworkUsageManager", NetworkUsageManagerImpl.class);
-    }
-
-    @Override
-    protected void populateAdapters() {
-    	super.populateAdapters();
-    	addAdapter(PxeServerService.class, PxeServerType.PING.getName(), BareMetalPingServiceImpl.class);
-    	addAdapter(TemplateAdapter.class, TemplateAdapterType.BareMetal.getName(), BareMetalTemplateAdapter.class);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/src/com/cloud/server/CloudStackComponentComposer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/CloudStackComponentComposer.java b/server/src/com/cloud/server/CloudStackComponentComposer.java
index 6bd9bc5..ae06325 100644
--- a/server/src/com/cloud/server/CloudStackComponentComposer.java
+++ b/server/src/com/cloud/server/CloudStackComponentComposer.java
@@ -30,7 +30,6 @@ import com.cloud.api.query.QueryManagerImpl;
 import com.cloud.async.AsyncJobManager;
 import com.cloud.async.SyncQueueManager;
 import com.cloud.capacity.CapacityManagerImpl;
-import com.cloud.cluster.CheckPointManagerImpl;
 import com.cloud.cluster.ClusterFenceManagerImpl;
 import com.cloud.cluster.ClusterManagerImpl;
 import com.cloud.configuration.ConfigurationManager;
@@ -75,7 +74,7 @@ import com.cloud.vm.VirtualMachineManager;
 
 @Component
 public class CloudStackComponentComposer {
-	@Inject CheckPointManagerImpl _checkPointMgr;
+	// @Inject CheckPointManagerImpl _checkPointMgr;
     @Inject ClusterManagerImpl _clusterMgr;
     @Inject ClusterFenceManagerImpl _clusterFenceMgr;
     @Inject AgentManager _AgentMgr;
@@ -130,7 +129,7 @@ public class CloudStackComponentComposer {
     
     @PostConstruct
     void init() {
-    	_managers.add(_checkPointMgr);
+    	// _managers.add(_checkPointMgr);
         _managers.add(_clusterMgr);
         _managers.add(_clusterFenceMgr);
         _managers.add(_AgentMgr);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/src/com/cloud/servlet/ConsoleProxyServlet.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/servlet/ConsoleProxyServlet.java b/server/src/com/cloud/servlet/ConsoleProxyServlet.java
index 568ad06..6a47ba2 100644
--- a/server/src/com/cloud/servlet/ConsoleProxyServlet.java
+++ b/server/src/com/cloud/servlet/ConsoleProxyServlet.java
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
 import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
 import javax.inject.Inject;
@@ -36,6 +37,7 @@ import javax.servlet.http.HttpSession;
 import org.apache.cloudstack.api.IdentityService;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.exception.PermissionDeniedException;
 import com.cloud.host.HostVO;
@@ -57,6 +59,7 @@ import com.cloud.vm.VirtualMachineManager;
  * Console access : /conosole?cmd=access&vm=xxx
  * Authentication : /console?cmd=auth&vm=xxx&sid=xxx
  */
+@Component("consoleServlet")
 public class ConsoleProxyServlet extends HttpServlet {
     private static final long serialVersionUID = -5515382620323808168L;
     public static final Logger s_logger = Logger.getLogger(ConsoleProxyServlet.class.getName());
@@ -68,6 +71,15 @@ public class ConsoleProxyServlet extends HttpServlet {
     @Inject ManagementServer _ms;
     @Inject IdentityService _identityService; 
 
+    static ManagementServer s_ms;
+    public ConsoleProxyServlet() {
+    }
+    
+    @PostConstruct
+    void initComponent() {
+    	s_ms = _ms;
+    }
+    
     @Override
     protected void doPost(HttpServletRequest req, HttpServletResponse resp) {
         doGet(req, resp);
@@ -398,7 +410,7 @@ public class ConsoleProxyServlet extends HttpServlet {
 
             long ts = normalizedHashTime.getTime();
             ts = ts/60000;		// round up to 1 minute
-            String secretKey = _ms.getHashKey();
+            String secretKey = s_ms.getHashKey();
 
             SecretKeySpec keySpec = new SecretKeySpec(secretKey.getBytes(), "HmacSHA1");
             mac.init(keySpec);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/src/com/cloud/servlet/RegisterCompleteServlet.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/servlet/RegisterCompleteServlet.java b/server/src/com/cloud/servlet/RegisterCompleteServlet.java
index aecbce3..5922455 100644
--- a/server/src/com/cloud/servlet/RegisterCompleteServlet.java
+++ b/server/src/com/cloud/servlet/RegisterCompleteServlet.java
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.Configuration;
 import com.cloud.configuration.dao.ConfigurationDao;
@@ -37,7 +38,7 @@ import com.cloud.user.UserVO;
 import com.cloud.user.dao.UserDao;
 import com.cloud.utils.SerialVersionUID;
 
-
+@Component("registerCompleteServlet")
 public class RegisterCompleteServlet extends HttpServlet implements ServletContextListener {
     public static final Logger s_logger = Logger.getLogger(RegisterCompleteServlet.class.getName());
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/src/com/cloud/test/DatabaseConfig.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/test/DatabaseConfig.java b/server/src/com/cloud/test/DatabaseConfig.java
index f0e9d82..7c10f98 100755
--- a/server/src/com/cloud/test/DatabaseConfig.java
+++ b/server/src/com/cloud/test/DatabaseConfig.java
@@ -359,7 +359,7 @@ public class DatabaseConfig {
             s_logger.error("error starting database config, missing initial data file");
         } else {
             try {
-                DatabaseConfig config = ComponentContext.inject(DatabaseConfig.class, args[0]);
+                DatabaseConfig config = ComponentContext.inject(DatabaseConfig.class);
                 config.doVersionCheck();
                 config.doConfig();
                 System.exit(0);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/async/TestAsyncJobManager.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/async/TestAsyncJobManager.java b/server/test/com/cloud/async/TestAsyncJobManager.java
index d45ca4d..7cb24dd 100644
--- a/server/test/com/cloud/async/TestAsyncJobManager.java
+++ b/server/test/com/cloud/async/TestAsyncJobManager.java
@@ -200,12 +200,12 @@ public class TestAsyncJobManager extends TestCase {
                             if(host != null) {
                                 s_logger.info("Thread " + (current + 1) + " acquired lock");
 
-                                try { Thread.sleep(getRandomMilliseconds(1000, 5000)); } catch (InterruptedException e) {}
+                                try { Thread.sleep(1000); } catch (InterruptedException e) {}
 
                                 s_logger.info("Thread " + (current + 1) + " released lock");
                                 hostDao.releaseFromLockTable(host.getId());
 
-                                try { Thread.sleep(getRandomMilliseconds(1000, 5000)); } catch (InterruptedException e) {}
+                                try { Thread.sleep(1000); } catch (InterruptedException e) {}
                             } else {
                                 s_logger.info("Thread " + (current + 1) + " is not able to acquire lock");
                             }
@@ -226,7 +226,6 @@ public class TestAsyncJobManager extends TestCase {
     }
 
     public void testDomain() {
-        getRandomMilliseconds(1, 100);		
         DomainDao domainDao = new DomainDaoImpl();
 
         DomainVO domain1 = new DomainVO("d1", 2L, 1L, null);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/async/TestSyncQueueManager.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/async/TestSyncQueueManager.java b/server/test/com/cloud/async/TestSyncQueueManager.java
index 32b7dde..2322aec 100644
--- a/server/test/com/cloud/async/TestSyncQueueManager.java
+++ b/server/test/com/cloud/async/TestSyncQueueManager.java
@@ -67,7 +67,7 @@ public class TestSyncQueueManager extends TestCase {
                         mgr.purgeItem(item.getId());
                     }
                     try {
-                        Thread.sleep(getRandomMilliseconds(1, 10));
+                        Thread.sleep(100);
                     } catch (InterruptedException e) {
                     }
                 }
@@ -90,7 +90,7 @@ public class TestSyncQueueManager extends TestCase {
                     }
 
                     try {
-                        Thread.sleep(getRandomMilliseconds(1, 10));
+                        Thread.sleep(100);
                     } catch (InterruptedException e) {
                     }
                 }
@@ -138,7 +138,7 @@ public class TestSyncQueueManager extends TestCase {
                         }
                     }
                     try {
-                        Thread.sleep(getRandomMilliseconds(1, 10));
+                        Thread.sleep(100);
                     } catch (InterruptedException e) {
                     }
                 }
@@ -162,7 +162,7 @@ public class TestSyncQueueManager extends TestCase {
                     }
 
                     try {
-                        Thread.sleep(getRandomMilliseconds(1, 10));
+                        Thread.sleep(100);
                     } catch (InterruptedException e) {
                     }
                 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/network/security/SecurityGroupManagerImpl2Test.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/security/SecurityGroupManagerImpl2Test.java b/server/test/com/cloud/network/security/SecurityGroupManagerImpl2Test.java
index 6bf94a2..723e4e6 100644
--- a/server/test/com/cloud/network/security/SecurityGroupManagerImpl2Test.java
+++ b/server/test/com/cloud/network/security/SecurityGroupManagerImpl2Test.java
@@ -19,6 +19,7 @@ package com.cloud.network.security;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import junit.framework.TestCase;
@@ -47,7 +48,6 @@ import com.cloud.user.MockDomainManagerImpl;
 import com.cloud.user.dao.AccountDaoImpl;
 import com.cloud.utils.Profiler;
 
-import com.cloud.utils.component.MockComponentLocator;
 import com.cloud.vm.MockUserVmManagerImpl;
 import com.cloud.vm.MockVirtualMachineManagerImpl;
 import com.cloud.vm.dao.UserVmDaoImpl;
@@ -55,14 +55,13 @@ import com.cloud.vm.dao.VMInstanceDaoImpl;
 
 public class SecurityGroupManagerImpl2Test extends TestCase {
     //private final static Logger s_logger = Logger.getLogger(SecurityGroupManagerImpl2Test.class);
-    SecurityGroupManagerImpl2 _sgMgr = null;
-    UserVmDaoImpl _vmDao = null;
+    @Inject SecurityGroupManagerImpl2 _sgMgr = null;
+    @Inject UserVmDaoImpl _vmDao = null;
     
     @Before
     @Override
     public  void setUp() {
-        MockComponentLocator locator = new MockComponentLocator("management-server");
-       
+/*       
         locator.addDao("ConfigurationDao", ConfigurationDaoImpl.class);
         locator.addDao("SecurityGroupDao", SecurityGroupDaoImpl.class);
         
@@ -87,8 +86,7 @@ public class SecurityGroupManagerImpl2Test extends TestCase {
         locator.addManager("DomainManager", MockDomainManagerImpl.class); 
         locator.addManager("ProjectManager", MockProjectManagerImpl.class);
         locator.makeActive(new DefaultInterceptorLibrary());
-        _sgMgr = ComponentLocator.inject(SecurityGroupManagerImpl2.class);
-        _sgMgr._mBean = new SecurityManagerMBeanImpl(_sgMgr);
+*/  
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/snapshot/SnapshotDaoTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/snapshot/SnapshotDaoTest.java b/server/test/com/cloud/snapshot/SnapshotDaoTest.java
index 644980b..2f2803e 100644
--- a/server/test/com/cloud/snapshot/SnapshotDaoTest.java
+++ b/server/test/com/cloud/snapshot/SnapshotDaoTest.java
@@ -18,6 +18,8 @@ package com.cloud.snapshot;
 
 import java.util.List;
 
+import javax.inject.Inject;
+
 import com.cloud.storage.Snapshot;
 import com.cloud.storage.SnapshotVO;
 import com.cloud.storage.dao.SnapshotDaoImpl;
@@ -27,10 +29,9 @@ import junit.framework.Assert;
 import junit.framework.TestCase;
 
 public class SnapshotDaoTest extends TestCase {
-	
+    @Inject SnapshotDaoImpl dao;
+    	
     public void testListBy() {
-        SnapshotDaoImpl dao = ComponentLocator.inject(SnapshotDaoImpl.class);
-        
         List<SnapshotVO> snapshots = dao.listByInstanceId(3, Snapshot.Status.BackedUp);
         for(SnapshotVO snapshot : snapshots) {
             Assert.assertTrue(snapshot.getStatus() == Snapshot.Status.BackedUp);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/storage/dao/StoragePoolDaoTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/storage/dao/StoragePoolDaoTest.java b/server/test/com/cloud/storage/dao/StoragePoolDaoTest.java
index 57d74f6..87dbf16 100644
--- a/server/test/com/cloud/storage/dao/StoragePoolDaoTest.java
+++ b/server/test/com/cloud/storage/dao/StoragePoolDaoTest.java
@@ -16,15 +16,17 @@
 // under the License.
 package com.cloud.storage.dao;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import com.cloud.storage.StoragePoolStatus;
 
 
 public class StoragePoolDaoTest extends TestCase {
+    @Inject StoragePoolDaoImpl dao;
     
     public void testCountByStatus() {
-        StoragePoolDaoImpl dao = ComponentLocator.inject(StoragePoolDaoImpl.class);
         long count = dao.countPoolsByStatus(StoragePoolStatus.Up);
         System.out.println("Found " + count + " storage pools");
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/AdvanceZone217To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/AdvanceZone217To224UpgradeTest.java b/server/test/com/cloud/upgrade/AdvanceZone217To224UpgradeTest.java
index 9d442dc..532a62f 100644
--- a/server/test/com/cloud/upgrade/AdvanceZone217To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/AdvanceZone217To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -35,7 +37,9 @@ import com.cloud.utils.db.Transaction;
 
 public class AdvanceZone217To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(AdvanceZone217To224UpgradeTest.class);
-
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+    
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,9 +58,6 @@ public class AdvanceZone217To224UpgradeTest extends TestCase {
         Connection conn;
         PreparedStatement pstmt;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         assert version.equals("2.1.7") : "Version returned is not 2.1.7 but " + version;
         

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java b/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
index 17f3158..519ae70 100644
--- a/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/AdvanceZone223To224UpgradeTest.java
@@ -18,6 +18,8 @@ package com.cloud.upgrade;
 
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -29,6 +31,8 @@ import com.cloud.upgrade.dao.VersionDaoImpl;
 
 public class AdvanceZone223To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(AdvanceZone223To224UpgradeTest.class);
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -43,8 +47,6 @@ public class AdvanceZone223To224UpgradeTest extends TestCase {
 
     public void test223to224Upgrade() throws SQLException {
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
 
         String version = dao.getCurrentVersion();
         assert version.equals("2.2.3") : "Version returned is not 2.2.3 but " + version;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java b/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
index 19048e0..8bd9f06 100644
--- a/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/BasicZone218To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -35,6 +37,9 @@ import com.cloud.utils.db.Transaction;
 
 public class BasicZone218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(BasicZone218To224UpgradeTest.class);
+    
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -54,9 +59,6 @@ public class BasicZone218To224UpgradeTest extends TestCase {
         Connection conn = Transaction.getStandaloneConnection();
         PreparedStatement pstmt;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/HostCapacity218to22Test.java b/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
index 3d89f21..76ad12e 100644
--- a/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
+++ b/server/test/com/cloud/upgrade/HostCapacity218to22Test.java
@@ -18,6 +18,8 @@ package com.cloud.upgrade;
 
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -30,6 +32,9 @@ import com.cloud.utils.db.DbTestUtils;
 
 public class HostCapacity218to22Test extends TestCase {
     private static final Logger s_logger = Logger.getLogger(HostCapacity218to22Test.class);
+
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 	
     @Override
     @Before
@@ -46,9 +51,6 @@ public class HostCapacity218to22Test extends TestCase {
         s_logger.debug("Finding sample data from 2.1.8");
         DbTestUtils.executeScript("fake.sql", false, true);
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java b/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
index 8624019..41f334d 100644
--- a/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/InstanceGroup218To224UpgradeTest.java
@@ -23,6 +23,8 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -37,6 +39,9 @@ import com.cloud.utils.db.Transaction;
 public class InstanceGroup218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(InstanceGroup218To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -55,9 +60,6 @@ public class InstanceGroup218To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java b/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
index 647d2b0..a9cb51f 100644
--- a/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/PortForwarding218To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -35,6 +37,9 @@ import com.cloud.utils.db.Transaction;
 
 public class PortForwarding218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(PortForwarding218To224UpgradeTest.class);
+    
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -55,9 +60,6 @@ public class PortForwarding218To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         
         if (!version.equals("2.1.8")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
index 080482f..d33192f 100644
--- a/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity220To224UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -35,6 +37,9 @@ import com.cloud.utils.db.Transaction;
 public class Sanity220To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity220To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,9 +59,6 @@ public class Sanity220To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-
         String version = dao.getCurrentVersion();
 
         if (!version.equals("2.2.1")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
index 44e90eb..108eca9 100644
--- a/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity222To224UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -35,6 +37,9 @@ import com.cloud.utils.db.Transaction;
 public class Sanity222To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity222To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,8 +59,6 @@ public class Sanity222To224UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
 
         String version = dao.getCurrentVersion();
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
index 7312cc6..fd0b219 100644
--- a/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity223To225UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -34,6 +36,9 @@ import com.cloud.utils.db.Transaction;
 public class Sanity223To225UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity223To225UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -53,9 +58,6 @@ public class Sanity223To225UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-
         String version = dao.getCurrentVersion();
 
         if (!version.equals("2.2.3")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java b/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
index 89ab58b..775a62e 100644
--- a/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Sanity224To225UpgradeTest.java
@@ -21,6 +21,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -35,6 +37,9 @@ import com.cloud.utils.db.Transaction;
 public class Sanity224To225UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Sanity224To225UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,9 +59,6 @@ public class Sanity224To225UpgradeTest extends TestCase {
         PreparedStatement pstmt;
         ResultSet rs;
 
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-
         String version = dao.getCurrentVersion();
 
         if (!version.equals("2.2.4")) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java b/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
index 88a4ea4..06835b5 100644
--- a/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Template2214To30UpgradeTest.java
@@ -23,6 +23,8 @@ import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -37,6 +39,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
 public class Template2214To30UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger
             .getLogger(Template2214To30UpgradeTest.class);
+    @Inject DatabaseUpgradeChecker checker;
 
     @Override
     @Before
@@ -56,8 +59,6 @@ public class Template2214To30UpgradeTest extends TestCase {
                 "fake.sql", false,
                 true);
 
-        DatabaseUpgradeChecker checker = ComponentLocator
-                .inject(DatabaseUpgradeChecker.class);
 
         checker.upgrade("2.2.14", "3.0.0");
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java b/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
index 66a2fda..ff44803 100644
--- a/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
+++ b/server/test/com/cloud/upgrade/Test2214To30DBUpgrade.java
@@ -23,6 +23,8 @@ import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -34,10 +36,13 @@ import com.cloud.utils.db.DbTestUtils;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 
+
 public class Test2214To30DBUpgrade extends TestCase {
     private static final Logger s_logger = Logger
             .getLogger(Test2214To30DBUpgrade.class);
 
+    @Inject DatabaseUpgradeChecker checker;
+    
     @Override
     @Before
     public void setUp() throws Exception {
@@ -56,9 +61,6 @@ public class Test2214To30DBUpgrade extends TestCase {
                 "fake.sql", false,
                 true);
 
-        DatabaseUpgradeChecker checker = ComponentLocator
-                .inject(DatabaseUpgradeChecker.class);
-
         checker.upgrade("2.2.14", "3.0.0");
 
         Connection conn = Transaction.getStandaloneConnection();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java b/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
index 17a85fb..741af5a 100644
--- a/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/Usage217To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -36,6 +38,9 @@ import com.cloud.utils.db.Transaction;
 public class Usage217To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(Usage217To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject PremiumDatabaseUpgradeChecker checker;
+    
     @Override
     @Before
     public void setUp() throws Exception {
@@ -56,8 +61,6 @@ public class Usage217To224UpgradeTest extends TestCase {
         Connection conn;
         PreparedStatement pstmt;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        PremiumDatabaseUpgradeChecker checker = ComponentLocator.inject(PremiumDatabaseUpgradeChecker.class);
         
         String version = dao.getCurrentVersion();
         assert version.equals("2.1.7") : "Version returned is not 2.1.7 but " + version;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java b/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
index 94ae836..cde114b 100644
--- a/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
+++ b/server/test/com/cloud/upgrade/UsageEvents218To224UpgradeTest.java
@@ -22,6 +22,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -36,6 +38,9 @@ import com.cloud.utils.db.Transaction;
 public class UsageEvents218To224UpgradeTest extends TestCase {
     private static final Logger s_logger = Logger.getLogger(UsageEvents218To224UpgradeTest.class);
 
+    @Inject VersionDaoImpl dao;
+    @Inject DatabaseUpgradeChecker checker;
+    
     @Override
     @Before
     public void setUp() throws Exception {
@@ -54,9 +59,6 @@ public class UsageEvents218To224UpgradeTest extends TestCase {
         Connection conn;
         PreparedStatement pstmt;
         
-        VersionDaoImpl dao = ComponentLocator.inject(VersionDaoImpl.class);
-        DatabaseUpgradeChecker checker = ComponentLocator.inject(DatabaseUpgradeChecker.class);
-        
         String version = dao.getCurrentVersion();
         assert version.equals("2.1.8") : "Version returned is not 2.1.8 but " + version;
         

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java b/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
index b062dd2..1a5a900 100644
--- a/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
+++ b/server/test/com/cloud/vm/dao/UserVmDaoImplTest.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.vm.dao;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -25,8 +27,9 @@ import com.cloud.vm.VirtualMachine;
 
 
 public class UserVmDaoImplTest extends TestCase {
-    public void testPersist() {
-        UserVmDao dao = ComponentLocator.inject(UserVmDaoImpl.class);
+    @Inject UserVmDao dao;
+     
+	public void testPersist() {
         
         dao.expunge(1000l);
         

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/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 4403d75..000fea6 100644
--- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java
@@ -66,7 +66,6 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.user.Account;
 import com.cloud.user.User;
 import com.cloud.utils.Pair;
-import com.cloud.utils.component.Adapters;
 import com.cloud.utils.component.Manager;
 import com.cloud.vm.*;
 import com.cloud.vpc.dao.MockVpcVirtualRouterElement;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/vpc/MockVpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockVpcManagerImpl.java b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
index c41bb7b..e7d888e 100644
--- a/server/test/com/cloud/vpc/MockVpcManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockVpcManagerImpl.java
@@ -21,6 +21,7 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.ejb.Local;
+import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
@@ -57,7 +58,7 @@ import com.cloud.vpc.dao.MockVpcDaoImpl;
 
 @Local(value = { VpcManager.class, VpcService.class })
 public class MockVpcManagerImpl implements VpcManager, Manager{
-    MockVpcDaoImpl _vpcDao = ComponentLocator.inject(MockVpcDaoImpl.class);
+    @Inject MockVpcDaoImpl _vpcDao;
 
     /* (non-Javadoc)
      * @see com.cloud.network.vpc.VpcService#getVpcOffering(long)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/server/test/com/cloud/vpc/VpcApiUnitTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/VpcApiUnitTest.java b/server/test/com/cloud/vpc/VpcApiUnitTest.java
index 14e376a..9693f44 100644
--- a/server/test/com/cloud/vpc/VpcApiUnitTest.java
+++ b/server/test/com/cloud/vpc/VpcApiUnitTest.java
@@ -19,6 +19,8 @@ package com.cloud.vpc;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.inject.Inject;
+
 import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
@@ -46,7 +48,6 @@ import com.cloud.user.AccountVO;
 import com.cloud.user.MockAccountManagerImpl;
 import com.cloud.user.dao.AccountDaoImpl;
 
-import com.cloud.utils.component.MockComponentLocator;
 import com.cloud.vm.dao.DomainRouterDaoImpl;
 import com.cloud.vpc.dao.MockNetworkDaoImpl;
 import com.cloud.vpc.dao.MockNetworkOfferingDaoImpl;
@@ -58,45 +59,11 @@ import com.cloud.vpc.dao.MockVpcOfferingServiceMapDaoImpl;
 
 public class VpcApiUnitTest extends TestCase{
     private static final Logger s_logger = Logger.getLogger(VpcApiUnitTest.class);
-    MockComponentLocator _locator;
-    VpcManager _vpcService;
+    @Inject VpcManager _vpcService;
 
     @Override
     @Before
     public void setUp() throws Exception {
-        _locator = new MockComponentLocator(ManagementService.Name);
-        _locator.addDao("VpcDao", MockVpcDaoImpl.class);
-        _locator.addDao("VpcOfferingDao", VpcOfferingDaoImpl.class);
-        _locator.addDao("ConfigurationDao", ConfigurationDaoImpl.class);
-        _locator.addDao("NetworkDao", MockNetworkDaoImpl.class);
-        _locator.addDao("IPAddressDao", IPAddressDaoImpl.class);
-        _locator.addDao("DomainRouterDao", DomainRouterDaoImpl.class);
-        _locator.addDao("VpcGatewayDao", VpcGatewayDaoImpl.class);
-        _locator.addDao("PrivateIpDao", PrivateIpDaoImpl.class);
-        _locator.addDao("StaticRouteDao", StaticRouteDaoImpl.class);
-        _locator.addDao("NetworkOfferingServiceMapDao", MockNetworkOfferingServiceMapDaoImpl.class);
-        _locator.addDao("VpcOfferingServiceMapDao", MockVpcOfferingServiceMapDaoImpl.class);
-        _locator.addDao("PhysicalNetworkDao", PhysicalNetworkDaoImpl.class);
-        _locator.addDao("ResourceTagDao", ResourceTagsDaoImpl.class);
-        _locator.addDao("FirewallRulesDao", FirewallRulesDaoImpl.class);
-        _locator.addDao("VlanDao", VlanDaoImpl.class);
-        _locator.addDao("AccountDao", AccountDaoImpl.class);
-        _locator.addDao("ResourceCountDao", ResourceCountDaoImpl.class);
-        _locator.addDao("NetworkOfferingDao", MockNetworkOfferingDaoImpl.class);
-        _locator.addDao("NetworkServiceMapDao", MockNetworkServiceMapDaoImpl.class);
-        _locator.addDao("VpcOfferingDao", MockVpcOfferingDaoImpl.class);
-        _locator.addDao("Site2SiteVpnDao", Site2SiteVpnGatewayDaoImpl.class);
-        
-        _locator.addManager("ConfigService", MockConfigurationManagerImpl.class);
-        _locator.addManager("vpc manager", VpcManagerImpl.class);
-        _locator.addManager("account manager", MockAccountManagerImpl.class);
-        _locator.addManager("network manager", MockNetworkManagerImpl.class);
-        _locator.addManager("Site2SiteVpnManager", MockSite2SiteVpnManagerImpl.class);
-        _locator.addManager("ResourceLimitService", MockResourceLimitManagerImpl.class);
-        
-        _locator.makeActive(null);
-        
-        _vpcService = ComponentLocator.inject(VpcManagerImpl.class);
     }
     
     public void test() {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/usage/src/com/cloud/usage/UsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/UsageManagerImpl.java b/usage/src/com/cloud/usage/UsageManagerImpl.java
index 971f5df..4944a14 100644
--- a/usage/src/com/cloud/usage/UsageManagerImpl.java
+++ b/usage/src/com/cloud/usage/UsageManagerImpl.java
@@ -30,6 +30,7 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
 import javax.ejb.Local;
+import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
@@ -89,23 +90,23 @@ public class UsageManagerImpl implements UsageManager, Runnable {
     private static final int THREE_DAYS_IN_MINUTES = 60 * 24 * 3;
     private static final int USAGE_AGGREGATION_RANGE_MIN = 10;
 
-    private final ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private final AccountDao m_accountDao = _locator.getDao(AccountDao.class);
-    private final UserStatisticsDao m_userStatsDao = _locator.getDao(UserStatisticsDao.class);
-    private final UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private final UsageVMInstanceDao m_usageInstanceDao = _locator.getDao(UsageVMInstanceDao.class);
-    private final UsageIPAddressDao m_usageIPAddressDao = _locator.getDao(UsageIPAddressDao.class);
-    private final UsageNetworkDao m_usageNetworkDao = _locator.getDao(UsageNetworkDao.class);
-    private final UsageVolumeDao m_usageVolumeDao = _locator.getDao(UsageVolumeDao.class);
-    private final UsageStorageDao m_usageStorageDao = _locator.getDao(UsageStorageDao.class);
-    private final UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao = _locator.getDao(UsageLoadBalancerPolicyDao.class);
-    private final UsagePortForwardingRuleDao m_usagePortForwardingRuleDao = _locator.getDao(UsagePortForwardingRuleDao.class);
-    private final UsageNetworkOfferingDao m_usageNetworkOfferingDao = _locator.getDao(UsageNetworkOfferingDao.class);
-    private final UsageVPNUserDao m_usageVPNUserDao = _locator.getDao(UsageVPNUserDao.class);
-    private final UsageSecurityGroupDao m_usageSecurityGroupDao = _locator.getDao(UsageSecurityGroupDao.class);
-    private final UsageJobDao m_usageJobDao = _locator.getDao(UsageJobDao.class);
+    @Inject private AccountDao m_accountDao;
+    @Inject private UserStatisticsDao m_userStatsDao;
+    @Inject private UsageDao m_usageDao;
+    @Inject private UsageVMInstanceDao m_usageInstanceDao;
+    @Inject private UsageIPAddressDao m_usageIPAddressDao;
+    @Inject private UsageNetworkDao m_usageNetworkDao;
+    @Inject private UsageVolumeDao m_usageVolumeDao;
+    @Inject private UsageStorageDao m_usageStorageDao;
+    @Inject private UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao;
+    @Inject private UsagePortForwardingRuleDao m_usagePortForwardingRuleDao;
+    @Inject private UsageNetworkOfferingDao m_usageNetworkOfferingDao;
+    @Inject private UsageVPNUserDao m_usageVPNUserDao;
+    @Inject private UsageSecurityGroupDao m_usageSecurityGroupDao;
+    @Inject private UsageJobDao m_usageJobDao;
     @Inject protected AlertManager _alertMgr;
     @Inject protected UsageEventDao _usageEventDao;
+    @Inject ConfigurationDao _configDao;
 
     private String m_version = null;
     private String m_name = null;
@@ -152,14 +153,7 @@ public class UsageManagerImpl implements UsageManager, Runnable {
 
         m_name = name;
 
-        ComponentLocator locator = ComponentLocator.getCurrentLocator();
-        ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
-        if (configDao == null) {
-            s_logger.error("Unable to get the configuration dao.");
-            return false;
-        }
-
-        Map<String, String> configs = configDao.getConfiguration(params);
+        Map<String, String> configs = _configDao.getConfiguration(params);
 
         if (params != null) {
             mergeConfigs(configs, params);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/usage/src/com/cloud/usage/UsageServer.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/UsageServer.java b/usage/src/com/cloud/usage/UsageServer.java
index 5fe46e6..eaf9132 100644
--- a/usage/src/com/cloud/usage/UsageServer.java
+++ b/usage/src/com/cloud/usage/UsageServer.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.usage;
 
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
 
 
@@ -24,6 +26,7 @@ public class UsageServer {
     private static final Logger s_logger = Logger.getLogger(UsageServer.class.getName());
     public static final String Name = "usage-server";
 
+    @Inject UsageManager mgr; 
     /**
      * @param args
      */
@@ -38,7 +41,6 @@ public class UsageServer {
     }
 
     public void start() {
-        UsageManager mgr = new UsageManager();
         if (mgr != null) {
             if (s_logger.isInfoEnabled()) {
                 s_logger.info("UsageServer ready...");

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java b/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
index f60c0bf..a5a40c0 100644
--- a/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/IPAddressUsageParser.java
@@ -22,7 +22,11 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageIPAddressVO;
 import com.cloud.usage.UsageServer;
@@ -33,15 +37,23 @@ import com.cloud.usage.dao.UsageIPAddressDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
 
-
+@Component
 public class IPAddressUsageParser {
     public static final Logger s_logger = Logger.getLogger(IPAddressUsageParser.class.getName());
 
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageIPAddressDao m_usageIPAddressDao = _locator.getDao(UsageIPAddressDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageIPAddressDao m_usageIPAddressDao;
 
+    
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageIPAddressDao _usageIPAddressDao;
 
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageIPAddressDao = _usageIPAddressDao;
+    }
+    
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("Parsing IP Address usage for account: " + account.getId());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fb1a1e6/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java b/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
index 8763527..edea320 100644
--- a/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
+++ b/usage/src/com/cloud/usage/parser/LoadBalancerUsageParser.java
@@ -22,7 +22,11 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
 import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.usage.UsageLoadBalancerPolicyVO;
 import com.cloud.usage.UsageServer;
@@ -33,13 +37,21 @@ import com.cloud.usage.dao.UsageLoadBalancerPolicyDao;
 import com.cloud.user.AccountVO;
 import com.cloud.utils.Pair;
 
-
+@Component
 public class LoadBalancerUsageParser {
     public static final Logger s_logger = Logger.getLogger(LoadBalancerUsageParser.class.getName());
     
-    private static ComponentLocator _locator = ComponentLocator.getLocator(UsageServer.Name, "usage-components.xml", "log4j-cloud_usage");
-    private static UsageDao m_usageDao = _locator.getDao(UsageDao.class);
-    private static UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao = _locator.getDao(UsageLoadBalancerPolicyDao.class);
+    private static UsageDao m_usageDao;
+    private static UsageLoadBalancerPolicyDao m_usageLoadBalancerPolicyDao;
+    
+    @Inject private UsageDao _usageDao;
+    @Inject private UsageLoadBalancerPolicyDao _usageLoadBalancerPolicyDao;
+    
+    @PostConstruct
+    void init() {
+    	m_usageDao = _usageDao;
+    	m_usageLoadBalancerPolicyDao = _usageLoadBalancerPolicyDao;
+    }
     
     public static boolean parse(AccountVO account, Date startDate, Date endDate) {
         if (s_logger.isDebugEnabled()) {


Mime
View raw message