Skip to content
This repository was archived by the owner on Jan 15, 2020. It is now read-only.

Commit 333dd81

Browse files
committed
CLOUDSTACK-1339: Using Sping interface injection pattern to avoid using CGLIB proxying mode. Spring with CGLIB proxying will concflict with CGLIB usage in CloudStack DB code, CloudStack CGLIB usage can cause Spring to lose tack of its proxied object and therefore creates a massive amount of objects in memory
1 parent 72e6fd6 commit 333dd81

56 files changed

Lines changed: 1437 additions & 175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/tomcatconf/applicationContext.xml.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<!--
3838
@DB support
3939
-->
40-
<aop:config proxy-target-class="true">
40+
<aop:config>
4141
<aop:aspect id="dbContextBuilder" ref="transactionContextBuilder">
4242
<aop:pointcut id="captureAnyMethod"
4343
expression="execution(* *(..))"
@@ -50,15 +50,14 @@
5050
<aop:pointcut id="captureEventMethod"
5151
expression="execution(* *(..)) and @annotation(com.cloud.event.ActionEvent)"
5252
/>
53+
5354
<aop:around pointcut-ref="captureEventMethod" method="AroundAnyMethod"/>
5455
</aop:aspect>
55-
5656
</aop:config>
57-
57+
5858
<bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
5959
<bean id="actionEventInterceptor" class="com.cloud.event.ActionEventInterceptor" />
6060

61-
6261
<!--
6362
RPC/Async/EventBus
6463
-->

engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public class VMEntityDaoImpl extends GenericDaoBase<VMEntityVO, Long> implements
4949
public static final Logger s_logger = Logger.getLogger(VMEntityDaoImpl.class);
5050

5151

52-
@Inject protected VMReservationDaoImpl _vmReservationDao;
52+
@Inject protected VMReservationDao _vmReservationDao;
5353

54-
@Inject protected VMComputeTagDaoImpl _vmComputeTagDao;
54+
@Inject protected VMComputeTagDao _vmComputeTagDao;
5555

56-
@Inject protected VMRootDiskTagDaoImpl _vmRootDiskTagsDao;
56+
@Inject protected VMRootDiskTagDao _vmRootDiskTagsDao;
5757

58-
@Inject protected VMNetworkMapDaoImpl _vmNetworkMapDao;
58+
@Inject protected VMNetworkMapDao _vmNetworkMapDao;
5959

6060

6161
@Inject

engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDaoImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class VMReservationDaoImpl extends GenericDaoBase<VMReservationVO, Long>
4343

4444
protected SearchBuilder<VMReservationVO> VmIdSearch;
4545

46-
@Inject protected VolumeReservationDaoImpl _volumeReservationDao;
46+
@Inject protected VolumeReservationDao _volumeReservationDao;
4747

4848
public VMReservationDaoImpl() {
4949
}

engine/orchestration/src/org/apache/cloudstack/platform/orchestration/CloudOrchestrator.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ public class CloudOrchestrator implements OrchestrationService {
8484
@Inject
8585
protected DiskOfferingDao _diskOfferingDao = null;
8686

87-
@Inject
88-
protected VirtualMachineEntityFactory _vmEntityFactory;
89-
9087
@Inject
9188
protected NetworkDao _networkDao;
9289

@@ -230,7 +227,9 @@ public VirtualMachineEntity createVirtualMachineFromScratch(String id, String ow
230227
// VirtualMachineEntityImpl vmEntity = new VirtualMachineEntityImpl(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, networks, vmEntityManager);
231228
VirtualMachineEntityImpl vmEntity = null;
232229
try {
233-
vmEntity = _vmEntityFactory.getObject();
230+
vmEntity = VirtualMachineEntityImpl.class.newInstance();
231+
vmEntity = ComponentContext.inject(vmEntity);
232+
234233
} catch (Exception e) {
235234
// add error handling here
236235
}

engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,10 @@ public Answer sendToSSVM(Long dcId, Command cmd) {
240240
return null;
241241
}
242242

243+
@Override
244+
public void disconnectWithInvestigation(long hostId, Event event) {
245+
// TODO Auto-generated method stub
246+
247+
}
248+
243249
}

0 commit comments

Comments
 (0)