cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dar...@apache.org
Subject git commit: updated refs/heads/master to ad74948
Date Fri, 25 Oct 2013 22:14:22 GMT
Updated Branches:
  refs/heads/master 56f127733 -> ad7494848


Move LockMasterListener initialization to system context

This reverts commit d178b25daa484dda44bb34e63cb719d1c3cc1519 and moves
the initialization to the system context, which really where it should have
been from the beginning.


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

Branch: refs/heads/master
Commit: ad74948480f017694fb31277b97bd8582372fb2c
Parents: 56f1277
Author: Darren Shepherd <darren.s.shepherd@gmail.com>
Authored: Fri Oct 25 15:10:51 2013 -0700
Committer: Darren Shepherd <darren.s.shepherd@gmail.com>
Committed: Fri Oct 25 15:11:47 2013 -0700

----------------------------------------------------------------------
 .../spring-server-core-managers-context.xml     |  1 +
 .../system/spring-server-system-context.xml     | 36 ++++++++++++++++++++
 .../com/cloud/server/ManagementServerImpl.java  | 18 ++++++++--
 3 files changed, 52 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ad749484/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
index 8a13b14..5e37908 100644
--- a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
+++ b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
@@ -36,6 +36,7 @@
     </bean>
 
     <bean id="managementServerImpl" class="com.cloud.server.ManagementServerImpl">
+        <property name="lockMasterListener" ref="lockMasterListener" />
         <property name="userAuthenticators"
             value="#{userAuthenticatorsRegistry.registered}" />
         <property name="userPasswordEncoders"

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ad749484/server/resources/META-INF/cloudstack/system/spring-server-system-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/system/spring-server-system-context.xml
b/server/resources/META-INF/cloudstack/system/spring-server-system-context.xml
new file mode 100644
index 0000000..a14a073
--- /dev/null
+++ b/server/resources/META-INF/cloudstack/system/spring-server-system-context.xml
@@ -0,0 +1,36 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+                      >
+
+    <bean id="lockMasterListener" class="com.cloud.server.LockMasterListener" >
+        <constructor-arg>
+            <bean class="org.apache.cloudstack.utils.identity.ManagementServerNode" factory-method="getManagementServerId"
/>
+        </constructor-arg>
+    </bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ad749484/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index e00c182..058a756 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -599,8 +599,6 @@ import com.cloud.vm.dao.VMInstanceDao;
 public class ManagementServerImpl extends ManagerBase implements ManagementServer {
     public static final Logger s_logger = Logger.getLogger(ManagementServerImpl.class.getName());
 
-    private static final LockMasterListener s_lockMasterListener = new LockMasterListener(ManagementServerNode.getManagementServerId());
-
     @Inject
     public AccountManager _accountMgr;
     @Inject
@@ -716,6 +714,8 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
     @Inject
     DeploymentPlanningManager _dpMgr;
 
+    LockMasterListener _lockMasterListener;
+
     private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1,
new NamedThreadFactory("EventChecker"));
     private final ScheduledExecutorService _alertExecutor = Executors.newScheduledThreadPool(1,
new NamedThreadFactory("AlertChecker"));
     @Inject private KeystoreManager _ksMgr;
@@ -820,7 +820,11 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
     public boolean start() {
         s_logger.info("Startup CloudStack management server...");
 
-        _clusterMgr.registerListener(s_lockMasterListener);
+        if ( _lockMasterListener == null ) {
+            _lockMasterListener = new LockMasterListener(ManagementServerNode.getManagementServerId());
+        }
+
+        _clusterMgr.registerListener(_lockMasterListener);
 
         enableAdminUser("password");
         return true;
@@ -3881,4 +3885,12 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
     public void setStoragePoolAllocators(List<StoragePoolAllocator> storagePoolAllocators)
{
         this._storagePoolAllocators = storagePoolAllocators;
     }
+
+    public LockMasterListener getLockMasterListener() {
+        return _lockMasterListener;
+    }
+
+    public void setLockMasterListener(LockMasterListener lockMasterListener) {
+        this._lockMasterListener = lockMasterListener;
+    }
 }


Mime
View raw message