brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [4/4] brooklyn-server git commit: small tweak to optimise subscription tracker access
Date Fri, 01 Apr 2016 14:22:22 GMT
small tweak to optimise subscription tracker access


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

Branch: refs/heads/master
Commit: 9720743a23b816914e66fb37ed4d783837ecca36
Parents: 6e3945a
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Apr 1 15:21:30 2016 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Apr 1 15:21:30 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/core/entity/AbstractEntity.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/9720743a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
index 58767e4..738ce86 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractEntity.java
@@ -264,7 +264,7 @@ public abstract class AbstractEntity extends AbstractBrooklynObject implements
E
     @Deprecated
     protected final Map<String,Object> tempWorkings = Maps.newLinkedHashMap();
 
-    protected transient SubscriptionTracker _subscriptionTracker;
+    protected transient volatile SubscriptionTracker _subscriptionTracker;
     
     public AbstractEntity() {
         this(Maps.newLinkedHashMap(), null);
@@ -1492,6 +1492,9 @@ public abstract class AbstractEntity extends AbstractBrooklynObject
implements E
         }
 
         protected SubscriptionTracker getSubscriptionTracker() {
+            if (_subscriptionTracker != null) {
+                return _subscriptionTracker;
+            }
             // TODO Would be nice to simplify concurrent model, and not synchronize on
             // AbstractEntity.this; perhaps could get rid of lazy-initialisation, but then
             // would need to first ensure `managementSupport` is definitely initialised.


Mime
View raw message