[jboss-cvs] JBossAS SVN: r75636 - 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
Thu Jul 10 16:35:42 EDT 2008


Author: galder.zamarreno at jboss.com
Date: 2008-07-10 16:35:42 -0400 (Thu, 10 Jul 2008)
New Revision: 75636

Added:
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/ResponseFilter.java
Modified:
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java
Log:
[JBAS-5647] callRemoteMethods() can now take a ResponseFilter which is an abstraction of JGroups' RspFilter.

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	2008-07-10 20:32:36 UTC (rev 75635)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAPartition.java	2008-07-10 20:35:42 UTC (rev 75636)
@@ -32,6 +32,7 @@
  *  
  *   @author  <a href="mailto:bill at burkecentral.com">Bill Burke</a>.
  *   @author  <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
+ *   @author  <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
  *   @version $Revision$
  *
  * <p><b>Revisions:</b><br>
@@ -134,6 +135,24 @@
     */
    public ArrayList callMethodOnCluster(String serviceName, String methodName,
          Object[] args, Class[] types, boolean excludeSelf) throws Exception;
+   
+   /**
+    * Invoke a synchronous RPC call on all nodes of the partition/cluster which
+    * can be terminated early based on response filter implementation passed. 
+    * @param serviceName Name of the target service name on which calls are de-multiplexed
+    * @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 The types of the parameters
+    * @param excludeSelf Indicates if the RPC must also be made on the current
+    * node of the partition or only on remote nodes
+    * @param filter Response filter instance which allows for early termination 
+    * of the synchronous RCP call. 
+    * @return an array of responses from remote nodes
+    * @throws Exception Throws if a communication exception occurs
+    */
+   public ArrayList callMethodOnCluster(String serviceName, String methodName,
+         Object[] args, Class[] types, boolean excludeSelf, ResponseFilter filter) throws Exception;
 
    /**
     * Invoke a asynchronous RPC call on all nodes of the partition/cluster. The

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/ResponseFilter.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/ResponseFilter.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/ResponseFilter.java	2008-07-10 20:35:42 UTC (rev 75636)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.interfaces;
+
+/**
+ * Cluster abstraction of JGroups' RspFilter that allows termination of a group 
+ * request based on logic implemented by an implementation of this interface. 
+ * The abstraction has be done to avoid first, leaking JGroups classes to 
+ * ha-server-api consumers and secondly, avoid direct dependency on JGroups.  
+ * 
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ */
+public interface ResponseFilter
+{
+   boolean isAcceptable(Object response, ClusterNode sender);
+   
+   boolean needMoreResponses();
+}




More information about the jboss-cvs-commits mailing list