karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf-cellar git commit: [KARAF-4602] Now define source node in all cluster events, and introduce "local" attribute
Date Mon, 11 Jul 2016 08:34:05 GMT
Repository: karaf-cellar
Updated Branches:
  refs/heads/master 130525c55 -> 1d05e8c4c


[KARAF-4602] Now define source node in all cluster events, and introduce "local" attribute


Project: http://git-wip-us.apache.org/repos/asf/karaf-cellar/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cellar/commit/1d05e8c4
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/1d05e8c4
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/1d05e8c4

Branch: refs/heads/master
Commit: 1d05e8c4c87b9152eb274748a574ac982429292a
Parents: 130525c
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Mon Jul 11 10:33:24 2016 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Mon Jul 11 10:33:24 2016 +0200

----------------------------------------------------------------------
 .../apache/karaf/cellar/bundle/BundleEventHandler.java  |  2 +-
 .../apache/karaf/cellar/bundle/BundleSynchronizer.java  |  2 ++
 .../apache/karaf/cellar/bundle/ClusterBundleEvent.java  |  9 +++++++++
 .../apache/karaf/cellar/bundle/LocalBundleListener.java |  1 +
 .../management/internal/CellarBundleMBeanImpl.java      |  5 +++++
 .../karaf/cellar/bundle/shell/InstallBundleCommand.java |  2 ++
 .../karaf/cellar/bundle/shell/StartBundleCommand.java   |  1 +
 .../karaf/cellar/bundle/shell/StopBundleCommand.java    |  1 +
 .../cellar/bundle/shell/UninstallBundleCommand.java     |  1 +
 .../karaf/cellar/config/ClusterConfigurationEvent.java  | 12 +++++++++++-
 .../karaf/cellar/config/ConfigurationEventHandler.java  |  2 +-
 .../karaf/cellar/config/ConfigurationSynchronizer.java  |  2 ++
 .../karaf/cellar/config/LocalConfigurationListener.java |  2 ++
 .../management/internal/CellarConfigMBeanImpl.java      |  4 ++++
 .../apache/karaf/cellar/config/shell/DeleteCommand.java |  1 +
 .../karaf/cellar/config/shell/PropAppendCommand.java    |  1 +
 .../karaf/cellar/config/shell/PropDelCommand.java       |  1 +
 .../karaf/cellar/config/shell/PropSetCommand.java       |  1 +
 .../org/apache/karaf/cellar/event/ClusterEvent.java     | 10 ++++++++++
 .../apache/karaf/cellar/event/ClusterEventHandler.java  |  6 ++++++
 .../apache/karaf/cellar/event/LocalEventListener.java   |  2 ++
 .../karaf/cellar/features/ClusterFeaturesEvent.java     |  9 +++++++++
 .../karaf/cellar/features/ClusterRepositoryEvent.java   | 10 ++++++++++
 .../karaf/cellar/features/FeaturesEventHandler.java     |  2 +-
 .../karaf/cellar/features/FeaturesSynchronizer.java     |  2 ++
 .../karaf/cellar/features/LocalFeaturesListener.java    |  2 ++
 .../karaf/cellar/features/RepositoryEventHandler.java   |  6 ++++++
 .../management/internal/CellarFeaturesMBeanImpl.java    |  3 +++
 .../karaf/cellar/features/shell/RepoAddCommand.java     |  1 +
 .../karaf/cellar/features/shell/RepoRefreshCommand.java |  1 +
 .../karaf/cellar/features/shell/RepoRemoveCommand.java  |  1 +
 .../cellar/http/balancer/BalancerEventHandler.java      |  2 +-
 .../cellar/http/balancer/ClusterBalancerEvent.java      |  9 +++++++++
 .../cellar/http/balancer/LocalServletListener.java      |  2 ++
 .../karaf/cellar/http/balancer/ServletSynchronizer.java |  1 +
 .../apache/karaf/cellar/obr/ClusterObrBundleEvent.java  | 10 ++++++++++
 .../org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java | 10 ++++++++++
 .../apache/karaf/cellar/obr/ObrBundleEventHandler.java  |  2 +-
 .../org/apache/karaf/cellar/obr/ObrUrlEventHandler.java |  2 +-
 .../org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java |  1 +
 .../obr/management/internal/CellarOBRMBeanImpl.java     |  3 +++
 .../apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java |  1 +
 .../apache/karaf/cellar/obr/shell/ObrDeployCommand.java |  1 +
 .../karaf/cellar/obr/shell/ObrRemoveUrlCommand.java     |  1 +
 44 files changed, 143 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleEventHandler.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleEventHandler.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleEventHandler.java
index 589fda4..8c4a349 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleEventHandler.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleEventHandler.java
@@ -67,7 +67,7 @@ public class BundleEventHandler extends BundleSupport implements EventHandler<Cl
 
         try {
             // check if it's not a "local" event
-            if (event.getSourceNode() != null && event.getSourceNode().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
+            if (event.getLocal() != null && event.getLocal().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
                 LOGGER.trace("CELLAR BUNDLE: cluster event is local (coming from local synchronizer or listener)");
                 return;
             }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
index aee5a26..6771d53 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
@@ -214,6 +214,7 @@ public class BundleSynchronizer extends BundleSupport implements Synchronizer {
                             ClusterBundleEvent clusterEvent = new ClusterBundleEvent(symbolicName, version, bundleLocation, status);
                             clusterEvent.setSourceGroup(group);
                             clusterEvent.setSourceNode(clusterManager.getNode());
+                            clusterEvent.setLocal(clusterManager.getNode());
                             eventProducer.produce(clusterEvent);
                         } else {
                             BundleState bundleState = clusterBundles.get(id);
@@ -226,6 +227,7 @@ public class BundleSynchronizer extends BundleSupport implements Synchronizer {
                                 ClusterBundleEvent clusterEvent = new ClusterBundleEvent(symbolicName, version, bundleLocation, status);
                                 clusterEvent.setSourceGroup(group);
                                 clusterEvent.setSourceNode(clusterManager.getNode());
+                                clusterEvent.setLocal(clusterManager.getNode());
                                 eventProducer.produce(clusterEvent);
                             }
                         }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/ClusterBundleEvent.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/ClusterBundleEvent.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/ClusterBundleEvent.java
index a043fb3..938c4ef 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/ClusterBundleEvent.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/ClusterBundleEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.bundle;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 
 /**
@@ -24,6 +25,7 @@ public class ClusterBundleEvent extends Event {
     private String version;
     private String location;
     private int type;
+    private Node local;
 
     public ClusterBundleEvent(String symbolicName, String version, String location, int type) {
         super(symbolicName + "/" + version);
@@ -65,4 +67,11 @@ public class ClusterBundleEvent extends Event {
         this.type = type;
     }
 
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
 }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/LocalBundleListener.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/LocalBundleListener.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/LocalBundleListener.java
index c418c60..72d8caf 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/LocalBundleListener.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/LocalBundleListener.java
@@ -128,6 +128,7 @@ public class LocalBundleListener extends BundleSupport implements SynchronousBun
                             ClusterBundleEvent clusterBundleEvent = new ClusterBundleEvent(symbolicName, version, bundleLocation, status);
                             clusterBundleEvent.setSourceGroup(group);
                             clusterBundleEvent.setSourceNode(clusterManager.getNode());
+                            clusterBundleEvent.setLocal(clusterManager.getNode());
                             eventProducer.produce(clusterBundleEvent);
                         } catch (Exception e) {
                         	LOGGER.error("CELLAR BUNDLE: failed to create bundle event", e);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/management/internal/CellarBundleMBeanImpl.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/management/internal/CellarBundleMBeanImpl.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/management/internal/CellarBundleMBeanImpl.java
index ec87ed9..8efe1a0 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/management/internal/CellarBundleMBeanImpl.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/management/internal/CellarBundleMBeanImpl.java
@@ -158,9 +158,11 @@ public class CellarBundleMBeanImpl extends StandardMBean implements CellarBundle
         // broadcast the event
         ClusterBundleEvent event = new ClusterBundleEvent(symbolicName, version, location, Bundle.INSTALLED);
         event.setSourceGroup(group);
+        event.setSourceNode(clusterManager.getNode());
         if (start) {
             event = new ClusterBundleEvent(symbolicName, version, location, Bundle.ACTIVE);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
         }
         eventProducer.produce(event);
     }
@@ -211,6 +213,7 @@ public class CellarBundleMBeanImpl extends StandardMBean implements CellarBundle
                 String[] split = bundle.split("/");
                 ClusterBundleEvent event = new ClusterBundleEvent(split[0], split[1], location, Bundle.UNINSTALLED);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } finally {
@@ -267,6 +270,7 @@ public class CellarBundleMBeanImpl extends StandardMBean implements CellarBundle
                 String[] split = bundle.split("/");
                 ClusterBundleEvent event = new ClusterBundleEvent(split[0], split[1], location, Bundle.ACTIVE);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } finally {
@@ -320,6 +324,7 @@ public class CellarBundleMBeanImpl extends StandardMBean implements CellarBundle
                 String[] split = bundle.split("/");
                 ClusterBundleEvent event = new ClusterBundleEvent(split[0], split[1], location, Bundle.RESOLVED);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } finally {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java
index a347ae5..fe79aa8 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java
@@ -124,9 +124,11 @@ public class InstallBundleCommand extends CellarCommandSupport {
                 if (start) {
                     event = new ClusterBundleEvent(symbolicName, version, url, Bundle.ACTIVE);
                     event.setSourceGroup(group);
+                    event.setSourceNode(clusterManager.getNode());
                 } else {
                     event = new ClusterBundleEvent(symbolicName, version, url, Bundle.INSTALLED);
                     event.setSourceGroup(group);
+                    event.setSourceNode(clusterManager.getNode());
                 }
                 eventProducer.produce(event);
             } else {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StartBundleCommand.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StartBundleCommand.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StartBundleCommand.java
index eba376d..059da85 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StartBundleCommand.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StartBundleCommand.java
@@ -85,6 +85,7 @@ public class StartBundleCommand extends BundleCommandSupport {
                 String[] split = bundle.split("/");
                 ClusterBundleEvent event = new ClusterBundleEvent(split[0], split[1], location, Bundle.ACTIVE);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } finally {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StopBundleCommand.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StopBundleCommand.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StopBundleCommand.java
index 5fd70f8..4faf095 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StopBundleCommand.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StopBundleCommand.java
@@ -85,6 +85,7 @@ public class StopBundleCommand extends BundleCommandSupport {
                 String[] split = bundle.split("/");
                 ClusterBundleEvent event = new ClusterBundleEvent(split[0], split[1], location, Bundle.RESOLVED);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } finally {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/UninstallBundleCommand.java
----------------------------------------------------------------------
diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/UninstallBundleCommand.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/UninstallBundleCommand.java
index a6616f3..8584a39 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/UninstallBundleCommand.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/UninstallBundleCommand.java
@@ -84,6 +84,7 @@ public class UninstallBundleCommand extends BundleCommandSupport {
                 String[] split = bundle.split("/");
                 ClusterBundleEvent event = new ClusterBundleEvent(split[0], split[1], location, Bundle.UNINSTALLED);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } finally {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/ClusterConfigurationEvent.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/ClusterConfigurationEvent.java b/config/src/main/java/org/apache/karaf/cellar/config/ClusterConfigurationEvent.java
index 9c51e44..cf0ffa4 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/ClusterConfigurationEvent.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/ClusterConfigurationEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.config;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 
 /**
@@ -21,6 +22,7 @@ import org.apache.karaf.cellar.core.event.Event;
 public class ClusterConfigurationEvent extends Event {
 
 	private Integer type;
+    private Node local;
 
     public ClusterConfigurationEvent(String id) {
         super(id);
@@ -34,7 +36,15 @@ public class ClusterConfigurationEvent extends Event {
         this.type = type;
     }
 
-	@Override
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
+
+    @Override
 	public String toString() {
 		return "ClusterConfigurationEvent [type=" + type + ", id=" + id
 				+ ", sourceNode=" + sourceNode + ", sourceGroup=" + sourceGroup

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java
index 682bc2c..910cb7a 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java
@@ -63,7 +63,7 @@ public class ConfigurationEventHandler extends ConfigurationSupport implements E
         }
 
         // check if it's not a "local" event
-        if (event.getSourceNode() != null && event.getSourceNode().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
+        if (event.getLocal() != null && event.getLocal().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
             LOGGER.trace("CELLAR CONFIG: cluster event is local (coming from local synchronizer or listener)");
             return;
         }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
index 79b0ade..75cb4c3 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
@@ -176,6 +176,7 @@ public class ConfigurationSynchronizer extends ConfigurationSupport implements S
                                 ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
                                 event.setSourceGroup(group);
                                 event.setSourceNode(clusterManager.getNode());
+                                event.setLocal(clusterManager.getNode());
                                 eventProducer.produce(event);
                             } else {
                                 Dictionary clusterDictionary = clusterConfigurations.get(pid);
@@ -186,6 +187,7 @@ public class ConfigurationSynchronizer extends ConfigurationSupport implements S
                                     // send cluster event
                                     ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
                                     event.setSourceGroup(group);
+                                    event.setLocal(clusterManager.getNode());
                                     event.setSourceNode(clusterManager.getNode());
                                     eventProducer.produce(event);
                                 }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java b/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java
index 67fb201..20ce8c5 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java
@@ -77,6 +77,7 @@ public class LocalConfigurationListener extends ConfigurationSupport implements
                                 clusterConfigurationEvent.setType(event.getType());
                                 clusterConfigurationEvent.setSourceNode(clusterManager.getNode());
                                 clusterConfigurationEvent.setSourceGroup(group);
+                                clusterConfigurationEvent.setLocal(clusterManager.getNode());
                                 eventProducer.produce(clusterConfigurationEvent);
                             }
 
@@ -95,6 +96,7 @@ public class LocalConfigurationListener extends ConfigurationSupport implements
                                 ClusterConfigurationEvent clusterConfigurationEvent = new ClusterConfigurationEvent(pid);
                                 clusterConfigurationEvent.setSourceGroup(group);
                                 clusterConfigurationEvent.setSourceNode(clusterManager.getNode());
+                                clusterConfigurationEvent.setLocal(clusterManager.getNode());
                                 eventProducer.produce(clusterConfigurationEvent);
                             }
                         }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/management/internal/CellarConfigMBeanImpl.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/management/internal/CellarConfigMBeanImpl.java b/config/src/main/java/org/apache/karaf/cellar/config/management/internal/CellarConfigMBeanImpl.java
index d6101b3..01c497c 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/management/internal/CellarConfigMBeanImpl.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/management/internal/CellarConfigMBeanImpl.java
@@ -91,6 +91,7 @@ public class CellarConfigMBeanImpl extends StandardMBean implements CellarConfig
             // broadcast the cluster event
             ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             event.setType(ConfigurationEvent.CM_DELETED);
             eventProducer.produce(event);
         } else {
@@ -150,6 +151,7 @@ public class CellarConfigMBeanImpl extends StandardMBean implements CellarConfig
             // broadcast the cluster event
             ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             eventProducer.produce(event);
         } else {
             throw new IllegalArgumentException("No configuration found in cluster group " + groupName);
@@ -198,6 +200,7 @@ public class CellarConfigMBeanImpl extends StandardMBean implements CellarConfig
             // broadcast the cluster event
             ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             eventProducer.produce(event);
         } else {
             throw new IllegalArgumentException("No configuration found in cluster group " + groupName);
@@ -236,6 +239,7 @@ public class CellarConfigMBeanImpl extends StandardMBean implements CellarConfig
                 // broadcast the cluster event
                 ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } else {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java b/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java
index 0ce9994..b87150b 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java
@@ -76,6 +76,7 @@ public class DeleteCommand extends ConfigCommandSupport {
             // broadcast a cluster event
             ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             event.setType(ConfigurationEvent.CM_DELETED);
             eventProducer.produce(event);
 

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java b/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java
index 7728840..92d3e7e 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java
@@ -94,6 +94,7 @@ public class PropAppendCommand extends ConfigCommandSupport {
             // broadcast the cluster event
             ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             eventProducer.produce(event);
         } else {
             System.out.println("No configuration found in cluster group " + groupName);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/shell/PropDelCommand.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/shell/PropDelCommand.java b/config/src/main/java/org/apache/karaf/cellar/config/shell/PropDelCommand.java
index daa87f5..d704db2 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/shell/PropDelCommand.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/shell/PropDelCommand.java
@@ -81,6 +81,7 @@ public class PropDelCommand extends ConfigCommandSupport {
                 // broadcast the cluster event
                 ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             }
         } else {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
----------------------------------------------------------------------
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java b/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
index ac25f9c..e1f2d16 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
@@ -86,6 +86,7 @@ public class PropSetCommand extends ConfigCommandSupport {
             // broadcast the cluster event
             ClusterConfigurationEvent event = new ClusterConfigurationEvent(pid);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             eventProducer.produce(event);
         } else {
             System.out.println("No configuration found in cluster group " + groupName);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/event/src/main/java/org/apache/karaf/cellar/event/ClusterEvent.java
----------------------------------------------------------------------
diff --git a/event/src/main/java/org/apache/karaf/cellar/event/ClusterEvent.java b/event/src/main/java/org/apache/karaf/cellar/event/ClusterEvent.java
index c5076fc..286c845 100644
--- a/event/src/main/java/org/apache/karaf/cellar/event/ClusterEvent.java
+++ b/event/src/main/java/org/apache/karaf/cellar/event/ClusterEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.event;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 
 import java.io.Serializable;
@@ -25,6 +26,7 @@ public class ClusterEvent extends Event {
 
     private String topicName;
     private Map<String, Serializable> properties;
+    private Node local;
 
     public ClusterEvent(String topicName, Map<String, Serializable> properties) {
         super(topicName);
@@ -48,4 +50,12 @@ public class ClusterEvent extends Event {
         this.properties = properties;
     }
 
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/event/src/main/java/org/apache/karaf/cellar/event/ClusterEventHandler.java
----------------------------------------------------------------------
diff --git a/event/src/main/java/org/apache/karaf/cellar/event/ClusterEventHandler.java b/event/src/main/java/org/apache/karaf/cellar/event/ClusterEventHandler.java
index 0013115..1cef5ae 100644
--- a/event/src/main/java/org/apache/karaf/cellar/event/ClusterEventHandler.java
+++ b/event/src/main/java/org/apache/karaf/cellar/event/ClusterEventHandler.java
@@ -57,6 +57,12 @@ public class ClusterEventHandler extends EventSupport implements EventHandler<Cl
             return;
         }
 
+        // check if the event is not local
+        if (event.getLocal() != null && event.getLocal().getId().equals(clusterManager.getNode().getId())) {
+            LOGGER.trace("CELLAR EVENT: cluster event is local (coming from local listener)");
+            return;
+        }
+
         try {
             if (isAllowed(event.getSourceGroup(), Constants.CATEGORY, event.getTopicName(), EventType.INBOUND)) {
                 Map<String, Serializable> properties = event.getProperties();

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/event/src/main/java/org/apache/karaf/cellar/event/LocalEventListener.java
----------------------------------------------------------------------
diff --git a/event/src/main/java/org/apache/karaf/cellar/event/LocalEventListener.java b/event/src/main/java/org/apache/karaf/cellar/event/LocalEventListener.java
index 1683b72..3a8a158 100644
--- a/event/src/main/java/org/apache/karaf/cellar/event/LocalEventListener.java
+++ b/event/src/main/java/org/apache/karaf/cellar/event/LocalEventListener.java
@@ -71,6 +71,8 @@ public class LocalEventListener extends EventSupport implements EventHandler {
                             // broadcast the event
                             ClusterEvent clusterEvent = new ClusterEvent(topicName, properties);
                             clusterEvent.setSourceGroup(group);
+                            clusterEvent.setSourceNode(clusterManager.getNode());
+                            clusterEvent.setLocal(clusterManager.getNode());
                             eventProducer.produce(clusterEvent);
                         } else LOGGER.trace("CELLAR EVENT: event {} is marked as BLOCKED OUTBOUND for cluster group {}", topicName, group.getName());
                     }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/ClusterFeaturesEvent.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/ClusterFeaturesEvent.java b/features/src/main/java/org/apache/karaf/cellar/features/ClusterFeaturesEvent.java
index 0d56efc..13866c5 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/ClusterFeaturesEvent.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/ClusterFeaturesEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.features;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 import org.apache.karaf.features.FeatureEvent.EventType;
 
@@ -28,6 +29,7 @@ public class ClusterFeaturesEvent extends Event {
     private Boolean noRefresh;
     private Boolean noStart;
     private EventType type;
+    private Node local;
 
     public ClusterFeaturesEvent(String name, String version, EventType type) {
         super(name + separator + version);
@@ -67,4 +69,11 @@ public class ClusterFeaturesEvent extends Event {
         return type;
     }
 
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
 }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/ClusterRepositoryEvent.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/ClusterRepositoryEvent.java b/features/src/main/java/org/apache/karaf/cellar/features/ClusterRepositoryEvent.java
index 784c492..39ed0bd 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/ClusterRepositoryEvent.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/ClusterRepositoryEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.features;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 import org.apache.karaf.features.RepositoryEvent.EventType;
 
@@ -25,6 +26,7 @@ public class ClusterRepositoryEvent extends Event {
     private Boolean install;
     private Boolean uninstall;
     private Boolean refresh;
+    private Node local;
 
     public ClusterRepositoryEvent(String id, EventType type) {
         super(id);
@@ -59,6 +61,14 @@ public class ClusterRepositoryEvent extends Event {
         this.refresh = refresh;
     }
 
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
+
     @Override
 	public String toString() {
 		return "ClusterRepositoryEvent [type=" + type + ", id=" + id

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/FeaturesEventHandler.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesEventHandler.java b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesEventHandler.java
index 2fead83..af56749 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesEventHandler.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesEventHandler.java
@@ -73,7 +73,7 @@ public class FeaturesEventHandler extends FeaturesSupport implements EventHandle
         }
 
         // check if it's not a "local" event
-        if (event.getSourceNode() != null && event.getSourceNode().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
+        if (event.getLocal() != null && event.getLocal().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
             LOGGER.trace("CELLAR FEATURE: cluster event is local (coming from local synchronizer or listener)");
             return;
         }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
index d5efe38..be4df54 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
@@ -215,6 +215,7 @@ public class FeaturesSynchronizer extends FeaturesSupport implements Synchronize
                                 ClusterRepositoryEvent event = new ClusterRepositoryEvent(repository.getURI().toString(), RepositoryEvent.EventType.RepositoryAdded);
                                 event.setSourceGroup(group);
                                 event.setSourceNode(clusterManager.getNode());
+                                event.setLocal(clusterManager.getNode());
                                 eventProducer.produce(event);
                             } else {
                                 LOGGER.debug("CELLAR FEATURE: repository {} is already in cluster group {}", repository.getName(), groupName);
@@ -249,6 +250,7 @@ public class FeaturesSynchronizer extends FeaturesSupport implements Synchronize
                                 }
                                 event.setSourceGroup(group);
                                 event.setSourceNode(clusterManager.getNode());
+                                event.setLocal(clusterManager.getNode());
                                 eventProducer.produce(event);
 
                             } else {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/LocalFeaturesListener.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/LocalFeaturesListener.java b/features/src/main/java/org/apache/karaf/cellar/features/LocalFeaturesListener.java
index a3a104b..ada4c6b 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/LocalFeaturesListener.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/LocalFeaturesListener.java
@@ -96,6 +96,7 @@ public class LocalFeaturesListener extends FeaturesSupport implements org.apache
                         ClusterFeaturesEvent featureEvent = new ClusterFeaturesEvent(name, version, type);
                         featureEvent.setSourceGroup(group);
                         featureEvent.setSourceNode(clusterManager.getNode());
+                        featureEvent.setLocal(clusterManager.getNode());
                         eventProducer.produce(featureEvent);
                     } else LOGGER.trace("CELLAR FEATURE: feature {} is marked BLOCKED OUTBOUND for cluster group {}", name, group.getName());
                 }
@@ -133,6 +134,7 @@ public class LocalFeaturesListener extends FeaturesSupport implements org.apache
                         ClusterRepositoryEvent clusterRepositoryEvent = new ClusterRepositoryEvent(event.getRepository().getURI().toString(), event.getType());
                         clusterRepositoryEvent.setSourceGroup(group);
                         clusterRepositoryEvent.setSourceNode(clusterManager.getNode());
+                        clusterRepositoryEvent.setLocal(clusterManager.getNode());
                         clusterRepositoryEvent.setInstall(false);
                         clusterRepositoryEvent.setUninstall(false);
                         clusterRepositoryEvent.setRefresh(false);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/RepositoryEventHandler.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/RepositoryEventHandler.java b/features/src/main/java/org/apache/karaf/cellar/features/RepositoryEventHandler.java
index 4f95578..7acf1a2 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/RepositoryEventHandler.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/RepositoryEventHandler.java
@@ -70,6 +70,12 @@ public class RepositoryEventHandler extends FeaturesSupport implements EventHand
             return;
         }
 
+        // check if the event is not "local"
+        if (event.getLocal() != null && event.getLocal().getId().equals(clusterManager.getNode().getId())) {
+            LOGGER.trace("CELLAR FEATURE: event is local (coming from synchronizer or listener)");
+            return;
+        }
+
         String uri = event.getId();
         RepositoryEvent.EventType type = event.getType();
         try {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/management/internal/CellarFeaturesMBeanImpl.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/management/internal/CellarFeaturesMBeanImpl.java b/features/src/main/java/org/apache/karaf/cellar/features/management/internal/CellarFeaturesMBeanImpl.java
index 696802c..f694fb8 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/management/internal/CellarFeaturesMBeanImpl.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/management/internal/CellarFeaturesMBeanImpl.java
@@ -459,6 +459,7 @@ public class CellarFeaturesMBeanImpl extends StandardMBean implements CellarFeat
                 ClusterRepositoryEvent event = new ClusterRepositoryEvent(uri.toString(), RepositoryEvent.EventType.RepositoryAdded);
                 event.setInstall(install);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             } else {
                 throw new IllegalArgumentException("Features repository URL " + uri + " already registered");
@@ -500,6 +501,7 @@ public class CellarFeaturesMBeanImpl extends StandardMBean implements CellarFeat
             ClusterRepositoryEvent event = new ClusterRepositoryEvent(uri.toString(), RepositoryEvent.EventType.RepositoryAdded);
             event.setRefresh(true);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             eventProducer.produce(event);
         } finally {
             Thread.currentThread().setContextClassLoader(originalClassLoader);
@@ -582,6 +584,7 @@ public class CellarFeaturesMBeanImpl extends StandardMBean implements CellarFeat
                     ClusterRepositoryEvent event = new ClusterRepositoryEvent(url, RepositoryEvent.EventType.RepositoryRemoved);
                     event.setUninstall(uninstall);
                     event.setSourceGroup(group);
+                    event.setSourceNode(clusterManager.getNode());
                     eventProducer.produce(event);
                 } else {
                     throw new IllegalArgumentException("Features repository URL " + url + " not found in cluster group " + groupName);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
index 549e887..1a97df6 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoAddCommand.java
@@ -120,6 +120,7 @@ public class RepoAddCommand extends CellarCommandSupport {
                 ClusterRepositoryEvent event = new ClusterRepositoryEvent(uri.toString(), RepositoryEvent.EventType.RepositoryAdded);
                 event.setInstall(install);
                 event.setSourceGroup(group);
+                event.setSourceNode(clusterManager.getNode());
                 eventProducer.produce(event);
             } else {
                 System.err.println("Features repository URL " + uri + " already registered");

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRefreshCommand.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRefreshCommand.java b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRefreshCommand.java
index 9b183bf..3b4033d 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRefreshCommand.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRefreshCommand.java
@@ -89,6 +89,7 @@ public class RepoRefreshCommand extends CellarCommandSupport {
             ClusterRepositoryEvent event = new ClusterRepositoryEvent(uri.toString(), RepositoryEvent.EventType.RepositoryAdded);
             event.setRefresh(true);
             event.setSourceGroup(group);
+            event.setSourceNode(clusterManager.getNode());
             eventProducer.produce(event);
         } finally {
             Thread.currentThread().setContextClassLoader(originalClassLoader);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
----------------------------------------------------------------------
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
index 65bd6df..5ef2322 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/shell/RepoRemoveCommand.java
@@ -137,6 +137,7 @@ public class RepoRemoveCommand extends CellarCommandSupport {
                     ClusterRepositoryEvent event = new ClusterRepositoryEvent(url, RepositoryEvent.EventType.RepositoryRemoved);
                     event.setUninstall(uninstall);
                     event.setSourceGroup(group);
+                    event.setSourceNode(clusterManager.getNode());
                     eventProducer.produce(event);
                 } else {
                     System.err.println("Features repository URL " + url + " not found in cluster group " + groupName);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/BalancerEventHandler.java
----------------------------------------------------------------------
diff --git a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/BalancerEventHandler.java b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/BalancerEventHandler.java
index 32ca80e..8498daf 100644
--- a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/BalancerEventHandler.java
+++ b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/BalancerEventHandler.java
@@ -64,7 +64,7 @@ public class BalancerEventHandler implements EventHandler<ClusterBalancerEvent>
         }
 
         // check if it's not a "local" event
-        if (event.getSourceNode() != null && event.getSourceNode().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
+        if (event.getLocal() != null && event.getLocal().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
             LOGGER.trace("CELLAR HTTP BALANCER: cluster event is local (coming from local synchronizer or listener)");
             return;
         }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ClusterBalancerEvent.java
----------------------------------------------------------------------
diff --git a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ClusterBalancerEvent.java b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ClusterBalancerEvent.java
index 4713a09..2e173c3 100644
--- a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ClusterBalancerEvent.java
+++ b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ClusterBalancerEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.http.balancer;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 
 import java.util.List;
@@ -22,6 +23,7 @@ public class ClusterBalancerEvent extends Event {
     private String alias;
     private int type;
     private List<String> locations;
+    private Node local;
 
     public static int ADDING = 0;
     public static int REMOVING = 1;
@@ -57,4 +59,11 @@ public class ClusterBalancerEvent extends Event {
         this.locations = locations;
     }
 
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
 }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/LocalServletListener.java
----------------------------------------------------------------------
diff --git a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/LocalServletListener.java b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/LocalServletListener.java
index 04e7331..d05d403 100644
--- a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/LocalServletListener.java
+++ b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/LocalServletListener.java
@@ -81,6 +81,7 @@ public class LocalServletListener implements ServletListener {
                     ClusterBalancerEvent event = new ClusterBalancerEvent(alias, ClusterBalancerEvent.ADDING, locations);
                     event.setSourceGroup(group);
                     event.setSourceNode(clusterManager.getNode());
+                    event.setLocal(clusterManager.getNode());
                     eventProducer.produce(event);
                 } else {
                     LOGGER.debug("CELLAR HTTP BALANCER: location {} already defined for servlet {} on cluster", location, alias);
@@ -98,6 +99,7 @@ public class LocalServletListener implements ServletListener {
                     ClusterBalancerEvent event = new ClusterBalancerEvent(alias, ClusterBalancerEvent.REMOVING, locations);
                     event.setSourceGroup(group);
                     event.setSourceNode(clusterManager.getNode());
+                    event.setLocal(clusterManager.getNode());
                     eventProducer.produce(event);
                 }
                 if (locations.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
----------------------------------------------------------------------
diff --git a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
index d3714a0..20fdf81 100644
--- a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
+++ b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
@@ -141,6 +141,7 @@ public class ServletSynchronizer implements Synchronizer {
                                 ClusterBalancerEvent event = new ClusterBalancerEvent(alias, ClusterBalancerEvent.ADDING, locations);
                                 event.setSourceGroup(group);
                                 event.setSourceNode(clusterManager.getNode());
+                                event.setLocal(clusterManager.getNode());
                                 eventProducer.produce(event);
                             } else {
                                 LOGGER.debug("CELLAR HTTP BALANCER: location {} already defined for servlet {} on cluster", location, alias);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java b/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java
index 4d6d61d..9aa7197 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.obr;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 
 /**
@@ -23,6 +24,7 @@ public class ClusterObrBundleEvent extends Event {
     private String bundleId;
     private Boolean start;
     private Boolean deployOptional;
+    private Node local;
 
     public ClusterObrBundleEvent(String bundleId, boolean start, boolean deployOptional) {
         super(bundleId);
@@ -43,4 +45,12 @@ public class ClusterObrBundleEvent extends Event {
         return this.deployOptional;
     }
 
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java b/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java
index c1fc67f..b763d9f 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java
@@ -13,6 +13,7 @@
  */
 package org.apache.karaf.cellar.obr;
 
+import org.apache.karaf.cellar.core.Node;
 import org.apache.karaf.cellar.core.event.Event;
 
 /**
@@ -22,6 +23,7 @@ public class ClusterObrUrlEvent extends Event {
 
     private String url;
     private int type;
+    private Node local;
 
     public ClusterObrUrlEvent(String url, int type) {
         super(url);
@@ -37,4 +39,12 @@ public class ClusterObrUrlEvent extends Event {
         return this.type;
     }
 
+    public Node getLocal() {
+        return local;
+    }
+
+    public void setLocal(Node local) {
+        this.local = local;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java
index 02cbf1a..5927284 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java
@@ -132,7 +132,7 @@ public class ObrBundleEventHandler extends ObrSupport implements EventHandler<Cl
         }
 
         // check if it's not a "local" event
-        if (event.getSourceNode() != null && event.getSourceNode().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
+        if (event.getLocal() != null && event.getLocal().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
             LOGGER.trace("CELLAR OBR: cluster event is local (coming from local synchronizer or listener)");
             return;
         }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java
index 6f435aa..19ca432 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java
@@ -71,7 +71,7 @@ public class ObrUrlEventHandler extends ObrSupport implements EventHandler<Clust
         }
 
         // check if it's not a "local" event
-        if (event.getSourceNode() != null && event.getSourceNode().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
+        if (event.getLocal() != null && event.getLocal().getId().equalsIgnoreCase(clusterManager.getNode().getId())) {
             LOGGER.trace("CELLAR OBR: cluster event is local (coming from local synchronizer or listener)");
             return;
         }

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
index d5f7d7d..2937618 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
@@ -149,6 +149,7 @@ public class ObrUrlSynchronizer extends ObrSupport implements Synchronizer {
                         ClusterObrUrlEvent urlEvent = new ClusterObrUrlEvent(repository.getURI().toString(), Constants.URL_ADD_EVENT_TYPE);
                         urlEvent.setSourceGroup(group);
                         urlEvent.setSourceNode(clusterManager.getNode());
+                        urlEvent.setLocal(clusterManager.getNode());
                         eventProducer.produce(urlEvent);
                         // update OBR bundles in the cluster group
                         Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java b/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java
index f374ae0..d2f3be3 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java
@@ -139,6 +139,7 @@ public class CellarOBRMBeanImpl extends StandardMBean implements CellarOBRMBean
         ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_ADD_EVENT_TYPE);
         event.setForce(true);
         event.setSourceGroup(group);
+        event.setSourceNode(clusterManager.getNode());
         eventProducer.produce(event);
     }
 
@@ -182,6 +183,7 @@ public class CellarOBRMBeanImpl extends StandardMBean implements CellarOBRMBean
         // broadcast a cluster event
         ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_REMOVE_EVENT_TYPE);
         event.setSourceGroup(group);
+        event.setSourceNode(clusterManager.getNode());
         eventProducer.produce(event);
     }
 
@@ -210,6 +212,7 @@ public class CellarOBRMBeanImpl extends StandardMBean implements CellarOBRMBean
         // broadcast a cluster event
         ClusterObrBundleEvent event = new ClusterObrBundleEvent(bundleId, start, deployOptional);
         event.setSourceGroup(group);
+        event.setSourceNode(clusterManager.getNode());
         eventProducer.produce(event);
     }
 

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java b/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java
index 46e7b61..0c15b59 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java
@@ -85,6 +85,7 @@ public class ObrAddUrlCommand extends ObrCommandSupport {
         // broadcast a cluster event
         ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_ADD_EVENT_TYPE);
         event.setSourceGroup(group);
+        event.setSourceNode(clusterManager.getNode());
         eventProducer.produce(event);
 
         return null;

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java b/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java
index 0f5de1a..5bdfbf8 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java
@@ -71,6 +71,7 @@ public class ObrDeployCommand extends ObrCommandSupport {
         // broadcast a cluster event
         ClusterObrBundleEvent event = new ClusterObrBundleEvent(bundleId, start, deployOptional);
         event.setSourceGroup(group);
+        event.setSourceNode(clusterManager.getNode());
         eventProducer.produce(event);
 
         return null;

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/1d05e8c4/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java
----------------------------------------------------------------------
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java b/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java
index 1c4e919..5dbf078 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java
@@ -84,6 +84,7 @@ public class ObrRemoveUrlCommand extends ObrCommandSupport {
         // create an event and produce it
         ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_REMOVE_EVENT_TYPE);
         event.setSourceGroup(group);
+        event.setSourceNode(clusterManager.getNode());
         eventProducer.produce(event);
 
         return null;


Mime
View raw message