karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1471549 - in /karaf/cellar/trunk/hazelcast/src: main/java/org/apache/karaf/cellar/hazelcast/ main/java/org/apache/karaf/cellar/hazelcast/factory/ main/java/org/apache/karaf/cellar/hazelcast/merge/ main/resources/OSGI-INF/blueprint/ test/ja...
Date Wed, 24 Apr 2013 17:23:49 GMT
Author: jbonofre
Date: Wed Apr 24 17:23:48 2013
New Revision: 1471549

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

Modified:
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/CellarExtender.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/Constants.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastBundleListener.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastEventTransportFactory.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastInstanceAware.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastNode.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueProducer.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicConsumer.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicProducer.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastConfigurationManager.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactory.java
    karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/merge/CellarMergePolicy.java
    karaf/cellar/trunk/hazelcast/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactoryTest.java

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/CellarExtender.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/CellarExtender.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/CellarExtender.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/CellarExtender.java Wed Apr 24 17:23:48 2013
@@ -11,12 +11,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.karaf.cellar.hazelcast;
 
 import org.apache.karaf.cellar.core.utils.CombinedClassLoader;
 import org.osgi.framework.BundleContext;
 
+/**
+ * Cellar extender.
+ */
 public class CellarExtender  {
 
     private HazelcastBundleListener hazelcastBundleListener;
@@ -45,4 +47,5 @@ public class CellarExtender  {
     public void setCombinedClassLoader(CombinedClassLoader combinedClassLoader) {
         this.combinedClassLoader = combinedClassLoader;
     }
+
 }

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/Constants.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/Constants.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/Constants.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/Constants.java Wed Apr 24 17:23:48 2013
@@ -14,7 +14,7 @@
 package org.apache.karaf.cellar.hazelcast;
 
 /**
- * Hazelcast constants.
+ * Hazelcast configuration constants.
  */
 public class Constants {
 

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastBundleListener.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastBundleListener.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastBundleListener.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastBundleListener.java Wed Apr 24 17:23:48 2013
@@ -18,6 +18,9 @@ import org.osgi.framework.*;
 
 import java.util.Dictionary;
 
+/**
+ * Hazelcast bundle listener.
+ */
 public class HazelcastBundleListener implements SynchronousBundleListener {
 
     private BundleContext bundleContext;

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastClusterManager.java Wed Apr 24 17:23:48 2013
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Set;
 
 /**
- * Hazelcast cluster manager.
+ * Cluster manager implementation powered by Hazelcast.
  */
 public class HazelcastClusterManager extends HazelcastInstanceAware implements ClusterManager {
 
@@ -41,40 +41,44 @@ public class HazelcastClusterManager ext
     private CombinedClassLoader combinedClassLoader;
 
     /**
-     * Returns a named distributed map.
+     * Get a Map in Hazelcast.
      *
-     * @param mapName
-     * @return
+     * @param mapName the Map name.
+     * @return the Map in Hazelcast.
      */
+    @Override
     public Map getMap(String mapName) {
         return instance.getMap(mapName);
     }
 
     /**
-     * Returns a named distributed list.
+     * Get a List in Hazelcast.
      *
-     * @param listName
-     * @return
+     * @param listName the List name.
+     * @return the List in Hazelcast.
      */
+    @Override
     public List getList(String listName) {
         return instance.getList(listName);
     }
 
     /**
-     * Returns a named distributed set.
-     * @param setName
-     * @return
+     * Get a Set in Hazelcast.
+     *
+     * @param setName the Set name.
+     * @return the Set in Hazelcast.
      */
+    @Override
     public Set getSet(String setName) {
         return instance.getSet(setName);
     }
 
-
     /**
-     * Returns the list of Hazelcast Nodes.
+     * Get the list of Hazelcast nodes.
      *
-     * @return
+     * @return a Set containing the Hazelcast nodes.
      */
+    @Override
     public Set<Node> listNodes() {
         Set<Node> nodes = new HashSet<Node>();
 
@@ -91,14 +95,13 @@ public class HazelcastClusterManager ext
         return nodes;
     }
 
-
-
     /**
-     * Returns the {@code Node}s with the corresponding ids.
+     * Get the nodes with given IDs.
      *
-     * @param ids
-     * @return
+     * @param ids a collection of IDs to look for.
+     * @return a Set containing the nodes.
      */
+    @Override
     public Set<Node> listNodes(Collection<String> ids) {
         Set<Node> nodes = new HashSet<Node>();
         if (ids != null && !ids.isEmpty()) {
@@ -119,11 +122,12 @@ public class HazelcastClusterManager ext
     }
 
     /**
-     * Returns the {@code Node} with the corresponding id.
+     * Get a node with a given ID.
      *
-     * @param id
-     * @return
+     * @param id the node ID.
+     * @return the node.
      */
+    @Override
     public Node findNodeById(String id) {
         if (id != null) {
             Cluster cluster = instance.getCluster();
@@ -142,16 +146,23 @@ public class HazelcastClusterManager ext
         return null;
     }
 
+    /**
+     * List the nodes in a given cluster group.
+     *
+     * @param group the cluster group.
+     * @return a Set with the nodes.
+     */
     @Override
     public Set<Node> listNodesByGroup(Group group) {
         return group.getNodes();
     }
 
     /**
-     * Generate an id.
+     * Generate an unique ID.
      *
-     * @return
+     * @return the generated unique ID.
      */
+    @Override
     public synchronized String generateId() {
         if (idgenerator == null) {
             idgenerator = instance.getIdGenerator(GENERATOR_ID);
@@ -159,16 +170,19 @@ public class HazelcastClusterManager ext
         return String.valueOf(idgenerator.newId());
     }
 
+    @Override
     public void start() {
-
+        // nothing to do
     }
 
+    @Override
     public void stop() {
         if (instance != null && instance.getLifecycleService().isRunning()) {
             instance.getLifecycleService().shutdown();
         }
     }
 
+    @Override
     public void restart() {
         if (instance != null && instance.getLifecycleService().isRunning()) {
             instance.getLifecycleService().restart();
@@ -190,4 +204,5 @@ public class HazelcastClusterManager ext
     public void setCombinedClassLoader(CombinedClassLoader combinedClassLoader) {
         this.combinedClassLoader = combinedClassLoader;
     }
+
 }

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastEventTransportFactory.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastEventTransportFactory.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastEventTransportFactory.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastEventTransportFactory.java Wed Apr 24 17:23:48 2013
@@ -21,9 +21,9 @@ import org.apache.karaf.cellar.core.even
 import org.apache.karaf.cellar.core.event.EventTransportFactory;
 import org.apache.karaf.cellar.core.utils.CombinedClassLoader;
 
-import java.util.HashMap;
-import java.util.Map;
-
+/**
+ * An event transport factory powered by Hazelcast.
+ */
 public class HazelcastEventTransportFactory extends HazelcastInstanceAware implements EventTransportFactory {
 
     private Dispatcher dispatcher;

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java Wed Apr 24 17:23:48 2013
@@ -42,7 +42,7 @@ import org.osgi.service.cm.Configuration
 import org.slf4j.Logger;
 
 /**
- * Hazelcast group manager.
+ * A group manager implementation powered by Hazelcast.
  * The role of this class is to provide means of creating groups, setting nodes to groups etc.
  * Keep in sync the distributed group configuration with the locally persisted.
  */
@@ -89,7 +89,7 @@ public class HazelcastGroupManager imple
                 }
             }
         } catch (IOException e) {
-            LOGGER.warn("CELLAR HAZELCAST: can't create group from configuration admin", e);
+            LOGGER.warn("CELLAR HAZELCAST: can't create cluster group from configuration admin", e);
         }
         try {
             // add group membership from configuration
@@ -169,7 +169,7 @@ public class HazelcastGroupManager imple
                     // store the group list to configuration admin
                     persist(listGroups());
                 } catch (Exception e) {
-                    LOGGER.warn("CELLAR HAZELCAST: can't store group list", e);
+                    LOGGER.warn("CELLAR HAZELCAST: can't store cluster group list", e);
                 }
             }
             return group;
@@ -189,7 +189,7 @@ public class HazelcastGroupManager imple
                     // store the group list to configuration admin
                     persist(listGroups());
                 } catch (Exception e) {
-                    LOGGER.warn("CELLAR HAZELCAST: can't store group list", e);
+                    LOGGER.warn("CELLAR HAZELCAST: can't store cluster group list", e);
                 }
             }
         } finally {
@@ -331,8 +331,9 @@ public class HazelcastGroupManager imple
     }
 
     /**
-     * Registers a {@link Group}.
-     * @param group
+     * Register a cluster {@link Group}.
+     *
+     * @param group the cluster group to register.
      */
     @Override
     public void registerGroup(Group group) {
@@ -342,7 +343,7 @@ public class HazelcastGroupManager imple
             String groupName = group.getName();
             createGroup(groupName);
 
-            LOGGER.info("Registering group {}.", groupName);
+            LOGGER.info("CELLAR HAZELCAST: registering cluster group {}.", groupName);
             Properties serviceProperties = new Properties();
             serviceProperties.put("type", "group");
             serviceProperties.put("name", groupName);
@@ -396,7 +397,7 @@ public class HazelcastGroupManager imple
                     }
                 }
             } catch (IOException e) {
-                LOGGER.error("Error reading group configuration {}", group);
+                LOGGER.error("CELLAR HAZELCAST: error reading cluster group configuration {}", group);
             }
 
             // launch the synchronization on the group
@@ -413,7 +414,7 @@ public class HazelcastGroupManager imple
                     }
                 }
             } catch (InvalidSyntaxException e) {
-                LOGGER.error("Error looking up for Synchronizers", e);
+                LOGGER.error("CELLAR HAZELCAST: failed to look for synchronizers", e);
             }
         } finally {
             Thread.currentThread().setContextClassLoader(originalClassLoader);
@@ -446,16 +447,17 @@ public class HazelcastGroupManager imple
         }
     }
 
+    @Override
     public void unRegisterGroup(Group group) {
         ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
         try {
             Thread.currentThread().setContextClassLoader(combinedClassLoader);
             String groupName = group.getName();
-            // remove local node from group.
+            // remove local node from cluster group
             group.getNodes().remove(getNode());
             listGroups().put(groupName, group);
 
-            // unregister group consumers
+            // un-register cluster group consumers
             if (consumerRegistrations != null && !consumerRegistrations.isEmpty()) {
                 ServiceRegistration consumerRegistration = consumerRegistrations.get(groupName);
                 if (consumerRegistration != null) {
@@ -464,7 +466,7 @@ public class HazelcastGroupManager imple
                 }
             }
 
-            // unregister group producers
+            // un-register cluster group producers
             if (producerRegistrations != null && !producerRegistrations.isEmpty()) {
                 ServiceRegistration producerRegistration = producerRegistrations.get(groupName);
                 if (producerRegistration != null) {
@@ -473,14 +475,14 @@ public class HazelcastGroupManager imple
                 }
             }
 
-            // remove Consumers & Producers
+            // remove consumers & producers
             groupProducers.remove(groupName);
             EventConsumer consumer = groupConsumer.remove(groupName);
             if (consumer != null) {
                 consumer.stop();
             }
 
-            // remove group from configuration
+            // remove cluster group from configuration
             try {
                 Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE);
                 Dictionary<String, Object> properties = configuration.getProperties();
@@ -495,7 +497,7 @@ public class HazelcastGroupManager imple
                 properties.put(Configurations.GROUPS_KEY, groups);
                 configuration.update(properties);
             } catch (IOException e) {
-                LOGGER.error("Error reading group configuration {}", group);
+                LOGGER.error("CELLAR HAZELCAST: failed to read cluster group configuration", e);
             }
         } finally {
             Thread.currentThread().setContextClassLoader(originalClassLoader);
@@ -503,27 +505,28 @@ public class HazelcastGroupManager imple
     }
 
     /**
-     * Copies the configuration of a {@link Group}.
+     * Copy the configuration of a cluster {@link Group}.
+     *
      * <b>1.</b> Updates configuration admin from Hazelcast using source config.
      * <b>2.</b> Creates target configuration both on Hazelcast and configuration admin.
      *
-     * @param sourceGroupName
-     * @param targetGroupName
+     * @param sourceGroupName the source cluster group.
+     * @param targetGroupName the target cluster group.
      */
     public void copyGroupConfiguration(String sourceGroupName, String targetGroupName) {
         try {
             Configuration conf = configurationAdmin.getConfiguration(Configurations.GROUP);
             if (conf != null) {
 
-                //Get configuration from config admin.
+                // get configuration from config admin
                 Dictionary configAdminProperties = conf.getProperties();
                 if (configAdminProperties == null) {
                     configAdminProperties = new Properties();
                 }
-                //Get configuration from Hazelcast
+                // get configuration from Hazelcast
                 Map<String, String> sourceGropConfig = instance.getMap(GROUPS_CONFIG);
 
-                //Update local configuration from cluster.
+                // update local configuration from cluster
                 for (Map.Entry<String, String> parentEntry : sourceGropConfig.entrySet()) {
                     configAdminProperties.put(parentEntry.getKey(), parentEntry.getValue());
                 }
@@ -546,15 +549,15 @@ public class HazelcastGroupManager imple
             }
 
         } catch (IOException e) {
-            LOGGER.error("Error reading group configuration ", e);
+            LOGGER.error("CELLAR HAZELCAST: failed to read cluster group configuration", e);
         }
     }
 
     /**
-     * Utility method which converts a set to a String.
+     * Util method which converts a Set to a String.
      *
-     * @param set
-     * @return
+     * @param set the Set to convert.
+     * @return the String corresponding to the Set.
      */
     protected String convertSetToString(Set<String> set) {
         StringBuffer result = new StringBuffer();
@@ -570,10 +573,10 @@ public class HazelcastGroupManager imple
     }
 
     /**
-     * Utility method which converts String to Set.
+     * Util method which converts a String to a Set.
      *
-     * @param string
-     * @return
+     * @param string the String to convert.
+     * @return the Set corresponding to the String.
      */
     protected Set<String> convertStringToSet(String string) {
     	if (string == null)
@@ -591,7 +594,11 @@ public class HazelcastGroupManager imple
         return result;
     }
 
-
+    /**
+     * A local configuration listener to update the local Hazelcast instance when the configuration changes.
+     *
+     * @param configurationEvent the local configuration event.
+     */
     @Override
     public void configurationEvent(ConfigurationEvent configurationEvent) {
         String pid = configurationEvent.getPid();
@@ -610,7 +617,7 @@ public class HazelcastGroupManager imple
                     }
                 }
             } catch (Exception e) {
-                LOGGER.warn("Failed to update group configuration");
+                LOGGER.warn("CELLAR HAZELCAST: failed to update cluster group configuration", e);
             }
         }
     }
@@ -642,7 +649,7 @@ public class HazelcastGroupManager imple
      */
     @Override
     public void entryUpdated(EntryEvent entryEvent) {
-        LOGGER.info("Distributed Group configuration has been updated, updating local configuration.");
+        LOGGER.info("CELLAR HAZELCAST: cluster group configuration has been updated, updating local configuration");
         try {
             Configuration conf = configurationAdmin.getConfiguration(GROUPS);
             Dictionary props = conf.getProperties();
@@ -653,7 +660,7 @@ public class HazelcastGroupManager imple
                 conf.update(props);
             }
         } catch (Exception ex) {
-            LOGGER.warn("Error while updating local group configuration", ex);
+            LOGGER.warn("CELLAR HAZELCAST: failed to update local configuration", ex);
         }
     }
 
@@ -667,7 +674,6 @@ public class HazelcastGroupManager imple
         entryUpdated(entryEvent);
     }
 
-
     public HazelcastInstance getInstance() {
         return instance;
     }

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastInstanceAware.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastInstanceAware.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastInstanceAware.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastInstanceAware.java Wed Apr 24 17:23:48 2013
@@ -18,6 +18,9 @@ import com.hazelcast.core.HazelcastInsta
 import com.hazelcast.core.Member;
 import org.apache.karaf.cellar.core.Node;
 
+/**
+ * Hazelcast instance aware.
+ */
 public class HazelcastInstanceAware {
 
     protected HazelcastInstance instance;
@@ -30,10 +33,10 @@ public class HazelcastInstanceAware {
         this.instance = null;
     }
 
-        /**
-     * Returns the node on which the command was run.
+    /**
+     * Return the local node.
      *
-     * @return
+     * @return the local node.
      */
     public Node getNode() {
         Cluster cluster = instance.getCluster();
@@ -53,6 +56,4 @@ public class HazelcastInstanceAware {
         this.instance = instance;
     }
 
-
-
 }

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastNode.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastNode.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastNode.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastNode.java Wed Apr 24 17:23:48 2013
@@ -16,7 +16,7 @@ package org.apache.karaf.cellar.hazelcas
 import org.apache.karaf.cellar.core.Node;
 
 /**
- * Hazelcast cluster node.
+ * Cluster node powered by Hazelcast.
  */
 public class HazelcastNode implements Node {
 
@@ -25,12 +25,6 @@ public class HazelcastNode implements No
     private String host;
     private int port;
 
-    /**
-     * Constructor
-     *
-     * @param host
-     * @param port
-     */
     public HazelcastNode(String host, int port) {
         StringBuilder builder = new StringBuilder();
         this.host = host;
@@ -38,10 +32,12 @@ public class HazelcastNode implements No
         this.id = builder.append(host).append(":").append(port).toString();
     }
 
+    @Override
     public String getId() {
         return id;
     }
 
+    @Override
     public String getHost() {
         return host;
     }
@@ -50,6 +46,7 @@ public class HazelcastNode implements No
         this.host = host;
     }
 
+    @Override
     public int getPort() {
         return port;
     }
@@ -81,9 +78,6 @@ public class HazelcastNode implements No
         return id != null ? id.hashCode() : 0;
     }
 
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
 	@Override
 	public String toString() {
 		return "HazelcastNode [id=" + id + ", host=" + host + ", port=" + port

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueConsumer.java Wed Apr 24 17:23:48 2013
@@ -36,7 +36,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
 /**
- * Consumes messages from the distributed {@code ITopic} and calls the {@code EventDispatcher}.
+ * Consumes cluster events from the Hazelcast {@code IQueue} and calls the {@code EventDispatcher}.
  */
 public class QueueConsumer<E extends Event> implements EventConsumer<E>, ItemListener<E>, Runnable {
 
@@ -57,15 +57,13 @@ public class QueueConsumer<E extends Eve
     private ConfigurationAdmin configurationAdmin;
 
     public QueueConsumer() {
+        // nothing to do
     }
 
     public QueueConsumer(CombinedClassLoader combinedClassLoader) {
         this.combinedClassLoader = combinedClassLoader;
     }
 
-    /**
-     * Initialization method.
-     */
     public void init() {
         if (queue != null) {
             queue.addItemListener(this, true);
@@ -76,9 +74,6 @@ public class QueueConsumer<E extends Eve
         executorService.execute(this);
     }
 
-    /**
-     * Destruction method.
-     */
     public void destroy() {
         isConsuming = false;
         if (queue != null) {
@@ -99,24 +94,25 @@ public class QueueConsumer<E extends Eve
                 try {
                     e = getQueue().poll(10, TimeUnit.SECONDS);
                 } catch (InterruptedException e1) {
-                    LOGGER.warn("Consume task interrupted");
+                    LOGGER.warn("CELLAR HAZELCAST: consume task interrupted");
                 }
                 if (e != null) {
                     consume(e);
                 }
             }
         } catch (Exception ex) {
-            LOGGER.error("Error while consuming from queue", ex);
+            LOGGER.error("CELLAR HAZELCAST: failed to consume from queue", ex);
         } finally {
             Thread.currentThread().setContextClassLoader(originalClassLoader);
         }
     }
 
     /**
-     * Consumes an event form the topic.
+     * Consume a cluster event.
      *
-     * @param event
+     * @param event the cluster event.
      */
+    @Override
     public void consume(E event) {
         if (event != null && (this.getSwitch().getStatus().equals(SwitchStatus.ON) || event.getForce())) {
             dispatcher.dispatch(event);
@@ -133,24 +129,24 @@ public class QueueConsumer<E extends Eve
         executorService.execute(this);
     }
 
-
     @Override
     public void stop() {
         isConsuming = false;
     }
 
+    @Override
     public Boolean isConsuming() {
         return isConsuming;
     }
 
     @Override
     public void itemAdded(ItemEvent<E> event) {
-
+        // nothing to do
     }
 
     @Override
     public void itemRemoved(ItemEvent<E> event) {
-
+        // nothing to do
     }
 
     public Dispatcher getDispatcher() {
@@ -177,6 +173,7 @@ public class QueueConsumer<E extends Eve
         this.queue = queue;
     }
 
+    @Override
     public Switch getSwitch() {
         // load the switch status from the config
         try {

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueProducer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueProducer.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueProducer.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/QueueProducer.java Wed Apr 24 17:23:48 2013
@@ -43,7 +43,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Produces {@code Event}s into the distributed {@code ITopic}.
+ * Produces cluster {@code Event}s into the Hazelcast {@code IQueue}.
  */
 public class QueueProducer<E extends Event> implements EventProducer<E> {
 
@@ -58,33 +58,24 @@ public class QueueProducer<E extends Eve
     private Node node;
     private ConfigurationAdmin configurationAdmin;
 
-    /**
-     * Initialization method.
-     */
     public void init() {
         if (queue == null) {
             queue = instance.getQueue(Constants.QUEUE);
         }
     }
 
-    /**
-     * Destruction method.
-     */
     public void destroy() {
+        // nothing to do
     }
 
-    /**
-     * Propagates an event into the distributed {@code ITopic}.
-     *
-     * @param event
-     */
+    @Override
     public void produce(E event) {
         if (this.getSwitch().getStatus().equals(SwitchStatus.ON) || event.getForce() || event instanceof Result) {
             event.setSourceNode(node);
             try {
                 queue.put(event);
             } catch (InterruptedException e) {
-                LOGGER.error("Queue producer interrupted", e);
+                LOGGER.error("CELLAR HAZELCAST: queue producer interrupted", e);
             }
         } else {
             if (eventSwitch.getStatus().equals(SwitchStatus.OFF)) {
@@ -93,6 +84,7 @@ public class QueueProducer<E extends Eve
         }
     }
 
+    @Override
     public Switch getSwitch() {
         // load the switch status from the config
         try {

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicConsumer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicConsumer.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicConsumer.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicConsumer.java Wed Apr 24 17:23:48 2013
@@ -31,7 +31,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Consumes messages from the distributed {@code ITopic} and calls the {@code EventDispatcher}.
+ * Consumes messages from the Hazelcast {@code ITopic} and calls the {@code EventDispatcher}.
  */
 public class TopicConsumer<E extends Event> implements EventConsumer<E>, MessageListener<E> {
 
@@ -49,9 +49,6 @@ public class TopicConsumer<E extends Eve
 
     private boolean isConsuming;
 
-    /**
-     * Initialization method.
-     */
     public void init() {
         if (topic == null) {
             topic = instance.getTopic(Constants.TOPIC);
@@ -59,20 +56,13 @@ public class TopicConsumer<E extends Eve
         start();
     }
 
-    /**
-     * Destruction method.
-     */
     public void destroy() {
         stop();
     }
 
-    /**
-     * Consumes an event form the topic.
-     *
-     * @param event
-     */
+    @Override
     public void consume(E event) {
-        //Check if event has a specified destination.
+        // check if event has a specified destination.
         if ((event.getDestination() == null || event.getDestination().contains(node)) && (this.getSwitch().getStatus().equals(SwitchStatus.ON) || event.getForce())) {
             dispatcher.dispatch(event);
         } else {
@@ -107,6 +97,7 @@ public class TopicConsumer<E extends Eve
         return isConsuming;
     }
 
+    @Override
     public void onMessage(Message<E> message) {
         consume(message.getMessageObject());
     }
@@ -135,6 +126,7 @@ public class TopicConsumer<E extends Eve
         this.topic = topic;
     }
 
+    @Override
     public Switch getSwitch() {
         // load the switch status from the config
         try {

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicProducer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicProducer.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicProducer.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/TopicProducer.java Wed Apr 24 17:23:48 2013
@@ -29,7 +29,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Produces {@code Event}s into the distributed {@code ITopic}.
+ * Produces cluster {@code Event}s into the distributed {@code ITopic}.
  */
 public class TopicProducer<E extends Event> implements EventProducer<E> {
 
@@ -44,26 +44,17 @@ public class TopicProducer<E extends Eve
     private Node node;
     private ConfigurationAdmin configurationAdmin;
 
-    /**
-     * Initialization method.
-     */
     public void init() {
         if (topic == null) {
             topic = instance.getTopic(Constants.TOPIC);
         }
     }
 
-    /**
-     * Destruction method.
-     */
     public void destroy() {
+        // nothing to do
     }
 
-    /**
-     * Propagates an event into the distributed {@code ITopic}.
-     *
-     * @param event
-     */
+    @Override
     public void produce(E event) {
         if (this.getSwitch().getStatus().equals(SwitchStatus.ON) || event.getForce() || event instanceof Result) {
             event.setSourceNode(node);
@@ -75,6 +66,7 @@ public class TopicProducer<E extends Eve
         }
     }
 
+    @Override
     public Switch getSwitch() {
         // load the switch status from the config
         try {

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastConfigurationManager.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastConfigurationManager.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastConfigurationManager.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastConfigurationManager.java Wed Apr 24 17:23:48 2013
@@ -25,6 +25,10 @@ import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 
+/**
+ * Hazelcast configuration manager.
+ * It loads hazelcast.xml configuration file.
+ */
 public class HazelcastConfigurationManager {
 
     private static final transient Logger LOGGER = LoggerFactory.getLogger(HazelcastServiceFactory.class);
@@ -34,9 +38,9 @@ public class HazelcastConfigurationManag
     private Set<String> discoveredMemberSet = new LinkedHashSet<String>();
 
     /**
-     * Builds a Hazelcast {@link com.hazelcast.config.Config}
+     * Build a Hazelcast {@link com.hazelcast.config.Config}.
      *
-     * @return
+     * @return the Hazelcast configuration.
      */
     public Config getHazelcastConfig() {
         System.setProperty("hazelcast.config", xmlConfigLocation);
@@ -49,9 +53,9 @@ public class HazelcastConfigurationManag
     }
 
     /**
-     * Updates Hazelcast Instance.
+     * Update configuration of a Hazelcast instance.
      *
-     * @param properties
+     * @param properties the updated configuration properties.
      */
     public boolean isUpdated(Map properties) {
         Boolean updated = Boolean.FALSE;

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactory.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactory.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactory.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactory.java Wed Apr 24 17:23:48 2013
@@ -15,20 +15,16 @@ package org.apache.karaf.cellar.hazelcas
 
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
-import com.hazelcast.config.Config;
+
 import com.hazelcast.core.Hazelcast;
 import com.hazelcast.core.HazelcastInstance;
 import org.apache.karaf.cellar.core.utils.CombinedClassLoader;
 import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
- * A factory for a Hazelcast Instance, which integration with OSGi Service Registry and Config Admin.
+ * Factory for Hazelcast instance, including integration with OSGi ServiceRegistry and ConfigAdmin.
  */
-public class HazelcastServiceFactory  {
-
-    private static final transient Logger LOGGER = LoggerFactory.getLogger(HazelcastServiceFactory.class);
+public class HazelcastServiceFactory {
 
     private BundleContext bundleContext;
     private CombinedClassLoader combinedClassLoader;
@@ -38,7 +34,6 @@ public class HazelcastServiceFactory  {
     private CountDownLatch instanceLatch = new CountDownLatch(1);
     private HazelcastInstance instance;
 
-
     public void init() {
         if (combinedClassLoader != null) {
             combinedClassLoader.addBundle(bundleContext.getBundle());
@@ -57,26 +52,26 @@ public class HazelcastServiceFactory  {
     }
 
     /**
-     * Returs a Hazelcast instance from service registry.
+     * Return the local Hazelcast instance.
      *
-     * @return
+     * @return the Hazelcast instance.
      */
     public HazelcastInstance getInstance() throws InterruptedException {
         if (instance == null) {
-                initializationLatch.await();
-                this.instance = buildInstance();
+            initializationLatch.await();
+            this.instance = buildInstance();
             instanceLatch.countDown();
         }
         return instance;
     }
 
     /**
-     * Builds a {@link HazelcastInstance}
+     * Build a {@link HazelcastInstance}.
      *
-     * @return
+     * @return the Hazelcast instance.
      */
     private HazelcastInstance buildInstance() {
-        if(combinedClassLoader != null) {
+        if (combinedClassLoader != null) {
             Thread.currentThread().setContextClassLoader(combinedClassLoader);
         }
         return Hazelcast.newHazelcastInstance(configurationManager.getHazelcastConfig());
@@ -97,4 +92,5 @@ public class HazelcastServiceFactory  {
     public void setCombinedClassLoader(CombinedClassLoader combinedClassLoader) {
         this.combinedClassLoader = combinedClassLoader;
     }
+
 }

Modified: karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/merge/CellarMergePolicy.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/merge/CellarMergePolicy.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/merge/CellarMergePolicy.java (original)
+++ karaf/cellar/trunk/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/merge/CellarMergePolicy.java Wed Apr 24 17:23:48 2013
@@ -1,3 +1,16 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
 package org.apache.karaf.cellar.hazelcast.merge;
 
 import java.util.LinkedHashSet;
@@ -6,25 +19,29 @@ import java.util.List;
 import java.util.Set;
 import com.hazelcast.core.MapEntry;
 import com.hazelcast.merge.MergePolicy;
-import org.apache.karaf.cellar.core.Group;
 import org.apache.karaf.cellar.core.MultiNode;
 import org.apache.karaf.cellar.core.utils.CellarUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * A Cellar custom Hazelcast merge policy.
+ */
 public class CellarMergePolicy  implements MergePolicy {
 
     private static final transient Logger LOGGER = LoggerFactory.getLogger(CellarMergePolicy.class);
+
     /**
      * Returns the value of the entry after the merge
      * of entries with the same key. Returning value can be
      * You should consider the case where existingEntry is null.
      *
-     * @param mapName       name of the map
-     * @param mergingEntry  entry merging into the destination cluster
+     * @param mapName name of the map
+     * @param mergingEntry entry merging into the destination cluster
      * @param existingEntry existing entry in the destination cluster
      * @return final value of the entry. If returns null then no change on the entry.
      */
+    @Override
     public Object merge(String mapName, MapEntry mergingEntry, MapEntry existingEntry) {
         LOGGER.info("Cellar merge policy triggered merging entry {}, existing entry {}",mergingEntry,existingEntry);
         Object mergingDataValue = mergingEntry != null ? mergingEntry.getValue() : null;
@@ -38,7 +55,7 @@ public class CellarMergePolicy  implemen
             return existingDataValue;
         }
 
-        //Merge MultiNodes by merging their members.
+        // merge MultiNodes by merging their members.
         else if(MultiNode.class.isAssignableFrom(mergingDataValue.getClass())
                 && MultiNode.class.isAssignableFrom(existingDataValue.getClass())) {
 
@@ -69,23 +86,23 @@ public class CellarMergePolicy  implemen
     }
 
     /**
-     * Merges Sets.
-     * @param mergingSet
-     * @param existingSet
-     * @param <T>
-     * @return
+     * Merges sets.
+     *
+     * @param mergingSet the first set to merge.
+     * @param existingSet the second set to merge.
+     * @return a set resulting of the merge of the two others.
      */
     public <T> Set<T> merge(Set<T> mergingSet, Set<T> existingSet) {
        Set<T> result = new LinkedHashSet<T>();
 
-       //Copy new Set.
+       // copy new Set
        if(mergingSet != null && !mergingSet.isEmpty()) {
            for(T obj:mergingSet) {
                result.add(obj);
            }
        }
 
-       //Copy existing Set.
+       // copy existing Set
        if(existingSet != null && !existingSet.isEmpty()) {
            for(T obj:existingSet) {
                result.add(obj);
@@ -95,25 +112,24 @@ public class CellarMergePolicy  implemen
        return result;
     }
 
-
     /**
-     * Merges Lists.
-     * @param mergingList
-     * @param existingList
-     * @param <T>
-     * @return
+     * Merge lists.
+     *
+     * @param mergingList the first list to merge.
+     * @param existingList the second list to merge.
+     * @return a list resulting of the merge of the two others.
      */
     public <T> List<T> merge(List<T> mergingList, List<T> existingList) {
        List<T> result = new LinkedList<T>();
 
-       //Copy existing List.
+       // copy existing List
        if(existingList != null && !existingList.isEmpty()) {
            for(T obj:existingList) {
                result.add(obj);
            }
        }
 
-       //Copy new List.
+       // copy new List
        if(mergingList != null && !mergingList.isEmpty()) {
            for(T obj:mergingList) {
                result.add(obj);
@@ -124,10 +140,11 @@ public class CellarMergePolicy  implemen
     }
 
     /**
-     * Merges Strings.
-     * @param mergingString
-     * @param existingString
-     * @return
+     * Merge Strings.
+     *
+     * @param mergingString the first String to merge.
+     * @param existingString the second String to merge.
+     * @return a String resulting of the merge of the two others.
      */
     public String merge(String mergingString, String existingString) {
        String result = existingString;
@@ -139,4 +156,5 @@ public class CellarMergePolicy  implemen
        }
        return result;
     }
+
 }

Modified: karaf/cellar/trunk/hazelcast/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/main/resources/OSGI-INF/blueprint/blueprint.xml (original)
+++ karaf/cellar/trunk/hazelcast/src/main/resources/OSGI-INF/blueprint/blueprint.xml Wed Apr 24 17:23:48 2013
@@ -14,13 +14,11 @@
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
         xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
-           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+        xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
 
-
-
-    <!-- Hazelcast hazelcast -->
     <bean id="hazelcast" class="com.hazelcast.core.Hazelcast" factory-ref="instanceFactory"
           factory-method="getInstance" destroy-method="shutdown"/>
+    <service ref="hazelcast" interface="com.hazelcast.core.HazelcastInstance"/>
 
     <bean id="instanceFactory" class="org.apache.karaf.cellar.hazelcast.factory.HazelcastServiceFactory"
           init-method="init" destroy-method="destroy">
@@ -36,7 +34,7 @@
         <property name="configurationAdmin" ref="configurationAdmin"/>
     </bean>
 
-
+    <!-- Members Listener -->
     <bean id="membershipListener" class="org.apache.karaf.cellar.hazelcast.CellarMembershipListener">
         <argument index="0" ref="hazelcast"/>
         <property name="synchronizers" ref="synchronizers"/>
@@ -49,8 +47,9 @@
         <property name="configurationAdmin" ref="configurationAdmin"/>
         <property name="combinedClassLoader" ref="combinedClassLoader"/>
     </bean>
+    <service ref="clusterManager" interface="org.apache.karaf.cellar.core.ClusterManager"/>
 
-    <!-- Group Manager -->
+    <!-- Cluster Group Manager -->
     <bean id="groupManager" class="org.apache.karaf.cellar.hazelcast.HazelcastGroupManager" init-method="init" destroy-method="destroy">
         <property name="instance" ref="hazelcast"/>
         <property name="configurationAdmin" ref="configurationAdmin"/>
@@ -58,30 +57,39 @@
         <property name="combinedClassLoader" ref="combinedClassLoader"/>
         <property name="bundleContext" ref="blueprintBundleContext"/>
     </bean>
+    <service ref="groupManager">
+        <interfaces>
+            <value>org.apache.karaf.cellar.core.GroupManager</value>
+            <value>org.osgi.service.cm.ConfigurationListener</value>
+        </interfaces>
+    </service>
 
+    <!-- Cluster Event Transport Factory -->
     <bean id="eventTransportFactory" class="org.apache.karaf.cellar.hazelcast.HazelcastEventTransportFactory">
         <property name="dispatcher"  ref="dispatcher"/>
         <property name="instance" ref="hazelcast"/>
         <property name="combinedClassLoader" ref="combinedClassLoader"/>
     </bean>
+    <service ref="eventTransportFactory" interface="org.apache.karaf.cellar.core.event.EventTransportFactory"/>
 
+    <!-- Cellar Extender -->
     <bean id="cellarExtender" class="org.apache.karaf.cellar.hazelcast.CellarExtender"  init-method="init" destroy-method="destroy">
         <property name="combinedClassLoader" ref="combinedClassLoader"/>
         <property name="bundleContext" ref="blueprintBundleContext"/>
     </bean>
 
+    <!-- Bundle Combined ClassLoader -->
     <bean id="combinedClassLoader" class="org.apache.karaf.cellar.core.utils.CombinedClassLoader" init-method="init" destroy-method="destroy"/>
 
-
-    <!-- Hazelcast Cluster and Node -->
+    <!-- Local Node -->
     <bean id="node" factory-ref="clusterManager" factory-method="getNode"/>
 
-    <!-- The distributed topic -->
+    <!-- Cluster Event Topic -->
     <bean id="eventTopic" factory-ref="hazelcast" factory-method="getTopic">
         <argument value="org.apache.karaf.cellar.event.topic"/>
     </bean>
 
-    <!-- Consumer -->
+    <!-- Cluster Event Consumer -->
     <bean id="consumer" class="org.apache.karaf.cellar.hazelcast.TopicConsumer" init-method="init"
           destroy-method="destroy">
         <property name="instance" ref="hazelcast"/>
@@ -90,108 +98,93 @@
         <property name="configurationAdmin" ref="configurationAdmin"/>
     </bean>
 
-    <!-- Producer -->
+    <!-- Cluster Event Producer -->
     <bean id="producer" class="org.apache.karaf.cellar.hazelcast.TopicProducer" init-method="init">
         <property name="instance" ref="hazelcast"/>
         <property name="node" ref="node"/>
         <property name="configurationAdmin" ref="configurationAdmin"/>
     </bean>
+    <service ref="producer" interface="org.apache.karaf.cellar.core.event.EventProducer"/>
 
+    <!-- Execution Context -->
     <bean id="executionContext" class="org.apache.karaf.cellar.core.command.ClusteredExecutionContext">
         <property name="producer" ref="producer"/>
         <property name="commandStore" ref="commandStore"/>
     </bean>
+    <service ref="executionContext" interface="org.apache.karaf.cellar.core.command.ExecutionContext"/>
 
-    <!-- Producer Switch Handler -->
+    <!-- Handler For Cluster Producer Switch Command Event -->
     <bean id="producerSwitchCommandHandler" class="org.apache.karaf.cellar.core.control.ProducerSwitchCommandHandler">
         <property name="producer" ref="producer"/>
         <property name="configurationAdmin" ref="configurationAdmin"/>
     </bean>
+    <service ref="producerSwitchCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
+    <!-- Handler For Cluster Producer Switch Result Event -->
     <bean id="producerSwitchResultHandler" class="org.apache.karaf.cellar.core.control.ProducerSwitchResultHandler">
         <property name="commandStore" ref="commandStore"/>
     </bean>
+    <service ref="producerSwitchResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
-    <!-- Consumer Switch Event Handler -->
+    <!-- Handler For Cluster Consumer Switch Command Event -->
     <bean id="consumerSwitchCommandHandler" class="org.apache.karaf.cellar.core.control.ConsumerSwitchCommandHandler">
         <property name="producer" ref="producer"/>
         <property name="consumer" ref="consumer"/>
         <property name="configurationAdmin" ref="configurationAdmin"/>
     </bean>
+    <service ref="consumerSwitchCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
+    <!-- Handler For Cluster Consumer Switch Result Event -->
     <bean id="consumerSwitchResultHandler" class="org.apache.karaf.cellar.core.control.ConsumerSwitchResultHandler">
         <property name="commandStore" ref="commandStore"/>
     </bean>
+    <service ref="consumerSwitchResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
-    <!-- Managed Handlers Command Handlers -->
+    <!-- Handler For Cluster Manage Handlers Command Event -->
     <bean id="manageHandlersCommandHandler" class="org.apache.karaf.cellar.core.control.ManageHandlersCommandHandler">
         <property name="producer" ref="producer"/>
         <property name="configurationAdmin" ref="configurationAdmin"/>
     </bean>
+    <service ref="manageHandlersCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
+    <!-- Handler For Cluster Manage Handlers Result Event -->
     <bean id="manageHandlersResultHandler" class="org.apache.karaf.cellar.core.control.ManageHandlersResultHandler">
         <property name="commandStore" ref="commandStore"/>
     </bean>
+    <service ref="manageHandlersResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
-    <!-- Managed Group Command Handlers -->
+    <!-- Handler For Cluster Manager Group Command Event -->
     <bean id="manageGroupCommandHandler" class="org.apache.karaf.cellar.core.control.ManageGroupCommandHandler">
         <property name="producer" ref="producer"/>
         <property name="clusterManager" ref="clusterManager"/>
         <property name="groupManager" ref="groupManager"/>
     </bean>
+    <service ref="manageGroupCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
+    <!-- Handlers For Cluster Manager Group Result Event -->
     <bean id="manageGroupResultHandler" class="org.apache.karaf.cellar.core.control.ManageGroupResultHandler">
         <property name="commandStore" ref="commandStore"/>
     </bean>
+    <service ref="manageGroupResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
 
     <!-- Command Store -->
     <bean id="commandStore" class="org.apache.karaf.cellar.core.command.BasicCommandStore"/>
+    <service ref="commandStore" interface="org.apache.karaf.cellar.core.command.CommandStore"/>
 
-
+    <!-- Cluster Event Dispatcher -->
     <bean id="dispatcher" class="org.apache.karaf.cellar.core.event.EventHandlerRegistryDispatcher" init-method="init">
         <property name="handlerRegistry" ref="registry"/>
     </bean>
 
-
-    <!-- Hazelcast Instance Service-->
-    <service ref="hazelcast" interface="com.hazelcast.core.HazelcastInstance"/>
-
-    <service ref="producer" interface="org.apache.karaf.cellar.core.event.EventProducer"/>
-
-    <service ref="clusterManager" interface="org.apache.karaf.cellar.core.ClusterManager"/>
-    <service ref="eventTransportFactory" interface="org.apache.karaf.cellar.core.event.EventTransportFactory"/>
-    <service ref="executionContext" interface="org.apache.karaf.cellar.core.command.ExecutionContext"/>
-    <service ref="commandStore" interface="org.apache.karaf.cellar.core.command.CommandStore"/>
-
-    <service ref="groupManager">
-        <interfaces>
-            <value>org.apache.karaf.cellar.core.GroupManager</value>
-            <value>org.osgi.service.cm.ConfigurationListener</value>
-        </interfaces>
-    </service>
-
-    <!-- Event Handler Service -->
-    <service ref="consumerSwitchCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-    <service ref="consumerSwitchResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-    <service ref="producerSwitchCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-    <service ref="producerSwitchResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-    <service ref="manageHandlersCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-    <service ref="manageHandlersResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-    <service ref="manageGroupCommandHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-    <service ref="manageGroupResultHandler" interface="org.apache.karaf.cellar.core.event.EventHandler"/>
-
     <reference id="registry" interface="org.apache.karaf.cellar.core.event.EventHandlerRegistry"/>
     <reference id="configurationAdmin" interface="org.osgi.service.cm.ConfigurationAdmin"/>
 
     <reference-list id="discoveryServices" availability="optional"
                interface="org.apache.karaf.cellar.core.discovery.DiscoveryService"/>
-
-    <!-- Group Consumer & Producer Serices -->
     <reference-list id="groupEventProducers" availability="optional" interface="org.apache.karaf.cellar.core.event.EventProducer"
           filter="(type = group)"/>
     <reference-list id="groupEventConsumers" availability="optional" interface="org.apache.karaf.cellar.core.event.EventConsumer"
           filter="(type = group)"/>
-
     <reference-list id="synchronizers" availability="optional" interface="org.apache.karaf.cellar.core.Synchronizer"/>
 
 </blueprint>

Modified: karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactoryTest.java?rev=1471549&r1=1471548&r2=1471549&view=diff
==============================================================================
--- karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactoryTest.java (original)
+++ karaf/cellar/trunk/hazelcast/src/test/java/org/apache/karaf/cellar/hazelcast/factory/HazelcastServiceFactoryTest.java Wed Apr 24 17:23:48 2013
@@ -15,30 +15,17 @@ package org.apache.karaf.cellar.hazelcas
 
 import com.hazelcast.core.Hazelcast;
 import com.hazelcast.core.HazelcastInstance;
-import org.junit.After;
 import org.junit.Assert;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
-import java.util.Properties;
-
 /**
  * Hazelcast service factory test.
  */
 @RunWith(JUnit4.class)
 public class HazelcastServiceFactoryTest {
 
-    @Before
-    public void setUp() throws Exception {
-    }
-
-    @After
-    public void tearDown() throws Exception {
-
-    }
-
     @Test
     public void testDefaultInstance() throws InterruptedException {
         HazelcastServiceFactory factory = new HazelcastServiceFactory();



Mime
View raw message