You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2013/10/03 00:45:50 UTC
[6/9] Spring Modularization
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
----------------------------------------------------------------------
diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
new file mode 100644
index 0000000..cc5af3f
--- /dev/null
+++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
@@ -0,0 +1,321 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <!--
+ DAO with customized configuration
+ -->
+ <bean id="serviceOfferingDaoImpl" class="com.cloud.service.dao.ServiceOfferingDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="50" />
+ <entry key="cache.time.to.live" value="600" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="diskOfferingDaoImpl" class="com.cloud.storage.dao.DiskOfferingDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="50" />
+ <entry key="cache.time.to.live" value="600" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="dataCenterDaoImpl" class="com.cloud.dc.dao.DataCenterDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="50" />
+ <entry key="cache.time.to.live" value="600" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="hostPodDaoImpl" class="com.cloud.dc.dao.HostPodDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="50" />
+ <entry key="cache.time.to.live" value="600" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="vlanDaoImpl" class="com.cloud.dc.dao.VlanDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="30" />
+ <entry key="cache.time.to.live" value="3600" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="userDaoImpl" class="com.cloud.user.dao.UserDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="5000" />
+ <entry key="cache.time.to.live" value="300" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="VMTemplateDaoImpl" class="com.cloud.storage.dao.VMTemplateDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="100" />
+ <entry key="cache.time.to.live" value="600" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="hypervisorCapabilitiesDaoImpl" class="com.cloud.hypervisor.dao.HypervisorCapabilitiesDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="100" />
+ <entry key="cache.time.to.live" value="600" />
+ </map>
+ </property>
+ </bean>
+ <bean id="dedicatedResourceDaoImpl" class="com.cloud.dc.dao.DedicatedResourceDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="cache.size" value="30" />
+ <entry key="cache.time.to.live" value="3600" />
+ </map>
+ </property>
+ </bean>
+
+ <!--
+ DAOs with default configuration
+ -->
+ <bean id="accountDaoImpl" class="com.cloud.user.dao.AccountDaoImpl" />
+ <bean id="accountDetailsDaoImpl" class="com.cloud.user.AccountDetailsDaoImpl" />
+ <bean id="accountJoinDaoImpl" class="com.cloud.api.query.dao.AccountJoinDaoImpl" />
+ <bean id="accountGuestVlanMapDaoImpl" class="com.cloud.network.dao.AccountGuestVlanMapDaoImpl" />
+ <bean id="accountVlanMapDaoImpl" class="com.cloud.dc.dao.AccountVlanMapDaoImpl" />
+ <bean id="alertDaoImpl" class="com.cloud.alert.dao.AlertDaoImpl" />
+ <bean id="asyncJobJoinDaoImpl" class="com.cloud.api.query.dao.AsyncJobJoinDaoImpl" />
+ <bean id="autoScalePolicyConditionMapDaoImpl" class="com.cloud.network.as.dao.AutoScalePolicyConditionMapDaoImpl" />
+ <bean id="autoScalePolicyDaoImpl" class="com.cloud.network.as.dao.AutoScalePolicyDaoImpl" />
+ <bean id="autoScaleVmGroupDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmGroupDaoImpl" />
+ <bean id="autoScaleVmGroupPolicyMapDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmGroupPolicyMapDaoImpl" />
+ <bean id="autoScaleVmProfileDaoImpl" class="com.cloud.network.as.dao.AutoScaleVmProfileDaoImpl" />
+ <bean id="capacityDaoImpl" class="com.cloud.capacity.dao.CapacityDaoImpl" />
+ <bean id="certificateDaoImpl" class="com.cloud.certificate.dao.CertificateDaoImpl" />
+ <bean id="clusterDaoImpl" class="com.cloud.dc.dao.ClusterDaoImpl" />
+ <bean id="clusterDetailsDaoImpl" class="com.cloud.dc.ClusterDetailsDaoImpl" />
+ <bean id="clusterVSMMapDaoImpl" class="com.cloud.dc.dao.ClusterVSMMapDaoImpl" />
+ <bean id="commandExecLogDaoImpl" class="com.cloud.secstorage.CommandExecLogDaoImpl" />
+ <bean id="conditionDaoImpl" class="com.cloud.network.as.dao.ConditionDaoImpl" />
+ <bean id="consoleProxyDaoImpl" class="com.cloud.vm.dao.ConsoleProxyDaoImpl" />
+ <bean id="counterDaoImpl" class="com.cloud.network.as.dao.CounterDaoImpl" />
+ <bean id="dataCenterIpAddressDaoImpl" class="com.cloud.dc.dao.DataCenterIpAddressDaoImpl" />
+ <bean id="dataCenterJoinDaoImpl" class="com.cloud.api.query.dao.DataCenterJoinDaoImpl" />
+ <bean id="dataCenterLinkLocalIpAddressDaoImpl" class="com.cloud.dc.dao.DataCenterLinkLocalIpAddressDaoImpl" />
+ <bean id="dataCenterVnetDaoImpl" class="com.cloud.dc.dao.DataCenterVnetDaoImpl" />
+ <bean id="dcDetailsDaoImpl" class="com.cloud.dc.dao.DcDetailsDaoImpl" />
+ <bean id="engineDcDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.DcDetailsDaoImpl" />
+ <bean id="diskOfferingJoinDaoImpl" class="com.cloud.api.query.dao.DiskOfferingJoinDaoImpl" />
+ <bean id="domainDaoImpl" class="com.cloud.domain.dao.DomainDaoImpl" />
+ <bean id="domainRouterDaoImpl" class="com.cloud.vm.dao.DomainRouterDaoImpl" />
+ <bean id="domainRouterJoinDaoImpl" class="com.cloud.api.query.dao.DomainRouterJoinDaoImpl" />
+ <bean id="engineClusterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDaoImpl" />
+ <bean id="engineDataCenterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDaoImpl" />
+ <bean id="engineHostDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDaoImpl" />
+ <bean id="engineHostPodDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDaoImpl" />
+ <bean id="eventDaoImpl" class="com.cloud.event.dao.EventDaoImpl" />
+ <bean id="eventJoinDaoImpl" class="com.cloud.event.dao.EventJoinDaoImpl" />
+ <bean id="externalFirewallDeviceDaoImpl" class="com.cloud.network.dao.ExternalFirewallDeviceDaoImpl" />
+ <bean id="externalLoadBalancerDeviceDaoImpl" class="com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl" />
+ <bean id="externalPublicIpStatisticsDaoImpl" class="com.cloud.usage.dao.ExternalPublicIpStatisticsDaoImpl" />
+ <bean id="firewallRulesCidrsDaoImpl" class="com.cloud.network.dao.FirewallRulesCidrsDaoImpl" />
+ <bean id="firewallRulesDaoImpl" class="com.cloud.network.dao.FirewallRulesDaoImpl" />
+ <bean id="globalLoadBalancerDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerDaoImpl" />
+ <bean id="globalLoadBalancerLbRuleMapDaoImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancerLbRuleMapDaoImpl" />
+ <bean id="guestOSCategoryDaoImpl" class="com.cloud.storage.dao.GuestOSCategoryDaoImpl" />
+ <bean id="guestOSDaoImpl" class="com.cloud.storage.dao.GuestOSDaoImpl" />
+ <bean id="guestOSHypervisorDaoImpl" class="com.cloud.storage.dao.GuestOSHypervisorDaoImpl" />
+ <bean id="highAvailabilityDaoImpl" class="com.cloud.ha.dao.HighAvailabilityDaoImpl" />
+ <bean id="hostDaoImpl" class="com.cloud.host.dao.HostDaoImpl" />
+ <bean id="engineHostDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostDetailsDaoImpl" />
+ <bean id="hostDetailsDaoImpl" class="com.cloud.host.dao.HostDetailsDaoImpl" />
+ <bean id="hostJoinDaoImpl" class="com.cloud.api.query.dao.HostJoinDaoImpl" />
+ <bean id="engineHostTagsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostTagsDaoImpl" />
+ <bean id="hostTagsDaoImpl" class="com.cloud.host.dao.HostTagsDaoImpl" />
+ <bean id="hostTransferMapDaoImpl" class="com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl" />
+ <bean id="iPAddressDaoImpl" class="com.cloud.network.dao.IPAddressDaoImpl" />
+ <bean id="identityDaoImpl" class="com.cloud.uuididentity.dao.IdentityDaoImpl" />
+ <bean id="imageStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageStoreDaoImpl" />
+ <bean id="imageStoreDetailsDaoImpl" class="org.apache.cloudstack.storage.image.db.ImageStoreDetailsDaoImpl" />
+ <bean id="imageStoreJoinDaoImpl" class="com.cloud.api.query.dao.ImageStoreJoinDaoImpl" />
+ <bean id="snapshotDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.SnapshotDataStoreDaoImpl" />
+ <bean id="templateDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.TemplateDataStoreDaoImpl" />
+ <bean id="templateJoinDaoImpl" class="com.cloud.api.query.dao.TemplateJoinDaoImpl" />
+ <bean id="volumeDataStoreDaoImpl" class="org.apache.cloudstack.storage.image.db.VolumeDataStoreDaoImpl" />
+ <bean id="inlineLoadBalancerNicMapDaoImpl" class="com.cloud.network.dao.InlineLoadBalancerNicMapDaoImpl" />
+ <bean id="instanceGroupDaoImpl" class="com.cloud.vm.dao.InstanceGroupDaoImpl" />
+ <bean id="instanceGroupJoinDaoImpl" class="com.cloud.api.query.dao.InstanceGroupJoinDaoImpl" />
+ <bean id="instanceGroupVMMapDaoImpl" class="com.cloud.vm.dao.InstanceGroupVMMapDaoImpl" />
+ <bean id="itWorkDaoImpl" class="com.cloud.vm.ItWorkDaoImpl" />
+ <bean id="keystoreDaoImpl" class="com.cloud.keystore.KeystoreDaoImpl" />
+ <bean id="lBHealthCheckPolicyDaoImpl" class="com.cloud.network.dao.LBHealthCheckPolicyDaoImpl" />
+ <bean id="lBStickinessPolicyDaoImpl" class="com.cloud.network.dao.LBStickinessPolicyDaoImpl" />
+ <bean id="launchPermissionDaoImpl" class="com.cloud.storage.dao.LaunchPermissionDaoImpl" />
+ <bean id="loadBalancerDaoImpl" class="com.cloud.network.dao.LoadBalancerDaoImpl" />
+ <bean id="loadBalancerVMMapDaoImpl" class="com.cloud.network.dao.LoadBalancerVMMapDaoImpl" />
+ <bean id="managementServerHostDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostDaoImpl" />
+ <bean id="managementServerHostPeerDaoImpl" class="com.cloud.cluster.dao.ManagementServerHostPeerDaoImpl" />
+ <bean id="networkAccountDaoImpl" class="com.cloud.network.dao.NetworkAccountDaoImpl" />
+ <bean id="networkACLDaoImpl" class="com.cloud.network.vpc.dao.NetworkACLDaoImpl" />
+ <bean id="networkACLItemDaoImpl" class="com.cloud.network.vpc.dao.NetworkACLItemDaoImpl" />
+ <bean id="networkDaoImpl" class="com.cloud.network.dao.NetworkDaoImpl" />
+ <bean id="networkDomainDaoImpl" class="com.cloud.network.dao.NetworkDomainDaoImpl" />
+ <bean id="networkExternalFirewallDaoImpl" class="com.cloud.network.dao.NetworkExternalFirewallDaoImpl" />
+ <bean id="networkExternalLoadBalancerDaoImpl" class="com.cloud.network.dao.NetworkExternalLoadBalancerDaoImpl" />
+ <bean id="networkOfferingDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingDaoImpl" />
+ <bean id="networkOfferingServiceMapDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingServiceMapDaoImpl" />
+ <bean id="networkOpDaoImpl" class="com.cloud.network.dao.NetworkOpDaoImpl" />
+ <bean id="networkRuleConfigDaoImpl" class="com.cloud.network.dao.NetworkRuleConfigDaoImpl" />
+ <bean id="networkServiceMapDaoImpl" class="com.cloud.network.dao.NetworkServiceMapDaoImpl" />
+ <bean id="nicDaoImpl" class="com.cloud.vm.dao.NicDaoImpl" />
+ <bean id="nicDetailDaoImpl" class="com.cloud.vm.dao.NicDetailDaoImpl" />
+ <bean id="nicSecondaryIpDaoImpl" class="com.cloud.vm.dao.NicSecondaryIpDaoImpl" />
+ <bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
+ <bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
+ <bean id="ovsTunnelInterfaceDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelInterfaceDaoImpl" />
+ <bean id="ovsTunnelNetworkDaoImpl" class="com.cloud.network.ovs.dao.OvsTunnelNetworkDaoImpl" />
+ <bean id="physicalNetworkDaoImpl" class="com.cloud.network.dao.PhysicalNetworkDaoImpl" />
+ <bean id="physicalNetworkIsolationMethodDaoImpl" class="com.cloud.network.dao.PhysicalNetworkIsolationMethodDaoImpl" />
+ <bean id="physicalNetworkServiceProviderDaoImpl" class="com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl" />
+ <bean id="physicalNetworkTagDaoImpl" class="com.cloud.network.dao.PhysicalNetworkTagDaoImpl" />
+ <bean id="physicalNetworkTrafficTypeDaoImpl" class="com.cloud.network.dao.PhysicalNetworkTrafficTypeDaoImpl" />
+ <bean id="podVlanDaoImpl" class="com.cloud.dc.dao.PodVlanDaoImpl" />
+ <bean id="podVlanMapDaoImpl" class="com.cloud.dc.dao.PodVlanMapDaoImpl" />
+ <bean id="PortableIpDaoImpl" class="org.apache.cloudstack.region.PortableIpDaoImpl" />
+ <bean id="PortableIpRangeDaoImpl" class="org.apache.cloudstack.region.PortableIpRangeDaoImpl" />
+ <bean id="portForwardingRulesDaoImpl" class="com.cloud.network.rules.dao.PortForwardingRulesDaoImpl" />
+ <bean id="portProfileDaoImpl" class="com.cloud.network.dao.PortProfileDaoImpl" />
+ <bean id="primaryDataStoreDaoImpl" class="org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDaoImpl" />
+ <bean id="primaryDataStoreDetailsDaoImpl" class="org.apache.cloudstack.storage.volume.db.PrimaryDataStoreDetailsDaoImpl" />
+ <bean id="privateIpDaoImpl" class="com.cloud.network.vpc.dao.PrivateIpDaoImpl" />
+ <bean id="projectAccountDaoImpl" class="com.cloud.projects.dao.ProjectAccountDaoImpl" />
+ <bean id="projectAccountJoinDaoImpl" class="com.cloud.api.query.dao.ProjectAccountJoinDaoImpl" />
+ <bean id="projectDaoImpl" class="com.cloud.projects.dao.ProjectDaoImpl" />
+ <bean id="projectInvitationDaoImpl" class="com.cloud.projects.dao.ProjectInvitationDaoImpl" />
+ <bean id="projectInvitationJoinDaoImpl" class="com.cloud.api.query.dao.ProjectInvitationJoinDaoImpl" />
+ <bean id="projectJoinDaoImpl" class="com.cloud.api.query.dao.ProjectJoinDaoImpl" />
+ <bean id="regionDaoImpl" class="org.apache.cloudstack.region.dao.RegionDaoImpl" />
+ <bean id="remoteAccessVpnDaoImpl" class="com.cloud.network.dao.RemoteAccessVpnDaoImpl" />
+ <bean id="resourceCountDaoImpl" class="com.cloud.configuration.dao.ResourceCountDaoImpl" />
+ <bean id="resourceLimitDaoImpl" class="com.cloud.configuration.dao.ResourceLimitDaoImpl" />
+ <bean id="resourceTagJoinDaoImpl" class="com.cloud.api.query.dao.ResourceTagJoinDaoImpl" />
+ <bean id="resourceTagsDaoImpl" class="com.cloud.tags.dao.ResourceTagsDaoImpl" />
+ <bean id="routerNetworkDaoImpl" class="com.cloud.network.dao.RouterNetworkDaoImpl" />
+ <bean id="sSHKeyPairDaoImpl" class="com.cloud.user.dao.SSHKeyPairDaoImpl" />
+ <bean id="secondaryStorageVmDaoImpl" class="com.cloud.vm.dao.SecondaryStorageVmDaoImpl" />
+ <bean id="securityGroupDaoImpl" class="com.cloud.network.security.dao.SecurityGroupDaoImpl" />
+ <bean id="securityGroupJoinDaoImpl" class="com.cloud.api.query.dao.SecurityGroupJoinDaoImpl" />
+ <bean id="securityGroupRuleDaoImpl" class="com.cloud.network.security.dao.SecurityGroupRuleDaoImpl" />
+ <bean id="securityGroupRulesDaoImpl" class="com.cloud.network.security.dao.SecurityGroupRulesDaoImpl" />
+ <bean id="securityGroupVMMapDaoImpl" class="com.cloud.network.security.dao.SecurityGroupVMMapDaoImpl" />
+ <bean id="securityGroupWorkDaoImpl" class="com.cloud.network.security.dao.SecurityGroupWorkDaoImpl" />
+ <bean id="serviceOfferingJoinDaoImpl" class="com.cloud.api.query.dao.ServiceOfferingJoinDaoImpl" />
+ <bean id="site2SiteCustomerGatewayDaoImpl" class="com.cloud.network.dao.Site2SiteCustomerGatewayDaoImpl" />
+ <bean id="site2SiteVpnConnectionDaoImpl" class="com.cloud.network.dao.Site2SiteVpnConnectionDaoImpl" />
+ <bean id="site2SiteVpnGatewayDaoImpl" class="com.cloud.network.dao.Site2SiteVpnGatewayDaoImpl" />
+ <bean id="snapshotDaoImpl" class="com.cloud.storage.dao.SnapshotDaoImpl" />
+ <bean id="snapshotPolicyDaoImpl" class="com.cloud.storage.dao.SnapshotPolicyDaoImpl" />
+ <bean id="snapshotScheduleDaoImpl" class="com.cloud.storage.dao.SnapshotScheduleDaoImpl" />
+ <bean id="staticRouteDaoImpl" class="com.cloud.network.vpc.dao.StaticRouteDaoImpl" />
+ <bean id="storageNetworkIpAddressDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpAddressDaoImpl" />
+ <bean id="storageNetworkIpRangeDaoImpl" class="com.cloud.dc.dao.StorageNetworkIpRangeDaoImpl" />
+ <bean id="storagePoolDetailsDaoImpl" class="com.cloud.storage.dao.StoragePoolDetailsDaoImpl" />
+ <bean id="storagePoolHostDaoImpl" class="com.cloud.storage.dao.StoragePoolHostDaoImpl" />
+ <bean id="storagePoolJoinDaoImpl" class="com.cloud.api.query.dao.StoragePoolJoinDaoImpl" />
+ <bean id="storagePoolWorkDaoImpl" class="com.cloud.storage.dao.StoragePoolWorkDaoImpl" />
+ <bean id="templatePrimaryDataStoreDaoImpl" class="org.apache.cloudstack.storage.volume.db.TemplatePrimaryDataStoreDaoImpl" />
+ <bean id="uploadDaoImpl" class="com.cloud.storage.dao.UploadDaoImpl" />
+ <bean id="usageDaoImpl" class="com.cloud.usage.dao.UsageDaoImpl" />
+ <bean id="usageEventDaoImpl" class="com.cloud.event.dao.UsageEventDaoImpl" />
+ <bean id="usageIPAddressDaoImpl" class="com.cloud.usage.dao.UsageIPAddressDaoImpl" />
+ <bean id="usageJobDaoImpl" class="com.cloud.usage.dao.UsageJobDaoImpl" />
+ <bean id="usageLoadBalancerPolicyDaoImpl" class="com.cloud.usage.dao.UsageLoadBalancerPolicyDaoImpl" />
+ <bean id="usageNetworkDaoImpl" class="com.cloud.usage.dao.UsageNetworkDaoImpl" />
+ <bean id="usageNetworkOfferingDaoImpl" class="com.cloud.usage.dao.UsageNetworkOfferingDaoImpl" />
+ <bean id="usagePortForwardingRuleDaoImpl" class="com.cloud.usage.dao.UsagePortForwardingRuleDaoImpl" />
+ <bean id="usageSecurityGroupDaoImpl" class="com.cloud.usage.dao.UsageSecurityGroupDaoImpl" />
+ <bean id="usageStorageDaoImpl" class="com.cloud.usage.dao.UsageStorageDaoImpl" />
+ <bean id="usageVMInstanceDaoImpl" class="com.cloud.usage.dao.UsageVMInstanceDaoImpl" />
+ <bean id="usageVPNUserDaoImpl" class="com.cloud.usage.dao.UsageVPNUserDaoImpl" />
+ <bean id="usageVolumeDaoImpl" class="com.cloud.usage.dao.UsageVolumeDaoImpl" />
+ <bean id="usageVmDiskDaoImpl" class="com.cloud.usage.dao.UsageVmDiskDaoImpl" />
+ <bean id="userAccountDaoImpl" class="com.cloud.user.dao.UserAccountDaoImpl" />
+ <bean id="userAccountJoinDaoImpl" class="com.cloud.api.query.dao.UserAccountJoinDaoImpl" />
+ <bean id="userIpv6AddressDaoImpl" class="com.cloud.network.dao.UserIpv6AddressDaoImpl" />
+ <bean id="userStatisticsDaoImpl" class="com.cloud.user.dao.UserStatisticsDaoImpl" />
+ <bean id="userStatsLogDaoImpl" class="com.cloud.user.dao.UserStatsLogDaoImpl" />
+ <bean id="userVmDiskStatsDaoImpl" class="com.cloud.user.dao.VmDiskStatisticsDaoImpl" />
+ <bean id="userVmCloneSettingDaoImpl" class="com.cloud.vm.dao.UserVmCloneSettingDaoImpl" />
+ <bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
+ <bean id="userVmDetailsDaoImpl" class="com.cloud.vm.dao.UserVmDetailsDaoImpl" />
+ <bean id="userVmJoinDaoImpl" class="com.cloud.api.query.dao.UserVmJoinDaoImpl" />
+ <bean id="vMComputeTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMComputeTagDaoImpl" />
+ <bean id="vMEntityDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMEntityDaoImpl" />
+ <bean id="vMInstanceDaoImpl" class="com.cloud.vm.dao.VMInstanceDaoImpl" />
+ <bean id="vMNetworkMapDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDaoImpl" />
+ <bean id="vMReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDaoImpl" />
+ <bean id="vMRootDiskTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMRootDiskTagDaoImpl" />
+ <bean id="vMSnapshotDaoImpl" class="com.cloud.vm.snapshot.dao.VMSnapshotDaoImpl" />
+ <bean id="vMTemplateDetailsDaoImpl" class="com.cloud.storage.dao.VMTemplateDetailsDaoImpl" />
+ <bean id="vMTemplateHostDaoImpl" class="com.cloud.storage.dao.VMTemplateHostDaoImpl" />
+ <bean id="vMTemplatePoolDaoImpl" class="com.cloud.storage.dao.VMTemplatePoolDaoImpl" />
+ <bean id="vMTemplateZoneDaoImpl" class="com.cloud.storage.dao.VMTemplateZoneDaoImpl" />
+ <bean id="virtualRouterProviderDaoImpl" class="com.cloud.network.dao.VirtualRouterProviderDaoImpl" />
+ <bean id="vmRulesetLogDaoImpl" class="com.cloud.network.security.dao.VmRulesetLogDaoImpl" />
+ <bean id="volumeDaoImpl" class="com.cloud.storage.dao.VolumeDaoImpl" />
+ <bean id="volumeDetailsDaoImpl" class="com.cloud.storage.dao.VolumeDetailsDaoImpl" />
+ <bean id="volumeHostDaoImpl" class="com.cloud.storage.dao.VolumeHostDaoImpl" />
+ <bean id="volumeJoinDaoImpl" class="com.cloud.api.query.dao.VolumeJoinDaoImpl" />
+ <bean id="volumeReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VolumeReservationDaoImpl" />
+ <bean id="vpcDaoImpl" class="com.cloud.network.vpc.dao.VpcDaoImpl" />
+ <bean id="vpcGatewayDaoImpl" class="com.cloud.network.vpc.dao.VpcGatewayDaoImpl" />
+ <bean id="vpcOfferingDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingDaoImpl" />
+ <bean id="vpcOfferingServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingServiceMapDaoImpl" />
+ <bean id="vpcServiceMapDaoImpl" class="com.cloud.network.vpc.dao.VpcServiceMapDaoImpl" />
+ <bean id="vpnUserDaoImpl" class="com.cloud.network.dao.VpnUserDaoImpl" />
+ <bean id="applicationLbRuleDaoImpl" class="org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDaoImpl" />
+ <bean id="networkOfferingDetailsDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingDetailsDaoImpl" />
+ <bean id="serviceOfferingDetailsDaoImpl" class="com.cloud.service.dao.ServiceOfferingDetailsDaoImpl"/>
+
+ <bean id="AffinityGroupDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDaoImpl" />
+ <bean id="AffinityGroupVMMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDaoImpl" />
+ <bean id="AffinityGroupDomainMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDomainMapDaoImpl" />
+
+ <bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker" />
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml
----------------------------------------------------------------------
diff --git a/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml b/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml
new file mode 100644
index 0000000..2a30887
--- /dev/null
+++ b/engine/schema/resources/META-INF/cloudstack/system/spring-engine-schema-system-checkers-context.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="databaseUpgradeChecker" class="com.cloud.upgrade.DatabaseUpgradeChecker" />
+
+ <bean id="versionDaoImpl" class="com.cloud.upgrade.dao.VersionDaoImpl" />
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index c107fa0..1afd056 100755
--- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -31,6 +31,7 @@ import java.util.List;
import java.util.TreeMap;
import javax.ejb.Local;
+import javax.inject.Inject;
import org.apache.log4j.Logger;
@@ -66,7 +67,6 @@ import com.cloud.upgrade.dao.Upgrade420to430;
import com.cloud.upgrade.dao.UpgradeSnapshot217to224;
import com.cloud.upgrade.dao.UpgradeSnapshot223to224;
import com.cloud.upgrade.dao.VersionDao;
-import com.cloud.upgrade.dao.VersionDaoImpl;
import com.cloud.upgrade.dao.VersionVO;
import com.cloud.upgrade.dao.VersionVO.Step;
import com.cloud.utils.component.SystemIntegrityChecker;
@@ -81,10 +81,10 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
protected HashMap<String, DbUpgrade[]> _upgradeMap = new HashMap<String, DbUpgrade[]>();
+ @Inject
VersionDao _dao;
public DatabaseUpgradeChecker() {
- _dao = new VersionDaoImpl();
_upgradeMap.put("2.1.7", new DbUpgrade[] {new Upgrade217to218(), new Upgrade218to22(), new Upgrade221to222(),
new UpgradeSnapshot217to224(), new Upgrade222to224(), new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(),
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml b/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml
new file mode 100644
index 0000000..7b8e2a4
--- /dev/null
+++ b/engine/storage/cache/resources/META-INF/cloudstack/core/spring-engine-storage-cache-core-context.xml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="storageCacheRandomAllocator"
+ class="org.apache.cloudstack.storage.cache.allocator.StorageCacheRandomAllocator" />
+ <bean id="storageCacheManagerImpl"
+ class="org.apache.cloudstack.storage.cache.manager.StorageCacheManagerImpl" />
+ <bean id="StorageCacheReplacementAlgorithm"
+ class="org.apache.cloudstack.storage.cache.manager.StorageCacheReplacementAlgorithmLRU" />
+
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml b/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml
new file mode 100644
index 0000000..822644e
--- /dev/null
+++ b/engine/storage/datamotion/resources/META-INF/cloudstack/core/spring-engine-storage-datamotion-core-context.xml
@@ -0,0 +1,45 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+ <bean id="ancientDataMotionStrategy"
+ class="org.apache.cloudstack.storage.motion.AncientDataMotionStrategy" />
+ <bean id="xenserverStorageMotionStrategy"
+ class="org.apache.cloudstack.storage.motion.XenServerStorageMotionStrategy" />
+
+ <bean id="dataMotionServiceImpl"
+ class="org.apache.cloudstack.storage.motion.DataMotionServiceImpl">
+ <property name="strategies">
+ <list>
+ <ref local="ancientDataMotionStrategy" />
+ <ref local="xenserverStorageMotionStrategy" />
+ </list>
+ </property>
+ </bean>
+
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml b/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
new file mode 100644
index 0000000..db517db
--- /dev/null
+++ b/engine/storage/image/resources/META-INF/cloudstack/core/spring-engine-storage-image-core-context.xml
@@ -0,0 +1,45 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="templateServiceImpl"
+ class="org.apache.cloudstack.storage.image.TemplateServiceImpl"
+ depends-on="dataObjectManagerImpl, dataStoreManagerImpl, dataMotionServiceImpl, objectInDataStoreManagerImpl, defaultEndPointSelector, templateDataFactoryImpl" />
+
+ <bean id="templateDataFactoryImpl"
+ class="org.apache.cloudstack.storage.image.TemplateDataFactoryImpl" />
+
+ <bean id="imageStoreHelper"
+ class="org.apache.cloudstack.storage.image.datastore.ImageStoreHelper" />
+ <bean id="imageFormatHelper"
+ class="org.apache.cloudstack.storage.image.format.ImageFormatHelper" />
+
+ <bean id="imageStoreProviderMgr"
+ class="org.apache.cloudstack.storage.image.manager.ImageStoreProviderManagerImpl" />
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml b/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
new file mode 100644
index 0000000..29f4fcd
--- /dev/null
+++ b/engine/storage/resources/META-INF/cloudstack/core/spring-engine-storage-core-context.xml
@@ -0,0 +1,63 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <!--Image formats-->
+ <bean id="ISO" class="org.apache.cloudstack.storage.image.format.ISO" />
+ <bean id="OVA" class="org.apache.cloudstack.storage.image.format.OVA" />
+ <bean id="QCOW2" class="org.apache.cloudstack.storage.image.format.QCOW2" />
+ <bean id="VHD" class="org.apache.cloudstack.storage.image.format.VHD" />
+ <bean id="VHDX" class="org.apache.cloudstack.storage.image.format.VHDX" />
+ <bean id="unknown" class="org.apache.cloudstack.storage.image.format.Unknown" />
+ <bean id="BAREMETAL" class="org.apache.cloudstack.storage.image.format.BAREMETAL" />
+
+
+ <bean id="objectInDataStoreManagerImpl"
+ class="org.apache.cloudstack.storage.datastore.ObjectInDataStoreManagerImpl" />
+
+ <bean id="dataObjectManagerImpl"
+ class="org.apache.cloudstack.storage.datastore.DataObjectManagerImpl" />
+
+ <bean id="defaultEndPointSelector"
+ class="org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector" />
+
+ <bean id="dataStoreManagerImpl"
+ class="org.apache.cloudstack.storage.datastore.DataStoreManagerImpl"
+ depends-on="dataStoreProviderManager">
+ <property name="primaryStoreMgr" ref="primaryDataStoreProviderMgr" />
+ <property name="imageDataStoreMgr" ref="imageStoreProviderMgr" />
+ </bean>
+
+ <bean id="dataStoreProviderManager"
+ class="org.apache.cloudstack.storage.datastore.provider.DataStoreProviderManagerImpl">
+ <property name="providers">
+ <list />
+ </property>
+ </bean>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties
----------------------------------------------------------------------
diff --git a/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties b/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties
new file mode 100644
index 0000000..7a1cd0e
--- /dev/null
+++ b/engine/storage/resources/META-INF/cloudstack/storage-allocator/module.properties
@@ -0,0 +1,2 @@
+name=storage-allocator
+parent=storage
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml b/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml
new file mode 100644
index 0000000..e4e02aa
--- /dev/null
+++ b/engine/storage/resources/META-INF/cloudstack/storage-allocator/spring-engine-storage-storage-allocator-context.xml
@@ -0,0 +1,49 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="LocalStoragePoolAllocator"
+ class="org.apache.cloudstack.storage.allocator.LocalStoragePoolAllocator">
+ <property name="name" value="LocalStorage" />
+ </bean>
+
+ <bean id="clusterScopeStoragePoolAllocator"
+ class="org.apache.cloudstack.storage.allocator.ClusterScopeStoragePoolAllocator" />
+ <bean id="zoneWideStoragePoolAllocator"
+ class="org.apache.cloudstack.storage.allocator.ZoneWideStoragePoolAllocator" />
+ <bean id="garbageCollectingStoragePoolAllocator"
+ class="org.apache.cloudstack.storage.allocator.GarbageCollectingStoragePoolAllocator">
+ <property name="name" value="GCStorage" />
+ </bean>
+
+ <bean id="UserConcentratedAllocator"
+ class="com.cloud.agent.manager.allocator.impl.UserConcentratedAllocator">
+ <property name="name" value="UserFirst" />
+ </bean>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml b/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml
new file mode 100644
index 0000000..c9c89e3
--- /dev/null
+++ b/engine/storage/snapshot/resources/META-INF/cloudstack/core/spring-engine-storage-snapshot-core-context.xml
@@ -0,0 +1,44 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="snapshotServiceImpl"
+ class="org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl"
+ depends-on="snapshotStateMachineManagerImpl, snapshotDataFactoryImpl, dataStoreManagerImpl, dataMotionServiceImpl, objectInDataStoreManagerImpl" />
+
+ <bean id="xenserverSnapshotStrategy"
+ class="org.apache.cloudstack.storage.snapshot.XenserverSnapshotStrategy" />
+
+ <bean id="snapshotDataFactoryImpl"
+ class="org.apache.cloudstack.storage.snapshot.SnapshotDataFactoryImpl"
+ depends-on="dataStoreManagerImpl, snapshotDataStoreDaoImpl, volumeDataFactoryImpl" />
+
+ <bean id="snapshotStateMachineManagerImpl"
+ class="org.apache.cloudstack.storage.snapshot.SnapshotStateMachineManagerImpl" />
+
+</beans>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
index 92b4e7a..c5d904b 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
@@ -20,6 +20,8 @@ package org.apache.cloudstack.storage.datastore.provider;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.utils.component.ManagerBase;
+import com.cloud.utils.component.Registry;
+
import org.apache.cloudstack.api.response.StorageProviderResponse;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider.DataStoreProviderType;
@@ -33,18 +35,22 @@ import org.springframework.stereotype.Component;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
@Component
-public class DataStoreProviderManagerImpl extends ManagerBase implements DataStoreProviderManager {
+public class DataStoreProviderManagerImpl extends ManagerBase implements DataStoreProviderManager, Registry<DataStoreProvider> {
private static final Logger s_logger = Logger.getLogger(DataStoreProviderManagerImpl.class);
- @Inject
+
List<DataStoreProvider> providers;
- protected Map<String, DataStoreProvider> providerMap = new HashMap<String, DataStoreProvider>();
+ protected Map<String, DataStoreProvider> providerMap = new ConcurrentHashMap<String, DataStoreProvider>();
@Inject
PrimaryDataStoreProviderManager primaryDataStoreProviderMgr;
@Inject
@@ -96,43 +102,54 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
- Map<String, Object> copyParams = new HashMap<String, Object>(params);
- for (DataStoreProvider provider : providers) {
- String providerName = provider.getName();
- if (providerMap.get(providerName) != null) {
- s_logger.debug("Failed to register data store provider, provider name: " + providerName
- + " is not unique");
- return false;
+ if ( providers != null ) {
+ for (DataStoreProvider provider : providers) {
+ registerProvider(provider);
}
+ }
+
+ providers = new CopyOnWriteArrayList<DataStoreProvider>(providers);
+
+ return true;
+ }
+
+ protected boolean registerProvider(DataStoreProvider provider) {
+ Map<String, Object> copyParams = new HashMap<String, Object>();
+
+ String providerName = provider.getName();
+ if (providerMap.get(providerName) != null) {
+ s_logger.debug("Did not register data store provider, provider name: " + providerName
+ + " is not unique");
+ return false;
+ }
- s_logger.debug("registering data store provider:" + provider.getName());
-
- providerMap.put(providerName, provider);
- try {
- boolean registrationResult = provider.configure(copyParams);
- if (!registrationResult) {
- providerMap.remove(providerName);
- s_logger.debug("Failed to register data store provider: " + providerName);
- return false;
- }
-
- Set<DataStoreProviderType> types = provider.getTypes();
- if (types.contains(DataStoreProviderType.PRIMARY)) {
- primaryDataStoreProviderMgr.registerDriver(provider.getName(),
- (PrimaryDataStoreDriver) provider.getDataStoreDriver());
- primaryDataStoreProviderMgr.registerHostListener(provider.getName(), provider.getHostListener());
- } else if (types.contains(DataStoreProviderType.IMAGE)) {
- imageStoreProviderMgr.registerDriver(provider.getName(),
- (ImageStoreDriver) provider.getDataStoreDriver());
- }
- } catch (Exception e) {
- s_logger.debug("configure provider failed", e);
+ s_logger.debug("registering data store provider:" + provider.getName());
+
+ providerMap.put(providerName, provider);
+ try {
+ boolean registrationResult = provider.configure(copyParams);
+ if (!registrationResult) {
providerMap.remove(providerName);
+ s_logger.debug("Failed to register data store provider: " + providerName);
return false;
}
- }
+ Set<DataStoreProviderType> types = provider.getTypes();
+ if (types.contains(DataStoreProviderType.PRIMARY)) {
+ primaryDataStoreProviderMgr.registerDriver(provider.getName(),
+ (PrimaryDataStoreDriver) provider.getDataStoreDriver());
+ primaryDataStoreProviderMgr.registerHostListener(provider.getName(), provider.getHostListener());
+ } else if (types.contains(DataStoreProviderType.IMAGE)) {
+ imageStoreProviderMgr.registerDriver(provider.getName(),
+ (ImageStoreDriver) provider.getDataStoreDriver());
+ }
+ } catch (Exception e) {
+ s_logger.debug("configure provider failed", e);
+ providerMap.remove(providerName);
+ return false;
+ }
+
return true;
}
@@ -167,6 +184,27 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
}
}
+ @Override
+ public boolean register(DataStoreProvider type) {
+ if ( registerProvider(type) ) {
+ providers.add(type);
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public void unregister(DataStoreProvider type) {
+ /* Sorry, no unregister supported... */
+ }
+
+ @Override
+ public List<DataStoreProvider> getRegistered() {
+ return Collections.unmodifiableList(providers);
+ }
+
+ @Inject
public void setProviders(List<DataStoreProvider> providers) {
this.providers = providers;
}
@@ -178,4 +216,9 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
public void setImageStoreProviderMgr(ImageStoreProviderManager imageDataStoreProviderMgr) {
this.imageStoreProviderMgr = imageDataStoreProviderMgr;
}
+
+ public List<DataStoreProvider> getProviders() {
+ return providers;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml
----------------------------------------------------------------------
diff --git a/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml b/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml
new file mode 100644
index 0000000..ba9afb5
--- /dev/null
+++ b/engine/storage/volume/resources/META-INF/cloudstack/core/spring-engine-storage-volume-core-context.xml
@@ -0,0 +1,49 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <!--Filesystem types -->
+ <bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />
+ <bean id="networkFileSystem"
+ class="org.apache.cloudstack.storage.datastore.type.NetworkFileSystem" />
+
+ <bean id="volumeServiceImpl"
+ class="org.apache.cloudstack.storage.volume.VolumeServiceImpl"
+ depends-on="snapshotManagerImpl, dataMotionServiceImpl" />
+
+ <bean id="volumeDataFactoryImpl"
+ class="org.apache.cloudstack.storage.volume.VolumeDataFactoryImpl" />
+
+
+ <bean id="primaryDataStoreHelper"
+ class="org.apache.cloudstack.storage.volume.datastore.PrimaryDataStoreHelper" />
+
+ <bean id="primaryDataStoreProviderMgr"
+ class="org.apache.cloudstack.storage.datastore.manager.PrimaryDataStoreProviderManagerImpl" />
+
+</beans>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml
----------------------------------------------------------------------
diff --git a/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml b/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml
new file mode 100644
index 0000000..13353b0
--- /dev/null
+++ b/framework/cluster/resources/META-INF/cloudstack/core/spring-framework-cluster-core-context.xml
@@ -0,0 +1,36 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="clusterServiceServletAdapter" class="com.cloud.cluster.ClusterServiceServletAdapter" />
+
+ <bean id="clusterManagerImpl" class="com.cloud.cluster.ClusterManagerImpl" />
+
+ <bean id="clusterFenceManagerImpl" class="com.cloud.cluster.ClusterFenceManagerImpl" />
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml
new file mode 100644
index 0000000..c887531
--- /dev/null
+++ b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context-inheritable.xml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle" >
+ <property name="registry" ref="scopedConfigStorageRegistry" />
+ <property name="typeClass" value="org.apache.cloudstack.framework.config.ScopedConfigStorage" />
+ </bean>
+
+ <bean class="org.apache.cloudstack.spring.lifecycle.ConfigDepotLifeCycle" />
+
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml
----------------------------------------------------------------------
diff --git a/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml
new file mode 100644
index 0000000..8d75d27
--- /dev/null
+++ b/framework/config/resources/META-INF/cloudstack/bootstrap/spring-framework-config-bootstrap-context.xml
@@ -0,0 +1,51 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="configurationDaoImpl"
+ class="org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl">
+ <property name="configParams">
+ <map>
+ <entry key="premium" value="${premium}" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="configDepot"
+ class="org.apache.cloudstack.framework.config.impl.ConfigDepotImpl">
+ <property name="scopedStorages"
+ value="#{scopedConfigStorageRegistry.registered}" />
+ <property name="configurables">
+ <list />
+ </property>
+ </bean>
+
+ <bean id="scopedConfigStorageRegistry"
+ class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry" />
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java b/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
index b4d3773..b7fe125 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/ConfigDepotAdmin.java
@@ -31,6 +31,8 @@ public interface ConfigDepotAdmin {
* @see Configuration
*/
void populateConfigurations();
+
+ void populateConfiguration(Configurable configurable);
List<String> getComponentsInDepot();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
index e402988..43e2cec 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.annotation.PostConstruct;
import javax.ejb.Local;
import javax.naming.ConfigurationException;
@@ -128,6 +129,14 @@ public class ConfigurationDaoImpl extends GenericDaoBase<ConfigurationVO, String
return true;
}
+ @PostConstruct
+ public void init() throws ConfigurationException {
+ /* This bean is loaded in bootstrap and beans
+ * in bootstrap don't go through the CloudStackExtendedLifeCycle
+ */
+ configure(getName(), getConfigParams());
+ }
+
//Use update method with category instead
@Override
@Deprecated
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
----------------------------------------------------------------------
diff --git a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
index 11281bf..254e6d2 100644
--- a/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
+++ b/framework/config/src/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
@@ -17,14 +17,16 @@
package org.apache.cloudstack.framework.config.impl;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
-import org.apache.log4j.Logger;
import org.apache.cloudstack.framework.config.ConfigDepot;
import org.apache.cloudstack.framework.config.ConfigDepotAdmin;
import org.apache.cloudstack.framework.config.ConfigKey;
@@ -32,9 +34,9 @@ import org.apache.cloudstack.framework.config.Configurable;
import org.apache.cloudstack.framework.config.ScopedConfigStorage;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.commons.lang.ObjectUtils;
+import org.apache.log4j.Logger;
import com.cloud.utils.Pair;
-import com.cloud.utils.component.SystemIntegrityChecker;
import com.cloud.utils.exception.CloudRuntimeException;
/**
@@ -64,14 +66,13 @@ import com.cloud.utils.exception.CloudRuntimeException;
* when constructing a ConfigKey then configuration server should use the
* validation class to validate the value the admin input for the key.
*/
-public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin, SystemIntegrityChecker {
+public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin {
private final static Logger s_logger = Logger.getLogger(ConfigDepotImpl.class);
@Inject
ConfigurationDao _configDao;
- @Inject
List<Configurable> _configurables;
- @Inject
List<ScopedConfigStorage> _scopedStorages;
+ Set<Configurable> _configured = Collections.synchronizedSet(new HashSet<Configurable>());
HashMap<String, Pair<String, ConfigKey<?>>> _allKeys = new HashMap<String, Pair<String, ConfigKey<?>>>(1007);
@@ -85,50 +86,58 @@ public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin, SystemInt
return value != null ? value.second() : null;
}
+ @PostConstruct
@Override
public void populateConfigurations() {
Date date = new Date();
for (Configurable configurable : _configurables) {
- for (ConfigKey<?> key : configurable.getConfigKeys()) {
- ConfigurationVO vo = _configDao.findById(key.key());
- if (vo == null) {
- vo = new ConfigurationVO(configurable.getConfigComponentName(), key);
+ populateConfiguration(date, configurable);
+ }
+ }
+
+ protected void populateConfiguration(Date date, Configurable configurable) {
+ if ( _configured.contains(configurable) )
+ return;
+
+ s_logger.debug("Retrieving keys from " + configurable.getClass().getSimpleName());
+
+ for (ConfigKey<?> key : configurable.getConfigKeys()) {
+ Pair<String, ConfigKey<?>> previous = _allKeys.get(key.key());
+ if (previous != null && !previous.first().equals(configurable.getConfigComponentName())) {
+ throw new CloudRuntimeException("Configurable " + configurable.getConfigComponentName() + " is adding a key that has been added before by " + previous.first() +
+ ": " + key.toString());
+ }
+ _allKeys.put(key.key(), new Pair<String, ConfigKey<?>>(configurable.getConfigComponentName(), key));
+
+ ConfigurationVO vo = _configDao.findById(key.key());
+ if (vo == null) {
+ vo = new ConfigurationVO(configurable.getConfigComponentName(), key);
+ vo.setUpdated(date);
+ _configDao.persist(vo);
+ } else {
+ if (vo.isDynamic() != key.isDynamic() ||
+ !ObjectUtils.equals(vo.getDescription(), key.description()) ||
+ !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())) {
+ vo.setDynamic(key.isDynamic());
+ vo.setDescription(key.description());
+ vo.setDefaultValue(key.defaultValue());
vo.setUpdated(date);
_configDao.persist(vo);
- } else {
- if (vo.isDynamic() != key.isDynamic() ||
- !ObjectUtils.equals(vo.getDescription(), key.description()) ||
- !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())) {
- vo.setDynamic(key.isDynamic());
- vo.setDescription(key.description());
- vo.setDefaultValue(key.defaultValue());
- vo.setUpdated(date);
- _configDao.persist(vo);
- }
}
}
}
+
+ _configured.add(configurable);
}
@Override
- public List<String> getComponentsInDepot() {
- return new ArrayList<String>();
+ public void populateConfiguration(Configurable configurable) {
+ populateConfiguration(new Date(), configurable);
}
-
+
@Override
- @PostConstruct
- public void check() {
- for (Configurable configurable : _configurables) {
- s_logger.debug("Retrieving keys from " + configurable.getClass().getSimpleName());
- for (ConfigKey<?> key : configurable.getConfigKeys()) {
- Pair<String, ConfigKey<?>> previous = _allKeys.get(key.key());
- if (previous != null && !previous.first().equals(configurable.getConfigComponentName())) {
- throw new CloudRuntimeException("Configurable " + configurable.getConfigComponentName() + " is adding a key that has been added before by " + previous.first() +
- ": " + key.toString());
- }
- _allKeys.put(key.key(), new Pair<String, ConfigKey<?>>(configurable.getConfigComponentName(), key));
- }
- }
+ public List<String> getComponentsInDepot() {
+ return new ArrayList<String>();
}
public ConfigurationDao global() {
@@ -144,4 +153,23 @@ public class ConfigDepotImpl implements ConfigDepot, ConfigDepotAdmin, SystemInt
throw new CloudRuntimeException("Unable to find config storage for this scope: " + config.scope() + " for " + config.key());
}
+
+ public List<ScopedConfigStorage> getScopedStorages() {
+ return _scopedStorages;
+ }
+
+ @Inject
+ public void setScopedStorages(List<ScopedConfigStorage> scopedStorages) {
+ this._scopedStorages = scopedStorages;
+ }
+
+ public List<Configurable> getConfigurables() {
+ return _configurables;
+ }
+
+ @Inject
+ public void setConfigurables(List<Configurable> configurables) {
+ this._configurables = configurables;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
----------------------------------------------------------------------
diff --git a/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java b/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
index 1c5fbe5..5a7f176 100644
--- a/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
+++ b/framework/config/test/org/apache/cloudstack/framework/config/impl/ConfigDepotAdminTest.java
@@ -95,6 +95,7 @@ public class ConfigDepotAdminTest extends TestCase {
verify(_configDao, times(1)).persist(any(ConfigurationVO.class));
when(_configDao.findById(DynamicIntCK.key())).thenReturn(dynamicIntCV);
+ _depotAdmin._configured.clear();
_depotAdmin.populateConfigurations();
// This is two because DynamicIntCK also returns null.
verify(_configDao, times(2)).persist(any(ConfigurationVO.class));
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml
----------------------------------------------------------------------
diff --git a/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml b/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml
new file mode 100644
index 0000000..651b874
--- /dev/null
+++ b/framework/db/resources/META-INF/cloudstack/system/spring-framework-db-system-context.xml
@@ -0,0 +1,32 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="entityManagerImpl" class="com.cloud.dao.EntityManagerImpl" />
+
+</beans>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/src/com/cloud/utils/db/Transaction.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/Transaction.java b/framework/db/src/com/cloud/utils/db/Transaction.java
index a5da4b3..60baf9e 100755
--- a/framework/db/src/com/cloud/utils/db/Transaction.java
+++ b/framework/db/src/com/cloud/utils/db/Transaction.java
@@ -138,7 +138,9 @@ public class Transaction {
// the existing DAO features
//
public void transitToUserManagedConnection(Connection conn) {
- assert(_conn == null /*&& _stack.size() <= 1*/) : "Can't change to a user managed connection unless the stack is empty and the db connection is null, you may have forgotten to invoke transitToAutoManagedConnection to close out the DB connection: " + toString();
+ if ( _conn != null )
+ throw new IllegalStateException("Can't change to a user managed connection unless the db connection is null");
+
_conn = conn;
_dbId = CONNECTED_DB;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java b/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java
new file mode 100644
index 0000000..9dbbbe1
--- /dev/null
+++ b/framework/db/src/com/cloud/utils/db/TransactionContextInterceptor.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.utils.db;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+
+public class TransactionContextInterceptor implements MethodInterceptor {
+
+ public TransactionContextInterceptor() {
+
+ }
+ @Override
+ public Object invoke(MethodInvocation m) throws Throwable {
+ Transaction txn = Transaction.open(m.getMethod().getName());
+ try {
+ return m.proceed();
+ } finally {
+ txn.close();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/db/src/com/cloud/utils/db/TransactionContextListener.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/TransactionContextListener.java b/framework/db/src/com/cloud/utils/db/TransactionContextListener.java
new file mode 100644
index 0000000..30e9e02
--- /dev/null
+++ b/framework/db/src/com/cloud/utils/db/TransactionContextListener.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.cloud.utils.db;
+
+import org.apache.cloudstack.managed.context.ManagedContextListener;
+
+public class TransactionContextListener implements ManagedContextListener<Transaction> {
+
+ @Override
+ public Transaction onEnterContext(boolean reentry) {
+ if ( ! reentry ) {
+ return Transaction.open(Thread.currentThread().getName());
+ }
+
+ return null;
+ }
+
+ @Override
+ public void onLeaveContext(Transaction data, boolean reentry) {
+ if ( ! reentry ) {
+ data.close();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml
----------------------------------------------------------------------
diff --git a/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml b/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml
new file mode 100644
index 0000000..effa23e
--- /dev/null
+++ b/framework/ipc/resources/META-INF/cloudstack/core/spring-framework-ipc-core-context.xml
@@ -0,0 +1,59 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <!--
+ RPC/Async/EventBus
+ -->
+ <bean id="onwireRegistry" class="org.apache.cloudstack.framework.serializer.OnwireClassRegistry"
+ init-method="scan" >
+ <property name="packages">
+ <list>
+ <value>org.apache.cloudstack.framework</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="messageSerializer" class="org.apache.cloudstack.framework.serializer.JsonMessageSerializer">
+ <property name="onwireClassRegistry" ref="onwireRegistry" />
+ </bean>
+
+ <bean id="transportProvider" class="org.apache.cloudstack.framework.server.ServerTransportProvider" init-method="initialize">
+ <property name="workerPoolSize" value="5" />
+ <property name="nodeId" value="Node1" />
+ <property name="messageSerializer" ref="messageSerializer" />
+ </bean>
+
+ <bean id="rpcProvider" class="org.apache.cloudstack.framework.rpc.RpcProviderImpl" init-method="initialize">
+ <constructor-arg ref="transportProvider" />
+ <property name="messageSerializer" ref="messageSerializer" />
+ </bean>
+
+ <bean id="messageBus" class = "org.apache.cloudstack.framework.messagebus.MessageBusBase" />
+
+</beans>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67186429/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml
----------------------------------------------------------------------
diff --git a/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml b/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml
new file mode 100644
index 0000000..85cad02
--- /dev/null
+++ b/framework/jobs/resources/META-INF/cloudstack/core/spring-framework-jobs-core-context.xml
@@ -0,0 +1,48 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ >
+
+ <bean id="asyncJobDaoImpl"
+ class="org.apache.cloudstack.framework.jobs.dao.AsyncJobDaoImpl" />
+ <bean id="asyncJobJournalDaoImpl"
+ class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDaoImpl" />
+ <bean id="asyncJobJoinMapDaoImpl"
+ class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDaoImpl" />
+ <bean id="asyncJobManagerImpl"
+ class="org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl" />
+ <bean id="asyncJobMonitor"
+ class="org.apache.cloudstack.framework.jobs.impl.AsyncJobMonitor" />
+ <bean id="syncQueueDaoImpl"
+ class="org.apache.cloudstack.framework.jobs.dao.SyncQueueDaoImpl" />
+ <bean id="syncQueueItemDaoImpl"
+ class="org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDaoImpl" />
+ <bean id="syncQueueManagerImpl"
+ class="org.apache.cloudstack.framework.jobs.impl.SyncQueueManagerImpl" />
+
+
+</beans>