[jboss-cvs] JBossCache/src/org/jboss/cache/marshall ...
Manik Surtani
msurtani at jboss.com
Mon Jan 15 06:22:39 EST 2007
User: msurtani
Date: 07/01/15 06:22:39
Modified: src/org/jboss/cache/marshall MethodDeclarations.java
Marshaller.java
Log:
Tests marshalling of return values
Revision Changes Path
1.32 +20 -3 JBossCache/src/org/jboss/cache/marshall/MethodDeclarations.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MethodDeclarations.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/marshall/MethodDeclarations.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- MethodDeclarations.java 10 Jan 2007 18:35:09 -0000 1.31
+++ MethodDeclarations.java 15 Jan 2007 11:22:38 -0000 1.32
@@ -31,7 +31,7 @@
* allowing lookup operations both ways.
*
* @author <a href="galder.zamarreno at jboss.com">Galder Zamarreno</a>
- * @version $Revision: 1.31 $
+ * @version $Revision: 1.32 $
*/
public class MethodDeclarations
{
@@ -42,6 +42,7 @@
static final Set<Integer> buddyGroupOrganisationMethodIds = new HashSet<Integer>();
static final Set<Integer> blockUnblockMethodIds = new HashSet<Integer>();
static final Set<Integer> putMethodIds = new HashSet<Integer>();
+ static final Set<Integer> methodsThatNeedToReturnValuesToRemoteCallers = new HashSet<Integer>();
// maintain a list of method IDs that correspond to Methods in CacheImpl
static final Map<Integer, Method> methods = new HashMap<Integer, Method>();
@@ -222,6 +223,11 @@
{
try
{
+ // these methods need to return values even to remote callers.
+ methodsThatNeedToReturnValuesToRemoteCallers.add(dataGravitationMethod_id);
+ methodsThatNeedToReturnValuesToRemoteCallers.add(clusteredGetMethod_id);
+
+
getDataMapMethodLocal = CacheImpl.class.getDeclaredMethod("_getData", Fqn.class);
existsMethod = CacheImpl.class.getDeclaredMethod("exists", Fqn.class);
putDataMethodLocal = CacheImpl.class.getDeclaredMethod("_put", GlobalTransaction.class, Fqn.class, Map.class, boolean.class);
@@ -502,5 +508,16 @@
{
return methodId == MethodDeclarations.dataGravitationCleanupMethod_id || methodId == MethodDeclarations.dataGravitationMethod_id;
}
+
+ /**
+ * Tests whether remote calls to this method should return the value to the caller or just return a null (more efficient if the caller won't use this value anyway)
+ *
+ * @param methodId
+ * @return true if the caller expects the value to come back.
+ */
+ public static boolean returnValueForRemoteCall(int methodId)
+ {
+ return methodsThatNeedToReturnValuesToRemoteCallers.contains(methodId);
+ }
}
1.8 +5 -0 JBossCache/src/org/jboss/cache/marshall/Marshaller.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Marshaller.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/marshall/Marshaller.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- Marshaller.java 30 Dec 2006 19:48:49 -0000 1.7
+++ Marshaller.java 15 Jan 2007 11:22:39 -0000 1.8
@@ -123,6 +123,10 @@
case MethodDeclarations.dataGravitationMethod_id:
case MethodDeclarations.evictNodeMethodLocal_id:
case MethodDeclarations.evictVersionedNodeMethodLocal_id:
+ case MethodDeclarations.getChildrenNamesMethodLocal_id:
+ case MethodDeclarations.getDataMapMethodLocal_id:
+ case MethodDeclarations.getKeysMethodLocal_id:
+ case MethodDeclarations.getKeyValueMethodLocal_id:
Fqn fqn = (Fqn) args[0];
fqnStr = fqn.toString();
break;
@@ -135,6 +139,7 @@
case MethodDeclarations.remoteRemoveFromBuddyGroupMethod_id:
break;
case MethodDeclarations.replicateMethod_id:
+ case MethodDeclarations.clusteredGetMethod_id:
// possible when we have a replication queue.
fqnStr = extractFqn((MethodCall) args[0]);
break;
More information about the jboss-cvs-commits
mailing list