diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in index 6cec8b38223..608ffc43356 100644 --- a/client/tomcatconf/applicationContext.xml.in +++ b/client/tomcatconf/applicationContext.xml.in @@ -32,8 +32,6 @@ - - @@ -91,9 +89,6 @@ - - - @@ -165,5 +160,586 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in index f67dbb703f8..609155ca796 100644 --- a/client/tomcatconf/componentContext.xml.in +++ b/client/tomcatconf/componentContext.xml.in @@ -30,290 +30,172 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - - - diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in index 531b3b92926..948ef24a5dd 100644 --- a/client/tomcatconf/nonossComponentContext.xml.in +++ b/client/tomcatconf/nonossComponentContext.xml.in @@ -33,294 +33,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -330,4 +48,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java index 66a24ac0e43..31fc43c4477 100755 --- a/server/src/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/com/cloud/deploy/FirstFitPlanner.java @@ -100,12 +100,24 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner { @Inject protected AccountManager _accountMgr; @Inject protected StorageManager _storageMgr; - //@com.cloud.utils.component.Inject(adapter=StoragePoolAllocator.class) - @Inject protected List _storagePoolAllocators; + protected List _storagePoolAllocators; + public List getStoragePoolAllocators() { + return _storagePoolAllocators; + } + public void setStoragePoolAllocators( + List _storagePoolAllocators) { + this._storagePoolAllocators = _storagePoolAllocators; + } - //@com.cloud.utils.component.Inject(adapter=HostAllocator.class) - @Inject protected List _hostAllocators; - protected String _allocationAlgorithm = "random"; + protected List _hostAllocators; + public List getHostAllocators() { + return _hostAllocators; + } + public void setHostAllocators(List _hostAllocators) { + this._hostAllocators = _hostAllocators; + } + + protected String _allocationAlgorithm = "random"; @Override diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java index eb27fda1fe8..d8b8da1e5f7 100755 --- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -116,11 +116,23 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai ClusterDetailsDao _clusterDetailsDao; long _serverId; - @Inject List _investigators; - @Inject - List _fenceBuilders; - @Inject + public List getInvestigators() { + return _investigators; + } + public void setInvestigators(List _investigators) { + this._investigators = _investigators; + } + + List _fenceBuilders; + public List getFenceBuilders() { + return _fenceBuilders; + } + public void setFenceBuilders(List _fenceBuilders) { + this._fenceBuilders = _fenceBuilders; + } + + @Inject AgentManager _agentMgr; @Inject AlertManager _alertMgr; diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index bdc5577aaee..16694304dab 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -193,16 +193,41 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Inject PodVlanMapDao _podVlanMapDao; - @Inject List _networkGurus; + public List getNetworkGurus() { + return _networkGurus; + } + public void setNetworkGurus(List _networkGurus) { + this._networkGurus = _networkGurus; + } - @Inject protected List _networkElements; + List _networkElements; + public List getNetworkElements() { + return _networkElements; + } + public void setNetworkElements(List _networkElements) { + this._networkElements = _networkElements; + } - @Inject NetworkDomainDao _networkDomainDao; - @Inject List _ipDeployers; - @Inject List _dhcpProviders; - - @Inject + @Inject NetworkDomainDao _networkDomainDao; + + List _ipDeployers; + public List getIpDeployers() { + return _ipDeployers; + } + public void setIpDeployers(List _ipDeployers) { + this._ipDeployers = _ipDeployers; + } + + List _dhcpProviders; + public List getDhcpProviders() { + return _dhcpProviders; + } + public void setDhcpProviders(List _dhcpProviders) { + this._dhcpProviders = _dhcpProviders; + } + + @Inject VMInstanceDao _vmDao; @Inject FirewallManager _firewallMgr; diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java index 3c7329fd6da..e3759ca38f1 100644 --- a/server/src/com/cloud/network/NetworkModelImpl.java +++ b/server/src/com/cloud/network/NetworkModelImpl.java @@ -143,9 +143,15 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel { @Inject PodVlanMapDao _podVlanMapDao; - @Inject List _networkElements; - - @Inject + List _networkElements; + public List getNetworkElements() { + return _networkElements; + } + public void setNetworkElements(List _networkElements) { + this._networkElements = _networkElements; + } + + @Inject NetworkDomainDao _networkDomainDao; @Inject VMInstanceDao _vmDao; diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index 79ccdb30198..bd454cbb7f2 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -211,19 +211,29 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager, protected HighAvailabilityManager _haMgr; @Inject protected StorageService _storageSvr; - // @com.cloud.utils.component.Inject(adapter = Discoverer.class) + + protected List _discoverers; + public List getDiscoverers() { + return _discoverers; + } + public void setDiscoverers(List _discoverers) { + this._discoverers = _discoverers; + } + @Inject - protected List _discoverers; - @Inject protected ClusterManager _clusterMgr; @Inject protected StoragePoolHostDao _storagePoolHostDao; - // @com.cloud.utils.component.Inject(adapter = PodAllocator.class) - @Inject - protected List _podAllocators = null; + protected List _podAllocators; + public List getPodAllocators() { + return _podAllocators; + } + public void setPodAllocators(List _podAllocators) { + this._podAllocators = _podAllocators; + } - @Inject + @Inject protected VMTemplateDao _templateDao; @Inject protected ConfigurationManager _configMgr; diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index f03f5b8e41c..3a57b2fd5b8 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -106,6 +106,7 @@ import org.apache.cloudstack.api.command.user.zone.*; import org.apache.cloudstack.api.response.ExtractResponse; import org.apache.commons.codec.binary.Base64; import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; import com.cloud.agent.AgentManager; import com.cloud.agent.api.GetVncPortAnswer; @@ -233,8 +234,10 @@ import com.cloud.utils.EnumUtils; import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; import com.cloud.utils.PasswordGenerator; +import com.cloud.utils.ReflectUtil; import com.cloud.utils.Ternary; import com.cloud.utils.component.Adapter; +import com.cloud.utils.component.AdapterBase; import com.cloud.utils.component.ComponentContext; import com.cloud.utils.component.ComponentLifecycle; import com.cloud.utils.component.Manager; @@ -370,9 +373,9 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe @Inject private HypervisorCapabilitiesDao _hypervisorCapabilitiesDao; - @Inject private List _hostAllocators; - @Inject + + @Inject private ConfigurationManager _configMgr; @Inject private ResourceTagDao _resourceTagDao; @@ -391,13 +394,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe @Inject S3Manager _s3Mgr; -/* - @Inject - ComponentContext _forceContextRef; // create a dependency to ComponentContext so that it can be loaded beforehead - - @Inject - EventUtils _forceEventUtilsRef; -*/ private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("EventChecker")); private KeystoreManager _ksMgr; @@ -405,7 +401,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe private Map _availableIdsMap; - @Inject List _userAuthenticators; + List _userAuthenticators; @Inject ClusterManager _clusterMgr; private String _hashKey = null; @@ -413,6 +409,22 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe public ManagementServerImpl() { setRunLevel(ComponentLifecycle.RUN_LEVEL_APPLICATION_MAINLOOP); } + + public List getUserAuthenticators() { + return _userAuthenticators; + } + + public void setUserAuthenticators(List authenticators) { + _userAuthenticators = authenticators; + } + + public List getHostAllocators() { + return _hostAllocators; + } + + public void setHostAllocators(List _hostAllocators) { + this._hostAllocators = _hostAllocators; + } @Override public boolean configure(String name, Map params) @@ -437,7 +449,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe return true; } - @Override + @Override public boolean start() { s_logger.info("Startup CloudStack management server..."); diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 05e0cfe9869..624361fbc90 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -260,17 +260,28 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C protected DownloadMonitor _downloadMonitor; @Inject protected ResourceTagDao _resourceTagDao; - @Inject + protected List _storagePoolAllocators; - @Inject ConfigurationDao _configDao; + public List getStoragePoolAllocators() { + return _storagePoolAllocators; + } + public void setStoragePoolAllocators( + List _storagePoolAllocators) { + this._storagePoolAllocators = _storagePoolAllocators; + } + + @Inject ConfigurationDao _configDao; @Inject ManagementServer _msServer; - // TODO : we don't have any instantiated pool discover, disable injection temporarily - // @Inject protected List _discoverers; + public List getDiscoverers() { + return _discoverers; + } + public void setDiscoverers(List _discoverers) { + this._discoverers = _discoverers; + } - - protected SearchBuilder HostTemplateStatesSearch; + protected SearchBuilder HostTemplateStatesSearch; protected GenericSearchBuilder UpHostsInPoolSearch; protected SearchBuilder StoragePoolSearch; protected SearchBuilder LocalStorageSearch; diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index ca4465d36e3..f46db0e860b 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -222,7 +222,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M @Inject private AutoScaleManager _autoscaleMgr; - @Inject private List _userAuthenticators; private final ScheduledExecutorService _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("AccountChecker")); @@ -232,10 +231,26 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M UserVO _systemUser; AccountVO _systemAccount; - @Inject List _securityCheckers; - int _cleanupInterval; + + int _cleanupInterval; + public List getUserAuthenticators() { + return _userAuthenticators; + } + + public void setUserAuthenticators(List authenticators) { + _userAuthenticators = authenticators; + } + + public List getSecurityCheckers() { + return _securityCheckers; + } + + public void setSecurityCheckers(List securityCheckers) { + this._securityCheckers = securityCheckers; + } + @Override public boolean configure(final String name, final Map params) throws ConfigurationException { _systemAccount = _accountDao.findById(AccountVO.ACCOUNT_ID_SYSTEM); diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index c22adfb9d56..47ed6220a45 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -228,13 +228,23 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac @Inject protected NetworkDao _networkDao; - @Inject protected List _planners; + public List getPlanners() { + return _planners; + } + public void setPlanners(List _planners) { + this._planners = _planners; + } - @Inject protected List _hostAllocators; + public List getHostAllocators() { + return _hostAllocators; + } + public void setHostAllocators(List _hostAllocators) { + this._hostAllocators = _hostAllocators; + } - @Inject + @Inject protected ResourceManager _resourceMgr; @Inject