You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2013/04/29 08:02:20 UTC

svn commit: r1476898 - in /karaf/cellar/trunk/obr/src/main: java/org/apache/karaf/cellar/obr/ java/org/apache/karaf/cellar/obr/management/ java/org/apache/karaf/cellar/obr/management/internal/ java/org/apache/karaf/cellar/obr/shell/ resources/OSGI-INF/...

Author: jbonofre
Date: Mon Apr 29 06:02:19 2013
New Revision: 1476898

URL: http://svn.apache.org/r1476898
Log:
Code cleanup.

Added:
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java
      - copied, changed from r1476084, karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEvent.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java
      - copied, changed from r1476084, karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEvent.java
Removed:
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEvent.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEvent.java
Modified:
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/Constants.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleInfo.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrSupport.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/CellarOBRMBean.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrCommandSupport.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListCommand.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListUrlCommand.java
    karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java
    karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/shell-commands.xml

Copied: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java (from r1476084, karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEvent.java)
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java?p2=karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java&p1=karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEvent.java&r1=1476084&r2=1476898&rev=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEvent.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrBundleEvent.java Mon Apr 29 06:02:19 2013
@@ -14,17 +14,16 @@
 package org.apache.karaf.cellar.obr;
 
 import org.apache.karaf.cellar.core.event.Event;
-import org.apache.karaf.cellar.core.event.EventType;
 
 /**
- * OBR bundle cluster event.
+ * Cluster OBR bundle event.
  */
-public class ObrBundleEvent extends Event {
+public class ClusterObrBundleEvent extends Event {
 
     private String bundleId;
     private int type;
 
-    public ObrBundleEvent(String bundleId, int type) {
+    public ClusterObrBundleEvent(String bundleId, int type) {
         super(bundleId);
         this.bundleId = bundleId;
         this.type = type;

Copied: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java (from r1476084, karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEvent.java)
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java?p2=karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java&p1=karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEvent.java&r1=1476084&r2=1476898&rev=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEvent.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ClusterObrUrlEvent.java Mon Apr 29 06:02:19 2013
@@ -14,17 +14,16 @@
 package org.apache.karaf.cellar.obr;
 
 import org.apache.karaf.cellar.core.event.Event;
-import org.apache.karaf.cellar.core.event.EventType;
 
 /**
- * OBR URLS_DISTRIBUTED_SET_NAME Event.
+ * Cluster OBR URL event.
  */
-public class ObrUrlEvent extends Event {
+public class ClusterObrUrlEvent extends Event {
 
     private String url;
     private int type;
 
-    public ObrUrlEvent(String url, int type) {
+    public ClusterObrUrlEvent(String url, int type) {
         super(url);
         this.url = url;
         this.type = type;

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/Constants.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/Constants.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/Constants.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/Constants.java Mon Apr 29 06:02:19 2013
@@ -14,7 +14,7 @@
 package org.apache.karaf.cellar.obr;
 
 /**
- * OBR constants
+ * Cellar OBR configuration constants.
  */
 public class Constants {
 

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleEventHandler.java Mon Apr 29 06:02:19 2013
@@ -30,9 +30,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- *  Bundles event handler.
+ *  Handler for cluster OBR bundle event.
  */
-public class ObrBundleEventHandler extends ObrSupport implements EventHandler<ObrBundleEvent> {
+public class ObrBundleEventHandler extends ObrSupport implements EventHandler<ClusterObrBundleEvent> {
 
     private static final transient Logger LOGGER = LoggerFactory.getLogger(ObrBundleEventHandler.class);
 
@@ -106,28 +106,28 @@ public class ObrBundleEventHandler exten
     }
 
     /**
-     * Process an OBR bundle event.
+     * Handle a received cluster OBR bundle event.
      *
-     * @param event the OBR bundle event.
+     * @param event the received cluster OBR bundle event.
      */
     @Override
-    public void handle(ObrBundleEvent event) {
+    public void handle(ClusterObrBundleEvent event) {
 
         // check if the handler is ON
         if (this.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
-            LOGGER.warn("CELLAR OBR: {} switch is OFF, cluster event not handled", SWITCH_ID);
+            LOGGER.warn("CELLAR OBR: {} switch is OFF", SWITCH_ID);
             return;
         }
 
         if (groupManager == null) {
         	//in rare cases for example right after installation this happens!
-        	LOGGER.error("CELLAR OBR: retrieved event {} while groupManager is not available yet!", event);
+        	LOGGER.error("CELLAR OBR: retrieved cluster event {} while groupManager is not available yet!", event);
         	return;
         }
 
         // check if the group is local
         if (!groupManager.isLocalGroup(event.getSourceGroup().getName())) {
-            LOGGER.debug("CELLAR OBR: node is not part of the event cluster group");
+            LOGGER.debug("CELLAR OBR: node is not part of the event cluster group {}", event.getSourceGroup().getName());
             return;
         }
 
@@ -165,10 +165,12 @@ public class ObrBundleEventHandler exten
         }
     }
 
-    public Class<ObrBundleEvent> getType() {
-        return ObrBundleEvent.class;
+    @Override
+    public Class<ClusterObrBundleEvent> getType() {
+        return ClusterObrBundleEvent.class;
     }
 
+    @Override
     public Switch getSwitch() {
         // load the switch status from the config
         try {

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleInfo.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleInfo.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleInfo.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrBundleInfo.java Mon Apr 29 06:02:19 2013
@@ -16,7 +16,7 @@ package org.apache.karaf.cellar.obr;
 import java.io.Serializable;
 
 /**
- * Simple wrapper class for OBR bundle information.
+ * OBR bundle info wrapper to be store in a cluster group.
  */
 public class ObrBundleInfo implements Serializable {
 

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrSupport.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrSupport.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrSupport.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrSupport.java Mon Apr 29 06:02:19 2013
@@ -18,16 +18,20 @@ import org.apache.karaf.cellar.core.Cell
 import org.osgi.framework.BundleContext;
 
 /**
- * Cellar OBR support.
+ * Generic OBR support.
  */
 public class ObrSupport extends CellarSupport {
 
     protected BundleContext bundleContext;
     protected RepositoryAdmin obrService;
 
-    public void init() { }
+    public void init() {
+        // nothing to do
+    }
 
-    public void destroy() { }
+    public void destroy() {
+        // nothing to do
+    }
 
     public RepositoryAdmin getObrService() {
         return this.obrService;

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlEventHandler.java Mon Apr 29 06:02:19 2013
@@ -24,9 +24,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * OBR URLS_DISTRIBUTED_SET_NAME Event handler.
+ * Handler for cluster OBR URL event.
  */
-public class ObrUrlEventHandler extends ObrSupport implements EventHandler<ObrUrlEvent> {
+public class ObrUrlEventHandler extends ObrSupport implements EventHandler<ClusterObrUrlEvent> {
 
     private static final transient Logger LOGGER = LoggerFactory.getLogger(ObrUrlEventHandler.class);
 
@@ -45,40 +45,39 @@ public class ObrUrlEventHandler extends 
     }
 
     /**
-     * Process an OBR URLS_DISTRIBUTED_SET_NAME event.
+     * Handle a received cluster OBR URL event.
      *
-     * @param obrUrlEvent the OBR URLS_DISTRIBUTED_SET_NAME Event.
+     * @param event the received cluster OBR URL event.
      */
     @Override
-    public void handle(ObrUrlEvent obrUrlEvent) {
+    public void handle(ClusterObrUrlEvent event) {
 
         // check if the handler is ON
         if (this.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
-            LOGGER.warn("CELLAR OBR: {} switch is OFF, cluster event not handled", SWITCH_ID);
+            LOGGER.warn("CELLAR OBR: switch is OFF", SWITCH_ID);
             return;
         }
 
         if (groupManager == null) {
         	//in rare cases for example right after installation this happens!
-        	LOGGER.error("CELLAR OBR: retrieved event {} while groupManager is not available yet!", obrUrlEvent);
+        	LOGGER.error("CELLAR OBR: retrieved event {} while groupManager is not available yet!", event);
         	return;
         }
 
         // check if the group is local
-        if (!groupManager.isLocalGroup(obrUrlEvent.getSourceGroup().getName())) {
-            LOGGER.debug("CELLAR OBR: node is not part of the event cluster group");
+        if (!groupManager.isLocalGroup(event.getSourceGroup().getName())) {
+            LOGGER.debug("CELLAR OBR: node is not part of the event cluster group {}", event.getSourceGroup().getName());
             return;
         }
 
-        String url = obrUrlEvent.getUrl();
-        String groupName = obrUrlEvent.getSourceGroup().getName();
+        String url = event.getUrl();
         try {
-            if (isAllowed(obrUrlEvent.getSourceGroup(), Constants.URLS_CONFIG_CATEGORY, url, EventType.INBOUND) || obrUrlEvent.getForce()) {
-                if (obrUrlEvent.getType() == Constants.URL_ADD_EVENT_TYPE) {
+            if (isAllowed(event.getSourceGroup(), Constants.URLS_CONFIG_CATEGORY, url, EventType.INBOUND) || event.getForce()) {
+                if (event.getType() == Constants.URL_ADD_EVENT_TYPE) {
                     LOGGER.debug("CELLAR OBR: adding repository URL {}", url);
                     obrService.addRepository(url);
                 }
-                if (obrUrlEvent.getType() == Constants.URL_REMOVE_EVENT_TYPE) {
+                if (event.getType() == Constants.URL_REMOVE_EVENT_TYPE) {
                     LOGGER.debug("CELLAR OBR: removing repository URL {}", url);
                     boolean removed = obrService.removeRepository(url);
                     if (!removed) {
@@ -91,10 +90,12 @@ public class ObrUrlEventHandler extends 
         }
     }
 
-    public Class<ObrUrlEvent> getType() {
-        return ObrUrlEvent.class;
+    @Override
+    public Class<ClusterObrUrlEvent> getType() {
+        return ClusterObrUrlEvent.class;
     }
 
+    @Override
     public Switch getSwitch() {
         // load the switch status from the config
         try {

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java Mon Apr 29 06:02:19 2013
@@ -30,7 +30,7 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * Bootstrap synchronizer for the OBR URLs.
+ * OBR URL Synchronizer.
  */
 public class ObrUrlSynchronizer extends ObrSupport implements Synchronizer {
 
@@ -38,6 +38,7 @@ public class ObrUrlSynchronizer extends 
 
     private List<EventProducer> producerList;
 
+    @Override
     public void init() {
         super.init();
         Set<Group> groups = groupManager.listLocalGroups();
@@ -51,24 +52,26 @@ public class ObrUrlSynchronizer extends 
         }
     }
 
+    @Override
     public void destroy() {
         super.destroy();
     }
 
     /**
-     * Pull the OBR URLS_DISTRIBUTED_SET_NAME from the cluster.
+     * Pull the OBR URLs from a cluster group to update the local state.
      *
      * @param group the cluster group.
      */
+    @Override
     public void pull(Group group) {
         if (group != null) {
             String groupName = group.getName();
-            Set<String> urls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+            Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
             ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
             try {
                 Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-                if (urls != null && !urls.isEmpty()) {
-                    for (String url : urls) {
+                if (clusterUrls != null && !clusterUrls.isEmpty()) {
+                    for (String url : clusterUrls) {
                         try {
                             LOGGER.debug("CELLAR OBR: adding repository URL {}", url);
                             obrService.addRepository(url);
@@ -84,14 +87,15 @@ public class ObrUrlSynchronizer extends 
     }
 
     /**
-     * Push the local OBR URLs to the cluster
+     * Push the local OBR URLs to a cluster group.
      *
      * @param group the cluster group.
      */
+    @Override
     public void push(Group group) {
         if (group != null) {
             String groupName = group.getName();
-            Set<String> urls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+            Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
 
             ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
             try {
@@ -99,17 +103,17 @@ public class ObrUrlSynchronizer extends 
                 Repository[] repositories = obrService.listRepositories();
                 for (Repository repository : repositories) {
                     if (isAllowed(group, Constants.URLS_CONFIG_CATEGORY, repository.getURI().toString(), EventType.OUTBOUND)) {
-                        urls.add(repository.getURI().toString());
-                        // push the bundles in the OBR distributed set
-                        Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+                        clusterUrls.add(repository.getURI().toString());
+                        // update OBR bundles in the cluster group
+                        Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
                         Resource[] resources = repository.getResources();
                         for (Resource resource : resources) {
                             ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString());
-                            bundles.add(info);
+                            clusterBundles.add(info);
                             // TODO fire event to the other nodes ?
                         }
                     } else {
-                        LOGGER.warn("CELLAR OBR: URL " + repository.getURI().toString() + " is blocked outbound");
+                        LOGGER.warn("CELLAR OBR: URL {} is blocked outbound for cluster group {}", repository.getURI().toString(), groupName);
                     }
                 }
             } finally {

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/CellarOBRMBean.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/CellarOBRMBean.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/CellarOBRMBean.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/CellarOBRMBean.java Mon Apr 29 06:02:19 2013
@@ -17,15 +17,53 @@ import javax.management.openmbean.Tabula
 import java.util.List;
 
 /**
- * MBean interface describing the operations and attributes on OBR service..
+ * Describe the operations and attributes of the Cellar OBR MBean.
  */
 public interface CellarOBRMBean {
 
+    /**
+     * List the OBR URLs in a cluster group.
+     *
+     * @param groupName the cluster group name.
+     * @return the list of OBR URLs.
+     * @throws Exception in case of retrieval failure.
+     */
     List<String> listUrls(String groupName) throws Exception;
+
+    /**
+     * List the OBR bundles in a cluster group.
+     *
+     * @param groupName the cluster group name.
+     * @return the list of OBR bundles.
+     * @throws Exception in case of retrieval failure.
+     */
     TabularData listBundles(String groupName) throws Exception;
 
+    /**
+     * Add an OBR URL in a cluster group.
+     *
+     * @param groupName the cluster group name.
+     * @param url the OBR URL.
+     * @throws Exception in case of add failure.
+     */
     void addUrl(String groupName, String url) throws Exception;
+
+    /**
+     * Remove an OBR URL from a cluster group.
+     *
+     * @param groupName the cluster group name.
+     * @param url the OBR URL.
+     * @throws Exception in case of remove failure.
+     */
     void removeUrl(String groupName, String url) throws Exception;
+
+    /**
+     * Deploy an OBR bundle in a cluster group.
+     *
+     * @param groupName the cluster group name.
+     * @param bundleId the bundle ID.
+     * @throws Exception in case of deploy failure.
+     */
     void deploy(String groupName, String bundleId) throws Exception;
 
 }

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/management/internal/CellarOBRMBeanImpl.java Mon Apr 29 06:02:19 2013
@@ -20,10 +20,10 @@ import org.apache.karaf.cellar.core.*;
 import org.apache.karaf.cellar.core.control.SwitchStatus;
 import org.apache.karaf.cellar.core.event.EventProducer;
 import org.apache.karaf.cellar.core.event.EventType;
+import org.apache.karaf.cellar.obr.ClusterObrBundleEvent;
+import org.apache.karaf.cellar.obr.ClusterObrUrlEvent;
 import org.apache.karaf.cellar.obr.Constants;
-import org.apache.karaf.cellar.obr.ObrBundleEvent;
 import org.apache.karaf.cellar.obr.ObrBundleInfo;
-import org.apache.karaf.cellar.obr.ObrUrlEvent;
 import org.apache.karaf.cellar.obr.management.CellarOBRMBean;
 import org.osgi.service.cm.ConfigurationAdmin;
 
@@ -49,6 +49,7 @@ public class CellarOBRMBeanImpl extends 
         super(CellarOBRMBean.class);
     }
 
+    @Override
     public List<String> listUrls(String groupName) throws Exception {
         // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
@@ -57,13 +58,14 @@ public class CellarOBRMBeanImpl extends 
         }
 
         List<String> result = new ArrayList<String>();
-        Set<String> urls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
-        for (String url : urls) {
+        Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        for (String url : clusterUrls) {
             result.add(url);
         }
         return result;
     }
 
+    @Override
     public TabularData listBundles(String groupName) throws Exception {
         // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
@@ -82,8 +84,8 @@ public class CellarOBRMBeanImpl extends 
         ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
         try {
             Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-            Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
-            for (ObrBundleInfo info : bundles) {
+            Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+            for (ObrBundleInfo info : clusterBundles) {
                 CompositeData data = new CompositeDataSupport(compositeType,
                         new String[]{ "name", "symbolic", "version" },
                         new Object[]{ info.getPresentationName(), info.getSymbolicName(), info.getVersion() });
@@ -96,6 +98,7 @@ public class CellarOBRMBeanImpl extends 
         return table;
     }
 
+    @Override
     public void addUrl(String groupName, String url) throws Exception {
         // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
@@ -114,31 +117,32 @@ public class CellarOBRMBeanImpl extends 
         support.setGroupManager(this.groupManager);
         support.setConfigurationAdmin(this.configurationAdmin);
         if (!support.isAllowed(group, Constants.URLS_CONFIG_CATEGORY, url, EventType.OUTBOUND)) {
-            throw new IllegalArgumentException("OBR URL " + url + " is blocked outbound");
+            throw new IllegalArgumentException("OBR URL " + url + " is blocked outbound for cluster group " + groupName);
         }
 
-        // push the OBR URL in the distributed set
-        Set<String> urls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
-        urls.add(url);
-        // push the bundles in the OBR distributed set
-        Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        // update OBR URLs in the cluster group
+        Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        clusterUrls.add(url);
+        // update OBR bundles in the cluster group
+        Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
         synchronized (obrService) {
             Repository repository = obrService.addRepository(url);
             Resource[] resources = repository.getResources();
             for (Resource resource : resources) {
                 ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString());
-                bundles.add(info);
+                clusterBundles.add(info);
             }
             obrService.removeRepository(url);
         }
 
-        // create an cluster event and produce it
-        ObrUrlEvent event = new ObrUrlEvent(url, Constants.URL_ADD_EVENT_TYPE);
+        // broadcast a cluster event
+        ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_ADD_EVENT_TYPE);
         event.setForce(true);
         event.setSourceGroup(group);
         eventProducer.produce(event);
     }
 
+    @Override
     public void removeUrl(String groupName, String url) throws Exception {
         // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
@@ -157,30 +161,31 @@ public class CellarOBRMBeanImpl extends 
         support.setGroupManager(this.groupManager);
         support.setConfigurationAdmin(this.configurationAdmin);
         if (!support.isAllowed(group, Constants.URLS_CONFIG_CATEGORY, url, EventType.OUTBOUND)) {
-            throw new IllegalArgumentException("OBR URL " + url + " is blocked outbound");
+            throw new IllegalArgumentException("OBR URL " + url + " is blocked outbound for cluster group " + groupName);
         }
 
-        // remove URL from the distributed map
-        Set<String> urls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
-        urls.remove(url);
-        // remove bundles from the distributed map
-        Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        // update the OBR URLs in the cluster group
+        Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        clusterUrls.remove(url);
+        // update the OBR bundles in the cluster group
+        Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
         synchronized (obrService) {
             Repository repository = obrService.addRepository(url);
             Resource[] resources = repository.getResources();
             for (Resource resource : resources) {
                 ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString());
-                bundles.remove(info);
+                clusterBundles.remove(info);
             }
             obrService.removeRepository(url);
         }
 
-        // create an event and produce it
-        ObrUrlEvent event = new ObrUrlEvent(url, Constants.URL_REMOVE_EVENT_TYPE);
+        // broadcast a cluster event
+        ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_REMOVE_EVENT_TYPE);
         event.setSourceGroup(group);
         eventProducer.produce(event);
     }
 
+    @Override
     public void deploy(String groupName, String bundleId) throws Exception {
         // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
@@ -199,12 +204,12 @@ public class CellarOBRMBeanImpl extends 
         support.setGroupManager(this.groupManager);
         support.setConfigurationAdmin(this.configurationAdmin);
         if (!support.isAllowed(group, Constants.BUNDLES_CONFIG_CATEGORY, bundleId, EventType.OUTBOUND)) {
-            throw new IllegalArgumentException("OBR bundle " + bundleId + " is blocked outbound");
+            throw new IllegalArgumentException("OBR bundle " + bundleId + " is blocked outbound for cluster group " + groupName);
         }
 
-        // create an event and produce it
+        // broadcast a cluster event
         int type = 0;
-        ObrBundleEvent event = new ObrBundleEvent(bundleId, type);
+        ClusterObrBundleEvent event = new ClusterObrBundleEvent(bundleId, type);
         event.setForce(true);
         event.setSourceGroup(group);
         eventProducer.produce(event);

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrAddUrlCommand.java Mon Apr 29 06:02:19 2013
@@ -20,25 +20,26 @@ import org.apache.karaf.cellar.core.Grou
 import org.apache.karaf.cellar.core.control.SwitchStatus;
 import org.apache.karaf.cellar.core.event.EventProducer;
 import org.apache.karaf.cellar.core.event.EventType;
+import org.apache.karaf.cellar.obr.ClusterObrUrlEvent;
 import org.apache.karaf.cellar.obr.Constants;
 import org.apache.karaf.cellar.obr.ObrBundleInfo;
-import org.apache.karaf.cellar.obr.ObrUrlEvent;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 
 import java.util.Set;
 
-@Command(scope = "cluster", name = "obr-add-url", description = "Register a repository URL in the distributed OBR service.")
+@Command(scope = "cluster", name = "obr-add-url", description = "Add an OBR URL in a cluster group")
 public class ObrAddUrlCommand extends ObrCommandSupport {
 
-    @Argument(index = 0, name = "group", description = "The cluster group name.", required = true, multiValued = false)
+    @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
     String groupName;
 
-    @Argument(index = 1, name = "url", description = "The repository URL to register in the OBR service.", required = true, multiValued = false)
+    @Argument(index = 1, name = "url", description = "The OBR URL.", required = true, multiValued = false)
     String url;
 
     private EventProducer eventProducer;
 
+    @Override
     public Object doExecute() throws Exception {
         // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
@@ -49,33 +50,33 @@ public class ObrAddUrlCommand extends Ob
 
         // check if the producer is ON
         if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
-            System.err.println("Cluster event producer is OFF for this node");
+            System.err.println("Cluster event producer is OFF");
             return null;
         }
 
         // check if the URL is allowed
         if (!isAllowed(group, Constants.URLS_CONFIG_CATEGORY, url, EventType.OUTBOUND)) {
-            System.err.println("OBR URL " + url + " is blocked outbound");
+            System.err.println("OBR URL " + url + " is blocked outbound for cluster group " + groupName);
             return null;
         }
 
-        // push the OBR URL in the distributed set
-        Set<String> urls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
-        urls.add(url);
-        // push the bundles in the OBR distributed set
-        Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        // update the OBR URLs in the cluster group
+        Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        clusterUrls.add(url);
+        // update the OBR bundles in the cluster group
+        Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
         synchronized(obrService) {
             Repository repository = obrService.addRepository(url);
             Resource[] resources = repository.getResources();
             for (Resource resource : resources) {
                 ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(),resource.getSymbolicName(), resource.getVersion().toString());
-                bundles.add(info);
+                clusterBundles.add(info);
             }
             obrService.removeRepository(url);
         }
 
-        // broadcast the cluster event
-        ObrUrlEvent event = new ObrUrlEvent(url, Constants.URL_ADD_EVENT_TYPE);
+        // broadcast a cluster event
+        ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_ADD_EVENT_TYPE);
         event.setSourceGroup(group);
         eventProducer.produce(event);
 

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrCommandSupport.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrCommandSupport.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrCommandSupport.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrCommandSupport.java Mon Apr 29 06:02:19 2013
@@ -19,6 +19,9 @@ import org.apache.karaf.cellar.core.Grou
 import org.apache.karaf.cellar.core.event.EventType;
 import org.apache.karaf.cellar.core.shell.CellarCommandSupport;
 
+/**
+ * Generic cluster OBR shell command support.
+ */
 public abstract class ObrCommandSupport extends CellarCommandSupport {
 
     protected RepositoryAdmin obrService;
@@ -31,6 +34,15 @@ public abstract class ObrCommandSupport 
         this.obrService = obrService;
     }
 
+    /**
+     * Check if an OBR cluster event is allowed.
+     *
+     * @param group the cluster group.
+     * @param category the OBR category name.
+     * @param id the event ID.
+     * @param type the event type (inbound, outbound).
+     * @return in case of check failure.
+     */
     public boolean isAllowed(Group group, String category, String id, EventType type) {
         CellarSupport support = new CellarSupport();
         support.setClusterManager(this.clusterManager);
@@ -39,6 +51,7 @@ public abstract class ObrCommandSupport 
         return support.isAllowed(group, category, id, type);
     }
 
+    @Override
     public abstract Object doExecute() throws Exception;
 
 

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrDeployCommand.java Mon Apr 29 06:02:19 2013
@@ -17,20 +17,19 @@ import org.apache.karaf.cellar.core.Grou
 import org.apache.karaf.cellar.core.control.SwitchStatus;
 import org.apache.karaf.cellar.core.event.EventProducer;
 import org.apache.karaf.cellar.core.event.EventType;
-import org.apache.karaf.cellar.core.shell.CellarCommandSupport;
+import org.apache.karaf.cellar.obr.ClusterObrBundleEvent;
 import org.apache.karaf.cellar.obr.Constants;
-import org.apache.karaf.cellar.obr.ObrBundleEvent;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 
-@Command(scope = "cluster", name = "obr-deploy", description = "Deploy a bundle from the OBR assigned to a cluster group")
+@Command(scope = "cluster", name = "obr-deploy", description = "Deploy an OBR bundle in a cluster group")
 public class ObrDeployCommand extends ObrCommandSupport {
 
-    @Argument(index = 0, name = "group", description = "The cluster group name.", required = true, multiValued = false)
+    @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
     String groupName;
 
-    @Argument(index = 1, name="bundleId", description = "The bundle ID (symbolicname,version in the OBR) to deploy.", required = true, multiValued = false)
+    @Argument(index = 1, name="bundleId", description = "The bundle ID (symbolicname,version in the OBR) to deploy", required = true, multiValued = false)
     String bundleId;
 
     @Option(name = "-s", aliases = { "--start" }, description = "Start the deployed bundles.", required = false, multiValued = false)
@@ -49,20 +48,20 @@ public class ObrDeployCommand extends Ob
 
         // check if the producer is ON
         if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
-            System.err.println("Cluster event producer is OFF for this node");
+            System.err.println("Cluster event producer is OFF");
             return null;
         }
 
         // check if the bundle is allowed
         if (!isAllowed(group, Constants.BUNDLES_CONFIG_CATEGORY, bundleId, EventType.OUTBOUND)) {
-            System.err.println("OBR bundle " + bundleId + " is blocked outbound");
+            System.err.println("OBR bundle " + bundleId + " is blocked outbound for cluster group " + groupName);
             return null;
         }
 
-        // broadcast the cluster event
+        // broadcast a cluster event
         int type = 0;
         if (start) type = Constants.BUNDLE_START_EVENT_TYPE;
-        ObrBundleEvent event = new ObrBundleEvent(bundleId, type);
+        ClusterObrBundleEvent event = new ClusterObrBundleEvent(bundleId, type);
         event.setSourceGroup(group);
         eventProducer.produce(event);
 

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListCommand.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListCommand.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListCommand.java Mon Apr 29 06:02:19 2013
@@ -23,15 +23,13 @@ import org.apache.karaf.shell.commands.C
 
 import java.util.Set;
 
-/**
- * cluster:obr-list command.
- */
-@Command(scope = "cluster", name = "obr-list", description = "List available bundles in the OBR of all nodes assigned to a cluster group")
+@Command(scope = "cluster", name = "obr-list", description = "List the OBR bundles in a cluster group")
 public class ObrListCommand extends CellarCommandSupport {
 
     @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
     String groupName;
 
+    @Override
     public Object doExecute() {
         // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
@@ -43,11 +41,11 @@ public class ObrListCommand extends Cell
         ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
         try {
             Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-            Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+            Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
             int maxPName = 4;
             int maxSName = 13;
             int maxVersion = 7;
-            for (ObrBundleInfo bundle : bundles) {
+            for (ObrBundleInfo bundle : clusterBundles) {
                 maxPName = Math.max(maxPName, emptyIfNull(bundle.getPresentationName()).length());
                 maxSName = Math.max(maxSName, emptyIfNull(bundle.getSymbolicName()).length());
                 maxVersion = Math.max(maxVersion, emptyIfNull(bundle.getVersion()).length());
@@ -55,7 +53,7 @@ public class ObrListCommand extends Cell
             String formatHeader = "  %-" + maxPName + "s  %-" + maxSName + "s   %-" + maxVersion + "s";
             String formatLine = "[%-" + maxPName + "s] [%-" + maxSName + "s] [%-" + maxVersion + "s]";
             System.out.println(String.format(formatHeader, "NAME", "SYMBOLIC NAME", "VERSION"));
-            for (ObrBundleInfo bundle : bundles) {
+            for (ObrBundleInfo bundle : clusterBundles) {
                 System.out.println(String.format(formatLine, emptyIfNull(bundle.getPresentationName()), emptyIfNull(bundle.getSymbolicName()), emptyIfNull(bundle.getVersion())));
             }
         } finally {

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListUrlCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListUrlCommand.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListUrlCommand.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrListUrlCommand.java Mon Apr 29 06:02:19 2013
@@ -22,27 +22,25 @@ import org.apache.karaf.shell.commands.C
 
 import java.util.Set;
 
-/**
- * cluster:obr-list command
- */
-@Command(scope = "cluster", name = "obr-list-url", description = "List repository URLs defined in the distributed OBR service assigned to a given group")
+@Command(scope = "cluster", name = "obr-list-url", description = "List the OBR URLs in a cluster group")
 public class ObrListUrlCommand extends CellarCommandSupport {
 
     @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
     String groupName;
 
+    @Override
     public Object doExecute() throws Exception {
-        // cehck if the group exists
+        // check if the group exists
         Group group = groupManager.findGroupByName(groupName);
         if (group == null) {
             System.err.println("Cluster group " + groupName + " doesn't exist");
             return null;
         }
 
-        // get the URLs from the distribution set
-        Set<String> urls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
-        if (urls != null) {
-            for (String url : urls) {
+        // get the OBR URLs in a cluster group
+        Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
+        if (clusterUrls != null) {
+            for (String url : clusterUrls) {
                 System.out.println(url);
             }
         }

Modified: karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java (original)
+++ karaf/cellar/trunk/obr/src/main/java/org/apache/karaf/cellar/obr/shell/ObrRemoveUrlCommand.java Mon Apr 29 06:02:19 2013
@@ -20,9 +20,9 @@ import org.apache.karaf.cellar.core.Grou
 import org.apache.karaf.cellar.core.control.SwitchStatus;
 import org.apache.karaf.cellar.core.event.EventProducer;
 import org.apache.karaf.cellar.core.event.EventType;
+import org.apache.karaf.cellar.obr.ClusterObrUrlEvent;
 import org.apache.karaf.cellar.obr.Constants;
 import org.apache.karaf.cellar.obr.ObrBundleInfo;
-import org.apache.karaf.cellar.obr.ObrUrlEvent;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 
@@ -75,7 +75,7 @@ public class ObrRemoveUrlCommand extends
         }
 
         // create an event and produce it
-        ObrUrlEvent event = new ObrUrlEvent(url, Constants.URL_REMOVE_EVENT_TYPE);
+        ClusterObrUrlEvent event = new ClusterObrUrlEvent(url, Constants.URL_REMOVE_EVENT_TYPE);
         event.setSourceGroup(group);
         eventProducer.produce(event);
 

Modified: karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/blueprint.xml (original)
+++ karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/blueprint.xml Mon Apr 29 06:02:19 2013
@@ -14,7 +14,7 @@
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
 
-    <!-- OBR Bundles Event Handler -->
+    <!-- Cluster OBR Bundle Event Handler -->
     <bean id="obrBundleEventHandler" class="org.apache.karaf.cellar.obr.ObrBundleEventHandler"
             init-method="init" destroy-method="destroy">
         <property name="obrService" ref="repositoryAdmin"/>
@@ -28,7 +28,7 @@
         </service-properties>
     </service>
 
-    <!-- OBR URLS_DISTRIBUTED_SET_NAME Synchronizer -->
+    <!-- OBR URLs Synchronizer -->
     <bean id="obrUrlSynchronizer" class="org.apache.karaf.cellar.obr.ObrUrlSynchronizer"
             init-method="init" destroy-method="destroy">
         <property name="obrService" ref="repositoryAdmin"/>
@@ -39,7 +39,7 @@
     </bean>
     <service ref="obrUrlSynchronizer" interface="org.apache.karaf.cellar.core.Synchronizer"/>
 
-    <!-- OBR URLS_DISTRIBUTED_SET_NAME Event Handler -->
+    <!-- Cluster OBR URL Event Handler -->
     <bean id="obrUrlEventHandler" class="org.apache.karaf.cellar.obr.ObrUrlEventHandler"
           init-method="init" destroy-method="destroy">
         <property name="obrService" ref="repositoryAdmin"/>
@@ -53,7 +53,6 @@
         </service-properties>
     </service>
 
-    <!-- service references -->
     <reference id="repositoryAdmin" interface="org.apache.felix.bundlerepository.RepositoryAdmin"/>
     <reference id="clusterManager" interface="org.apache.karaf.cellar.core.ClusterManager"/>
     <reference id="groupManager" interface="org.apache.karaf.cellar.core.GroupManager"/>

Modified: karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/shell-commands.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/shell-commands.xml?rev=1476898&r1=1476897&r2=1476898&view=diff
==============================================================================
--- karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/shell-commands.xml (original)
+++ karaf/cellar/trunk/obr/src/main/resources/OSGI-INF/blueprint/shell-commands.xml Mon Apr 29 06:02:19 2013
@@ -14,7 +14,6 @@
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
 
-    <!-- Command Bundle -->
     <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
         <command name="cluster/obr-list">
             <action class="org.apache.karaf.cellar.obr.shell.ObrListCommand">