Skip to content

Commit 6aaa4f6

Browse files
kelvenychipchilders
authored andcommitted
CLOUDSTACK-1276, CLOUDSTACK-1729: Remove autoscanning, ensure adpater execution order in runtime
1 parent 8a35898 commit 6aaa4f6

12 files changed

Lines changed: 1117 additions & 577 deletions

‎client/tomcatconf/applicationContext.xml.in‎

Lines changed: 581 additions & 5 deletions
Large diffs are not rendered by default.

‎client/tomcatconf/componentContext.xml.in‎

Lines changed: 152 additions & 270 deletions
Large diffs are not rendered by default.

‎client/tomcatconf/nonossComponentContext.xml.in‎

Lines changed: 219 additions & 250 deletions
Large diffs are not rendered by default.

‎server/src/com/cloud/deploy/FirstFitPlanner.java‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,24 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
100100
@Inject protected AccountManager _accountMgr;
101101
@Inject protected StorageManager _storageMgr;
102102

103-
//@com.cloud.utils.component.Inject(adapter=StoragePoolAllocator.class)
104-
@Inject protected List<StoragePoolAllocator> _storagePoolAllocators;
105-
106-
//@com.cloud.utils.component.Inject(adapter=HostAllocator.class)
107-
@Inject protected List<HostAllocator> _hostAllocators;
108-
protected String _allocationAlgorithm = "random";
103+
protected List<StoragePoolAllocator> _storagePoolAllocators;
104+
public List<StoragePoolAllocator> getStoragePoolAllocators() {
105+
return _storagePoolAllocators;
106+
}
107+
public void setStoragePoolAllocators(
108+
List<StoragePoolAllocator> _storagePoolAllocators) {
109+
this._storagePoolAllocators = _storagePoolAllocators;
110+
}
111+
112+
protected List<HostAllocator> _hostAllocators;
113+
public List<HostAllocator> getHostAllocators() {
114+
return _hostAllocators;
115+
}
116+
public void setHostAllocators(List<HostAllocator> _hostAllocators) {
117+
this._hostAllocators = _hostAllocators;
118+
}
119+
120+
protected String _allocationAlgorithm = "random";
109121

110122

111123
@Override

‎server/src/com/cloud/ha/HighAvailabilityManagerImpl.java‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,23 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
116116
ClusterDetailsDao _clusterDetailsDao;
117117
long _serverId;
118118

119-
@Inject
120119
List<Investigator> _investigators;
121-
@Inject
122-
List<FenceBuilder> _fenceBuilders;
123-
@Inject
120+
public List<Investigator> getInvestigators() {
121+
return _investigators;
122+
}
123+
public void setInvestigators(List<Investigator> _investigators) {
124+
this._investigators = _investigators;
125+
}
126+
127+
List<FenceBuilder> _fenceBuilders;
128+
public List<FenceBuilder> getFenceBuilders() {
129+
return _fenceBuilders;
130+
}
131+
public void setFenceBuilders(List<FenceBuilder> _fenceBuilders) {
132+
this._fenceBuilders = _fenceBuilders;
133+
}
134+
135+
@Inject
124136
AgentManager _agentMgr;
125137
@Inject
126138
AlertManager _alertMgr;

‎server/src/com/cloud/network/NetworkManagerImpl.java‎

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,41 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
193193
@Inject
194194
PodVlanMapDao _podVlanMapDao;
195195

196-
@Inject
197196
List<NetworkGuru> _networkGurus;
197+
public List<NetworkGuru> getNetworkGurus() {
198+
return _networkGurus;
199+
}
200+
public void setNetworkGurus(List<NetworkGuru> _networkGurus) {
201+
this._networkGurus = _networkGurus;
202+
}
203+
204+
List<NetworkElement> _networkElements;
205+
public List<NetworkElement> getNetworkElements() {
206+
return _networkElements;
207+
}
208+
public void setNetworkElements(List<NetworkElement> _networkElements) {
209+
this._networkElements = _networkElements;
210+
}
198211

199-
@Inject protected List<NetworkElement> _networkElements;
212+
@Inject NetworkDomainDao _networkDomainDao;
200213

201-
@Inject NetworkDomainDao _networkDomainDao;
202-
@Inject List<IpDeployer> _ipDeployers;
203-
@Inject List<DhcpServiceProvider> _dhcpProviders;
204-
205-
@Inject
214+
List<IpDeployer> _ipDeployers;
215+
public List<IpDeployer> getIpDeployers() {
216+
return _ipDeployers;
217+
}
218+
public void setIpDeployers(List<IpDeployer> _ipDeployers) {
219+
this._ipDeployers = _ipDeployers;
220+
}
221+
222+
List<DhcpServiceProvider> _dhcpProviders;
223+
public List<DhcpServiceProvider> getDhcpProviders() {
224+
return _dhcpProviders;
225+
}
226+
public void setDhcpProviders(List<DhcpServiceProvider> _dhcpProviders) {
227+
this._dhcpProviders = _dhcpProviders;
228+
}
229+
230+
@Inject
206231
VMInstanceDao _vmDao;
207232
@Inject
208233
FirewallManager _firewallMgr;

‎server/src/com/cloud/network/NetworkModelImpl.java‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,15 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
143143
@Inject
144144
PodVlanMapDao _podVlanMapDao;
145145

146-
@Inject List<NetworkElement> _networkElements;
147-
148-
@Inject
146+
List<NetworkElement> _networkElements;
147+
public List<NetworkElement> getNetworkElements() {
148+
return _networkElements;
149+
}
150+
public void setNetworkElements(List<NetworkElement> _networkElements) {
151+
this._networkElements = _networkElements;
152+
}
153+
154+
@Inject
149155
NetworkDomainDao _networkDomainDao;
150156
@Inject
151157
VMInstanceDao _vmDao;

‎server/src/com/cloud/resource/ResourceManagerImpl.java‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,19 +211,29 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
211211
protected HighAvailabilityManager _haMgr;
212212
@Inject
213213
protected StorageService _storageSvr;
214-
// @com.cloud.utils.component.Inject(adapter = Discoverer.class)
214+
215+
protected List<? extends Discoverer> _discoverers;
216+
public List<? extends Discoverer> getDiscoverers() {
217+
return _discoverers;
218+
}
219+
public void setDiscoverers(List<? extends Discoverer> _discoverers) {
220+
this._discoverers = _discoverers;
221+
}
222+
215223
@Inject
216-
protected List<? extends Discoverer> _discoverers;
217-
@Inject
218224
protected ClusterManager _clusterMgr;
219225
@Inject
220226
protected StoragePoolHostDao _storagePoolHostDao;
221227

222-
// @com.cloud.utils.component.Inject(adapter = PodAllocator.class)
223-
@Inject
224-
protected List<PodAllocator> _podAllocators = null;
228+
protected List<PodAllocator> _podAllocators;
229+
public List<PodAllocator> getPodAllocators() {
230+
return _podAllocators;
231+
}
232+
public void setPodAllocators(List<PodAllocator> _podAllocators) {
233+
this._podAllocators = _podAllocators;
234+
}
225235

226-
@Inject
236+
@Inject
227237
protected VMTemplateDao _templateDao;
228238
@Inject
229239
protected ConfigurationManager _configMgr;

‎server/src/com/cloud/server/ManagementServerImpl.java‎

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
import org.apache.cloudstack.api.response.ExtractResponse;
107107
import org.apache.commons.codec.binary.Base64;
108108
import org.apache.log4j.Logger;
109+
import org.springframework.stereotype.Component;
109110

110111
import com.cloud.agent.AgentManager;
111112
import com.cloud.agent.api.GetVncPortAnswer;
@@ -233,8 +234,10 @@
233234
import com.cloud.utils.NumbersUtil;
234235
import com.cloud.utils.Pair;
235236
import com.cloud.utils.PasswordGenerator;
237+
import com.cloud.utils.ReflectUtil;
236238
import com.cloud.utils.Ternary;
237239
import com.cloud.utils.component.Adapter;
240+
import com.cloud.utils.component.AdapterBase;
238241
import com.cloud.utils.component.ComponentContext;
239242
import com.cloud.utils.component.ComponentLifecycle;
240243
import com.cloud.utils.component.Manager;
@@ -370,9 +373,9 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
370373
@Inject
371374
private HypervisorCapabilitiesDao _hypervisorCapabilitiesDao;
372375

373-
@Inject
374376
private List<HostAllocator> _hostAllocators;
375-
@Inject
377+
378+
@Inject
376379
private ConfigurationManager _configMgr;
377380
@Inject
378381
private ResourceTagDao _resourceTagDao;
@@ -391,28 +394,37 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
391394
@Inject
392395
S3Manager _s3Mgr;
393396

394-
/*
395-
@Inject
396-
ComponentContext _forceContextRef; // create a dependency to ComponentContext so that it can be loaded beforehead
397-
398-
@Inject
399-
EventUtils _forceEventUtilsRef;
400-
*/
401397
private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("EventChecker"));
402398
private KeystoreManager _ksMgr;
403399

404400
private Map<String, String> _configs;
405401

406402
private Map<String, Boolean> _availableIdsMap;
407403

408-
@Inject List<UserAuthenticator> _userAuthenticators;
404+
List<UserAuthenticator> _userAuthenticators;
409405

410406
@Inject ClusterManager _clusterMgr;
411407
private String _hashKey = null;
412408

413409
public ManagementServerImpl() {
414410
setRunLevel(ComponentLifecycle.RUN_LEVEL_APPLICATION_MAINLOOP);
415411
}
412+
413+
public List<UserAuthenticator> getUserAuthenticators() {
414+
return _userAuthenticators;
415+
}
416+
417+
public void setUserAuthenticators(List<UserAuthenticator> authenticators) {
418+
_userAuthenticators = authenticators;
419+
}
420+
421+
public List<HostAllocator> getHostAllocators() {
422+
return _hostAllocators;
423+
}
424+
425+
public void setHostAllocators(List<HostAllocator> _hostAllocators) {
426+
this._hostAllocators = _hostAllocators;
427+
}
416428

417429
@Override
418430
public boolean configure(String name, Map<String, Object> params)
@@ -437,7 +449,7 @@ public boolean configure(String name, Map<String, Object> params)
437449
return true;
438450
}
439451

440-
@Override
452+
@Override
441453
public boolean start() {
442454
s_logger.info("Startup CloudStack management server...");
443455

‎server/src/com/cloud/storage/StorageManagerImpl.java‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,28 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
260260
protected DownloadMonitor _downloadMonitor;
261261
@Inject
262262
protected ResourceTagDao _resourceTagDao;
263-
@Inject
263+
264264
protected List<StoragePoolAllocator> _storagePoolAllocators;
265-
@Inject ConfigurationDao _configDao;
265+
public List<StoragePoolAllocator> getStoragePoolAllocators() {
266+
return _storagePoolAllocators;
267+
}
268+
public void setStoragePoolAllocators(
269+
List<StoragePoolAllocator> _storagePoolAllocators) {
270+
this._storagePoolAllocators = _storagePoolAllocators;
271+
}
272+
273+
@Inject ConfigurationDao _configDao;
266274
@Inject ManagementServer _msServer;
267275

268-
// TODO : we don't have any instantiated pool discover, disable injection temporarily
269-
// @Inject
270276
protected List<StoragePoolDiscoverer> _discoverers;
271-
272-
273-
protected SearchBuilder<VMTemplateHostVO> HostTemplateStatesSearch;
277+
public List<StoragePoolDiscoverer> getDiscoverers() {
278+
return _discoverers;
279+
}
280+
public void setDiscoverers(List<StoragePoolDiscoverer> _discoverers) {
281+
this._discoverers = _discoverers;
282+
}
283+
284+
protected SearchBuilder<VMTemplateHostVO> HostTemplateStatesSearch;
274285
protected GenericSearchBuilder<StoragePoolHostVO, Long> UpHostsInPoolSearch;
275286
protected SearchBuilder<VMInstanceVO> StoragePoolSearch;
276287
protected SearchBuilder<StoragePoolVO> LocalStorageSearch;

0 commit comments

Comments
 (0)