Author: manik.surtani(a)jboss.com
Date: 2009-08-05 11:03:41 -0400 (Wed, 05 Aug 2009)
New Revision: 8154
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups28AddressLocator.java
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
Log:
Reverted back to JGroups 2.6 in some code as well, and removed JGroups 2.8 as a
compile-time dep
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
14:33:21 UTC (rev 8153)
+++
core/trunk/src/main/java/org/jboss/cache/buddyreplication/JGroups28AddressLocator.java 2009-08-05
15:03:41 UTC (rev 8154)
@@ -3,9 +3,9 @@
import org.jgroups.Address;
import org.jgroups.Channel;
import org.jgroups.Event;
-import org.jgroups.PhysicalAddress;
import org.jgroups.stack.IpAddress;
+import java.lang.reflect.Field;
import java.net.InetAddress;
/**
@@ -16,6 +16,18 @@
*/
public class JGroups28AddressLocator extends JGroups26AddressLocator
{
+ int getPhysicalAddressEventId;
+
+ public JGroups28AddressLocator() {
+ try {
+ Class eventClass = Event.class;
+ Field f = eventClass.getField("GET_PHYSICAL_ADDRESS");
+ getPhysicalAddressEventId = (Integer) f.get(null);
+ } catch (Exception e) {
+ throw new RuntimeException("Unable to initialize AddressLocator", e);
+ }
+ }
+
@Override
public InetAddress locate(Channel channel, Address a)
{
@@ -25,9 +37,8 @@
}
else
{
- PhysicalAddress pa; // physical address (interface)
- pa = (PhysicalAddress) channel.downcall(new Event(Event.GET_PHYSICAL_ADDRESS,
a));
- return super.locate(channel, pa);
+ Address physicalAddress = (Address) channel.downcall(new
Event(getPhysicalAddressEventId, a));
+ return super.locate(channel, physicalAddress);
}
}
}
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2009-08-05
14:33:21 UTC (rev 8153)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2009-08-05
15:03:41 UTC (rev 8154)
@@ -308,16 +308,11 @@
{
private static final long serialVersionUID = -2628268587640985944L;
- public int compareTo(Address arg0)
+ public int compareTo(Object o)
{
return 0;
}
-// public int compareTo(Object o)
-// {
-// return 0;
-// }
-
public void readFrom(DataInputStream
arg0)
{
@@ -347,8 +342,5 @@
{
return false;
}
-
-
}
-
}
Show replies by date