Author: manik.surtani(a)jboss.com
Date: 2009-08-05 07:55:43 -0400 (Wed, 05 Aug 2009)
New Revision: 8151
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/AddressLocator.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups26AddressLocator.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups28AddressLocator.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/NextMemberBuddyLocator.java
Log:
JBCACHE-1517 JGroups 2.8 compatibility
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/AddressLocator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/buddyreplication/AddressLocator.java 2009-08-05
11:45:34 UTC (rev 8150)
+++
core/trunk/src/main/java/org/jboss/cache/buddyreplication/AddressLocator.java 2009-08-05
11:55:43 UTC (rev 8151)
@@ -1,6 +1,7 @@
package org.jboss.cache.buddyreplication;
import org.jgroups.Address;
+import org.jgroups.Channel;
import java.net.InetAddress;
@@ -11,5 +12,5 @@
* @since 3.2.0
*/
public interface AddressLocator {
- InetAddress locate(Address a);
+ InetAddress locate(Channel c, Address a);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups26AddressLocator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups26AddressLocator.java 2009-08-05
11:45:34 UTC (rev 8150)
+++
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups26AddressLocator.java 2009-08-05
11:55:43 UTC (rev 8151)
@@ -1,6 +1,7 @@
package org.jboss.cache.buddyreplication;
import org.jgroups.Address;
+import org.jgroups.Channel;
import org.jgroups.stack.IpAddress;
import java.net.InetAddress;
@@ -13,7 +14,7 @@
*/
public class JGroups26AddressLocator implements AddressLocator
{
- public InetAddress locate(Address a)
+ public InetAddress locate(Channel c, Address a)
{
if (a instanceof IpAddress)
{
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups28AddressLocator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups28AddressLocator.java 2009-08-05
11:45:34 UTC (rev 8150)
+++
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups28AddressLocator.java 2009-08-05
11:55:43 UTC (rev 8151)
@@ -16,25 +16,18 @@
*/
public class JGroups28AddressLocator extends JGroups26AddressLocator
{
- private Channel channel;
-
- public JGroups28AddressLocator(Channel channel)
- {
- this.channel = channel;
- }
-
@Override
- public InetAddress locate(Address a)
+ public InetAddress locate(Channel channel, Address a)
{
if (a instanceof IpAddress)
{
- return super.locate(a);
+ return super.locate(channel, a);
}
else
{
PhysicalAddress pa; // physical address (interface)
pa = (PhysicalAddress) channel.downcall(new Event(Event.GET_PHYSICAL_ADDRESS,
a));
- return super.locate(pa);
+ return super.locate(channel, pa);
}
}
}
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/NextMemberBuddyLocator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/buddyreplication/NextMemberBuddyLocator.java 2009-08-05
11:45:34 UTC (rev 8150)
+++
core/trunk/src/main/java/org/jboss/cache/buddyreplication/NextMemberBuddyLocator.java 2009-08-05
11:55:43 UTC (rev 8151)
@@ -89,7 +89,7 @@
try
{
getClass().getClassLoader().loadClass("org.jgroups.PhysicalAddress");
// this is new in JG 2.8
- addressLocator = new JGroups28AddressLocator(channel);
+ addressLocator = new JGroups28AddressLocator();
}
catch (ClassNotFoundException e)
{
@@ -180,8 +180,8 @@
protected boolean isColocated(Address candidate, Address dataOwner)
{
- InetAddress inetC = addressLocator.locate(candidate);
- InetAddress inetD = addressLocator.locate(dataOwner);
+ InetAddress inetC = addressLocator.locate(channel, candidate);
+ InetAddress inetD = addressLocator.locate(channel, dataOwner);
if (inetC.equals(inetD)) return true;
Show replies by date