[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
msurtani at jboss.com
Tue Dec 5 10:27:52 EST 2006
User: msurtani
Date: 06/12/05 10:27:52
Modified: src/org/jboss/cache Tag: Branch_JBossCache_1_4_0
TreeCache.java
Log:
Ported stuff from 1.3.0.SP4 + upgraded JGroups
Revision Changes Path
No revision
No revision
1.195.2.27 +5 -44 JBossCache/src/org/jboss/cache/TreeCache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCache.java,v
retrieving revision 1.195.2.26
retrieving revision 1.195.2.27
diff -u -b -r1.195.2.26 -r1.195.2.27
--- TreeCache.java 5 Dec 2006 00:01:51 -0000 1.195.2.26
+++ TreeCache.java 5 Dec 2006 15:27:52 -0000 1.195.2.27
@@ -99,7 +99,7 @@
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
* @author Brian Stansberry
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: TreeCache.java,v 1.195.2.26 2006/12/05 00:01:51 msurtani Exp $
+ * @version $Id: TreeCache.java,v 1.195.2.27 2006/12/05 15:27:52 msurtani Exp $
* <p/>
* @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
*/
@@ -4311,16 +4311,10 @@
if (log.isTraceEnabled())
log.trace("callRemoteMethods(): valid members are " + validMembers + " method: " + method_call);
- // this is a temporary workaround (JBCACHE-813) until AnyCast (JGRP-338) is available.
- if (useTcpWorkaround())
- {
- // use a UNICAST
- rsps = multipleUnicast(validMembers, method_call, mode, timeout);
- }
- else
- {
- rsps = disp.callRemoteMethods(validMembers, method_call, mode, timeout);
- }
+
+ // if we are using buddy replication, all calls should use ANYCAST. Otherwise, use the default (multicast).
+ rsps = disp.callRemoteMethods(validMembers, method_call, mode, timeout, buddyManager != null && buddyManager.isEnabled());
+
// a null response is 99% likely to be due to a marshalling problem - we throw a NSE, this needs to be changed when
// JGroups supports http://jira.jboss.com/jira/browse/JGRP-193
@@ -4359,39 +4353,6 @@
return retval;
}
- boolean useTcpWorkaround()
- {
- return channel.getProtocolStack().findProtocol("UDP") == null;
- }
-
- /**
- * This is a workaround for JBCACHE-813
- */
- private RspList multipleUnicast(List recipients, MethodCall call, int mode, long timeout) throws Exception
- {
- if (recipients == null || recipients.isEmpty()) return null;
-
- Iterator i = recipients.iterator();
- RspList rsps = new RspList();
-
- while (i.hasNext())
- {
- Address recipient = (Address) i.next();
- Object r = null;
- try
- {
- r = disp.callRemoteMethod(recipient, call, mode, timeout);
- }
- catch (Throwable throwable)
- {
- throw new Exception(throwable);
- }
- rsps.addRsp(recipient, r);
- }
- return rsps;
- }
-
-
/**
* @param members
* @param method
More information about the jboss-cvs-commits
mailing list