cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [49/50] git commit: hanlde case where no EventBus implementation is configured in component locator config file
Date Fri, 25 Jan 2013 12:55:09 GMT
hanlde case where no EventBus implementation is configured in component
locator config file


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

Branch: refs/heads/events-framework
Commit: c35b016d9090ef6cd685564250dd867166929f66
Parents: ffd55c4
Author: Murali Reddy <murali.reddy@citrix.com>
Authored: Fri Jan 25 18:21:33 2013 +0530
Committer: Murali Reddy <murali.reddy@citrix.com>
Committed: Fri Jan 25 18:21:33 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/event/AlertGenerator.java     |    4 +++-
 .../src/com/cloud/event/UsageEventGenerator.java   |    4 +++-
 .../src/com/cloud/network/NetworkManagerImpl.java  |    3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c35b016d/server/src/com/cloud/event/AlertGenerator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/event/AlertGenerator.java b/server/src/com/cloud/event/AlertGenerator.java
index 5421aec..1846dd2 100644
--- a/server/src/com/cloud/event/AlertGenerator.java
+++ b/server/src/com/cloud/event/AlertGenerator.java
@@ -62,7 +62,9 @@ public class AlertGenerator {
                 Adapters<EventBus> eventBusImpls = locator.getAdapters(EventBus.class);
                 if (eventBusImpls != null) {
                     Enumeration<EventBus> eventBusenum = eventBusImpls.enumeration();
-                   _eventBus = eventBusenum.nextElement();
+                    if (eventBusenum != null && eventBusenum.hasMoreElements()) {
+                        _eventBus = eventBusenum.nextElement();
+                    }
                 }
                 _eventBusLoaded = true;
             }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c35b016d/server/src/com/cloud/event/UsageEventGenerator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/event/UsageEventGenerator.java b/server/src/com/cloud/event/UsageEventGenerator.java
index 80353e5..84946fb 100644
--- a/server/src/com/cloud/event/UsageEventGenerator.java
+++ b/server/src/com/cloud/event/UsageEventGenerator.java
@@ -74,7 +74,9 @@ public class UsageEventGenerator {
                 Adapters<EventBus> eventBusImpls = locator.getAdapters(EventBus.class);
                 if (eventBusImpls != null) {
                     Enumeration<EventBus> eventBusenum = eventBusImpls.enumeration();
-                   _eventBus = eventBusenum.nextElement();
+                    if (eventBusenum != null && eventBusenum.hasMoreElements()) {
+                        _eventBus = eventBusenum.nextElement();
+                    }
                 }
                 _eventBusLoaded = true;
             }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c35b016d/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 04f4488..1783379 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -198,11 +198,12 @@ public class NetworkManagerImpl implements NetworkManager, Manager,
Listener {
     NetworkACLManager _networkACLMgr;
     @Inject
     UsageEventDao _usageEventDao;
+    @Inject
+    NetworkModel _networkModel;
 
     protected StateMachine2<Network.State, Network.Event, Network> _stateMachine;
     private final HashMap<String, NetworkOfferingVO> _systemNetworks = new HashMap<String,
NetworkOfferingVO>(5);
     private static Long _privateOfferingId = null;
-    NetworkModel _networkModel;
 
     ScheduledExecutorService _executor;
 


Mime
View raw message