Author: manik.surtani(a)jboss.com
Date: 2008-04-14 20:34:48 -0400 (Mon, 14 Apr 2008)
New Revision: 5566
Modified:
core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
Log:
Fixed issues with replicate command
Modified: core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java 2008-04-14
21:11:20 UTC (rev 5565)
+++ core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java 2008-04-15
00:34:48 UTC (rev 5566)
@@ -64,10 +64,11 @@
}
@Inject
- private void injectDependencies(RPCManager rpcManager, Configuration configuration)
+ private void injectDependencies(RPCManager rpcManager, Configuration configuration,
CommandsFactory commandsFactory)
{
this.rpcManager = rpcManager;
this.configuration = configuration;
+ this.commandsFactory = commandsFactory;
enabled = configuration.isUseReplQueue() &&
(configuration.getBuddyReplicationConfig() == null ||
!configuration.getBuddyReplicationConfig().isEnabled());
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-14
21:11:20 UTC (rev 5565)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-15
00:34:48 UTC (rev 5566)
@@ -8,9 +8,7 @@
import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.InterceptorChain;
-import org.jboss.cache.marshall.MethodCallWrapper;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -115,7 +113,7 @@
public int getCommandId()
{
- return isSingleCommand() ? MULTIPLE_METHOD_ID : SINGLE_METHOD_ID;
+ return isSingleCommand() ? SINGLE_METHOD_ID : MULTIPLE_METHOD_ID;
}
public List<MarshallableCommand> getModifications()
@@ -131,9 +129,9 @@
public Object[] getParameters()
{
if (isSingleCommand())
- return new Object[]{toMethodCallList()};
+ return new Object[]{singleModification};
else
- return new Object[]{new MethodCallWrapper(singleModification)};
+ return new Object[]{modifications};
}
@SuppressWarnings("unchecked")
@@ -145,7 +143,7 @@
}
else
{
- modifications = (List<MarshallableCommand>) args[1];
+ modifications = (List<MarshallableCommand>) args[0];
}
}
@@ -154,13 +152,6 @@
return singleModification != null;
}
- private List<MethodCallWrapper> toMethodCallList()
- {
- List<MethodCallWrapper> l = new
ArrayList<MethodCallWrapper>(modifications.size());
- for (MarshallableCommand cc : modifications) l.add(new MethodCallWrapper(cc));
- return l;
- }
-
@Override
public boolean equals(Object o)
{