[jbosscache-commits] JBoss Cache SVN: r7607 - core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Jan 28 13:27:32 EST 2009


Author: manik.surtani at jboss.com
Date: 2009-01-28 13:27:32 -0500 (Wed, 28 Jan 2009)
New Revision: 7607

Modified:
   core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/CommandAwareRpcDispatcher.java
   core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/JGroupsTransport.java
Log:


Modified: core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/CommandAwareRpcDispatcher.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/CommandAwareRpcDispatcher.java	2009-01-28 18:26:32 UTC (rev 7606)
+++ core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/CommandAwareRpcDispatcher.java	2009-01-28 18:27:32 UTC (rev 7607)
@@ -22,6 +22,7 @@
 package org.horizon.remoting.transport.jgroups;
 
 import org.horizon.CacheException;
+import org.horizon.commands.RPCCommand;
 import org.horizon.commands.ReplicableCommand;
 import org.horizon.logging.Log;
 import org.horizon.logging.LogFactory;
@@ -117,7 +118,7 @@
    public Object handle(Message req) {
       if (isValid(req)) {
          try {
-            return executeCommand((ReplicableCommand) req_marshaller.objectFromByteBuffer(req.getBuffer(), req.getOffset(), req.getLength()), req);
+            return executeCommand((RPCCommand) req_marshaller.objectFromByteBuffer(req.getBuffer(), req.getOffset(), req.getLength()), req);
          }
          catch (Throwable x) {
             if (trace) log.trace("Problems invoking command.", x);
@@ -128,7 +129,7 @@
       }
    }
 
-   protected Object executeCommand(ReplicableCommand cmd, Message req) throws Throwable {
+   protected Object executeCommand(RPCCommand cmd, Message req) throws Throwable {
       if (cmd == null) throw new NullPointerException("Unable to execute a null command!  Message was " + req);
       if (trace) log.trace("Executing command: {0} [sender={1}]", cmd, req.getSrc());
       return inboundInvocationHandler.handle(cmd);

Modified: core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/JGroupsTransport.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/JGroupsTransport.java	2009-01-28 18:26:32 UTC (rev 7606)
+++ core/branches/flat/src/main/java/org/horizon/remoting/transport/jgroups/JGroupsTransport.java	2009-01-28 18:27:32 UTC (rev 7607)
@@ -1,7 +1,7 @@
 package org.horizon.remoting.transport.jgroups;
 
 import org.horizon.CacheException;
-import org.horizon.commands.ReplicableCommand;
+import org.horizon.commands.RPCCommand;
 import org.horizon.config.GlobalConfiguration;
 import org.horizon.config.parsing.XmlConfigHelper;
 import org.horizon.lock.TimeoutException;
@@ -216,7 +216,7 @@
    // outbound RPC
    // ------------------------------------------------------------------------------------------------------------------
 
-   public List<Object> invokeRemotely(List<Address> recipients, ReplicableCommand cacheCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter)
+   public List<Object> invokeRemotely(List<Address> recipients, RPCCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter)
          throws Exception {
 
       if (recipients != null && recipients.isEmpty()) {
@@ -225,16 +225,16 @@
          return Collections.emptyList();
       }
 
-      log.trace("dests={0}, command={1}, mode={2}, timeout={3}", recipients, cacheCommand, mode, timeout);
+      log.trace("dests={0}, command={1}, mode={2}, timeout={3}", recipients, rpcCommand, mode, timeout);
 
-      RspList rsps = dispatcher.invokeRemoteCommands(toJGroupsAddressVector(recipients), cacheCommand, toJGroupsMode(mode),
+      RspList rsps = dispatcher.invokeRemoteCommands(toJGroupsAddressVector(recipients), rpcCommand, toJGroupsMode(mode),
                                                      timeout, false, usePriorityQueue,
                                                      toJGroupsFilter(responseFilter));
 
       if (mode == ResponseMode.ASYNCHRONOUS) return Collections.emptyList();// async case
 
       if (trace)
-         log.trace("Cache [{0}]: responses for command {1}:\n{2}", getAddress(), cacheCommand.getClass().getSimpleName(), rsps);
+         log.trace("Cache [{0}]: responses for command {1}:\n{2}", getAddress(), rpcCommand.getClass().getSimpleName(), rsps);
 
       // short-circuit no-return-value calls.
       if (rsps == null) return Collections.emptyList();
@@ -308,9 +308,8 @@
             members = fromJGroupsAddressList(newMembers);
             needNotification = true;
          }
-
          // Now that we have a view, figure out if we are the coordinator
-         coordinator = (members != null && members.size() != 0 && members.get(0).equals(address));
+         coordinator = (members != null && members.size() != 0 && members.get(0).equals(getAddress()));
 
          // now notify listeners - *after* updating the coordinator. - JBCACHE-662
          if (needNotification && notifier != null) {




More information about the jbosscache-commits mailing list