Repository: stratos Updated Branches: refs/heads/stratos-4.1.x 1bc4f53f4 -> 28f3d4508
Fixing application filter logic in message processors Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/28f3d450 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/28f3d450 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/28f3d450 Branch: refs/heads/stratos-4.1.x Commit: 28f3d45082fd278c4bc32fcbddf5171ad7c933a5 Parents: 1bc4f53 Author: Imesh Gunaratne <[email protected]> Authored: Wed Oct 14 13:39:55 2015 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Wed Oct 14 13:39:55 2015 +0530 ---------------------------------------------------------------------- .../topology/ClusterInstanceCreatedMessageProcessor.java | 10 +++++----- .../topology/ClusterRemovedMessageProcessor.java | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/28f3d450/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java index 8fb28cb..ae84a67 100644 --- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java +++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterInstanceCreatedMessageProcessor.java @@ -101,11 +101,6 @@ public class ClusterInstanceCreatedMessageProcessor extends MessageProcessor { Cluster cluster = service.getCluster(event.getClusterId()); - // Apply application filter - if(TopologyApplicationFilter.apply(cluster.getAppId())) { - return false; - } - if (cluster == null) { if (log.isDebugEnabled()) { log.debug(String.format("Cluster not exists in service: [service] %s [cluster] %s", event.getServiceName(), @@ -113,6 +108,11 @@ public class ClusterInstanceCreatedMessageProcessor extends MessageProcessor { } return false; } else { + // Apply application filter + if(TopologyApplicationFilter.apply(cluster.getAppId())) { + return false; + } + // Apply changes to the topology ClusterInstance clusterInstance = event.getClusterInstance(); if (cluster.getInstanceContexts(clusterInstance.getInstanceId()) != null) { http://git-wip-us.apache.org/repos/asf/stratos/blob/28f3d450/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterRemovedMessageProcessor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterRemovedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterRemovedMessageProcessor.java index d38ada2..f84cece 100644 --- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterRemovedMessageProcessor.java +++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/ClusterRemovedMessageProcessor.java @@ -107,6 +107,13 @@ public class ClusterRemovedMessageProcessor extends MessageProcessor { } else { Cluster cluster = service.getCluster(event.getClusterId()); + if(cluster == null) { + if (log.isDebugEnabled()) { + log.debug(String.format("Cluster not exists in service: [service] %s [cluster] %s", + event.getServiceName(), event.getClusterId())); + } + return false; + } // Apply application filter if(TopologyApplicationFilter.apply(cluster.getAppId())) {
