You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2014/10/10 14:31:30 UTC
git commit: validating if the TopologyLock has already been removed
Repository: stratos
Updated Branches:
refs/heads/4.0.0-grouping c79f1407a -> 7f2cb13c7
validating if the TopologyLock has already been removed
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7f2cb13c
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7f2cb13c
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7f2cb13c
Branch: refs/heads/4.0.0-grouping
Commit: 7f2cb13c754a593fd7c90c1588d9cfb8484a83ba
Parents: c79f140
Author: Isuru Haththotuwa <is...@apache.org>
Authored: Fri Oct 10 18:00:44 2014 +0530
Committer: Isuru Haththotuwa <is...@apache.org>
Committed: Fri Oct 10 18:00:57 2014 +0530
----------------------------------------------------------------------
.../topology/locking/TopologyLockHierarchy.java | 21 ++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/7f2cb13c/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/locking/TopologyLockHierarchy.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/locking/TopologyLockHierarchy.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/locking/TopologyLockHierarchy.java
index 4a2fc58..015fa2e 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/locking/TopologyLockHierarchy.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/locking/TopologyLockHierarchy.java
@@ -127,18 +127,27 @@ public class TopologyLockHierarchy {
}
public void removeTopologyLockForApplication (String appId) {
- applicationIdToTopologyLockMap.remove(appId);
- log.info("Removed lock for Application " + appId);
+ if (applicationIdToTopologyLockMap.remove(appId) != null) {
+ log.info("Removed lock for Application " + appId);
+ } else {
+ log.info("Lock already removed for Application " + appId);
+ }
}
public void removeTopologyLockForService (String serviceName) {
- serviceNameToTopologyLockMap.remove(serviceName);
- log.info("Removed lock for Service " + serviceName);
+ if (serviceNameToTopologyLockMap.remove(serviceName) != null) {
+ log.info("Removed lock for Service " + serviceName);
+ } else {
+ log.info("Lock already removed for Service " + serviceName);
+ }
}
public void removeTopologyLockForCluster (String clusterId) {
- clusterIdToTopologyLockMap.remove(clusterId);
- log.info("Removed lock for Cluster " + clusterId);
+ if (clusterIdToTopologyLockMap.remove(clusterId) != null) {
+ log.info("Removed lock for Cluster " + clusterId);
+ } else {
+ log.info("Lock already removed for Cluster " + clusterId);
+ }
}
public TopologyLock getServiceLock() {