cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject git commit: refs/heads/affinity_groups - DAO constructor should be lightweight to make Spring DI faster.
Date Fri, 15 Mar 2013 22:06:38 GMT
Updated Branches:
  refs/heads/affinity_groups 0d7b10124 -> bffdefacf


DAO constructor should be lightweight to make Spring DI faster.


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

Branch: refs/heads/affinity_groups
Commit: bffdefacf75009a92b9ff69c029e82c1ad4b69bf
Parents: 0d7b101
Author: Prachi Damle <prachi@cloud.com>
Authored: Fri Mar 15 15:06:17 2013 -0700
Committer: Prachi Damle <prachi@cloud.com>
Committed: Fri Mar 15 15:06:17 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/incubator-cloudstack/blob/bffdefac/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/incubator-cloudstack/blob/bffdefac/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