JBoss Cache SVN: r5783 - core/tags/2.1.1.GA/src/main/docbook/userguide/en/modules.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-04-30 13:15:24 -0400 (Wed, 30 Apr 2008)
New Revision: 5783
Modified:
core/tags/2.1.1.GA/src/main/docbook/userguide/en/modules/deployment.xml
Log:
[JBCACHE-1334] Update microcontainer usage docs
Modified: core/tags/2.1.1.GA/src/main/docbook/userguide/en/modules/deployment.xml
===================================================================
--- core/tags/2.1.1.GA/src/main/docbook/userguide/en/modules/deployment.xml 2008-04-30 17:10:11 UTC (rev 5782)
+++ core/tags/2.1.1.GA/src/main/docbook/userguide/en/modules/deployment.xml 2008-04-30 17:15:24 UTC (rev 5783)
@@ -279,12 +279,12 @@
</bean>
<!-- The cache itself -->
- <bean name="ExampleCache" class="org.jboss.cache.CacheImpl">
+ <bean name="ExampleCache" class="org.jboss.cache.Cache">
<constructor factoryMethod="createCache">
<factory bean="DefaultCacheFactory"/>
- <parameter><inject bean="ExampleCacheConfig"/></parameter>
- <parameter>false</false>
+ <parameter class="org.jboss.cache.config.Configuration"><inject bean="ExampleCacheConfig"/></parameter>
+ <parameter class="boolean">false</false>
</constructor>
</bean>
16 years, 7 months
JBoss Cache SVN: r5782 - core/trunk/src/main/docbook/userguide/en/modules.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-04-30 13:10:11 -0400 (Wed, 30 Apr 2008)
New Revision: 5782
Modified:
core/trunk/src/main/docbook/userguide/en/modules/deployment.xml
Log:
[JBCACHE-1334] Update microcontainer usage docs
Modified: core/trunk/src/main/docbook/userguide/en/modules/deployment.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/deployment.xml 2008-04-30 17:07:14 UTC (rev 5781)
+++ core/trunk/src/main/docbook/userguide/en/modules/deployment.xml 2008-04-30 17:10:11 UTC (rev 5782)
@@ -279,12 +279,12 @@
</bean>
<!-- The cache itself -->
- <bean name="ExampleCache" class="org.jboss.cache.CacheImpl">
+ <bean name="ExampleCache" class="org.jboss.cache.Cache">
<constructor factoryMethod="createCache">
<factory bean="DefaultCacheFactory"/>
- <parameter><inject bean="ExampleCacheConfig"/></parameter>
- <parameter>false</false>
+ <parameter class="org.jboss.cache.config.Configuration"><inject bean="ExampleCacheConfig"/></parameter>
+ <parameter class="boolean">false</false>
</constructor>
</bean>
16 years, 7 months
JBoss Cache SVN: r5781 - core/branches/2.1.X/src/main/docbook/userguide/en/modules.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-04-30 13:07:14 -0400 (Wed, 30 Apr 2008)
New Revision: 5781
Modified:
core/branches/2.1.X/src/main/docbook/userguide/en/modules/deployment.xml
Log:
[JBCACHE-1334] Update microcontainer usage docs
Modified: core/branches/2.1.X/src/main/docbook/userguide/en/modules/deployment.xml
===================================================================
--- core/branches/2.1.X/src/main/docbook/userguide/en/modules/deployment.xml 2008-04-30 17:04:26 UTC (rev 5780)
+++ core/branches/2.1.X/src/main/docbook/userguide/en/modules/deployment.xml 2008-04-30 17:07:14 UTC (rev 5781)
@@ -279,12 +279,12 @@
</bean>
<!-- The cache itself -->
- <bean name="ExampleCache" class="org.jboss.cache.CacheImpl">
+ <bean name="ExampleCache" class="org.jboss.cache.Cache">
<constructor factoryMethod="createCache">
<factory bean="DefaultCacheFactory"/>
- <parameter><inject bean="ExampleCacheConfig"/></parameter>
- <parameter>false</false>
+ <parameter class="org.jboss.cache.config.Configuration"><inject bean="ExampleCacheConfig"/></parameter>
+ <parameter class="boolean">false</false>
</constructor>
</bean>
16 years, 7 months
JBoss Cache SVN: r5780 - in core/trunk/src/main/java/org/jboss/cache: marshall and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-30 13:04:26 -0400 (Wed, 30 Apr 2008)
New Revision: 5780
Modified:
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
Log:
Further optimisations around unnecessary construction of response lists
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-04-30 16:44:48 UTC (rev 5779)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-04-30 17:04:26 UTC (rev 5780)
@@ -42,7 +42,6 @@
import org.jgroups.util.RspList;
import javax.transaction.TransactionManager;
-import java.io.NotSerializableException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -406,17 +405,14 @@
RspList rsps = disp.invokeRemoteCommands(recipients, command, modeToUse, timeout, isUsingBuddyReplication, useOutOfBandMessage, responseFilter);
- // 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
- if (rsps == null)
- {
- throw new NotSerializableException("RpcDispatcher returned a null. This is most often caused by args for " + command.getClass().getSimpleName() + " not being serializable.");
- }
if (mode == GroupRequest.GET_NONE) return Collections.emptyList();// async case
if (trace)
log.trace("(" + getLocalAddress() + "): responses for method " + command.getClass().getSimpleName() + ":\n" + rsps);
+ // short-circuit no-return-value calls.
+ if (rsps == null) return Collections.emptyList();
+
List<Object> retval = new ArrayList<Object>(rsps.size());
for (Rsp rsp : rsps.values())
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-04-30 16:44:48 UTC (rev 5779)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-04-30 17:04:26 UTC (rev 5780)
@@ -16,8 +16,10 @@
import org.jgroups.MessageListener;
import org.jgroups.blocks.RpcDispatcher;
import org.jgroups.blocks.RspFilter;
+import org.jgroups.util.Rsp;
import org.jgroups.util.RspList;
+import java.io.NotSerializableException;
import java.util.Vector;
/**
@@ -66,7 +68,7 @@
* is aware of {@link org.jboss.cache.commands.ReplicableCommand} objects.
*/
public RspList invokeRemoteCommands(Vector<Address> dests, ReplicableCommand command, int mode, long timeout,
- boolean use_anycasting, boolean oob, RspFilter filter)
+ boolean use_anycasting, boolean oob, RspFilter filter) throws NotSerializableException
{
if (dests != null && dests.isEmpty())
{
@@ -94,9 +96,30 @@
msg.setFlag(Message.OOB);
RspList retval = super.castMessage(dests, msg, mode, timeout, use_anycasting, filter);
if (log.isTraceEnabled()) log.trace("responses: " + retval);
- return retval;
+
+ // 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
+ // the serialization problem could be on the remote end and this is why we cannot catch this above, when marshalling.
+ if (retval == null)
+ {
+ throw new NotSerializableException("RpcDispatcher returned a null. This is most often caused by args for " + command.getClass().getSimpleName() + " not being serializable.");
+ }
+
+ if (retval.isEmpty() || containsOnlyNulls(retval))
+ return null;
+ else
+ return retval;
}
+ private boolean containsOnlyNulls(RspList l)
+ {
+ for (Rsp r : l.values())
+ {
+ if (r.getValue() != null) return false;
+ }
+ return true;
+ }
+
/**
* Message contains a Command. Execute it against *this* object and return result.
*/
16 years, 7 months
JBoss Cache SVN: r5779 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/lib.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-04-30 12:44:48 -0400 (Wed, 30 Apr 2008)
New Revision: 5779
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/lib/jbosscache-core.jar
Log:
updated 2.2 distribution
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/lib/jbosscache-core.jar
===================================================================
(Binary files differ)
16 years, 7 months
JBoss Cache SVN: r5778 - benchmarks/benchmark-fwk/trunk/conf.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-04-30 12:42:58 -0400 (Wed, 30 Apr 2008)
New Revision: 5778
Modified:
benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
Log:
rollback
Modified: benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/conf/cachebench.xml 2008-04-30 16:24:51 UTC (rev 5777)
+++ benchmarks/benchmark-fwk/trunk/conf/cachebench.xml 2008-04-30 16:42:58 UTC (rev 5778)
@@ -8,7 +8,8 @@
emptyCacheBetweenTests - again, use if you're running out of mem.
numThreads - the number of executor threads to use to perform the required number of operations.
-->
-<cachebench sampleSize="10000" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true" numThreads="10">
+<cachebench sampleSize="10000" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true"
+ numThreads="10">
<!--
@@ -16,19 +17,19 @@
otherwise (part of) cluster operations do not replicate on all instances. We configure here one socket addresses
on each cluster node, so that the framework can communicate with all the nodes and barrier whenever needed.
- for each node instance socket address is specified. You can make sure that addresses are available by using
- checkClusterAddresses ant target
+ checkClusterAddresses ant target
-->
- <cluster bindAddress="127.0.0.1">
- <member host="127.0.0.1" port="7901"/>
- <member host="127.0.0.1" port="7902"/>
- <member host="127.0.0.1" port="7903"/>
- <member host="127.0.0.1" port="7904"/>
- <member host="127.0.0.1" port="7905"/>
- <member host="127.0.0.1" port="7906"/>
- <member host="127.0.0.1" port="7907"/>
- <member host="127.0.0.1" port="7908"/>
- <member host="127.0.0.1" port="7909"/>
- <member host="127.0.0.1" port="7910"/>
+ <cluster>
+ <member host="cluster01" port="17900"/>
+ <member host="cluster02" port="17900"/>
+ <member host="cluster03" port="17900"/>
+ <member host="cluster04" port="17900"/>
+ <member host="cluster05" port="17900"/>
+ <member host="cluster06" port="17900"/>
+ <member host="cluster07" port="17900"/>
+ <member host="cluster08" port="17900"/>
+ <member host="cluster09" port="17900"/>
+ <member host="cluster10" port="17900"/>
</cluster>
<!--
@@ -37,7 +38,7 @@
testcase. By default set to true.
-->
- <testcase name="WebSessionReplicationTest" stopOnFailure="true">
+ <testcase name="WebSessionReplicationTest" stopOnFailure="true">
<!-- org.cachebench.warmup.PutGetCacheWarmup warms up the cache by doing operation on it; simulates a real-world environment.
If no warmup is needed use org.cachebench.warmup.NoCacheWarmup
@@ -50,48 +51,46 @@
validates that replication is enabled and works. If repl does not occur and the stopOnFailure is set to true then exists.
Should be used to make sure that replication is enabled; see javadoc for more details
-->
- <!--
- <test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">
- <param name="partialReplication" value="true"/>
- </test>
+ <test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">
+ <param name="partialReplication" value="true"/>
+ </test>
--->
<!--
* The "name" attrib is just used for display in the reports.
* You can write your own custom testClass.
* weight is currently unused.
-->
- <!--<test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" />-->
-
- <test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0" >
- <param name="numberOfRequest" value="100000"/>
- <param name="numberOfAttributes" value="100"/>
- <param name="writePercentage" value="20"/>
- <param name="sizeOfAnAttribute" value="1000"/>
- </test>
+ <!--<test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" />-->
- <!--
- <test name="Primitive Wrappers" testClass="org.cachebench.tests.simpletests.PrimitiveTest" weight="1.0" />
- <test name="Custom Class Types" testClass="org.cachebench.tests.simpletests.CustomClassTest" weight="1.0" />
- <test name="Custom Subclasses of Abstracts" testClass="org.cachebench.tests.simpletests.SubclassTest" weight="1.5" />
- <test name="Custom Types With Transients" testClass="org.cachebench.tests.simpletests.TransientTest" weight="1.0" />
- <test name="Custom Types With Statics" testClass="org.cachebench.tests.simpletests.StaticsTest" weight="1.5" />
- <test name="Custom Types With Associations" testClass="org.cachebench.tests.simpletests.AssociationsTest" weight="2.0" />
- -->
+ <test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0">
+ <param name="numberOfRequest" value="100000"/>
+ <param name="numberOfAttributes" value="100"/>
+ <param name="writePercentage" value="20"/>
+ <param name="sizeOfAnAttribute" value="1000"/>
+ </test>
- <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored. Please pass in your cache config
- file name that you wish to use with the -DcacheBenchFwk.cacheConfigFile JVM parameter. The runNode.sh
- and cluster.sh scripts will also do this for you. -->
+ <!--
+ <test name="Primitive Wrappers" testClass="org.cachebench.tests.simpletests.PrimitiveTest" weight="1.0" />
+ <test name="Custom Class Types" testClass="org.cachebench.tests.simpletests.CustomClassTest" weight="1.0" />
+ <test name="Custom Subclasses of Abstracts" testClass="org.cachebench.tests.simpletests.SubclassTest" weight="1.5" />
+ <test name="Custom Types With Transients" testClass="org.cachebench.tests.simpletests.TransientTest" weight="1.0" />
+ <test name="Custom Types With Statics" testClass="org.cachebench.tests.simpletests.StaticsTest" weight="1.5" />
+ <test name="Custom Types With Associations" testClass="org.cachebench.tests.simpletests.AssociationsTest" weight="2.0" />
+ -->
+
+ <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored. Please pass in your cache config
+file name that you wish to use with the -DcacheBenchFwk.cacheConfigFile JVM parameter. The runNode.sh
+and cluster.sh scripts will also do this for you. -->
</testcase>
- <!--
- Available generators are: CSVReportGenerator and ClusterReportGenerator.
- See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
- own report generators such as XML generators, graphic generators, etc
+ <!--
+ Available generators are: CSVReportGenerator and ClusterReportGenerator.
+ See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
+ own report generators such as XML generators, graphic generators, etc
-->
<!-- The CSV report generated can be plugged in to a spreadsheet to generate graphs. If 'outputFile is set to
- '-generic-' then the name would be generated as follows: 'performance-<nodeIndexInCluster>.csv' -->
+ '-generic-' then the name would be generated as follows: 'data_<cache-product>_<configuration>_<cluster-size>.csv' -->
<report outputFile="-generic-" generator="org.cachebench.reportgenerators.ClusterReportGenerator"/>
</cachebench>
16 years, 7 months
JBoss Cache SVN: r5777 - in benchmarks/benchmark-fwk/trunk: src/org/cachebench and 1 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-04-30 12:24:51 -0400 (Wed, 30 Apr 2008)
New Revision: 5777
Modified:
benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
Log:
added 2.2.0 bench support
Modified: benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/conf/cachebench.xml 2008-04-30 16:22:10 UTC (rev 5776)
+++ benchmarks/benchmark-fwk/trunk/conf/cachebench.xml 2008-04-30 16:24:51 UTC (rev 5777)
@@ -8,8 +8,7 @@
emptyCacheBetweenTests - again, use if you're running out of mem.
numThreads - the number of executor threads to use to perform the required number of operations.
-->
-<cachebench sampleSize="10000" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true"
- numThreads="10">
+<cachebench sampleSize="10000" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true" numThreads="10">
<!--
@@ -19,17 +18,17 @@
- for each node instance socket address is specified. You can make sure that addresses are available by using
checkClusterAddresses ant target
-->
- <cluster>
- <member host="cluster01" port="17900"/>
- <member host="cluster02" port="17900"/>
- <member host="cluster03" port="17900"/>
- <member host="cluster04" port="17900"/>
- <member host="cluster05" port="17900"/>
- <member host="cluster06" port="17900"/>
- <member host="cluster07" port="17900"/>
- <member host="cluster08" port="17900"/>
- <member host="cluster09" port="17900"/>
- <member host="cluster10" port="17900"/>
+ <cluster bindAddress="127.0.0.1">
+ <member host="127.0.0.1" port="7901"/>
+ <member host="127.0.0.1" port="7902"/>
+ <member host="127.0.0.1" port="7903"/>
+ <member host="127.0.0.1" port="7904"/>
+ <member host="127.0.0.1" port="7905"/>
+ <member host="127.0.0.1" port="7906"/>
+ <member host="127.0.0.1" port="7907"/>
+ <member host="127.0.0.1" port="7908"/>
+ <member host="127.0.0.1" port="7909"/>
+ <member host="127.0.0.1" port="7910"/>
</cluster>
<!--
@@ -38,7 +37,7 @@
testcase. By default set to true.
-->
- <testcase name="WebSessionReplicationTest" stopOnFailure="true">
+ <testcase name="WebSessionReplicationTest" stopOnFailure="true">
<!-- org.cachebench.warmup.PutGetCacheWarmup warms up the cache by doing operation on it; simulates a real-world environment.
If no warmup is needed use org.cachebench.warmup.NoCacheWarmup
@@ -51,48 +50,48 @@
validates that replication is enabled and works. If repl does not occur and the stopOnFailure is set to true then exists.
Should be used to make sure that replication is enabled; see javadoc for more details
-->
- <!--
- <test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">
- <param name="partialReplication" value="true"/>
- </test>
+ <!--
+ <test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">
+ <param name="partialReplication" value="true"/>
+ </test>
- -->
+-->
<!--
* The "name" attrib is just used for display in the reports.
* You can write your own custom testClass.
* weight is currently unused.
-->
- <!--<test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" />-->
+ <!--<test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" />-->
+
+ <test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0" >
+ <param name="numberOfRequest" value="100000"/>
+ <param name="numberOfAttributes" value="100"/>
+ <param name="writePercentage" value="20"/>
+ <param name="sizeOfAnAttribute" value="1000"/>
+ </test>
- <test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0">
- <param name="numberOfRequest" value="100000"/>
- <param name="numberOfAttributes" value="100"/>
- <param name="writePercentage" value="20"/>
- <param name="sizeOfAnAttribute" value="1000"/>
- </test>
+ <!--
+ <test name="Primitive Wrappers" testClass="org.cachebench.tests.simpletests.PrimitiveTest" weight="1.0" />
+ <test name="Custom Class Types" testClass="org.cachebench.tests.simpletests.CustomClassTest" weight="1.0" />
+ <test name="Custom Subclasses of Abstracts" testClass="org.cachebench.tests.simpletests.SubclassTest" weight="1.5" />
+ <test name="Custom Types With Transients" testClass="org.cachebench.tests.simpletests.TransientTest" weight="1.0" />
+ <test name="Custom Types With Statics" testClass="org.cachebench.tests.simpletests.StaticsTest" weight="1.5" />
+ <test name="Custom Types With Associations" testClass="org.cachebench.tests.simpletests.AssociationsTest" weight="2.0" />
+ -->
- <!--
- <test name="Primitive Wrappers" testClass="org.cachebench.tests.simpletests.PrimitiveTest" weight="1.0" />
- <test name="Custom Class Types" testClass="org.cachebench.tests.simpletests.CustomClassTest" weight="1.0" />
- <test name="Custom Subclasses of Abstracts" testClass="org.cachebench.tests.simpletests.SubclassTest" weight="1.5" />
- <test name="Custom Types With Transients" testClass="org.cachebench.tests.simpletests.TransientTest" weight="1.0" />
- <test name="Custom Types With Statics" testClass="org.cachebench.tests.simpletests.StaticsTest" weight="1.5" />
- <test name="Custom Types With Associations" testClass="org.cachebench.tests.simpletests.AssociationsTest" weight="2.0" />
- -->
-
- <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored. Please pass in your cache config
-file name that you wish to use with the -DcacheBenchFwk.cacheConfigFile JVM parameter. The runNode.sh
-and cluster.sh scripts will also do this for you. -->
+ <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored. Please pass in your cache config
+ file name that you wish to use with the -DcacheBenchFwk.cacheConfigFile JVM parameter. The runNode.sh
+ and cluster.sh scripts will also do this for you. -->
</testcase>
- <!--
- Available generators are: CSVReportGenerator and ClusterReportGenerator.
- See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
- own report generators such as XML generators, graphic generators, etc
+ <!--
+ Available generators are: CSVReportGenerator and ClusterReportGenerator.
+ See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
+ own report generators such as XML generators, graphic generators, etc
-->
<!-- The CSV report generated can be plugged in to a spreadsheet to generate graphs. If 'outputFile is set to
- '-generic-' then the name would be generated as follows: 'data_<cache-product>_<configuration>_<cluster-size>.csv' -->
+ '-generic-' then the name would be generated as follows: 'performance-<nodeIndexInCluster>.csv' -->
<report outputFile="-generic-" generator="org.cachebench.reportgenerators.ClusterReportGenerator"/>
</cachebench>
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-04-30 16:22:10 UTC (rev 5776)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-04-30 16:24:51 UTC (rev 5777)
@@ -243,7 +243,7 @@
result.setTestPassed(false);
result.setErrorMsg("Failed to Execute - See logs for details : " + e.getMessage());
- logger.warn("Test case : " + testCaseName + ", Test : " + testName + " - Failed", e);
+ logger.warn("Test case : " + testCaseName + ", Test : " + testName + " - Failed due to", e);
errorLogger.error("Test case : " + testCaseName + ", Test : " + testName + " - Failed : " + e.getMessage(), e);
}
if (!result.isTestPassed() && testCase.isStopOnFailure())
Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-04-30 16:22:10 UTC (rev 5776)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-04-30 16:24:51 UTC (rev 5777)
@@ -19,8 +19,7 @@
*
* @author Mircea.Markus(a)jboss.com
*/
-public class ReplicationOccursTest implements CacheTest
-{
+public class ReplicationOccursTest implements CacheTest {
public static final Log log = LogFactory.getLog(ReplicationOccursTest.class);
private Configuration conf;
@@ -28,22 +27,19 @@
private static final int REPLICATION_TRY_COUNT = 5;
private static final int REPLICATION_TRY_SLEEP = 2000;
- public void setConfiguration(Configuration configuration)
- {
+ public void setConfiguration(Configuration configuration) {
this.conf = configuration;
}
- public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception
- {
+ public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception {
log.trace("TestCase = '" + testCaseName + "', TestName = " + testName);
barrierBeforeReplicationTest();
Integer currentNodeIndex = conf.getClusterConfig().getCurrentNodeIndex();
- cache.put(PREFIX + currentNodeIndex, "true");
+ tryToPut(cache, currentNodeIndex);
Thread.sleep(REPLICATION_TRY_SLEEP);//just to make sure that prev barrier closed its sockets etc
- if (conf.getClusterConfig().getClusterSize() == 1)
- {
+ if (conf.getClusterConfig().getClusterSize() == 1) {
log.info("Cluster size is one, no replication expected");
StatisticTestResult result = new StatisticTestResult();
result.setTestPassed(true);
@@ -54,23 +50,39 @@
boolean allNodesReplicated = checkReplicationSeveralTimes(testName, cache, testCaseName);
Map<SocketAddress, Object> receivedValues = broadcastReplicationResult(allNodesReplicated);
- cache.empty();
+ try {
+ cache.empty();
+ } catch (Throwable e)
+ {
+ log.warn("Fail to cleanup cache after replication test", e);
+ }
return allReplicatedFine(receivedValues);
}
+ private void tryToPut(CacheWrapper cache, Integer currentNodeIndex) throws Exception {
+ int tryCount = 0;
+ while (tryCount < 5) {
+ try {
+ cache.put(PREFIX + currentNodeIndex, "true");
+ return;
+ }
+ catch (Throwable e) {
+ log.warn("Error while trying to put data: ", e);
+ tryCount++;
+ }
+ }
+ }
+
/**
* If caches replicate async, then try several times.
*/
private boolean checkReplicationSeveralTimes(String testName, CacheWrapper cache, String testCaseName)
- throws Exception
- {
- for (int i =0; i < REPLICATION_TRY_COUNT; i++)
- {
- if (nodesReplicated(cache, testCaseName, testName))
- {
+ throws Exception {
+ for (int i = 0; i < REPLICATION_TRY_COUNT; i++) {
+ if (nodesReplicated(cache, testCaseName, testName)) {
return true;
}
- log.info("Replication test failed, " + (i+1) + " tries so far. Sleeping for " + REPLICATION_TRY_SLEEP
+ log.info("Replication test failed, " + (i + 1) + " tries so far. Sleeping for " + REPLICATION_TRY_SLEEP
+ " millis then try again");
Thread.sleep(REPLICATION_TRY_SLEEP);
}
@@ -78,8 +90,7 @@
}
private Map<SocketAddress, Object> broadcastReplicationResult(boolean allNodesReplicated)
- throws Exception
- {
+ throws Exception {
ClusterBarrier barrier = new ClusterBarrier();
barrier.setConfig(conf.getClusterConfig());
barrier.barrier(String.valueOf(allNodesReplicated));
@@ -89,22 +100,18 @@
}
private void barrierBeforeReplicationTest()
- throws Exception
- {
+ throws Exception {
ClusterBarrier barrier = new ClusterBarrier();
barrier.setAcknowledge(true);
barrier.setConfig(conf.getClusterConfig());
barrier.barrier("BEFORE_REPLICATION_OCCURS_BARRIER");
}
- private StatisticTestResult allReplicatedFine(Map<SocketAddress, Object> receivedValues)
- {
+ private StatisticTestResult allReplicatedFine(Map<SocketAddress, Object> receivedValues) {
StatisticTestResult result = new StatisticTestResult();
result.setSkipReport(true);
- for (Object value : receivedValues.values())
- {
- if (!"true".equals(value))
- {
+ for (Object value : receivedValues.values()) {
+ if (!"true".equals(value)) {
log.info("Replication was not successful on the entire cluster!");
result.setTestPassed(false);
return result;
@@ -115,66 +122,68 @@
return result;
}
- private boolean isPartialReplication(String testCaseName, String testName)
- {
+ private boolean isPartialReplication(String testCaseName, String testName) {
TestCase testCase = conf.getTestCase(testCaseName);
TestConfig thisConfig = testCase.getTest(testName);
return thisConfig.existsParam("partialReplication") &&
"true".equalsIgnoreCase(thisConfig.getParamValue("partialReplication"));
}
- private boolean nodesReplicated(CacheWrapper cache, String testCaseName, String testName) throws Exception
- {
+ private boolean nodesReplicated(CacheWrapper cache, String testCaseName, String testName) throws Exception {
int clusterSize = conf.getClusterConfig().getClusterSize();
int replicaCount = 0;
- for (int i = 0; i < clusterSize; i++)
- {
+ for (int i = 0; i < clusterSize; i++) {
int currentNodeIndex = conf.getClusterConfig().getCurrentNodeIndex();
- if (i == currentNodeIndex)
- {
+ if (i == currentNodeIndex) {
continue;
}
- Object data = cache.getReplicatedData(PREFIX + i);
- if (data == null || !"true".equals(data))
- {
+ Object data = tryGet(cache, i);
+ if (data == null || !"true".equals(data)) {
log.trace("Cache with index " + i + " did *NOT* replicate");
- }
- else
- {
+ } else {
log.trace("Cache with index " + i + " replicated here ");
replicaCount++;
}
}
log.info("Number of caches that replicated here is " + replicaCount);
- if (isPartialReplication(testCaseName, testName))
- {
+ if (isPartialReplication(testCaseName, testName)) {
return verifyClusterReplication(replicaCount);
}
return replicaCount == conf.getClusterConfig().getClusterSize() - 1;
}
+ private Object tryGet(CacheWrapper cache, int i) throws Exception {
+ int tryCont = 0;
+ while (tryCont < 5)
+ {
+ try {
+ return cache.getReplicatedData(PREFIX + i);
+ } catch (Throwable e) {
+ tryCont ++;
+ }
+ }
+ return null;
+ }
+
/**
* Checks whether the sum of replciations across the cluster is bigger than the number of nodes in the cluster, in
* other words each node replicated at least once.
*/
- private boolean verifyClusterReplication(int replicaCount) throws Exception
- {
+ private boolean verifyClusterReplication(int replicaCount) throws Exception {
ClusterBarrier barrier = new ClusterBarrier();
barrier.setConfig(conf.getClusterConfig());
barrier.barrier(replicaCount);
Collection recievedValues = barrier.getReceivedMessages().values();
log.trace("Recieved the following repilcation counts: " + recievedValues);
int totalValue = 0;
- for (Object val : recievedValues)
- {
+ for (Object val : recievedValues) {
totalValue += Integer.valueOf(val.toString());
}
log.info("********** Overall replication count is: " + totalValue);
//this means SOME replication occurred. This does not mean, though, that all nodes replicated successfuly.
//correct condition would be >= this.conf.getClusterConfig().getClusterSize()
//todo/FIXME - this seem not to work with all the products, so we will accept 'some replication'
- if (totalValue < this.conf.getClusterConfig().getClusterSize())
- {
+ if (totalValue < this.conf.getClusterConfig().getClusterSize()) {
log.warn("The replication was not total, but partial!!");
}
boolean isReplicationSuccess = totalValue > 0;
16 years, 7 months
JBoss Cache SVN: r5776 - in core/trunk/src/main/java/org/jboss/cache: invocation and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-30 12:22:10 -0400 (Wed, 30 Apr 2008)
New Revision: 5776
Modified:
core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
Log:
Further optimisations around not using the component registry to autowire frequently created objects such as nodes
Modified: core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/NodeFactory.java 2008-04-30 16:10:12 UTC (rev 5775)
+++ core/trunk/src/main/java/org/jboss/cache/NodeFactory.java 2008-04-30 16:22:10 UTC (rev 5776)
@@ -7,14 +7,17 @@
package org.jboss.cache;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.CommandsFactory;
import org.jboss.cache.factories.ComponentFactory;
-import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
+import org.jboss.cache.interceptors.InterceptorChain;
+import org.jboss.cache.invocation.InvocationContextContainer;
import org.jboss.cache.invocation.NodeInvocationDelegate;
import org.jboss.cache.optimistic.TransactionWorkspace;
import org.jboss.cache.optimistic.WorkspaceNode;
import org.jboss.cache.optimistic.WorkspaceNodeImpl;
+import org.jboss.cache.transaction.TransactionTable;
import java.util.Map;
@@ -25,10 +28,14 @@
*/
public class NodeFactory<K, V> extends ComponentFactory
{
- private ComponentRegistry componentRegistry;
private CacheSPI<K, V> cache;
private boolean optimistic;
private Configuration configuration;
+ private TransactionTable transactionTable;
+ private InvocationContextContainer invocationContextContainer;
+ private LifecycleManager lifecycleManager;
+ private InterceptorChain interceptorChain;
+ private CommandsFactory commandsFactory;
@Override
protected <T> T construct(String componentName, Class<T> componentType)
@@ -55,11 +62,17 @@
}
@Inject
- private void injectDependencies(CacheSPI<K, V> cache, Configuration configuration, ComponentRegistry componentRegistry)
+ private void injectDependencies(CacheSPI<K, V> cache, Configuration configuration, TransactionTable transactionTable,
+ InvocationContextContainer invocationContextContainer, LifecycleManager lifecycleManager,
+ InterceptorChain interceptorChain, CommandsFactory commandsFactory)
{
this.cache = cache;
this.configuration = configuration;
- this.componentRegistry = componentRegistry;
+ this.transactionTable = transactionTable;
+ this.invocationContextContainer = invocationContextContainer;
+ this.lifecycleManager = lifecycleManager;
+ this.interceptorChain = interceptorChain;
+ this.commandsFactory = commandsFactory;
}
/**
@@ -91,6 +104,12 @@
// always assume that new nodes do not have data loaded
un.setDataLoaded(false);
NodeInvocationDelegate<K, V> nid = new NodeInvocationDelegate(un);
+
+ // Too slow to have these autowired for now. Look at manually wiring them.
+ nid.initialize(configuration, invocationContextContainer, lifecycleManager, interceptorChain);
+ nid.injectDependencies(cache);
+ un.injectDependencies(cache, transactionTable, commandsFactory);
+
componentRegistry.wireDependencies(nid);
componentRegistry.wireDependencies(un);
// back ref
Modified: core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java 2008-04-30 16:10:12 UTC (rev 5775)
+++ core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java 2008-04-30 16:22:10 UTC (rev 5776)
@@ -11,8 +11,6 @@
import static org.jboss.cache.AbstractNode.NodeFlags.*;
import org.jboss.cache.commands.write.CreateNodeCommand;
import org.jboss.cache.factories.CommandsFactory;
-import org.jboss.cache.factories.annotations.CacheInjectionMethods;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.lock.IdentityLock;
import org.jboss.cache.marshall.MarshalledValue;
import org.jboss.cache.optimistic.DataVersion;
@@ -34,7 +32,6 @@
* @since 2.0.0
*/
@SuppressWarnings("unchecked")
-@CacheInjectionMethods
public class UnversionedNode<K, V> extends AbstractNode<K, V>
{
/**
@@ -106,11 +103,10 @@
this.delegate = delegate;
}
- @Inject
- private void injectDependencies(CacheSPI spi, TransactionTable impl, CommandsFactory commandsFactory)
+ public void injectDependencies(CacheSPI spi, TransactionTable transactionTable, CommandsFactory commandsFactory)
{
this.cache = spi;
- this.transactionTable = impl;
+ this.transactionTable = transactionTable;
this.commandsFactory = commandsFactory;
}
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-04-30 16:10:12 UTC (rev 5775)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-04-30 16:22:10 UTC (rev 5776)
@@ -8,7 +8,6 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.UnversionedNode;
import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.lock.NodeLock;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -41,8 +40,7 @@
return node;
}
- @Inject
- private void injectDependencies(CacheSPI spi)
+ public void injectDependencies(CacheSPI spi)
{
this.spi = spi;
}
16 years, 7 months
JBoss Cache SVN: r5775 - in core/trunk/src: main/java/org/jboss/cache/buddyreplication and 10 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-04-30 12:10:12 -0400 (Wed, 30 Apr 2008)
New Revision: 5775
Modified:
core/trunk/src/main/java/org/jboss/cache/RPCManager.java
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java
Log:
Performance enhancements relating to interactions with the membership list and JGroups rpc dispatcher APIs.
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManager.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManager.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -6,6 +6,7 @@
import org.jgroups.blocks.RspFilter;
import java.util.List;
+import java.util.Vector;
/**
* Provides a mechanism for communicating with other caches in the cluster. For now this is based on JGroups as an underlying
@@ -45,44 +46,41 @@
* Invokes an RPC call on other caches in the cluster.
*
* @param recipients a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.
- * @param methodCall the method call to invoke
+ * @param cacheCommand the cache command to invoke
* @param mode the group request mode to use. See {@link org.jgroups.blocks.GroupRequest}.
- * @param excludeSelf if true, the message is not looped back to the originator.
* @param timeout a timeout after which to throw a replication exception.
* @param responseFilter a response filter with which to filter out failed/unwanted/invalid responses.
* @param useOutOfBandMessage if true, the message is put on JGroups' OOB queue. See JGroups docs for more info.
* @return a list of responses from each member contacted.
* @throws Exception in the event of problems.
*/
- List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand cacheCommand, int mode, boolean excludeSelf, long timeout, RspFilter responseFilter, boolean useOutOfBandMessage) throws Exception;
+ List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand cacheCommand, int mode, long timeout, RspFilter responseFilter, boolean useOutOfBandMessage) throws Exception;
/**
* Invokes an RPC call on other caches in the cluster.
*
* @param recipients a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.
- * @param CacheCommand the method call to invoke
+ * @param cacheCommand the cache command to invoke
* @param mode the group request mode to use. See {@link org.jgroups.blocks.GroupRequest}.
- * @param excludeSelf if true, the message is not looped back to the originator.
* @param timeout a timeout after which to throw a replication exception.
* @param useOutOfBandMessage if true, the message is put on JGroups' OOB queue. See JGroups docs for more info.
* @return a list of responses from each member contacted.
* @throws Exception in the event of problems.
*/
- List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand cacheCommand, int mode, boolean excludeSelf, long timeout, boolean useOutOfBandMessage) throws Exception;
+ List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand cacheCommand, int mode, long timeout, boolean useOutOfBandMessage) throws Exception;
/**
* Invokes an RPC call on other caches in the cluster.
*
* @param recipients a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.
- * @param CacheCommand the method call to invoke
+ * @param cacheCommand the cache command to invoke
* @param synchronous if true, sets group request mode to {@link org.jgroups.blocks.GroupRequest#GET_ALL}, and if false sets it to {@link org.jgroups.blocks.GroupRequest#GET_NONE}.
- * @param excludeSelf if true, the message is not looped back to the originator.
* @param timeout a timeout after which to throw a replication exception.
* @param useOutOfBandMessage if true, the message is put on JGroups' OOB queue. See JGroups docs for more info.
* @return a list of responses from each member contacted.
* @throws Exception in the event of problems.
*/
- List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand cacheCommand, boolean synchronous, boolean excludeSelf, int timeout, boolean useOutOfBandMessage) throws Exception;
+ List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand cacheCommand, boolean synchronous, long timeout, boolean useOutOfBandMessage) throws Exception;
/**
* @return true if the current Channel is the coordinator of the cluster.
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -60,7 +60,9 @@
{
private Channel channel;
private final Log log = LogFactory.getLog(RPCManagerImpl.class);
- private final List<Address> members = new LinkedList<Address>();
+ private List<Address> members;
+
+ private final Object coordinatorLock = new Object();
/**
* True if this Cache is the coordinator.
*/
@@ -208,14 +210,9 @@
log.info("Stopping the RpcDispatcher");
disp.stop();
}
- if (members != null)
- {
- synchronized (members)
- {
- members.clear();
- }
- }
+ if (members != null) members = null;
+
coordinator = false;
disp = null;
@@ -272,6 +269,9 @@
configuration.getRuntimeConfig().setChannel(channel);
}
+ // Channel.LOCAL *must* be set to false so we don't see our own messages - otherwise invalidations targeted at
+ // remote instances will be received by self.
+ channel.setOpt(Channel.LOCAL, false);
channel.setOpt(Channel.AUTO_RECONNECT, true);
channel.setOpt(Channel.AUTO_GETSTATE, fetchState);
channel.setOpt(Channel.BLOCK, true);
@@ -373,53 +373,28 @@
// ------------ START: RPC call methods ------------
- public List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand command, int mode, boolean excludeSelf, long timeout, boolean useOutOfBandMessage) throws Exception
+ public List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand command, int mode, long timeout, boolean useOutOfBandMessage) throws Exception
{
- return callRemoteMethods(recipients, command, mode, excludeSelf, timeout, null, useOutOfBandMessage);
+ return callRemoteMethods(recipients, command, mode, timeout, null, useOutOfBandMessage);
}
- public List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand command, boolean synchronous, boolean excludeSelf, int timeout, boolean useOutOfBandMessage) throws Exception
+ public List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand command, boolean synchronous, long timeout, boolean useOutOfBandMessage) throws Exception
{
- return callRemoteMethods(recipients, command, synchronous ? GroupRequest.GET_ALL : GroupRequest.GET_NONE, excludeSelf, timeout, useOutOfBandMessage);
+ return callRemoteMethods(recipients, command, synchronous ? GroupRequest.GET_ALL : GroupRequest.GET_NONE, timeout, useOutOfBandMessage);
}
- public List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand command, int mode, boolean excludeSelf, long timeout, RspFilter responseFilter, boolean useOutOfBandMessage) throws Exception
+ public List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand command, int mode, long timeout, RspFilter responseFilter, boolean useOutOfBandMessage) throws Exception
{
+ // short circuit if we don't have an RpcDispatcher!
+ if (disp == null) return null;
+
int modeToUse = mode;
int preferredMode;
if ((preferredMode = spi.getInvocationContext().getOptionOverrides().getGroupRequestMode()) > -1)
modeToUse = preferredMode;
- RspList rsps;
- List<Object> retval;
- Vector<Address> validMembers;
-
- if (disp == null)
- {
- return null;
- }
-
- if (recipients != null)
- validMembers = new Vector<Address>(recipients);
- else
- {
- validMembers = new Vector<Address>(members);
- }
-
- if (excludeSelf && !validMembers.isEmpty())
- {
- Address local_addr = getLocalAddress();
- if (local_addr != null) validMembers.remove(local_addr);
- }
-
- if (validMembers.isEmpty())
- {
- if (trace) log.trace("destination list is empty, discarding call");
- return null;
- }
-
if (trace)
- log.trace("callRemoteMethods(): valid members are " + validMembers + " methods: " + command + " Using OOB? " + useOutOfBandMessage);
+ log.trace("callRemoteMethods(): valid members are " + recipients + " methods: " + command + " Using OOB? " + useOutOfBandMessage);
if (channel.flushSupported())
{
@@ -429,13 +404,12 @@
useOutOfBandMessage = false;
- rsps = disp.invokeRemoteCommands(validMembers, command, modeToUse, timeout, isUsingBuddyReplication, useOutOfBandMessage, responseFilter);
+ RspList rsps = disp.invokeRemoteCommands(recipients, command, modeToUse, timeout, isUsingBuddyReplication, useOutOfBandMessage, responseFilter);
// 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
if (rsps == null)
{
- // return null;
throw new NotSerializableException("RpcDispatcher returned a null. This is most often caused by args for " + command.getClass().getSimpleName() + " not being serializable.");
}
if (mode == GroupRequest.GET_NONE) return Collections.emptyList();// async case
@@ -443,7 +417,7 @@
if (trace)
log.trace("(" + getLocalAddress() + "): responses for method " + command.getClass().getSimpleName() + ":\n" + rsps);
- retval = new ArrayList<Object>(rsps.size());
+ List<Object> retval = new ArrayList<Object>(rsps.size());
for (Rsp rsp : rsps.values())
{
@@ -561,10 +535,10 @@
public List<Address> getMembers()
{
if (isInLocalMode) return null;
- synchronized (members)
- {
- return new ArrayList<Address>(members);
- }
+ if (members == null)
+ return Collections.emptyList();
+ else
+ return members;
}
public boolean isCoordinator()
@@ -579,14 +553,14 @@
return null;
}
- synchronized (members)
+ synchronized (coordinatorLock)
{
- while (members.isEmpty())
+ while (members == null || members.isEmpty())
{
log.debug("getCoordinator(): waiting on viewAccepted()");
try
{
- members.wait();
+ coordinatorLock.wait();
}
catch (InterruptedException e)
{
@@ -594,7 +568,7 @@
break;
}
}
- return members.size() > 0 ? members.get(0) : null;
+ return members != null && members.size() > 0 ? members.get(0) : null;
}
}
@@ -605,40 +579,42 @@
protected class MembershipListenerAdaptor implements ExtendedMembershipListener
{
- public void viewAccepted(View new_view)
+ public void viewAccepted(View newView)
{
- Vector<Address> new_mbrs = new_view.getMembers();
- if (log.isInfoEnabled()) log.info("Received new cluster view: " + new_view);
- synchronized (members)
+ Vector<Address> newMembers = newView.getMembers();
+ if (log.isInfoEnabled()) log.info("Received new cluster view: " + newView);
+ synchronized (coordinatorLock)
{
boolean needNotification = false;
- if (new_mbrs != null)
+ if (newMembers != null)
{
- // Determine what members have been removed
- // and roll back any tx and break any locks
- Vector<Address> removed = new Vector<Address>(members);
- removed.removeAll(new_mbrs);
- removeLocksForDeadMembers(spi.getRoot(), removed);
+ if (members != null)
+ {
+ // we had a membership list before this event. Check to make sure we haven't lost any members,
+ // and if so, determine what members have been removed
+ // and roll back any tx and break any locks
+ List<Address> removed = new ArrayList<Address>(members);
+ removed.removeAll(newMembers);
+ removeLocksForDeadMembers(spi.getRoot(), removed);
+ }
- members.clear();
- members.addAll(new_mbrs);
+ members = new ArrayList<Address>(newMembers); // defensive copy.
needNotification = true;
}
// Now that we have a view, figure out if we are the coordinator
- coordinator = (members.size() != 0 && members.get(0).equals(getLocalAddress()));
+ coordinator = (members != null && members.size() != 0 && members.get(0).equals(getLocalAddress()));
// now notify listeners - *after* updating the coordinator. - JBCACHE-662
if (needNotification && notifier != null)
{
InvocationContext ctx = spi.getInvocationContext();
- notifier.notifyViewChange(new_view, ctx);
+ notifier.notifyViewChange(newView, ctx);
}
- // Wake up any threads that are waiting to know who the members
- // are so they can figure out who the coordinator is
- members.notifyAll();
+ // Wake up any threads that are waiting to know about who the coordinator is
+ coordinatorLock.notifyAll();
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -15,7 +15,7 @@
import java.util.Collections;
import java.util.Date;
import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.Vector;
/**
* Value object that represents a buddy group
@@ -39,7 +39,7 @@
/**
* List<Address> - a list of JGroups addresses
*/
- private final List<Address> buddies = new CopyOnWriteArrayList<Address>();
+ private final Vector<Address> buddies = new Vector<Address>();
public String getGroupName()
{
@@ -97,4 +97,14 @@
return b.toString();
}
+ /**
+ * Added in 2.2.0 as an optimisation for JGroups which internally uses vectors.
+ *
+ * @return a list of buddies
+ * @since 2.2.0
+ */
+ public Vector<Address> getBuddiesAsVector()
+ {
+ return buddies;
+ }
}
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -639,6 +639,16 @@
return buddyGroup.getBuddies();
}
+ /**
+ * Created as an optimisation for JGroups, which uses vectors.
+ *
+ * @since 2.2.0
+ */
+ public Vector<Address> getBuddyAddressesAsVector()
+ {
+ return buddyGroup.getBuddiesAsVector();
+ }
+
public List<Address> getMembersOutsideBuddyGroup()
{
List<Address> members = new ArrayList<Address>(rpcManager.getMembers());
@@ -981,7 +991,7 @@
}
}
- rpcManager.callRemoteMethods(recipients, call, true, true, config.getBuddyCommunicationTimeout(), false);
+ rpcManager.callRemoteMethods(new Vector<Address>(recipients), call, true, config.getBuddyCommunicationTimeout(), false);
}
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-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -154,7 +154,7 @@
ReplicateCommand replicateCommand = commandsFactory.buildReplicateCommand(toReplicate);
// send to all live nodes in the cluster
- rpcManager.callRemoteMethods(null, replicateCommand, false, true, 5000, false);
+ rpcManager.callRemoteMethods(null, replicateCommand, false, configuration.getSyncReplTimeout(), false);
}
catch (Throwable t)
{
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -2,9 +2,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.*;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Option;
import org.jboss.cache.optimistic.DataVersion;
@@ -118,7 +122,10 @@
// mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
// be aware that it is no longer valid.
- ((NodeSPI) node).setValid(false, true);
+ NodeSPI nSPI = (NodeSPI) node;
+ nSPI.setValid(false, true);
+ // root nodes can never be invalid
+ if (fqn.isRoot()) nSPI.setValid(true, false); // non-recursive.
if (dataVersion != null)
{
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -22,6 +22,7 @@
import javax.transaction.Transaction;
import java.util.List;
+import java.util.Vector;
/**
* Acts as a base for all RPC calls - subclassed by
@@ -90,7 +91,7 @@
replicateCall(ctx, null, call, sync, o, false);
}
- protected void replicateCall(InvocationContext ctx, List<Address> recipients, ReplicableCommand c, boolean sync, Option o, boolean useOutOfBandMessage) throws Throwable
+ protected void replicateCall(InvocationContext ctx, Vector<Address> recipients, ReplicableCommand c, boolean sync, Option o, boolean useOutOfBandMessage) throws Throwable
{
long syncReplTimeout = configuration.getSyncReplTimeout();
@@ -116,10 +117,10 @@
}
}
- replicateCall(recipients, c, sync, true, useOutOfBandMessage, false, (int) syncReplTimeout);
+ replicateCall(recipients, c, sync, true, useOutOfBandMessage, false, syncReplTimeout);
}
- protected void replicateCall(List<Address> recipients, ReplicableCommand call, boolean sync, boolean wrapCacheCommandInReplicateMethod, boolean useOutOfBandMessage, boolean isBroadcast, int timeout) throws Throwable
+ protected void replicateCall(Vector<Address> recipients, ReplicableCommand call, boolean sync, boolean wrapCacheCommandInReplicateMethod, boolean useOutOfBandMessage, boolean isBroadcast, long timeout) throws Throwable
{
if (trace) log.trace("Broadcasting call " + call + " to recipient list " + recipients);
@@ -132,10 +133,10 @@
{
if (usingBuddyReplication && !isBroadcast) call = buddyManager.transformFqns((VisitableCommand) call);
- List<Address> callRecipients = recipients;
+ Vector<Address> callRecipients = recipients;
if (callRecipients == null)
{
- callRecipients = usingBuddyReplication && !isBroadcast ? buddyManager.getBuddyAddresses() : rpcManager.getMembers();
+ callRecipients = usingBuddyReplication && !isBroadcast ? buddyManager.getBuddyAddressesAsVector() : null;
if (trace)
log.trace("Setting call recipients to " + callRecipients + " since the original list of recipients passed in is null.");
}
@@ -145,7 +146,6 @@
List rsps = rpcManager.callRemoteMethods(callRecipients,
toCall,
sync, // is synchronised?
- true, // ignore self?
timeout,
useOutOfBandMessage
);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -310,7 +310,7 @@
GravitateDataCommand command = commandsFactory.buildGravitateDataCommand(fqn, searchSubtrees);
// doing a GET_ALL is crappy but necessary since JGroups' GET_FIRST could return null results from nodes that do
// not have either the primary OR backup, and stop polling other valid nodes.
- List resps = rpcManager.callRemoteMethods(mbrs, command, GroupRequest.GET_ALL, true, buddyManager.getBuddyCommunicationTimeout(), new ResponseValidityFilter(mbrs, rpcManager.getLocalAddress()), false);
+ List resps = rpcManager.callRemoteMethods(null, command, GroupRequest.GET_ALL, buddyManager.getBuddyCommunicationTimeout(), new ResponseValidityFilter(mbrs, rpcManager.getLocalAddress()), false);
if (trace) log.trace("got responses " + resps);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -81,12 +81,11 @@
{
Option optionOverride = ctx.getOptionOverrides();
if (optionOverride != null && optionOverride.isCacheModeLocal() && (ctx.getTransaction() == null))
- //|| MethodDeclarations.isTransactionLifecycleMethod(ctx.getMethodCall().getMethodId())))
{
// skip replication!!
return true;
}
- if (trace) log.trace("(" + rpcManager.getLocalAddress() + ") method call " + ctx.getMethodCall());
+ if (trace) log.trace("(" + rpcManager.getLocalAddress() + ") Command " + ctx.getCommand());
return false;
}
@@ -134,7 +133,7 @@
Transaction tx = ctx.getTransaction();
if (tx != null && !optimistic)
{
- log.debug("Entering InvalidationInterceptor's prepare phase");
+ if (trace) log.trace("Entering InvalidationInterceptor's prepare phase");
// fetch the modifications before the transaction is committed (and thus removed from the txTable)
GlobalTransaction gtx = ctx.getGlobalTransaction();
TransactionEntry entry = txTable.get(gtx);
@@ -146,7 +145,7 @@
}
else
{
- log.debug("Nothing to invalidate - no modifications in the transaction.");
+ if (trace) log.trace("Nothing to invalidate - no modifications in the transaction.");
}
}
return retval;
@@ -182,7 +181,7 @@
GlobalTransaction gtx = ctx.getGlobalTransaction();
List<ReversibleCommand> modifications = txMods.remove(gtx);
broadcastInvalidate(modifications, gtx, tx, ctx);
- log.debug("Committing. Broadcasting invalidations.");
+ if (trace) log.trace("Committing. Broadcasting invalidations.");
}
return retval;
}
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -493,7 +493,7 @@
protected void assertValid()
{
- if (!node.isValid())
+ if (!getFqn().isRoot() && !node.isValid())
throw new NodeNotValidException("Node " + getFqn() + " is not valid. Perhaps it has been moved or removed.");
}
Modified: core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/main/java/org/jboss/cache/loader/ClusteredCacheLoader.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -112,11 +112,10 @@
private Object callRemote(DataCommand dataCommand) throws Exception
{
if (trace) log.trace("cache=" + cache.getLocalAddress() + "; calling with " + dataCommand);
- List<Address> mbrs = cache.getMembers();
ClusteredGetCommand clusteredGet = commandsFactory.buildClusteredGetCommand(false, dataCommand);
- List resps = null;
+ List resps;
// JBCACHE-1186
- resps = cache.getRPCManager().callRemoteMethods(mbrs, clusteredGet, GroupRequest.GET_ALL, true, config.getTimeout(), new ResponseValidityFilter(mbrs, cache.getLocalAddress()), false);
+ resps = cache.getRPCManager().callRemoteMethods(null, clusteredGet, GroupRequest.GET_ALL, config.getTimeout(), new ResponseValidityFilter(cache.getMembers(), cache.getLocalAddress()), false);
if (resps == null)
{
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -11,6 +11,7 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
@@ -93,8 +94,11 @@
cache2.stop();
cache1.destroy();
cache2.destroy();
- cache1.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
- cache2.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
+ if (optimistic)
+ {
+ cache1.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
+ cache2.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
+ }
cache1.getConfiguration().setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
cache2.getConfiguration().setCacheMode(Configuration.CacheMode.INVALIDATION_SYNC);
cache1.start();
@@ -109,8 +113,8 @@
assertEquals(vA, cache1.getRoot().getChild(A).get(k));
assertEquals(vB, cache1.getRoot().getChild(A).getChild(B).get(k));
- assertInvalidated(cache2, A, "Should be invalidated");
- assertInvalidated(cache2, Fqn.fromRelativeElements(A, B.getLastElement()), "Should be invalidated");
+ assertInvalidated(cache2, A, "Should be invalidated", optimistic);
+ assertInvalidated(cache2, Fqn.fromRelativeElements(A, B.getLastElement()), "Should be invalidated", optimistic);
// now move...
cache1.move(nodeB.getFqn(), Fqn.ROOT);
@@ -118,22 +122,30 @@
assertEquals(vA, cache1.getRoot().getChild(A).get(k));
assertEquals(vB, cache1.getRoot().getChild(B).get(k));
- assertInvalidated(cache2, A, "Should be invalidated");
- assertInvalidated(cache2, B, "Should be invalidated");
+ assertInvalidated(cache2, A, "Should be invalidated", optimistic);
+ assertInvalidated(cache2, B, "Should be invalidated", optimistic);
// now make sure a node exists on cache 2
cache2.getRoot().addChild(A).put("k2", "v2");
// te invalidation will happen in afterCompletion, hence no exception!
- cache1.move(B, A);// should throw an NPE
+ try
+ {
+ cache1.move(B, A);// should throw an NPE
+ if (!optimistic) assert false : "Should throw an exception!";
+ }
+ catch (NodeNotExistsException expected)
+ {
+ if (optimistic) assert false : "Should not have thrown an exception!";
+ }
}
- private void assertInvalidated(Cache cache, Fqn fqn, String msg)
+ private void assertInvalidated(Cache cache, Fqn fqn, String msg, boolean optimistic)
{
assert cache.getRoot().getChild(fqn) == null : msg;
NodeSPI n = ((CacheSPI) cache).peek(fqn, true, true);
- assert n != null : msg;
- assert !n.isValid() : msg;
+ assert n == null || optimistic : msg;
+ assert !optimistic || !n.isValid() : msg;
}
public void testReplTxCommit() throws Exception
Modified: core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/test/java/org/jboss/cache/api/pfer/PutForExternalReadTestBase.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -28,6 +28,7 @@
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import java.util.List;
+import java.util.Vector;
@Test(groups = {"functional", "jgroups", "transaction"})
public abstract class PutForExternalReadTestBase
@@ -158,7 +159,7 @@
assertEquals("PFER should have been a no-op", value, cache2.get(fqn, key));
}
- private List<Address> anyAddresses()
+ private Vector<Address> anyAddresses()
{
anyObject();
return null;
@@ -178,7 +179,7 @@
{
// specify what we expect called on the mock Rpc Manager. For params we don't care about, just use ANYTHING.
// setting the mock object to expect the "sync" param to be false.
- expect(rpcManager.callRemoteMethods(anyAddresses(), (ReplicableCommand) anyObject(), eq(false), anyBoolean(), anyInt(), anyBoolean())).andReturn(null);
+ expect(rpcManager.callRemoteMethods(anyAddresses(), (ReplicableCommand) anyObject(), eq(false), anyLong(), anyBoolean())).andReturn(null);
}
replay(rpcManager);
@@ -241,7 +242,7 @@
List<Address> memberList = originalRpcManager.getMembers();
expect(barfingRpcManager.getMembers()).andReturn(memberList).anyTimes();
expect(barfingRpcManager.getLocalAddress()).andReturn(originalRpcManager.getLocalAddress()).anyTimes();
- expect(barfingRpcManager.callRemoteMethods(anyAddresses(), (ReplicableCommand) anyObject(), anyBoolean(), anyBoolean(), anyInt(), anyBoolean())).andThrow(new RuntimeException("Barf!")).anyTimes();
+ expect(barfingRpcManager.callRemoteMethods(anyAddresses(), (ReplicableCommand) anyObject(), anyBoolean(), anyLong(), anyBoolean())).andThrow(new RuntimeException("Barf!")).anyTimes();
replay(barfingRpcManager);
TestingUtil.extractComponentRegistry(cache1).registerComponent(RPCManager.class.getName(), barfingRpcManager, RPCManager.class);
Modified: core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTest.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -16,7 +16,7 @@
import org.testng.annotations.Test;
import java.util.Collections;
-import java.util.List;
+import java.util.Vector;
import java.util.concurrent.CountDownLatch;
@Test(groups = "functional")
@@ -82,7 +82,7 @@
// now try the last PUT which should result in the queue being flushed.
expect(mockRpcManager.getMembers()).andReturn(originalRpcManager.getMembers()).anyTimes();
- expect(mockRpcManager.callRemoteMethods((List<Address>) anyObject(), (ReplicableCommand) anyObject(), anyBoolean(), anyBoolean(), anyInt(), anyBoolean())).andReturn(Collections.emptyList()).anyTimes();
+ expect(mockRpcManager.callRemoteMethods((Vector<Address>) anyObject(), (ReplicableCommand) anyObject(), anyBoolean(), anyLong(), anyBoolean())).andReturn(Collections.emptyList()).anyTimes();
replay(mockRpcManager);
cache.put("/a/b/c/LAST", "k", "v");
@@ -111,7 +111,7 @@
// expect basic cluster related calls
expect(mockRpcManager.getMembers()).andReturn(originalRpcManager.getMembers()).anyTimes();
- expect(mockRpcManager.callRemoteMethods((List<Address>) anyObject(), (ReplicableCommand) anyObject(), anyBoolean(), anyBoolean(), anyInt(), anyBoolean())).andReturn(Collections.emptyList()).anyTimes();
+ expect(mockRpcManager.callRemoteMethods((Vector<Address>) anyObject(), (ReplicableCommand) anyObject(), anyBoolean(), anyLong(), anyBoolean())).andReturn(Collections.emptyList()).anyTimes();
replay(mockRpcManager);
Thread[] threads = new Thread[numThreads];
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -102,7 +102,7 @@
DataCommand command = new GetKeyValueCommand(fqn, key, false);
ClusteredGetCommand clusteredGet = new ClusteredGetCommand(false, command);
- List responses = cache1.getRPCManager().callRemoteMethods(null, clusteredGet, true, true, 15000, false);
+ List responses = cache1.getRPCManager().callRemoteMethods(null, clusteredGet, true, 15000, false);
List response1 = (List) responses.get(0);// response from the first (and only) node
Boolean found = (Boolean) response1.get(0);
@@ -130,7 +130,7 @@
GravitateDataCommand gravitateDataCommand = new GravitateDataCommand(fqn, false);
- List responses = cache1.getRPCManager().callRemoteMethods(null, gravitateDataCommand, true, true, 15000, false);
+ List responses = cache1.getRPCManager().callRemoteMethods(null, gravitateDataCommand, true, 15000, false);
GravitateResult data = (GravitateResult) responses.get(0);// response from the first (and only) node
assertTrue("Should have found remote data", data.isDataFound());
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java 2008-04-30 15:51:35 UTC (rev 5774)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/PrepareCommitContentionTest.java 2008-04-30 16:10:12 UTC (rev 5775)
@@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Vector;
/**
* This is to test the scenario described in http://jira.jboss.org/jira/browse/JBCACHE-1270
@@ -101,22 +102,22 @@
}
}
- public List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand cacheCommand, int mode, boolean excludeSelf, long timeout, RspFilter responseFilter, boolean useOutOfBandMessage) throws Exception
+ public List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand cacheCommand, int mode, long timeout, RspFilter responseFilter, boolean useOutOfBandMessage) throws Exception
{
logCall(cacheCommand, useOutOfBandMessage);
- return delegate.callRemoteMethods(recipients, cacheCommand, mode, excludeSelf, timeout, responseFilter, useOutOfBandMessage);
+ return delegate.callRemoteMethods(recipients, cacheCommand, mode, timeout, responseFilter, useOutOfBandMessage);
}
- public List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand cacheCommand, int mode, boolean excludeSelf, long timeout, boolean useOutOfBandMessage) throws Exception
+ public List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand cacheCommand, int mode, long timeout, boolean useOutOfBandMessage) throws Exception
{
logCall(cacheCommand, useOutOfBandMessage);
- return delegate.callRemoteMethods(recipients, cacheCommand, mode, excludeSelf, timeout, useOutOfBandMessage);
+ return delegate.callRemoteMethods(recipients, cacheCommand, mode, timeout, useOutOfBandMessage);
}
- public List<Object> callRemoteMethods(List<Address> recipients, ReplicableCommand command, boolean synchronous, boolean excludeSelf, int timeout, boolean useOutOfBandMessage) throws Exception
+ public List<Object> callRemoteMethods(Vector<Address> recipients, ReplicableCommand command, boolean synchronous, long timeout, boolean useOutOfBandMessage) throws Exception
{
logCall(command, useOutOfBandMessage);
- return delegate.callRemoteMethods(recipients, command, synchronous, excludeSelf, timeout, useOutOfBandMessage);
+ return delegate.callRemoteMethods(recipients, command, synchronous, timeout, useOutOfBandMessage);
}
public boolean isCoordinator()
16 years, 7 months
JBoss Cache SVN: r5774 - in core/trunk/src: main/java/org/jboss/cache/commands/read and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-04-30 11:51:35 -0400 (Wed, 30 Apr 2008)
New Revision: 5774
Removed:
core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java
core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/AbstractVersionAwareMarshallerTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java
Log:
refactored the way commands are being build (efficiency)
Modified: core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/AbstractVisitor.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -1,26 +1,12 @@
package org.jboss.cache.commands;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.read.ExistsCommand;
-import org.jboss.cache.commands.read.GetChildrenNamesCommand;
-import org.jboss.cache.commands.read.GetDataMapCommand;
-import org.jboss.cache.commands.read.GetKeyValueCommand;
-import org.jboss.cache.commands.read.GetKeysCommand;
-import org.jboss.cache.commands.read.GetNodeCommand;
-import org.jboss.cache.commands.read.GravitateDataCommand;
+import org.jboss.cache.commands.read.*;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictCommand;
-import org.jboss.cache.commands.write.InvalidateCommand;
-import org.jboss.cache.commands.write.MoveCommand;
-import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.RemoveDataCommand;
-import org.jboss.cache.commands.write.RemoveKeyCommand;
-import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.commands.write.*;
import java.util.Collection;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/Visitor.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -1,26 +1,12 @@
package org.jboss.cache.commands;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.read.ExistsCommand;
-import org.jboss.cache.commands.read.GetChildrenNamesCommand;
-import org.jboss.cache.commands.read.GetDataMapCommand;
-import org.jboss.cache.commands.read.GetKeyValueCommand;
-import org.jboss.cache.commands.read.GetKeysCommand;
-import org.jboss.cache.commands.read.GetNodeCommand;
-import org.jboss.cache.commands.read.GravitateDataCommand;
+import org.jboss.cache.commands.read.*;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictCommand;
-import org.jboss.cache.commands.write.InvalidateCommand;
-import org.jboss.cache.commands.write.MoveCommand;
-import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.RemoveDataCommand;
-import org.jboss.cache.commands.write.RemoveKeyCommand;
-import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.commands.write.*;
/**
* This interface is the core of JBoss Cache, where each {@link VisitableCommand} can be visited by a Visitor implementation.
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/AbstractDataCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -3,8 +3,6 @@
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.DataCommand;
-import org.jboss.cache.factories.annotations.CacheInjectionMethods;
-import org.jboss.cache.factories.annotations.Inject;
/**
* An abstract class providing basic functionality of all {@link DataCommand}s.
@@ -12,13 +10,11 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.2.0
*/
-@CacheInjectionMethods
public abstract class AbstractDataCommand implements DataCommand
{
protected Fqn fqn;
protected DataContainer dataContainer;
- @Inject
public void initialize(DataContainer dataContainer)
{
this.dataContainer = dataContainer;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -24,13 +24,13 @@
{
public static final int METHOD_ID = 16;
- public ExistsCommand()
+ public ExistsCommand(Fqn fqn)
{
+ this.fqn = fqn;
}
- public ExistsCommand(Fqn fqn)
+ public ExistsCommand()
{
- this.fqn = fqn;
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -5,11 +5,7 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
/**
* This command retrieves the names of children for a specific Fqn, as defined by {@link org.jboss.cache.Node#getChildrenNames()}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -20,13 +20,13 @@
{
public static final int METHOD_ID = 24;
- public GetDataMapCommand()
+ public GetDataMapCommand(Fqn fqn)
{
+ this.fqn = fqn;
}
- public GetDataMapCommand(Fqn fqn)
+ public GetDataMapCommand()
{
- this.fqn = fqn;
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -5,8 +5,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.notifications.Notifier;
/**
@@ -28,10 +28,6 @@
private Object key;
boolean sendNodeEvent;
- public GetKeyValueCommand()
- {
- }
-
public GetKeyValueCommand(Fqn<?> fqn, Object key, boolean sendNodeEvent)
{
this.fqn = fqn;
@@ -39,9 +35,13 @@
this.sendNodeEvent = sendNodeEvent;
}
- @Inject
- public void injectDependencies(Notifier notifier)
+ public GetKeyValueCommand()
{
+ }
+
+ public void initialize(DataContainer dataContainer, Notifier notifier)
+ {
+ this.dataContainer = dataContainer;
this.notifier = notifier;
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -21,13 +21,13 @@
{
public static final int METHOD_ID = 25;
- public GetKeysCommand()
+ public GetKeysCommand(Fqn fqn)
{
+ this.fqn = fqn;
}
- public GetKeysCommand(Fqn fqn)
+ public GetKeysCommand()
{
- this.fqn = fqn;
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -17,13 +17,13 @@
{
public static final int METHOD_ID = 31;
- public GetNodeCommand()
+ public GetNodeCommand(Fqn fqn)
{
+ this.fqn = fqn;
}
- public GetNodeCommand(Fqn fqn)
+ public GetNodeCommand()
{
- this.fqn = fqn;
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -2,17 +2,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.RPCManager;
+import org.jboss.cache.*;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.marshall.NodeData;
import java.util.LinkedList;
@@ -43,19 +37,19 @@
private static final Log log = LogFactory.getLog(GravitateDataCommand.class);
private static boolean trace = log.isTraceEnabled();
- public GravitateDataCommand()
- {
- }
-
public GravitateDataCommand(Fqn fqn, boolean searchSubtrees)
{
this.fqn = fqn;
this.searchSubtrees = searchSubtrees;
}
- @Inject
- public void initialize(RPCManager manager, CacheSPI spi)
+ public GravitateDataCommand()
{
+ }
+
+ public void initialize(DataContainer dataContainer, RPCManager manager, CacheSPI spi)
+ {
+ this.dataContainer = dataContainer;
this.rpcManager = manager;
this.spi = spi;
}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/AbstractReplicableCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -1,16 +0,0 @@
-package org.jboss.cache.commands.remote;
-
-import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.factories.annotations.CacheInjectionMethods;
-
-/**
- * An empty abstract class to provide the {@link org.jboss.cache.factories.annotations.CacheInjectionMethods} annotation
- * for all subclasses.
- *
- * @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
- * @since 2.2.0
- */
-@CacheInjectionMethods
-public abstract class AbstractReplicableCommand implements ReplicableCommand
-{
-}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -4,7 +4,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.commands.ReplicableCommand;
import org.jgroups.Address;
/**
@@ -15,7 +15,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2.0
*/
-public class AnnounceBuddyPoolNameCommand extends AbstractReplicableCommand
+public class AnnounceBuddyPoolNameCommand implements ReplicableCommand
{
public static final int METHOD_ID = 28;
private static final Log log = LogFactory.getLog(AnnounceBuddyPoolNameCommand.class);
@@ -37,7 +37,6 @@
this.buddyPoolName = buddyPoolName;
}
- @Inject
public void initialize(BuddyManager buddyManager)
{
this.buddyManager = buddyManager;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -4,7 +4,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.commands.ReplicableCommand;
import java.util.Arrays;
import java.util.Map;
@@ -17,27 +17,27 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2.0
*/
-public class AssignToBuddyGroupCommand extends AbstractReplicableCommand
+public class AssignToBuddyGroupCommand implements ReplicableCommand
{
public static final int METHOD_ID = 29;
+ /* dependencies */
private BuddyManager buddyManager;
-
+ /* parameters */
private BuddyGroup group;
private Map<Fqn, byte[]> state;
- public AssignToBuddyGroupCommand()
- {
- }
-
public AssignToBuddyGroupCommand(BuddyGroup group, Map<Fqn, byte[]> state)
{
this.group = group;
this.state = state;
}
- @Inject
+ public AssignToBuddyGroupCommand()
+ {
+ }
+
public void initialize(BuddyManager manager)
{
this.buddyManager = manager;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -5,10 +5,10 @@
import org.jboss.cache.DataContainer;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.DataCommand;
+import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.read.ExistsCommand;
import org.jboss.cache.commands.read.GetChildrenNamesCommand;
import org.jboss.cache.commands.read.GetDataMapCommand;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.InterceptorChain;
import java.util.ArrayList;
@@ -24,7 +24,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2.0
*/
-public class ClusteredGetCommand extends AbstractReplicableCommand
+public class ClusteredGetCommand implements ReplicableCommand
{
public static final int METHOD_ID = 22;
@@ -36,17 +36,16 @@
private static final Log log = LogFactory.getLog(ClusteredGetCommand.class);
private static boolean trace = log.isTraceEnabled();
- public ClusteredGetCommand()
- {
- }
-
public ClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand)
{
this.searchBackupSubtrees = searchBackupSubtrees;
this.dataCommand = dataCommand;
}
- @Inject
+ public ClusteredGetCommand()
+ {
+ }
+
public void initialize(DataContainer dataContainer, InterceptorChain interceptorChain)
{
this.dataContainer = dataContainer;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -8,10 +8,10 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.factories.CommandsFactory;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
@@ -27,9 +27,11 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class DataGravitationCleanupCommand extends AbstractReplicableCommand
+public class DataGravitationCleanupCommand implements ReplicableCommand
{
public static final int METHOD_ID = 34;
+ private static final Log log = LogFactory.getLog(DataGravitationCleanupCommand.class);
+ private static boolean trace = log.isTraceEnabled();
/* dependencies */
private BuddyManager buddyManager;
@@ -38,26 +40,22 @@
private CommandsFactory commandsFactory;
private DataContainer dataContainer;
- private static final Log log = LogFactory.getLog(DataGravitationCleanupCommand.class);
- private static boolean trace = log.isTraceEnabled();
-
/* parameters */
private GlobalTransaction globalTransaction;
private Fqn fqn;
private Fqn backup;
- public DataGravitationCleanupCommand()
- {
- }
-
public DataGravitationCleanupCommand(Fqn primary, Fqn backup)
{
this.fqn = primary;
this.backup = backup;
}
- @Inject
+ public DataGravitationCleanupCommand()
+ {
+ }
+
public void initialize(BuddyManager buddyManager, InterceptorChain invoker, TransactionTable transactionTable,
CommandsFactory commandsFactory, DataContainer dataContainer)
{
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -2,7 +2,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.commands.ReplicableCommand;
/**
* Removes a buddy from a group. This is not a {@link org.jboss.cache.commands.VisitableCommand} and hence
@@ -12,7 +12,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class RemoveFromBuddyGroupCommand extends AbstractReplicableCommand
+public class RemoveFromBuddyGroupCommand implements ReplicableCommand
{
public static final int METHOD_ID = 30;
@@ -20,16 +20,15 @@
private String groupName;
- public RemoveFromBuddyGroupCommand()
+ public RemoveFromBuddyGroupCommand(String groupName)
{
+ this.groupName = groupName;
}
- public RemoveFromBuddyGroupCommand(String groupName)
+ public RemoveFromBuddyGroupCommand()
{
- this.groupName = groupName;
}
- @Inject
public void initialize(BuddyManager buddyManager)
{
this.buddyManager = buddyManager;
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-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -7,7 +7,6 @@
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.InterceptorChain;
import java.util.List;
@@ -23,7 +22,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class ReplicateCommand extends AbstractReplicableCommand
+public class ReplicateCommand implements ReplicableCommand
{
public static final int SINGLE_METHOD_ID = 13;
public static final int MULTIPLE_METHOD_ID = 14;
@@ -40,10 +39,6 @@
private ReplicableCommand singleModification;
private List<ReplicableCommand> modifications;
- public ReplicateCommand()
- {
- }
-
public ReplicateCommand(List<ReplicableCommand> modifications)
{
if (modifications != null && modifications.size() == 1)
@@ -58,11 +53,13 @@
public ReplicateCommand(ReplicableCommand command)
{
- this();
this.singleModification = command;
}
- @Inject
+ public ReplicateCommand()
+ {
+ }
+
public void initialize(InterceptorChain interceptorChain)
{
this.invoker = interceptorChain;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -2,7 +2,6 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.VisitableCommand;
-import org.jboss.cache.factories.annotations.CacheInjectionMethods;
import org.jboss.cache.transaction.GlobalTransaction;
/**
@@ -11,7 +10,6 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.2.0
*/
-@CacheInjectionMethods
public abstract class AbstractTransactionCommand implements VisitableCommand
{
protected GlobalTransaction globalTransaction;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -14,13 +14,13 @@
{
public static final int METHOD_ID = 11;
- public CommitCommand()
+ public CommitCommand(GlobalTransaction globalTransaction)
{
+ this.globalTransaction = globalTransaction;
}
- public CommitCommand(GlobalTransaction globalTransaction)
+ public CommitCommand()
{
- this.globalTransaction = globalTransaction;
}
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -20,16 +20,16 @@
public static final int METHOD_ID = 18;
private Map data;
- public OptimisticPrepareCommand()
- {
- }
-
public OptimisticPrepareCommand(GlobalTransaction gtx, List<ReversibleCommand> modifications, Map data, Address address, boolean onePhaseCommit)
{
super(gtx, modifications, address, onePhaseCommit);
this.data = data;
}
+ public OptimisticPrepareCommand()
+ {
+ }
+
@Override
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
{
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -22,10 +22,6 @@
protected Address localAddress;
protected boolean onePhaseCommit;
- public PrepareCommand()
- {
- }
-
public PrepareCommand(GlobalTransaction gtx, List<ReversibleCommand> modifications, Address localAddress, boolean onePhaseCommit)
{
this.globalTransaction = gtx;
@@ -34,6 +30,10 @@
this.onePhaseCommit = onePhaseCommit;
}
+ public PrepareCommand()
+ {
+ }
+
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
{
return visitor.visitPrepareCommand(ctx, this);
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -14,13 +14,13 @@
{
public static final int METHOD_ID = 12;
- public RollbackCommand()
+ public RollbackCommand(GlobalTransaction globalTransaction)
{
+ this.globalTransaction = globalTransaction;
}
- public RollbackCommand(GlobalTransaction globalTransaction)
+ public RollbackCommand()
{
- this.globalTransaction = globalTransaction;
}
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -1,10 +1,9 @@
package org.jboss.cache.commands.write;
import org.jboss.cache.Fqn;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.commands.VersionedDataCommand;
import org.jboss.cache.commands.read.AbstractDataCommand;
-import org.jboss.cache.factories.annotations.CacheInjectionMethods;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -15,17 +14,17 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.2.0
*/
-@CacheInjectionMethods
public abstract class AbstractVersionedDataCommand extends AbstractDataCommand implements VersionedDataCommand
{
- protected DataVersion dataVersion;
protected Notifier notifier;
+
+ protected DataVersion dataVersion;
protected GlobalTransaction globalTransaction;
- @Inject
- public void injectNotifier(Notifier notifier)
+ public void initialize(Notifier notifier, DataContainer dataContainer)
{
this.notifier = notifier;
+ this.dataContainer = dataContainer;
}
public DataVersion getDataVersion()
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -22,16 +22,16 @@
public static final int METHOD_ID = 48;
private final List<Fqn> newlyCreated = new LinkedList<Fqn>();
- public CreateNodeCommand()
- {
- }
-
public CreateNodeCommand(Fqn fqn)
{
this.fqn = fqn;
newlyCreated.add(fqn);
}
+ public CreateNodeCommand()
+ {
+ }
+
public int getCommandId()
{
return METHOD_ID;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/EvictCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -25,6 +25,10 @@
this.fqn = fqn;
}
+ public EvictCommand()
+ {
+ }
+
/**
* Evicts a node.
* <p/>
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -2,16 +2,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
+import org.jboss.cache.*;
import org.jboss.cache.commands.Visitor;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.optimistic.DataVersion;
import javax.transaction.Transaction;
@@ -43,22 +37,20 @@
private TransactionManager transactionManager;
private CacheSPI spi;
- public InvalidateCommand()
+ public InvalidateCommand(Fqn fqn)
{
- super(null);
+ super(fqn);
}
- public InvalidateCommand(Fqn fqn)
+ public InvalidateCommand()
{
- super(fqn);
}
- @Inject
- public void initialize(TransactionManager txManager, Configuration configuration, CacheSPI spi)
+ public void initialize(TransactionManager txManager, CacheSPI cacheSpi, boolean optimistic)
{
this.transactionManager = txManager;
- this.spi = spi;
- this.isOptimisticLocking = configuration.isNodeLockingOptimistic();
+ this.spi = cacheSpi;
+ this.isOptimisticLocking = optimistic;
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -2,14 +2,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.NodeNotExistsException;
-import org.jboss.cache.NodeSPI;
+import org.jboss.cache.*;
import org.jboss.cache.commands.ReversibleCommand;
import org.jboss.cache.commands.Visitor;
import org.jboss.cache.commands.read.AbstractDataCommand;
-import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -25,20 +21,22 @@
public static final int METHOD_ID = 36;
private static final Log log = LogFactory.getLog(MoveCommand.class);
private static boolean trace = log.isTraceEnabled();
-
+
+ /* dependencies */
+ private Notifier notifier;
+
/* params */
private Fqn to;
- private Notifier notifier;
private GlobalTransaction globalTransaction;
- @Inject
- public void injectNotifier(Notifier notifier)
+ public MoveCommand()
{
- this.notifier = notifier;
}
- public MoveCommand()
+ public void initialize(Notifier notifier, DataContainer dataContainer)
{
+ this.notifier = notifier;
+ this.dataContainer = dataContainer;
}
public MoveCommand(Fqn from, Fqn to)
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -35,13 +35,8 @@
private boolean eraseContents;
private Map oldData;
- public PutDataMapCommand()
- {
- }
-
public PutDataMapCommand(GlobalTransaction globalTransaction, Fqn fqn, Map data, boolean createUndoOps, boolean eraseContents)
{
- this();
this.globalTransaction = globalTransaction;
this.fqn = fqn;
this.data = data;
@@ -49,6 +44,10 @@
this.eraseContents = eraseContents;
}
+ public PutDataMapCommand()
+ {
+ }
+
/**
* Adds the provided data map to the data map in the node referenced by the specified Fqn, optionally erasing the node's
* data first (if {@link #isEraseContents()} is <tt>true</tt>).
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -38,10 +38,6 @@
private boolean putForExternalRead;
private Object oldValue;
- public PutKeyValueCommand()
- {
- }
-
public PutKeyValueCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value, boolean createUndoOps, boolean putForExternalRead)
{
this.globalTransaction = gtx;
@@ -52,6 +48,10 @@
this.putForExternalRead = putForExternalRead;
}
+ public PutKeyValueCommand()
+ {
+ }
+
/**
* Puts the specified key and value into the data map in the node referenced by the specified Fqn.
*
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveDataCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -33,10 +33,6 @@
private boolean eviction;
private HashMap originalData;
- public RemoveDataCommand()
- {
- }
-
public RemoveDataCommand(GlobalTransaction gtx, Fqn fqn, boolean createUndoops, boolean sendNodeEvent, boolean eviction)
{
this.globalTransaction = gtx;
@@ -46,6 +42,10 @@
this.eviction = eviction;
}
+ public RemoveDataCommand()
+ {
+ }
+
/**
* Clears the data map in the node referenced by the specified Fqn.
*
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -32,19 +32,18 @@
private boolean createUndoOps;
private Object oldValue;
- public RemoveKeyCommand()
- {
- }
-
public RemoveKeyCommand(GlobalTransaction gtx, Fqn fqn, Object key, boolean createUndoOps)
{
- this();
this.globalTransaction = gtx;
this.fqn = fqn;
this.key = key;
this.createUndoOps = createUndoOps;
}
+ public RemoveKeyCommand()
+ {
+ }
+
/**
* Removes the specified key from the data map in the node referenced by the specified Fqn.
*
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -33,13 +33,8 @@
private NodeSPI targetNode;
private Map originalData;
- public RemoveNodeCommand()
- {
- }
-
public RemoveNodeCommand(GlobalTransaction globalTransaction, Fqn fqn, boolean createUndoOps, boolean skipSendingNodeEvents, boolean eviction)
{
- this();
this.globalTransaction = globalTransaction;
this.fqn = fqn;
this.createUndoOps = createUndoOps;
@@ -47,6 +42,10 @@
this.eviction = eviction;
}
+ public RemoveNodeCommand()
+ {
+ }
+
/**
* Removes the node referenced by the specified Fqn.
*
Modified: core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -1,42 +1,27 @@
package org.jboss.cache.factories;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.RPCManager;
+import org.jboss.cache.*;
import org.jboss.cache.buddyreplication.BuddyGroup;
+import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.ReversibleCommand;
-import org.jboss.cache.commands.read.ExistsCommand;
-import org.jboss.cache.commands.read.GetChildrenNamesCommand;
-import org.jboss.cache.commands.read.GetDataMapCommand;
-import org.jboss.cache.commands.read.GetKeyValueCommand;
-import org.jboss.cache.commands.read.GetKeysCommand;
-import org.jboss.cache.commands.read.GetNodeCommand;
-import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
-import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
-import org.jboss.cache.commands.remote.ClusteredGetCommand;
-import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
-import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
-import org.jboss.cache.commands.remote.ReplicateCommand;
+import org.jboss.cache.commands.read.*;
+import org.jboss.cache.commands.remote.*;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.CreateNodeCommand;
-import org.jboss.cache.commands.write.EvictCommand;
-import org.jboss.cache.commands.write.InvalidateCommand;
-import org.jboss.cache.commands.write.MoveCommand;
-import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.RemoveDataCommand;
-import org.jboss.cache.commands.write.RemoveKeyCommand;
-import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.commands.write.*;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.interceptors.InterceptorChain;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.cache.transaction.TransactionTable;
import org.jgroups.Address;
+import javax.transaction.TransactionManager;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -56,50 +41,60 @@
public class CommandsFactory
{
private RPCManager rpcManager;
- private ComponentRegistry registry;
+ private DataContainer dataContainer;
+ private Notifier notifier;
+ private InterceptorChain invoker;
+ private BuddyManager buddyManager;
+ private TransactionTable transactionTable;
+ private CacheSPI cacheSpi;
+ private Configuration configuration;
+ private TransactionManager txManager;
public CommandsFactory()
{
}
- public CommandsFactory(RPCManager rpcManager, ComponentRegistry registry)
- {
- this.rpcManager = rpcManager;
- this.registry = registry;
- }
-
@Inject
- public void initialize(RPCManager rpc, ComponentRegistry registry)
+ public void initialize(RPCManager rpc, DataContainer dataContainer, Notifier notifier, BuddyManager buddyManager,
+ InterceptorChain invoker, TransactionTable transactionTable, CacheSPI cacheSpi,
+ Configuration configuration, TransactionManager txManager)
{
this.rpcManager = rpc;
- this.registry = registry;
+ this.dataContainer = dataContainer;
+ this.notifier = notifier;
+ this.buddyManager = buddyManager;
+ this.invoker = invoker;
+ this.transactionTable = transactionTable;
+ this.cacheSpi = cacheSpi;
+ this.configuration = configuration;
+ this.txManager = txManager;
}
public PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map data, boolean createUndoOps, boolean eraseContents)
{
PutDataMapCommand cmd = new PutDataMapCommand(gtx, fqn, data, createUndoOps, eraseContents);
- registry.wireDependencies(cmd);
+ cmd.initialize(notifier, dataContainer);
return cmd;
}
public PutKeyValueCommand buildPutKeyValueCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value, boolean createUndoOps, boolean putForExternalRead)
{
PutKeyValueCommand command = new PutKeyValueCommand(gtx, fqn, key, value, createUndoOps, putForExternalRead);
- registry.wireDependencies(command);
+ command.initialize(notifier, dataContainer);
return command;
}
public ReplicateCommand buildReplicateCommand(ReplicableCommand command)
{
ReplicateCommand cmd = new ReplicateCommand(command);
- registry.wireDependencies(cmd);
+ cmd.initialize(invoker);
return cmd;
}
public ReplicateCommand buildReplicateCommand(List<ReplicableCommand> modifications)
{
ReplicateCommand cmd = new ReplicateCommand(modifications);
- registry.wireDependencies(cmd);
+ cmd.initialize(invoker);
return cmd;
}
@@ -110,135 +105,128 @@
public PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<ReversibleCommand> modifications, Address address, boolean onePhaseCommit)
{
- PrepareCommand cmd = new PrepareCommand(gtx, modifications, address, onePhaseCommit);
- registry.wireDependencies(cmd);
- return cmd;
+ return new PrepareCommand(gtx, modifications, address, onePhaseCommit);
}
public CommitCommand buildCommitCommand(GlobalTransaction gtx)
{
- CommitCommand cmd = new CommitCommand(gtx);
- registry.wireDependencies(cmd);
- return cmd;
+ return new CommitCommand(gtx);
}
public DataGravitationCleanupCommand buildDataGravitationCleanupCommand(Fqn primaryFqn, Fqn backupFqn)
{
DataGravitationCleanupCommand command = new DataGravitationCleanupCommand(primaryFqn, backupFqn);
- registry.wireDependencies(command);
+ command.initialize(buddyManager, invoker, transactionTable, this, dataContainer);
return command;
}
public GravitateDataCommand buildGravitateDataCommand(Fqn fqn, Boolean searchSubtrees)
{
GravitateDataCommand command = new GravitateDataCommand(fqn, searchSubtrees);
- registry.wireDependencies(command);
+ command.initialize(dataContainer, rpcManager, cacheSpi);
return command;
}
public RemoveNodeCommand buildRemoveNodeCommand(GlobalTransaction gtx, Fqn fqn, boolean eviction, boolean skipSendingNodeEvents, boolean createUndoOps)
{
RemoveNodeCommand command = new RemoveNodeCommand(gtx, fqn, createUndoOps, skipSendingNodeEvents, eviction);
- registry.wireDependencies(command);
+ command.initialize(notifier, dataContainer);
return command;
}
public RemoveDataCommand buildRemoveDataCommand(GlobalTransaction gtx, Fqn fqn, boolean createUndoops, boolean sendNodeEvent, boolean eviction)
{
RemoveDataCommand command = new RemoveDataCommand(gtx, fqn, createUndoops, sendNodeEvent, eviction);
- registry.wireDependencies(command);
+ command.initialize(notifier, dataContainer);
return command;
}
public EvictCommand buildEvictFqnCommand(Fqn fqn)
{
EvictCommand command = new EvictCommand(fqn);
- registry.wireDependencies(command);
+ command.initialize(notifier, dataContainer);
return command;
}
public InvalidateCommand buildInvalidateCommand(Fqn fqn)
{
InvalidateCommand command = new InvalidateCommand(fqn);
- registry.wireDependencies(command);
+ command.initialize(notifier, dataContainer);
+ command.initialize(txManager, cacheSpi, configuration.isNodeLockingOptimistic());
return command;
}
public RemoveKeyCommand buildRemoveKeyCommand(GlobalTransaction tx, Fqn<?> fqn, Object key, boolean b)
{
RemoveKeyCommand command = new RemoveKeyCommand(tx, fqn, key, b);
- registry.wireDependencies(command);
+ command.initialize(notifier, dataContainer);
return command;
}
public GetDataMapCommand buildGetDataMapCommand(Fqn fqn)
{
GetDataMapCommand command = new GetDataMapCommand(fqn);
- registry.wireDependencies(command);
+ command.initialize(dataContainer);
return command;
}
public ExistsCommand buildExistsNodeCommand(Fqn fqn)
{
ExistsCommand command = new ExistsCommand(fqn);
- registry.wireDependencies(command);
+ command.initialize(dataContainer);
return command;
}
public GetKeyValueCommand buildGetKeyValueCommand(Fqn<?> fqn, Object key, boolean sendNodeEvent)
{
GetKeyValueCommand command = new GetKeyValueCommand(fqn, key, sendNodeEvent);
- registry.wireDependencies(command);
+ command.initialize(dataContainer, notifier);
return command;
}
public GetNodeCommand buildGetNodeCommand(Fqn fqn)
{
GetNodeCommand command = new GetNodeCommand(fqn);
- registry.wireDependencies(command);
+ command.initialize(dataContainer);
return command;
}
public GetKeysCommand buildGetKeysCommand(Fqn fqn)
{
GetKeysCommand command = new GetKeysCommand(fqn);
- registry.wireDependencies(command);
+ command.initialize(dataContainer);
return command;
}
public GetChildrenNamesCommand buildGetChildrenNamesCommand(Fqn fqn)
{
GetChildrenNamesCommand command = new GetChildrenNamesCommand(fqn);
- registry.wireDependencies(command);
+ command.initialize(dataContainer);
return command;
}
public MoveCommand buildMoveCommand(Fqn from, Fqn to)
{
MoveCommand command = new MoveCommand(from, to);
- registry.wireDependencies(command);
+ command.initialize(notifier, dataContainer);
return command;
}
public GravitateDataCommand buildGravitateDataCacheCommand(Fqn fqn, boolean searchSubtrees)
{
GravitateDataCommand command = new GravitateDataCommand(fqn, searchSubtrees);
- registry.wireDependencies(command);
+ command.initialize(dataContainer, rpcManager, cacheSpi);
return command;
}
public RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
{
- RollbackCommand cmd = new RollbackCommand(gtx);
- registry.wireDependencies(cmd);
- return cmd;
+ return new RollbackCommand(gtx);
}
public OptimisticPrepareCommand buildOptimisticPrepareCommand(GlobalTransaction gtx, List<ReversibleCommand> modifications, Map data, Address address, boolean onePhaseCommit)
{
- OptimisticPrepareCommand cmd = new OptimisticPrepareCommand(gtx, modifications, data, address, onePhaseCommit);
- registry.wireDependencies(cmd);
- return cmd;
+ return new OptimisticPrepareCommand(gtx, modifications, data, address, onePhaseCommit);
}
@@ -251,36 +239,36 @@
public AnnounceBuddyPoolNameCommand buildAnnounceBuddyPoolNameCommand(Address address, String buddyPoolName)
{
AnnounceBuddyPoolNameCommand command = new AnnounceBuddyPoolNameCommand(address, buddyPoolName);
- registry.wireDependencies(command);
+ command.initialize(buddyManager);
return command;
}
public RemoveFromBuddyGroupCommand buildRemoveFromBuddyGroupCommand(String groupName)
{
RemoveFromBuddyGroupCommand command = new RemoveFromBuddyGroupCommand(groupName);
- registry.wireDependencies(command);
+ command.initialize(buddyManager);
return command;
}
public AssignToBuddyGroupCommand buildAssignToBuddyGroupCommand(BuddyGroup group, Map<Fqn, byte[]> state)
{
AssignToBuddyGroupCommand command = new AssignToBuddyGroupCommand(group, state);
- registry.wireDependencies(command);
+ command.initialize(buddyManager);
return command;
}
public ClusteredGetCommand buildClusteredGetCommand(Boolean searchBackupSubtrees, DataCommand dataCommand)
{
ClusteredGetCommand command = new ClusteredGetCommand(searchBackupSubtrees, dataCommand);
- registry.wireDependencies(command);
+ command.initialize(dataContainer, invoker);
return command;
}
public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
{
- CreateNodeCommand cmd = new CreateNodeCommand(fqn);
- registry.wireDependencies(cmd);
- return cmd;
+ CreateNodeCommand command = new CreateNodeCommand(fqn);
+ command.initialize(dataContainer);
+ return command;
}
/**
@@ -292,126 +280,203 @@
*/
public ReplicableCommand fromStream(int id, Object[] parameters)
{
- ReplicableCommand returnValue;
switch (id)
{
case ExistsCommand.METHOD_ID:
- returnValue = new ExistsCommand();
- break;
-
+ {
+ ExistsCommand result = new ExistsCommand();
+ result.initialize(dataContainer);
+ result.setParameters(id, parameters);
+ return result;
+ }
case GetChildrenNamesCommand.METHOD_ID:
- returnValue = new GetChildrenNamesCommand();
- break;
-
+ {
+ GetChildrenNamesCommand returnValue = new GetChildrenNamesCommand();
+ returnValue.initialize(dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case GetDataMapCommand.METHOD_ID:
- returnValue = new GetDataMapCommand();
- break;
-
+ {
+ GetDataMapCommand returnValue = new GetDataMapCommand();
+ returnValue.initialize(dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case GetKeysCommand.METHOD_ID:
- returnValue = new GetKeysCommand();
- break;
-
+ {
+ GetKeysCommand returnValue = new GetKeysCommand();
+ returnValue.initialize(dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case GetKeyValueCommand.METHOD_ID:
- returnValue = new GetKeyValueCommand();
- break;
-
+ {
+ GetKeyValueCommand returnValue = new GetKeyValueCommand();
+ returnValue.initialize(dataContainer, notifier);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case GetNodeCommand.METHOD_ID:
- returnValue = new GetNodeCommand();
- break;
-
+ {
+ GetNodeCommand returnValue = new GetNodeCommand();
+ returnValue.initialize(dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case MoveCommand.METHOD_ID:
- returnValue = new MoveCommand();
- break;
-
+ {
+ MoveCommand returnValue = new MoveCommand();
+ returnValue.initialize(notifier, dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case PutDataMapCommand.METHOD_ID:
case PutDataMapCommand.ERASE_METHOD_ID:
case PutDataMapCommand.ERASE_VERSIONED_METHOD_ID:
case PutDataMapCommand.VERSIONED_METHOD_ID:
- returnValue = new PutDataMapCommand();
- break;
-
+ {
+ PutDataMapCommand returnValue = new PutDataMapCommand();
+ returnValue.initialize(notifier,dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case PutKeyValueCommand.METHOD_ID:
case PutKeyValueCommand.VERSIONED_METHOD_ID:
case PutKeyValueCommand.PUT_FOR_EXT_READ_METHOD_ID:
case PutKeyValueCommand.PUT_FOR_EXT_READ_VERSIONED_METHOD_ID:
- returnValue = new PutKeyValueCommand();
- break;
-
+ {
+ PutKeyValueCommand returnValue = new PutKeyValueCommand();
+ returnValue.initialize(notifier, dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case RemoveDataCommand.METHOD_ID:
case RemoveDataCommand.VERSIONED_METHOD_ID:
- returnValue = new RemoveDataCommand();
- break;
-
+ {
+ RemoveDataCommand returnValue = new RemoveDataCommand();
+ returnValue.initialize(notifier, dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case RemoveKeyCommand.METHOD_ID:
case RemoveKeyCommand.VERSIONED_METHOD_ID:
- returnValue = new RemoveKeyCommand();
- break;
+ {
+ RemoveKeyCommand returnValue = new RemoveKeyCommand();
+ returnValue.initialize(notifier, dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case RemoveNodeCommand.METHOD_ID:
case RemoveNodeCommand.VERSIONED_METHOD_ID:
- returnValue = new RemoveNodeCommand();
- break;
-
+ {
+ RemoveNodeCommand returnValue = new RemoveNodeCommand();
+ returnValue.initialize(notifier, dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case CreateNodeCommand.METHOD_ID:
- returnValue = new CreateNodeCommand();
- break;
+ {
+ CreateNodeCommand returnValue = new CreateNodeCommand();
+ returnValue.initialize(dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
+ // --- transactional method calls
- // --- transactional method calls
-
case PrepareCommand.METHOD_ID:
- returnValue = new PrepareCommand();
- break;
+ {
+ PrepareCommand returnValue = new PrepareCommand();
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case OptimisticPrepareCommand.METHOD_ID:
- returnValue = new OptimisticPrepareCommand();
- break;
+ {
+ OptimisticPrepareCommand returnValue = new OptimisticPrepareCommand();
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case CommitCommand.METHOD_ID:
- returnValue = new CommitCommand();
- break;
+ {
+ CommitCommand returnValue = new CommitCommand();
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case RollbackCommand.METHOD_ID:
- returnValue = new RollbackCommand();
- break;
+ {
+ RollbackCommand returnValue = new RollbackCommand();
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
// --- replicate methods
case ReplicateCommand.MULTIPLE_METHOD_ID:
case ReplicateCommand.SINGLE_METHOD_ID:
- returnValue = new ReplicateCommand();
- break;
+ {
+ ReplicateCommand returnValue = new ReplicateCommand();
+ returnValue.initialize(invoker);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case InvalidateCommand.METHOD_ID:
- returnValue = new InvalidateCommand();
- break;
+ {
+ InvalidateCommand returnValue = new InvalidateCommand();
+ returnValue.initialize(txManager, cacheSpi, configuration.isNodeLockingOptimistic());
+ returnValue.initialize(notifier, dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case ClusteredGetCommand.METHOD_ID:
- returnValue = new ClusteredGetCommand();
- break;
-
+ {
+ ClusteredGetCommand returnValue = new ClusteredGetCommand();
+ returnValue.initialize(dataContainer, invoker);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
// ---- Buddy replication - group organisation commands
case AnnounceBuddyPoolNameCommand.METHOD_ID:
- returnValue = new AnnounceBuddyPoolNameCommand();
- break;
+ {
+ AnnounceBuddyPoolNameCommand returnValue = new AnnounceBuddyPoolNameCommand();
+ returnValue.initialize(buddyManager);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case AssignToBuddyGroupCommand.METHOD_ID:
- returnValue = new AssignToBuddyGroupCommand();
- break;
+ {
+ AssignToBuddyGroupCommand returnValue = new AssignToBuddyGroupCommand();
+ returnValue.initialize(buddyManager);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case RemoveFromBuddyGroupCommand.METHOD_ID:
- returnValue = new RemoveFromBuddyGroupCommand();
- break;
+ {
+ RemoveFromBuddyGroupCommand returnValue = new RemoveFromBuddyGroupCommand();
+ returnValue.initialize(buddyManager);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case DataGravitationCleanupCommand.METHOD_ID:
- returnValue = new DataGravitationCleanupCommand();
- break;
+ {
+ DataGravitationCleanupCommand returnValue = new DataGravitationCleanupCommand();
+ returnValue.initialize(buddyManager, invoker, transactionTable, this, dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
case GravitateDataCommand.METHOD_ID:
- returnValue = new GravitateDataCommand();
- break;
-
-
+ {
+ GravitateDataCommand returnValue = new GravitateDataCommand();
+ returnValue.initialize(dataContainer);
+ returnValue.setParameters(id, parameters);
+ return returnValue;
+ }
default:
throw new CacheException("Unknown command id " + id + "!");
}
-
- returnValue.setParameters(id, parameters);
- registry.wireDependencies(returnValue);
- return returnValue;
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -64,6 +64,7 @@
public class ComponentRegistry
{
// TODO: 2.2.0: Needs refactoring
+ //TODO: 2.2.x+ @Start annotation bug: BaseClass.start() and ChildrenClass.start() are annotated with @Start then only base class method is being called
static final Object NULL_COMPONENT = new Object();
State overallState = CONSTRUCTED;
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -125,7 +125,9 @@
Element element = XmlHelper.stringToElement("<config><buddyReplicationEnabled>true</buddyReplicationEnabled></config>");
BuddyReplicationConfig cfg = XmlConfigurationParser.parseBuddyReplicationConfig(element);
bm = new BuddyManager(cfg);
- bm.initFqnTransformer(DUMMY_LOCAL_ADDRESS, new CommandsFactory(null, new ComponentRegistry(new Configuration())));
+ CommandsFactory commandsFactory = new CommandsFactory();
+ commandsFactory.initialize(null, null, null, null, null, null, null, new Configuration(), null);
+ bm.initFqnTransformer(DUMMY_LOCAL_ADDRESS, commandsFactory);
}
catch (Exception e)
{
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/AbstractVersionAwareMarshallerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/AbstractVersionAwareMarshallerTest.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/AbstractVersionAwareMarshallerTest.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -27,7 +27,7 @@
if (cr.getOverallState() == ComponentRegistry.State.STARTED) cr.stop();
CommandsFactory cf = cr.getComponent(CommandsFactory.class);
- if (cf == null) cf = new CommandsFactory(null, cr);
+ if (cf == null) cf = new CommandsFactory();
cr.registerComponent(CommandsFactory.class.getName(), cf, CommandsFactory.class);
cr.start();
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java 2008-04-30 15:16:01 UTC (rev 5773)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/MethodIdPreservationTest.java 2008-04-30 15:51:35 UTC (rev 5774)
@@ -47,7 +47,7 @@
CacheMarshaller210 cm210 = new CacheMarshaller210();
ComponentRegistry registry = new ComponentRegistry(new Configuration());
- CommandsFactory factory = new CommandsFactory(null, registry);
+ CommandsFactory factory = new CommandsFactory();
cm210.injectCommandsFactory(factory);
m = cm210;
16 years, 7 months