Repository: brooklyn-server
Updated Branches:
  refs/heads/master 1f9446eac -> d62a7b946


Add RebindManager.isRebindActive

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

Branch: refs/heads/master
Commit: 1af80984becd6cce5f4c5e43d202927af5dc9540
Parents: f8a4a30
Author: Aled Sage <aled.s...@gmail.com>
Authored: Fri Feb 9 10:00:24 2018 +0000
Committer: Aled Sage <aled.s...@gmail.com>
Committed: Fri Feb 9 10:00:24 2018 +0000

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/api/mgmt/rebind/RebindManager.java | 5 +++++
 .../core/mgmt/internal/NonDeploymentManagementContext.java      | 5 ++++-
 .../org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1af80984/api/src/main/java/org/apache/brooklyn/api/mgmt/rebind/RebindManager.java
----------------------------------------------------------------------
diff --git 
a/api/src/main/java/org/apache/brooklyn/api/mgmt/rebind/RebindManager.java 
b/api/src/main/java/org/apache/brooklyn/api/mgmt/rebind/RebindManager.java
index ecf56c2..9dcda12 100644
--- a/api/src/main/java/org/apache/brooklyn/api/mgmt/rebind/RebindManager.java
+++ b/api/src/main/java/org/apache/brooklyn/api/mgmt/rebind/RebindManager.java
@@ -52,6 +52,11 @@ public interface RebindManager {
         CONTINUE;
     }
     
+    /**
+     * Whether rebind is currently executing.
+     */
+    public boolean isRebindActive();
+
     public void setPersister(BrooklynMementoPersister persister);
 
     public void setPersister(BrooklynMementoPersister persister, 
PersistenceExceptionHandler exceptionHandler);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1af80984/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/NonDeploymentManagementContext.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/NonDeploymentManagementContext.java
 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/NonDeploymentManagementContext.java
index 9a01419..9c9d366 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/NonDeploymentManagementContext.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/NonDeploymentManagementContext.java
@@ -623,11 +623,14 @@ public class NonDeploymentManagementContext implements 
ManagementContextInternal
         public boolean isAwaitingInitialRebind() {
             throw new IllegalStateException("Non-deployment context 
"+NonDeploymentManagementContext.this+" is not valid for this operation.");
         }
-        
         @Override
         public Map<String, Object> getMetrics() {
             throw new IllegalStateException("Non-deployment context 
"+NonDeploymentManagementContext.this+" is not valid for this operation.");
         }
+        @Override
+        public boolean isRebindActive() {
+            throw new IllegalStateException("Non-deployment context 
"+NonDeploymentManagementContext.this+" is not valid for this operation.");
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1af80984/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java
 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java
index a42b5d8..20e8f2a 100644
--- 
a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java
+++ 
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindManagerImpl.java
@@ -225,6 +225,11 @@ public class RebindManagerImpl implements RebindManager {
     }
     
     @Override
+    public boolean isRebindActive() {
+        return rebindActive.availablePermits() == 0;
+    }
+    
+    @Override
     public void setPersister(BrooklynMementoPersister val) {
         PersistenceExceptionHandler exceptionHandler = 
PersistenceExceptionHandlerImpl.builder()
                 .build();

Reply via email to