brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [1/2] git commit: Removes synchronization to prevent deadlock
Date Wed, 01 Oct 2014 15:24:19 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 5ff078480 -> d334c510c


Removes synchronization to prevent deadlock


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

Branch: refs/heads/master
Commit: cb3ae241e1fe94c3686b13d9b658e2de9f428327
Parents: 6fa0d22
Author: Martin Harris <github@nakomis.com>
Authored: Tue Sep 30 17:42:40 2014 +0100
Committer: Martin Harris <github@nakomis.com>
Committed: Tue Sep 30 17:42:40 2014 +0100

----------------------------------------------------------------------
 .../internal/EntityManagementSupport.java       | 26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cb3ae241/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
b/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
index b820cdc..0b31289 100644
--- a/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
+++ b/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
@@ -319,19 +319,21 @@ public class EntityManagementSupport {
         return getManagementContext().getEntitlementManager();
     }
 
-    public synchronized void attemptLegacyAutodeployment(String effectorName) {
-        if (managementContext!=null) {
-            log.warn("Autodeployment suggested but not required for "+entity+"."+effectorName);
-            return;
-        }
-        if (entity instanceof Application) {
-            log.warn("Autodeployment with new management context triggered for "+entity+"."+effectorName+"
-- will not be supported in future. Explicit manage call required.");
-            if (initialManagementContext != null) {
-                initialManagementContext.getEntityManager().manage(entity);
-            } else {
-                Entities.startManagement(entity);
+    public void attemptLegacyAutodeployment(String effectorName) {
+        synchronized (this) {
+            if (managementContext != null) {
+                log.warn("Autodeployment suggested but not required for " + entity + "."
+ effectorName);
+                return;
+            }
+            if (entity instanceof Application) {
+                log.warn("Autodeployment with new management context triggered for " + entity
+ "." + effectorName + " -- will not be supported in future. Explicit manage call required.");
+                if (initialManagementContext != null) {
+                    initialManagementContext.getEntityManager().manage(entity);
+                } else {
+                    Entities.startManagement(entity);
+                }
+                return;
             }
-            return;
         }
         if ("start".equals(effectorName)) {
             Entity e=entity;


Mime
View raw message