brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [07/10] git commit: support injecting the owning entity
Date Fri, 06 Jun 2014 22:05:25 GMT
support injecting the owning entity


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

Branch: refs/heads/master
Commit: ab222ffe294d909b7500de838c31be5c3a6a8703
Parents: 18a5d63
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Mon Jun 2 17:32:13 2014 +0100
Committer: Andrew Kennedy <adk@magnesium.(none)>
Committed: Fri Jun 6 20:50:57 2014 +0100

----------------------------------------------------------------------
 .../brooklyn/location/access/PortForwardManagerAuthority.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ab222ffe/core/src/main/java/brooklyn/location/access/PortForwardManagerAuthority.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/location/access/PortForwardManagerAuthority.java
b/core/src/main/java/brooklyn/location/access/PortForwardManagerAuthority.java
index f5c9f2d..8f56e9c 100644
--- a/core/src/main/java/brooklyn/location/access/PortForwardManagerAuthority.java
+++ b/core/src/main/java/brooklyn/location/access/PortForwardManagerAuthority.java
@@ -40,6 +40,13 @@ public class PortForwardManagerAuthority implements PortForwardManager
{
         this.owningEntity = owningEntity;
     }
     
+    public synchronized void injectOwningEntity(Entity owningEntity) {
+        if (this.owningEntity!=null && owningEntity!=null && !this.owningEntity.equals(owningEntity))
+            throw new IllegalStateException("Cannot set owningEntity for "+this+" to "+owningEntity+"
when it is already "+this.owningEntity);
+        this.owningEntity = owningEntity;
+        onChanged();
+    }
+    
     /** reserves a unique public port on the given publicIpId
      * (often followed by {@link #associate(String, int, Location, int)}
      * to enable {@link #lookup(Location, int)}) */


Mime
View raw message