[jboss-cvs] JBossAS SVN: r107062 - projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 23 13:40:23 EDT 2010


Author: pferraro
Date: 2010-07-23 13:40:23 -0400 (Fri, 23 Jul 2010)
New Revision: 107062

Modified:
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/DistributedState.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java
Log:
[JBCLUSTER-285] Un-deprecate DistributedState
Effectively rename DSListenerEx by deprecating DSListenerEx listener variants and replacing previously deprecated DSListener with DSListenerEx signature.


Modified: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/DistributedState.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/DistributedState.java	2010-07-23 17:39:11 UTC (rev 107061)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/DistributedState.java	2010-07-23 17:40:23 UTC (rev 107062)
@@ -41,15 +41,12 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision$
  * @see HAPartition
- * 
- * @deprecated Use JBoss Cache for distributed caching
  */
 public interface DistributedState
 {
    /**
     * When a particular key in a category of the DistributedState service gets
     * modified, all listeners will be notified of DS changes for that category.
-    * @deprecated use the DSListenerEx instead
     */
    public interface DSListener
    {
@@ -61,8 +58,8 @@
        * @param value The new value of the key
        * @param locallyModified Whether the change was made from this node
        */
-      public void valueHasChanged (String category, String key,
-         Serializable value, boolean locallyModified);
+      public void valueHasChanged(String category, Serializable key, Serializable value, boolean locallyModified);
+      
       /**
        * Called whenever a key has been removed from a category the called object had
        * subscribed in.
@@ -71,64 +68,21 @@
        * @param previousContent The previous content of the key that has been removed
        * @param locallyModified Whether the removal was made from this node
        */
-      public void keyHasBeenRemoved (String category, String key,
-         Serializable previousContent, boolean locallyModified);
+      public void keyHasBeenRemoved(String category, Serializable key, Serializable previousContent, boolean locallyModified);
    }
 
-   /** A generalization of the DSListener that supports the Serializable key
-    * type. When a particular key in a category of the DistributedState service
-    * gets modified, all listeners will be notified of DS changes for that
-    * category.
-    */
-   public interface DSListenerEx
-   {
-      /**
-       * Called whenever a key has been added or modified in the category the called object
-       * has subscribed in.
-       * @param category The category of the modified/added entry
-       * @param key The key that has been added or had its value modified
-       * @param value The new value of the key
-       * @param locallyModified Whether the change was made from this node
-       */
-      public void valueHasChanged (String category, Serializable key,
-         Serializable value, boolean locallyModified);
-      /**
-       * Called whenever a key has been removed from a category the called object had
-       * subscribed in.
-       * @param category The category under which a key has been removed
-       * @param key The key that has been removed
-       * @param previousContent The previous content of the key that has been removed
-       * @param locallyModified Whether the removal was made from this node
-       */
-      public void keyHasBeenRemoved (String category, Serializable key,
-         Serializable previousContent, boolean locallyModified);
-   }
-
    /**
-    * Subscribes to receive {@link DistributedState.DSListenerEx} events
-    * @param category Name of the private-space to watch for
-    * @param subscriber Object that will receive callbacks.
-    */
-   public void registerDSListenerEx (String category, DSListenerEx subscriber);
-   /**
-    * Unsubscribes from {@link DistributedState.DSListenerEx} events
-    * @param category Name of the private-space dictionary currently observed
-    * @param subscriber Object currently observing this category
-    */
-   public void unregisterDSListenerEx (String category, DSListenerEx subscriber);
-
-   /**
     * Subscribes to receive {@link DistributedState.DSListener} events
     * @param category Name of the private-space to watch for
     * @param subscriber Object that will receive callbacks.
     */
-   public void registerDSListener (String category, DSListener subscriber);
+   public void registerDSListener(String category, DSListener subscriber);
    /**
     * Unsubscribes from {@link DistributedState.DSListener} events
     * @param category Name of the private-space dictionary currently observed
     * @param subscriber Object currently observing this category
     */
-   public void unregisterDSListener (String category, DSListener subscriber);
+   public void unregisterDSListener(String category, DSListener subscriber);
 
    // State binding methods
    //
@@ -139,8 +93,7 @@
     * @param value Value of the data to set
     * @throws Exception If a network exception occurs
     */
-   public void set (String category, Serializable key, Serializable value)
-      throws Exception;
+   public void set(String category, Serializable key, Serializable value)  throws Exception;
 
    /**
     * Same as set(String, String) but caller can choose if the call is made
@@ -151,8 +104,7 @@
     * @param asynchronousCall True if the call should be asynchronous
     * @throws Exception If a network exception occurs
     */
-   public void set (String category, Serializable key, Serializable value,
-      boolean asynchronousCall) throws Exception;
+   public void set(String category, Serializable key, Serializable value, boolean asynchronousCall) throws Exception;
 
    /**
     * Read in a value associated to a key in the given category. Read is performed locally.
@@ -160,27 +112,27 @@
     * @param key The key of the value to read
     * @return The value of the key in the given category
     */
-   public Serializable get (String category, Serializable key);
+   public Serializable get(String category, Serializable key);
    
    /**
     * Return a list of all categories. Call managed locally: no network access.
     * @return A collection of String representing the existing categories in the DS service.
     */
-   public Collection<String> getAllCategories ();
+   public Collection<String> getAllCategories();
    
    /**
     * Return a list of all keys in a category. Call managed locally: no network access.
     * @param category The category under which to look for keys
     * @return A collection of all keys in the give category
     */
-   public Collection<? extends Serializable> getAllKeys (String category);
+   public Collection<? extends Serializable> getAllKeys(String category);
 
    /**
     * Return a list of all values in a category. Call managed locally: no network access.
     * @param category The category name under which to look for values
     * @return A collection of all values in the give category
     */
-   public Collection<? extends Serializable> getAllValues (String category);
+   public Collection<? extends Serializable> getAllValues(String category);
 
    /**
     * Remove the key from the ReplicationService in the given category
@@ -189,7 +141,7 @@
     * @return The value of the removed key
     * @throws Exception if a network exception occurs while removing the entry.
     */
-   public Serializable remove (String category, Serializable key) throws Exception;
+   public Serializable remove(String category, Serializable key) throws Exception;
    
    /**
     * Same as remove(String, String) but caller can choose if the call is made
@@ -200,6 +152,35 @@
     * @return The value of the removed key
     * @throws Exception if a network exception occurs while removing the entry.
     */
-   public Serializable remove (String category, Serializable key,
-      boolean asynchronousCall) throws Exception;
+   public Serializable remove(String category, Serializable key, boolean asynchronousCall) throws Exception;
+   
+   // Deprecated stuff to be removed in AS7
+   
+   /** A generalization of the DSListener that supports the Serializable key
+    * type. When a particular key in a category of the DistributedState service
+    * gets modified, all listeners will be notified of DS changes for that
+    * category.
+    * @deprecated Use {@link DSListener} instead
+    */
+   @Deprecated
+   public interface DSListenerEx extends DSListener
+   {
+   }
+
+   /**
+    * Subscribes to receive {@link DistributedState.DSListenerEx} events
+    * @param category Name of the private-space to watch for
+    * @param subscriber Object that will receive callbacks.
+    * @deprecated use {@link #registerDSListener(String, DSListener)} instead
+    */
+   @Deprecated
+   public void registerDSListenerEx(String category, DSListenerEx subscriber);
+   /**
+    * Unsubscribes from {@link DistributedState.DSListenerEx} events
+    * @param category Name of the private-space dictionary currently observed
+    * @param subscriber Object currently observing this category
+    * @deprecated use {@link #registerDSListener(String, DSListener)} instead
+    */
+   @Deprecated
+   public void unregisterDSListenerEx(String category, DSListenerEx subscriber);
 }

Modified: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java	2010-07-23 17:39:11 UTC (rev 107061)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java	2010-07-23 17:40:23 UTC (rev 107062)
@@ -42,7 +42,6 @@
  * <li> Added network-partition merge callback for listeners</li>
  * </ul>
  */
-
 public interface HAPartition extends GroupRpcDispatcher, GroupMembershipNotifier, GroupStateTransferService
 {
    // *******************************
@@ -59,27 +58,25 @@
     * @return The node name
     * 
     * @see #getClusterNode()
-    */   
+    */
    public String getNodeName();
    /**
     * The name of the partition.
     *
     * @return Name of the current partition
-    */   
+    */
    public String getPartitionName();
 
    /**
     * Accessor to the DistributedReplicantManager (DRM) that is linked to this partition.
     * @return the DistributedReplicantManager
-    */   
+    */
    public DistributedReplicantManager getDistributedReplicantManager();
    
    /**
     * Accessor to the DistributedState (DS) that is linked to this partition.
     * @return the DistributedState service
-    * 
-    * @deprecated Use JBoss Cache for distributed caching
-    */   
+    */
    public DistributedState getDistributedStateService ();
 
    // ***************************
@@ -170,7 +167,7 @@
     * @deprecated Use the {@link GroupStateTransferService} API
     */   
    @Deprecated
-   public void subscribeToStateTransferEvents (String serviceName, HAPartition.HAPartitionStateTransfer subscriber);
+   public void subscribeToStateTransferEvents(String serviceName, HAPartition.HAPartitionStateTransfer subscriber);
    
    /**
     * Unregister a service from state transfer callbacks.
@@ -180,7 +177,7 @@
     * @deprecated Use the {@link GroupStateTransferService} API
     */   
    @Deprecated
-   public void unsubscribeFromStateTransferEvents (String serviceName, HAPartition.HAPartitionStateTransfer subscriber);
+   public void unsubscribeFromStateTransferEvents(String serviceName, HAPartition.HAPartitionStateTransfer subscriber);
 
    // *************************
    // *************************
@@ -307,5 +304,5 @@
     * Return the list of member nodes that built the current view i.e., the current partition.
     * @return An array of Strings containing the node names
     */   
-   public Vector<String> getCurrentView ();
+   public Vector<String> getCurrentView();
 }
\ No newline at end of file



More information about the jboss-cvs-commits mailing list