cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [09/50] [abbrv] git commit: updated refs/heads/marvin_refactor to 30e2971
Date Fri, 12 Apr 2013 11:58:42 GMT
DAO constructor should be lightweight to make Spring DI faster.


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

Branch: refs/heads/marvin_refactor
Commit: e9300d2676b72875e4de1bdb6c48ae853df99263
Parents: 1ba6740
Author: Prachi Damle <prachi@cloud.com>
Authored: Fri Mar 15 15:06:17 2013 -0700
Committer: Prachi Damle <prachi@cloud.com>
Committed: Thu Apr 11 13:22:51 2013 -0700

----------------------------------------------------------------------
 .../affinity/dao/AffinityGroupDaoImpl.java         |    8 +++++++-
 .../affinity/dao/AffinityGroupVMMapDaoImpl.java    |    7 ++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9300d26/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupDaoImpl.java b/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupDaoImpl.java
index bfa06c7..f7db418 100644
--- a/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupDaoImpl.java
+++ b/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupDaoImpl.java
@@ -18,6 +18,7 @@ package org.apache.cloudstack.affinity.dao;
 
 import java.util.List;
 
+import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import org.apache.cloudstack.affinity.AffinityGroupVO;
 import org.springframework.stereotype.Component;
@@ -33,7 +34,12 @@ public class AffinityGroupDaoImpl extends GenericDaoBase<AffinityGroupVO,
Long>
     private SearchBuilder<AffinityGroupVO> AccountIdNamesSearch;
 
 
-    protected AffinityGroupDaoImpl() {
+    public AffinityGroupDaoImpl() {
+
+    }
+
+    @PostConstruct
+    protected void init() {
         AccountIdSearch = createSearchBuilder();
         AccountIdSearch.and("accountId", AccountIdSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
         AccountIdSearch.done();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9300d26/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupVMMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupVMMapDaoImpl.java
b/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupVMMapDaoImpl.java
index 0fb4e79..ea315ac 100644
--- a/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupVMMapDaoImpl.java
+++ b/server/src/org/apache/cloudstack/affinity/dao/AffinityGroupVMMapDaoImpl.java
@@ -18,6 +18,7 @@ package org.apache.cloudstack.affinity.dao;
 
 import java.util.List;
 
+import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
@@ -50,7 +51,11 @@ public class AffinityGroupVMMapDaoImpl extends GenericDaoBase<AffinityGroupVMMap
     @Inject
     protected AffinityGroupDao _affinityGroupDao;
 
-    protected AffinityGroupVMMapDaoImpl() {
+    public AffinityGroupVMMapDaoImpl() {
+    }
+
+    @PostConstruct
+    protected void init() {
         ListVmIdByAffinityGroup = createSearchBuilder(Long.class);
         ListVmIdByAffinityGroup.and("affinityGroupId", ListVmIdByAffinityGroup.entity().getAffinityGroupId(),
                 SearchCriteria.Op.EQ);


Mime
View raw message