[jboss-cvs] JBossAS SVN: r104049 - 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 Apr 16 08:42:31 EDT 2010


Author: bstansberry at jboss.com
Date: 2010-04-16 08:42:31 -0400 (Fri, 16 Apr 2010)
New Revision: 104049

Modified:
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java
Log:
[JBCLUSTER-263] Make the interface changes less disruptive
[JBCLUSTER-266] Add callAsyncMethodOnCoordinator

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-04-16 12:25:28 UTC (rev 104048)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java	2010-04-16 12:42:31 UTC (rev 104049)
@@ -22,6 +22,7 @@
 package org.jboss.ha.framework.interfaces;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Vector;
 
@@ -148,7 +149,8 @@
     *
     * @return an array of responses from nodes that invoked the RPC
     */
-   public List<?> callMethodOnCluster(String serviceName, String methodName,
+   @SuppressWarnings("unchecked")
+   public ArrayList callMethodOnCluster(String serviceName, String methodName,
          Object[] args, Class<?>[] types, boolean excludeSelf) throws InterruptedException;
    
    /**
@@ -170,7 +172,8 @@
     * 
     * @return an array of responses from remote nodes
     */
-   public List<?> callMethodOnCluster(String serviceName, String methodName,
+   @SuppressWarnings("unchecked")
+   public ArrayList callMethodOnCluster(String serviceName, String methodName,
          Object[] args, Class<?>[] types, boolean excludeSelf, ResponseFilter filter) throws InterruptedException;
    
    /**
@@ -196,7 +199,7 @@
     * to other RPCs originated by the same node
     * @return a list of responses from remote nodes
     */
-   public <T> List<T> callMethodOnCluster(String serviceName, String methodName,
+   public <T> ArrayList<T> callMethodOnCluster(String serviceName, String methodName,
          Object[] args, Class<?>[] types, Class<T> returnType, boolean excludeSelf, 
          ResponseFilter filter, long methodTimeout, boolean unordered) throws InterruptedException;
 
@@ -257,7 +260,7 @@
     * @return the value returned by the target method
     */
    public Object callMethodOnCoordinatorNode(String serviceName, String methodName,
-             Object[] args, Class<?>[] types, boolean excludeSelf) throws InterruptedException;
+             Object[] args, Class<?>[] types, boolean excludeSelf) throws Exception;
 
    /**
     * Calls method on Cluster coordinator node only.  The cluster coordinator 
@@ -281,7 +284,7 @@
     */
    public <T> T callMethodOnCoordinatorNode(String serviceName, String methodName,
              Object[] args, Class<?>[] types, Class<T> returnType, boolean excludeSelf, 
-             long methodTimeout, boolean unordered) throws InterruptedException;
+             long methodTimeout, boolean unordered) throws Exception;
 
 
    /**
@@ -302,7 +305,7 @@
     * @return the value returned by the target method
     */
    public Object callMethodOnNode(String serviceName, String methodName,
-           Object[] args, Class<?>[] types, ClusterNode targetNode) throws InterruptedException;
+           Object[] args, Class<?>[] types, ClusterNode targetNode) throws Exception;
 
 
    /**
@@ -322,7 +325,7 @@
     * @return the value returned by the target method
     */
    public Object callMethodOnNode(String serviceName, String methodName,
-           Object[] args, Class<?>[] types, long methodTimeout, ClusterNode targetNode) throws InterruptedException;
+           Object[] args, Class<?>[] types, long methodTimeout, ClusterNode targetNode) throws Exception;
 
 
    /**
@@ -345,7 +348,7 @@
     */
    public <T> T callMethodOnNode(String serviceName, String methodName,
           Object[] args, Class<?>[] types, Class<T> returnType, 
-          long methodTimeout, ClusterNode targetNode, boolean unordered) throws InterruptedException;
+          long methodTimeout, ClusterNode targetNode, boolean unordered) throws Exception;
 
    /**
     * Calls method on target node only. The call will return immediately and 
@@ -362,7 +365,7 @@
     * @param targetNode is the target of the call
      */
    public void callAsyncMethodOnNode(String serviceName, String methodName,
-           Object[] args, Class<?>[] types, ClusterNode targetNode) throws InterruptedException;
+           Object[] args, Class<?>[] types, ClusterNode targetNode) throws Exception;
 
    /**
     * Calls method on target node only. The call will return immediately and 
@@ -379,8 +382,46 @@
     * to other RPCs originated by the same node
     */
    public void callAsyncMethodOnNode(String serviceName, String methodName,
-           Object[] args, Class<?>[] types, ClusterNode targetNode, boolean unordered) throws InterruptedException;
+           Object[] args, Class<?>[] types, ClusterNode targetNode, boolean unordered) throws Exception;
 
+   /**
+    * Calls method on Cluster coordinator node only.  The cluster coordinator 
+    * node is the first node in the current cluster view.  The call will return immediately and 
+    * will not wait for the node to answer. Thus no answer is available. This convenience method is equivalent to 
+    * {@link #callAsyncMethodOnCoordinatorNode(String, String, Object[], Class[], boolean, boolean) 
+    * callMethodOnCoordinatorNode(serviceName, methodName, args, types, excludeSelf, false)}}.
+    * 
+    * @param serviceName name of the target service name on which calls are invoked
+    * @param methodName name of the Java method to be called on remote services
+    * @param args array of Java Object representing the set of parameters to be
+    * given to the remote method
+    * @param types types of the parameters
+    * @param excludeSelf <code>true</code> if the RPC should not be made on the 
+    * current node even if the current node is the coordinator
+    */
+   public void callAsyncMethodOnCoordinatorNode(String serviceName, String methodName,
+             Object[] args, Class<?>[] types, boolean excludeSelf) throws Exception;
+
+   /**
+    * Calls method on Cluster coordinator node only.  The cluster coordinator 
+    * node is the first node in the current cluster view. The call will return immediately and 
+    * will not wait for the node to answer. Thus no answer is available. 
+    * 
+    * @param serviceName name of the target service name on which calls are invoked
+    * @param methodName name of the Java method to be called on remote services
+    * @param args array of Java Object representing the set of parameters to be
+    * given to the remote method
+    * @param types types of the parameters
+    * @param excludeSelf <code>true</code> if the RPC should not be made on the 
+    * current node even if the current node is the coordinator
+    * @param unordered <code>true</code> if the HAPartition isn't required to ensure
+    * that this RPC is invoked on all nodes in a consistent order with respect
+    * to other RPCs originated by the same node
+    * @return the value returned by the target method
+    */
+   public void callAsyncMethodOnCoordinatorNode(String serviceName, String methodName,
+             Object[] args, Class<?>[] types, boolean excludeSelf, boolean unordered) throws Exception;
+
    // *************************
    // *************************
    // State transfer management
@@ -479,8 +520,8 @@
        * @param allMembers A list of nodes that built the current view
        * @param originatingGroups A list of nodes that were previously partioned and that are now merged
        */      
-      public void membershipChangedDuringMerge(List<ClusterNode> deadMembers, List<ClusterNode> newMembers,
-            List<ClusterNode> allMembers, List<List<ClusterNode>> originatingGroups);
+      public void membershipChangedDuringMerge(Vector<ClusterNode> deadMembers, Vector<ClusterNode> newMembers,
+            Vector<ClusterNode> allMembers, Vector<List<ClusterNode>> originatingGroups);
    }
 
    /** 
@@ -545,7 +586,7 @@
     * 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 List<ClusterNode> getCurrentView ();
+   public Vector<String> getCurrentView ();
 
    /**
     * Return the member nodes that built the current view i.e., the current partition.




More information about the jboss-cvs-commits mailing list