JBoss Cache SVN: r6833 - benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-10-03 09:24:45 -0400 (Fri, 03 Oct 2008)
New Revision: 6833
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
Log:
updated jbosscache-core.jar
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jbosscache-core.jar
===================================================================
(Binary files differ)
16 years, 2 months
JBoss Cache SVN: r6832 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-03 08:59:43 -0400 (Fri, 03 Oct 2008)
New Revision: 6832
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java
Log:
Fixed broken interceptors.
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-10-03 10:13:44 UTC (rev 6831)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-10-03 12:59:43 UTC (rev 6832)
@@ -43,6 +43,13 @@
}
@Override
+ protected boolean nodeDoesNotExist(InvocationContext ctx, Fqn fqn)
+ {
+ return ctx.lookUpNode(fqn) == null;
+ }
+
+
+ @Override
protected void wrapIfNeeded(InvocationContext ctx, Fqn fqnToWrap) throws InterruptedException
{
helper.wrapNodeForReading(ctx, fqnToWrap, true);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java 2008-10-03 10:13:44 UTC (rev 6831)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitatorInterceptor.java 2008-10-03 12:59:43 UTC (rev 6832)
@@ -158,6 +158,16 @@
}
}
+ /**
+ * @param ctx invocation context
+ * @param fqn fqn to test
+ * @return true if the node does not exist; false otherwise.
+ */
+ protected boolean nodeDoesNotExist(InvocationContext ctx, Fqn fqn)
+ {
+ return !dataContainer.exists(fqn);
+ }
+
private Object handleGetMethod(InvocationContext ctx, DataCommand command) throws Throwable
{
if (isGravitationEnabled(ctx))
@@ -170,7 +180,7 @@
}
else
{
- if (!dataContainer.exists(command.getFqn()))
+ if (nodeDoesNotExist(ctx, command.getFqn()))
{
// gravitation is necessary.
16 years, 2 months
JBoss Cache SVN: r6831 - core/trunk/src/test/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-03 06:13:44 -0400 (Fri, 03 Oct 2008)
New Revision: 6831
Added:
core/trunk/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java
Log:
Added test for JBCACHE-1420
Added: core/trunk/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java 2008-10-03 10:13:44 UTC (rev 6831)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache.lock;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.transaction.DummyTransactionManagerLookup;
+import org.jboss.cache.util.TestingUtil;
+import org.testng.annotations.Test;
+
+@Test(groups = "functional")
+public class LockParentRootFlagTest
+{
+ // to test https://jira.jboss.org/jira/browse/JBCACHE-1420
+
+ public void testMVCCSet()
+ {
+ doTest(NodeLockingScheme.MVCC, true);
+ }
+
+ public void testMVCCUnset()
+ {
+ doTest(NodeLockingScheme.MVCC, false);
+ }
+
+ public void testPessimisticSet()
+ {
+ doTest(NodeLockingScheme.PESSIMISTIC, true);
+ }
+
+ public void testPessimisticUnset()
+ {
+ doTest(NodeLockingScheme.PESSIMISTIC, false);
+ }
+
+ public void testOptimisticSet()
+ {
+ doTest(NodeLockingScheme.OPTIMISTIC, true);
+ }
+
+ public void testOptimisticUnset()
+ {
+ doTest(NodeLockingScheme.OPTIMISTIC, false);
+ }
+
+
+ private void doTest(NodeLockingScheme nls, boolean set)
+ {
+ Cache c = null;
+ try
+ {
+ c = new DefaultCacheFactory().createCache(false);
+ c.getConfiguration().setNodeLockingScheme(nls);
+ c.getConfiguration().setLockParentForChildInsertRemove(set);
+ if (nls.isVersionedScheme())
+ c.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
+ c.start();
+ assert c.getRoot().isLockForChildInsertRemove() == set;
+ }
+ finally
+ {
+ TestingUtil.killCaches(c);
+ }
+ }
+}
16 years, 2 months
JBoss Cache SVN: r6830 - in core/branches/2.2.X/src: test/java/org/jboss/cache/lock and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-03 06:10:45 -0400 (Fri, 03 Oct 2008)
New Revision: 6830
Added:
core/branches/2.2.X/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java
Modified:
core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainerImpl.java
Log:
JBCACHE-1420 - LockForChildInsertRemove flag not set for root node
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-10-02 14:42:40 UTC (rev 6829)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-10-03 10:10:45 UTC (rev 6830)
@@ -87,6 +87,7 @@
setRoot(tempRoot);
}
root.setChildrenLoaded(true);
+ root.setLockForChildInsertRemove(configuration.isLockParentForChildInsertRemove());
}
@Stop(priority = 100)
Added: core/branches/2.2.X/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java (rev 0)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/lock/LockParentRootFlagTest.java 2008-10-03 10:10:45 UTC (rev 6830)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache.lock;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.util.TestingUtil;
+import org.testng.annotations.Test;
+
+@Test(groups = "functional")
+public class LockParentRootFlagTest
+{
+ // to test https://jira.jboss.org/jira/browse/JBCACHE-1420
+
+ public void testPessimisticSet()
+ {
+ doTest(NodeLockingScheme.PESSIMISTIC, true);
+ }
+
+ public void testPessimisticUnset()
+ {
+ doTest(NodeLockingScheme.PESSIMISTIC, false);
+ }
+
+ public void testOptimisticSet()
+ {
+ doTest(NodeLockingScheme.OPTIMISTIC, true);
+ }
+
+ public void testOptimisticUnset()
+ {
+ doTest(NodeLockingScheme.OPTIMISTIC, false);
+ }
+
+
+ private void doTest(NodeLockingScheme nls, boolean set)
+ {
+ Cache c = null;
+ try
+ {
+ c = new DefaultCacheFactory().createCache(false);
+ c.getConfiguration().setNodeLockingScheme(nls);
+ c.getConfiguration().setLockParentForChildInsertRemove(set);
+ c.start();
+ assert c.getRoot().isLockForChildInsertRemove() == set;
+ }
+ finally
+ {
+ TestingUtil.killCaches(c);
+ }
+ }
+}
16 years, 2 months
JBoss Cache SVN: r6829 - in core/tags/1.4.1.SP10: src/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-02 10:42:40 -0400 (Thu, 02 Oct 2008)
New Revision: 6829
Modified:
core/tags/1.4.1.SP10/build.xml
core/tags/1.4.1.SP10/src/org/jboss/cache/Version.java
Log:
Modified: core/tags/1.4.1.SP10/build.xml
===================================================================
--- core/tags/1.4.1.SP10/build.xml 2008-10-02 14:29:02 UTC (rev 6828)
+++ core/tags/1.4.1.SP10/build.xml 2008-10-02 14:42:40 UTC (rev 6829)
@@ -6,7 +6,7 @@
<property name="module.name" value="JBossCache"/>
<!--We now requires version to have no white space since Ant+JBossAop will sometime choke. -->
- <property name="module.version" value="1.4.1.SP8"/>
+ <property name="module.version" value="1.4.1.SP10"/>
<property name="implementation.url" value="http://www.jboss.com/products/jbosscache"/>
<property file="build.properties"/>
<property name="root.dir" value="${basedir}"/>
Modified: core/tags/1.4.1.SP10/src/org/jboss/cache/Version.java
===================================================================
--- core/tags/1.4.1.SP10/src/org/jboss/cache/Version.java 2008-10-02 14:29:02 UTC (rev 6828)
+++ core/tags/1.4.1.SP10/src/org/jboss/cache/Version.java 2008-10-02 14:42:40 UTC (rev 6829)
@@ -10,10 +10,9 @@
*/
public class Version
{
- public static final String version = "1.4.1.SP8";
+ public static final String version = "1.4.1.SP10";
public static final String codename = "Cayenne";
- public static byte[] version_id = {'0', '1', '4', '1', 'S', 'P', '8'};
- public static final String cvs = "$Id$";
+ public static byte[] version_id = {'0', '1', '4', '1', 'S', 'P', '1', '0'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
@@ -31,7 +30,6 @@
{
System.out.println("\nVersion: \t" + version);
System.out.println("Codename: \t" + codename);
- System.out.println("CVS: \t" + cvs);
System.out.println("History: \t(see http://jira.jboss.com/jira/browse/JBCACHE for details)\n");
}
16 years, 2 months
JBoss Cache SVN: r6828 - core/trunk/src/main/java/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-02 10:29:02 -0400 (Thu, 02 Oct 2008)
New Revision: 6828
Modified:
core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
Log:
JBCACHE-1419: If async repl is used, marshalling should be done in a separate thread
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-10-02 14:12:36 UTC (rev 6827)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-10-02 14:29:02 UTC (rev 6828)
@@ -86,7 +86,7 @@
// what sort of a repl processor do we need?
Configuration c = componentRegistry.getComponent(Configuration.class);
- if (c.getCacheMode().isSynchronous() || c.getSerializationExecutorPoolSize() == 0)
+ if (c.getCacheMode().isSynchronous() || c.getSerializationExecutorPoolSize() < 1)
{
// in-process thread. Not async.
replicationProcessor = new WithinThreadExecutor();
16 years, 2 months
JBoss Cache SVN: r6827 - in core/trunk/src: main/java/org/jboss/cache/config/parsing and 5 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-02 10:12:36 -0400 (Thu, 02 Oct 2008)
New Revision: 6827
Added:
core/trunk/src/test/resources/configs/parser-test-async.xml
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinThreadExecutor.java
core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationSchemaTest.java
Log:
JBCACHE-1419: If async repl is used, marshalling should be done in a separate thread
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-10-02 13:55:54 UTC (rev 6826)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-10-02 14:12:36 UTC (rev 6827)
@@ -222,6 +222,7 @@
private boolean writeSkewCheck = false;
private int concurrencyLevel = 500;
private int listenerAsyncPoolSize = 1;
+ private int serializationExecutorPoolSize = 25;
@Start(priority = 1)
private void correctIsolationLevels()
@@ -630,6 +631,18 @@
this.objectOutputStreamPoolSize = objectOutputStreamPoolSize;
}
+ /**
+ * Sets the async replication serialization executor pool size for async replication. Has no effect if the
+ * replication queue is used.
+ *
+ * @param serializationExecutorPoolSize number of threads to use
+ */
+ public void setSerializationExecutorPoolSize(int serializationExecutorPoolSize)
+ {
+ testImmutability("serializationExecutorPoolSize");
+ this.serializationExecutorPoolSize = serializationExecutorPoolSize;
+ }
+
// ------------------------------------------------------------------------------------------------------------
// GETTERS
// ------------------------------------------------------------------------------------------------------------
@@ -878,6 +891,14 @@
return url;
}
+ /**
+ * @return the serialization executor pool size.
+ */
+ public int getSerializationExecutorPoolSize()
+ {
+ return serializationExecutorPoolSize;
+ }
+
// ------------------------------------------------------------------------------------------------------------
// HELPERS
// ------------------------------------------------------------------------------------------------------------
@@ -932,6 +953,7 @@
if (transactionManagerLookupClass != null ? !transactionManagerLookupClass.equals(that.transactionManagerLookupClass) : that.transactionManagerLookupClass != null)
return false;
if (listenerAsyncPoolSize != that.listenerAsyncPoolSize) return false;
+ if (serializationExecutorPoolSize != that.serializationExecutorPoolSize) return false;
return true;
}
@@ -972,6 +994,7 @@
result = 31 * result + (useLazyDeserialization ? 1 : 0);
result = 31 * result + objectInputStreamPoolSize;
result = 31 * result + objectOutputStreamPoolSize;
+ result = 31 * result + serializationExecutorPoolSize;
return result;
}
@@ -1042,8 +1065,9 @@
this.customInterceptors = customInterceptors;
}
- public BuddyManager getConsistentHashing() {
- return null;
- }
-
+ public BuddyManager getConsistentHashing()
+ {
+ return null;
+ }
+
}
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-10-02 13:55:54 UTC (rev 6826)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-10-02 14:12:36 UTC (rev 6827)
@@ -359,6 +359,9 @@
if (existsAttribute(replQueueInterval)) config.setReplQueueInterval(getLong(replQueueInterval));
String replQueueMaxElements = getAttributeValue(element, "replQueueMaxElements");
if (existsAttribute(replQueueMaxElements)) config.setReplQueueMaxElements(getInt(replQueueMaxElements));
+ String serializationExecutorPoolSize = getAttributeValue(element, "serializationExecutorPoolSize");
+ if (existsAttribute(serializationExecutorPoolSize))
+ config.setSerializationExecutorPoolSize(getInt(serializationExecutorPoolSize));
}
private void configureLocking(Element element)
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-10-02 13:55:54 UTC (rev 6826)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-10-02 14:12:36 UTC (rev 6827)
@@ -27,15 +27,16 @@
import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.invocation.InvocationContextContainer;
+import org.jboss.cache.util.concurrent.WithinThreadExecutor;
import org.jgroups.Address;
import org.jgroups.Channel;
import org.jgroups.MembershipListener;
import org.jgroups.Message;
import org.jgroups.MessageListener;
-import org.jgroups.blocks.GroupRequest;
import org.jgroups.blocks.RpcDispatcher;
import org.jgroups.blocks.RspFilter;
import org.jgroups.util.Buffer;
@@ -44,6 +45,14 @@
import java.io.NotSerializableException;
import java.util.Vector;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
/**
* A JGroups RPC dispatcher that knows how to deal with {@link org.jboss.cache.commands.ReplicableCommand}s.
@@ -57,6 +66,9 @@
protected InterceptorChain interceptorChain;
protected ComponentRegistry componentRegistry;
protected boolean trace;
+ private ExecutorService replicationProcessor;
+ private AtomicInteger replicationProcessorCount;
+ private boolean asyncSerial;
public CommandAwareRpcDispatcher()
{
@@ -71,8 +83,46 @@
this.componentRegistry = componentRegistry;
this.interceptorChain = interceptorChain;
trace = log.isTraceEnabled();
+
+ // what sort of a repl processor do we need?
+ Configuration c = componentRegistry.getComponent(Configuration.class);
+ if (c.getCacheMode().isSynchronous() || c.getSerializationExecutorPoolSize() == 0)
+ {
+ // in-process thread. Not async.
+ replicationProcessor = new WithinThreadExecutor();
+ asyncSerial = false;
+ }
+ else
+ {
+ asyncSerial = true;
+ replicationProcessorCount = new AtomicInteger(0);
+ replicationProcessor = Executors.newFixedThreadPool(c.isUseReplQueue() ? 1 : c.getSerializationExecutorPoolSize(),
+ new ThreadFactory()
+ {
+ public Thread newThread(Runnable r)
+ {
+ return new Thread(r, "AsyncReplicationProcessor-" + replicationProcessorCount.incrementAndGet());
+ }
+ }
+ );
+ }
}
+ @Override
+ public void stop()
+ {
+ replicationProcessor.shutdownNow();
+ try
+ {
+ replicationProcessor.awaitTermination(60, TimeUnit.SECONDS);
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ super.stop();
+ }
+
protected boolean isValid(Message req)
{
if (server_obj == null)
@@ -95,7 +145,7 @@
* is aware of {@link org.jboss.cache.commands.ReplicableCommand} objects.
*/
public RspList invokeRemoteCommands(Vector<Address> dests, ReplicableCommand command, int mode, long timeout,
- boolean anycasting, boolean oob, RspFilter filter) throws NotSerializableException
+ boolean anycasting, boolean oob, RspFilter filter) throws NotSerializableException, ExecutionException, InterruptedException
{
if (dests != null && dests.isEmpty())
{
@@ -108,34 +158,21 @@
log.trace(new StringBuilder("dests=").append(dests).append(", command=").append(command).
append(", mode=").append(mode).append(", timeout=").append(timeout));
- Buffer buf;
- try
+ ReplicationTask replicationTask = new ReplicationTask(command, oob, dests, mode, timeout, anycasting, filter);
+ Future<RspList> response = replicationProcessor.submit(replicationTask);
+ if (asyncSerial)
{
- buf = req_marshaller.objectToBuffer(command);
+ // don't care about the response. return.
+ return null;
}
- catch (Exception e)
+ else
{
- throw new RuntimeException("Failure to marshal argument(s)", e);
+ RspList retval = response.get();
+ if (retval.isEmpty() || containsOnlyNulls(retval))
+ return null;
+ else
+ return retval;
}
-
- Message msg = new Message();
- msg.setBuffer(buf);
- if (oob) msg.setFlag(Message.OOB);
- RspList retval = super.castMessage(dests, msg, mode, timeout, anycasting, filter);
- if (trace) log.trace("responses: " + 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 (mode == GroupRequest.GET_NONE || retval.isEmpty() || containsOnlyNulls(retval))
- return null;
- else
- return retval;
}
private boolean containsOnlyNulls(RspList l)
@@ -207,4 +244,53 @@
{
return getClass().getSimpleName() + "[Outgoing marshaller: " + req_marshaller + "; incoming marshaller: " + rsp_marshaller + "]";
}
+
+ private class ReplicationTask implements Callable<RspList>
+ {
+ private ReplicableCommand command;
+ private boolean oob;
+ private Vector<Address> dests;
+ private int mode;
+ private long timeout;
+ private boolean anycasting;
+ private RspFilter filter;
+
+ private ReplicationTask(ReplicableCommand command, boolean oob, Vector<Address> dests, int mode, long timeout, boolean anycasting, RspFilter filter)
+ {
+ this.command = command;
+ this.oob = oob;
+ this.dests = dests;
+ this.mode = mode;
+ this.timeout = timeout;
+ this.anycasting = anycasting;
+ this.filter = filter;
+ }
+
+ public RspList call() throws Exception
+ {
+ Buffer buf;
+ try
+ {
+ buf = req_marshaller.objectToBuffer(command);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failure to marshal argument(s)", e);
+ }
+
+ Message msg = new Message();
+ msg.setBuffer(buf);
+ if (oob) msg.setFlag(Message.OOB);
+ RspList retval = castMessage(dests, msg, mode, timeout, anycasting, filter);
+ if (trace) log.trace("responses: " + 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.");
+ return retval;
+ }
+ }
}
Modified: core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinThreadExecutor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinThreadExecutor.java 2008-10-02 13:55:54 UTC (rev 6826)
+++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinThreadExecutor.java 2008-10-02 14:12:36 UTC (rev 6827)
@@ -21,6 +21,8 @@
*/
package org.jboss.cache.util.concurrent;
+import org.jboss.cache.CacheException;
+
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -75,7 +77,42 @@
public <T> Future<T> submit(Callable<T> task)
{
- throw new UnsupportedOperationException();
+ try
+ {
+ final T resp = task.call();
+ return new Future<T>()
+ {
+
+ public boolean cancel(boolean mayInterruptIfRunning)
+ {
+ return false;
+ }
+
+ public boolean isCancelled()
+ {
+ return false;
+ }
+
+ public boolean isDone()
+ {
+ return true;
+ }
+
+ public T get() throws InterruptedException, ExecutionException
+ {
+ return resp;
+ }
+
+ public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
+ {
+ return resp;
+ }
+ };
+ }
+ catch (Exception e)
+ {
+ throw new CacheException(e);
+ }
}
public <T> Future<T> submit(Runnable task, T result)
Modified: core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd
===================================================================
--- core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd 2008-10-02 13:55:54 UTC (rev 6826)
+++ core/trunk/src/main/resources/schema/jbosscache-config-3.0.xsd 2008-10-02 14:12:36 UTC (rev 6827)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:tns="urn:jboss:jbosscache-core:config:3.0" targetNamespace="urn:jboss:jbosscache-core:config:3.0"
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
+ xmlns:tns="urn:jboss:jbosscache-core:config:3.0" targetNamespace="urn:jboss:jbosscache-core:config:3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:element name="jbosscache" type="tns:cacheConfigurationType"/>
@@ -28,7 +29,8 @@
<xs:attribute name="isolationLevel">
<xs:simpleType>
<xs:restriction base="xs:string">
- <xs:pattern value="[Ss][Ee][Rr][Ii][Aa][Ll][Ii][Zz][Aa][Bb][Ll][Ee]|[Rr][Ee][Pp][Ee][Aa][Tt][Aa][Bb][Ll][Ee]_[Rr][Ee][Aa][Dd]|[Rr][Ee][Aa][Dd]_[Cc][Oo][Mm][Mm][Ii][Tt][Tt][Ee][Dd]|[Nn][Oo][Nn][Ee]|\$\{.*\}"/>
+ <xs:pattern
+ value="[Ss][Ee][Rr][Ii][Aa][Ll][Ii][Zz][Aa][Bb][Ll][Ee]|[Rr][Ee][Pp][Ee][Aa][Tt][Aa][Bb][Ll][Ee]_[Rr][Ee][Aa][Dd]|[Rr][Ee][Aa][Dd]_[Cc][Oo][Mm][Mm][Ii][Tt][Tt][Ee][Dd]|[Nn][Oo][Nn][Ee]|\$\{.*\}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
@@ -37,7 +39,8 @@
<xs:attribute name="nodeLockingScheme">
<xs:simpleType>
<xs:restriction base="xs:string">
- <xs:pattern value="[Mm][Vv][Cc][Cc]|[Oo][Pp][Tt][Ii][Mm][Ii][Ss][Tt][Ii][Cc]|[Pp][Ee][Ss][Ss][Ii][Mm][Ii][Ss][Tt][Ii][Cc]|\$\{.*\}"/>
+ <xs:pattern
+ value="[Mm][Vv][Cc][Cc]|[Oo][Pp][Tt][Ii][Mm][Ii][Ss][Tt][Ii][Cc]|[Pp][Ee][Ss][Ss][Ii][Mm][Ii][Ss][Tt][Ii][Cc]|\$\{.*\}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
@@ -64,7 +67,8 @@
<xs:attribute name="hookBehavior">
<xs:simpleType>
<xs:restriction base="xs:string">
- <xs:pattern value="[Dd][Ee][Ff][Aa][Uu][Ll][Tt]|[Rr][Ee][Gg][Ii][Ss][Tt][Ee][Rr]|[Dd][Oo][Nn][Tt]_[Rr][Ee][Gg][Ii][Ss][Tt][Ee][Rr]|\$\{.*\}"/>
+ <xs:pattern
+ value="[Dd][Ee][Ff][Aa][Uu][Ll][Tt]|[Rr][Ee][Gg][Ii][Ss][Tt][Ee][Rr]|[Dd][Oo][Nn][Tt]_[Rr][Ee][Gg][Ii][Ss][Tt][Ee][Rr]|\$\{.*\}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
@@ -155,11 +159,11 @@
<xs:attribute name="replTimeout" type="tns:positiveInteger"/>
</xs:complexType>
-
<xs:complexType name="asyncType">
<xs:attribute name="useReplQueue" type="tns:booleanType"/>
<xs:attribute name="replQueueInterval" type="tns:positiveInteger"/>
<xs:attribute name="replQueueMaxElements" type="tns:positiveInteger"/>
+ <xs:attribute name="serializationExecutorPoolSize" type="tns:positiveInteger"/>
</xs:complexType>
<xs:complexType name="evictionType">
Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-10-02 13:55:54 UTC (rev 6826)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-10-02 14:12:36 UTC (rev 6827)
@@ -1,12 +1,18 @@
package org.jboss.cache.config.parsing;
-import org.jboss.cache.config.*;
+import org.jboss.cache.config.BuddyReplicationConfig;
+import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.ConfigurationException;
+import org.jboss.cache.config.CustomInterceptorConfig;
+import org.jboss.cache.config.EvictionConfig;
+import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor;
import org.jboss.cache.config.parsing.custominterceptors.BbbCustomInterceptor;
import org.jboss.cache.eviction.LRUAlgorithmConfig;
import org.jboss.cache.eviction.MRUAlgorithmConfig;
import org.jboss.cache.lock.IsolationLevel;
-import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.util.List;
@@ -21,18 +27,18 @@
@Test(groups = "functional")
public class XmlConfigurationParserTest
{
- Configuration config;
+ Configuration syncConfig, asyncConfig;
- @BeforeMethod
+ @BeforeTest
public void setUp()
{
- XmlConfigurationParser parser = new XmlConfigurationParser(false, null);
- config = parser.parseFile("configs/parser-test.xml");
+ syncConfig = new XmlConfigurationParser(false, null).parseFile("configs/parser-test.xml");
+ asyncConfig = new XmlConfigurationParser(false, null).parseFile("configs/parser-test-async.xml");
}
public void testParseOldConfigFile()
{
- System.setProperty("jbosscache.config.validate","false");
+ System.setProperty("jbosscache.config.validate", "false");
XmlConfigurationParser parser = new XmlConfigurationParser();
try
{
@@ -43,124 +49,132 @@
{
//expectd
}
- finally {
- System.setProperty("jbosscache.config.validate","true");
+ finally
+ {
+ System.setProperty("jbosscache.config.validate", "true");
}
}
public void testTransactionManagerLookupClass()
{
- assert config.getTransactionManagerLookupClass().equals("org.jboss.cache.transaction.GenericTransactionManagerLookup");
+ assert syncConfig.getTransactionManagerLookupClass().equals("org.jboss.cache.transaction.GenericTransactionManagerLookup");
}
public void testIsolationLevel()
{
- assert config.getIsolationLevel().equals(IsolationLevel.REPEATABLE_READ);
+ assert syncConfig.getIsolationLevel().equals(IsolationLevel.REPEATABLE_READ);
}
public void testCacheMode()
{
- assert config.getCacheMode().equals(Configuration.CacheMode.REPL_SYNC);
+ assert syncConfig.getCacheMode().equals(Configuration.CacheMode.REPL_SYNC);
+ assert asyncConfig.getCacheMode().equals(Configuration.CacheMode.REPL_ASYNC);
}
+ public void testAsyncSerializationExecutorSize()
+ {
+ assert asyncConfig.getSerializationExecutorPoolSize() == 250;
+ }
+
public void testUseReplQueue()
{
- assert !config.isUseReplQueue();
+ assert !syncConfig.isUseReplQueue();
+ assert !asyncConfig.isUseReplQueue();
}
public void testClusterName()
{
- assert config.getClusterName().equals("JBossCache-Cluster");
+ assert syncConfig.getClusterName().equals("JBossCache-Cluster");
}
public void testGetClusterConfig()
{
- assert config.getClusterConfig().indexOf("MERGE2") >= 0;
+ assert syncConfig.getClusterConfig().indexOf("MERGE2") >= 0;
}
public void testFetchInMemoryState()
{
- assert config.isFetchInMemoryState();
+ assert syncConfig.isFetchInMemoryState();
}
public void testStateRetrievalTimeout()
{
- assert config.getStateRetrievalTimeout() == 15124;
+ assert syncConfig.getStateRetrievalTimeout() == 15124;
}
public void testSyncReplTimeout()
{
- assert config.getSyncReplTimeout() == 15421;
+ assert syncConfig.getSyncReplTimeout() == 15421;
}
public void testLockAcquisitionTimeout()
{
- assert config.getLockAcquisitionTimeout() == 10234;
+ assert syncConfig.getLockAcquisitionTimeout() == 10234;
}
public void testUseLazyDeserialization()
{
- assert config.isUseLazyDeserialization();
+ assert syncConfig.isUseLazyDeserialization();
}
public void testObjectInputStreamPoolSize()
{
- assert 12 == config.getObjectInputStreamPoolSize();
+ assert 12 == syncConfig.getObjectInputStreamPoolSize();
}
public void testObjectOutputStreamPoolSize()
{
- assert 14 == config.getObjectOutputStreamPoolSize();
+ assert 14 == syncConfig.getObjectOutputStreamPoolSize();
}
public void testShutdownHookBehavior()
{
- assert Configuration.ShutdownHookBehavior.REGISTER == config.getShutdownHookBehavior();
+ assert Configuration.ShutdownHookBehavior.REGISTER == syncConfig.getShutdownHookBehavior();
}
public void testSyncRollbackPhase()
{
- assert config.isSyncRollbackPhase();
+ assert syncConfig.isSyncRollbackPhase();
}
public void testSyncCommitPhase()
{
- assert config.isSyncCommitPhase();
+ assert syncConfig.isSyncCommitPhase();
}
public void testUseReplicationVersion()
{
- assert config.getReplicationVersion() == 124;
+ assert syncConfig.getReplicationVersion() == 124;
}
public void testGetMultiplexerStack()
{
- assert "file_name".equals(config.getMultiplexerStack());
+ assert "file_name".equals(syncConfig.getMultiplexerStack());
}
public void testMarshallerClass()
{
- assert "some.Clazz".equals(config.getMarshallerClass());
+ assert "some.Clazz".equals(syncConfig.getMarshallerClass());
}
public void testLockParentForChildInsertRemove()
{
- assert config.isLockParentForChildInsertRemove();
+ assert syncConfig.isLockParentForChildInsertRemove();
}
public void testInactiveOnStartup()
{
- assert config.isInactiveOnStartup();
+ assert syncConfig.isInactiveOnStartup();
}
public void testExposeManagementStatistics()
{
- assert !config.getExposeManagementStatistics();
+ assert !syncConfig.getExposeManagementStatistics();
}
public void testCacheLoaderConfiguration()
{
- CacheLoaderConfig clc = config.getCacheLoaderConfig();
+ CacheLoaderConfig clc = syncConfig.getCacheLoaderConfig();
assert null != clc;
assert clc.isPassivation();
assert clc.isShared();
@@ -178,7 +192,7 @@
public void testBuddyReplicationConfig()
{
- BuddyReplicationConfig brConfig = config.getBuddyReplicationConfig();
+ BuddyReplicationConfig brConfig = syncConfig.getBuddyReplicationConfig();
assert brConfig.isEnabled();
BuddyReplicationConfig.BuddyLocatorConfig locatorConfig = brConfig.getBuddyLocatorConfig();
assert "org.jboss.cache.buddyreplication.NextMemberBuddyLocator".equals(locatorConfig.getBuddyLocatorClass());
@@ -193,12 +207,12 @@
public void testUseRegionBasedMarshalling()
{
- assert config.isUseRegionBasedMarshalling();
+ assert syncConfig.isUseRegionBasedMarshalling();
}
public void testEvictionPolicyConfig()
{
- EvictionConfig evictionConfig = config.getEvictionConfig();
+ EvictionConfig evictionConfig = syncConfig.getEvictionConfig();
assert "org.jboss.cache.eviction.LRUAlgorithm".equals(evictionConfig.getDefaultEvictionRegionConfig().getEvictionAlgorithmConfig().getEvictionAlgorithmClassName());
assert 200000 == evictionConfig.getDefaultEvictionRegionConfig().getEventQueueSize();
assert 5 == evictionConfig.getWakeupInterval();
@@ -229,7 +243,7 @@
public void testCustomInterceptors()
{
- List<CustomInterceptorConfig> interceptorConfigs = config.getCustomInterceptors();
+ List<CustomInterceptorConfig> interceptorConfigs = syncConfig.getCustomInterceptors();
assert interceptorConfigs.size() == 5;
assert interceptorConfigs.get(0).getInterceptor() instanceof AaaCustomInterceptor;
assert interceptorConfigs.get(1).getInterceptor() instanceof BbbCustomInterceptor;
@@ -246,7 +260,7 @@
public void testSingletonStore()
{
- CacheLoaderConfig.IndividualCacheLoaderConfig clc = config.getCacheLoaderConfig().getFirstCacheLoaderConfig();
+ CacheLoaderConfig.IndividualCacheLoaderConfig clc = syncConfig.getCacheLoaderConfig().getFirstCacheLoaderConfig();
assert clc != null;
CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig singlStoreConf = clc.getSingletonStoreConfig();
assert singlStoreConf != null;
@@ -259,17 +273,17 @@
public void testMvccAttributes()
{
- assert !config.isWriteSkewCheck();
- assert config.getConcurrencyLevel() == 21;
+ assert !syncConfig.isWriteSkewCheck();
+ assert syncConfig.getConcurrencyLevel() == 21;
}
public void testListenerAsyncThreads()
{
- assert config.getListenerAsyncPoolSize() == 5;
+ assert syncConfig.getListenerAsyncPoolSize() == 5;
}
public void testInvocationBatching()
{
- assert config.isInvocationBatchingEnabled();
+ assert syncConfig.isInvocationBatchingEnabled();
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationSchemaTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationSchemaTest.java 2008-10-02 13:55:54 UTC (rev 6826)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationSchemaTest.java 2008-10-02 14:12:36 UTC (rev 6827)
@@ -30,6 +30,7 @@
"mixedPolicy-eviction.xml",
"mux.xml",
"parser-test.xml",
+ "parser-test-async.xml",
"policyPerRegion-eviction.xml",
"replSync.xml",
"string-property-replaced.xml",
@@ -42,7 +43,7 @@
public void testSimpleFile()
{
ExceptionCountingErrorHandler handler = new ExceptionCountingErrorHandler();
- System.setProperty("jbosscache.config.schemaLocation","src/main/resources/jbosscache-config-3.0.xsd");
+ System.setProperty("jbosscache.config.schemaLocation", "src/main/resources/jbosscache-config-3.0.xsd");
XmlConfigurationParser parser = new XmlConfigurationParser(handler);
for (String file : testFiles)
{
Copied: core/trunk/src/test/resources/configs/parser-test-async.xml (from rev 6825, core/trunk/src/test/resources/configs/parser-test.xml)
===================================================================
--- core/trunk/src/test/resources/configs/parser-test-async.xml (rev 0)
+++ core/trunk/src/test/resources/configs/parser-test-async.xml 2008-10-02 14:12:36 UTC (rev 6827)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- file used for functional test of the xml parser -->
+
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+
+ <locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
+ nodeLockingScheme="mvcc" writeSkewCheck="false" concurrencyLevel="21"/>
+
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
+ syncRollbackPhase="true" syncCommitPhase="true"/>
+
+ <!-- serialization related configuration, used for replication and cache loading -->
+ <serialization objectInputStreamPoolSize="12" objectOutputStreamPoolSize="14" version="1.2.4"
+ marshallerClass="some.Clazz" useLazyDeserialization="true" useRegionBasedMarshalling="true"/>
+
+ <replication>
+ <async useReplQueue="false" serializationExecutorPoolSize="250"/>
+ <buddy enabled="true" poolName="myBuddyPoolReplicationGroup" communicationTimeout="2000">
+ <dataGravitation auto="true" removeOnFind="true" searchBackupTrees="true"/>
+ <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+ <properties>
+ numBuddies = 1
+ ignoreColocatedBuddies = true
+ </properties>
+ </locator>
+ </buddy>
+ </replication>
+
+ <stateRetrieval timeout="15124" fetchInMemoryState="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <shutdown hookBehavior="REGISTER"/>
+
+ <transport clusterName="JBossCache-Cluster" multiplexerStack="file_name">
+ <jgroupsConfig>
+ <PING timeout="2000" num_initial_members="3"/>
+ <MERGE2 max_interval="30000" min_interval="10000"/>
+ <FD_SOCK/>
+ <FD timeout="10000" max_tries="5" shun="true"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
+ retransmit_timeout="300,600,1200,2400,4800"
+ discard_delivered_msgs="true"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="400000"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
+ view_bundling="true" view_ack_collection_timeout="5000"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+ <!-- <pbcast.STATE_TRANSFER/> -->
+ <pbcast.FLUSH timeout="0"/>
+ </jgroupsConfig>
+ </transport>
+
+
+ <jmxStatistics enabled="false"/>
+
+ <eviction wakeUpInterval="5">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/org/jboss/data">
+ <attribute name="timeToLive">1002</attribute>
+ </region>
+ <region name="/org/jboss/xyz" algorithmClass="org.jboss.cache.eviction.MRUAlgorithm" eventQueueSize="21">
+ <attribute name="maxNodes">2103</attribute>
+ <attribute name="minTimeToLive">22</attribute>
+ </region>
+ </eviction>
+
+ <!-- this should be deprecated in 3.0 and should be replaced with CacheLoaderConfig-->
+ <loaders passivation="true" shared="true">
+ <preload>
+ <node fqn="/a/b/c"/>
+ <node fqn="/f/r/s"/>
+ </preload>
+
+ <!-- we can now have multiple cache loaders, which get chained -->
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="true" fetchPersistentState="true"
+ ignoreModifications="true" purgeOnStartup="true">
+ <properties>
+ cache.jdbc.table.name=jbosscache
+ cache.jdbc.table.create=true
+ cache.jdbc.table.drop=true
+ </properties>
+ <singletonStore enabled="true" class="org.jboss.cache.loader.SingletonStoreCacheLoader">
+ <properties>
+ pushStateWhenCoordinator=true
+ pushStateWhenCoordinatorTimeout=20000
+ </properties>
+ </singletonStore>
+ </loader>
+ </loaders>
+
+ <!-- this is new behavior added within 3.x only. it support configuring custom interceptors through configurations -->
+ <customInterceptors>
+ <interceptor position="first" class="org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor">
+ <attribute name="attrOne">value1</attribute>
+ <attribute name="attrTwo">value2</attribute>
+ <attribute name="attrThree">value3</attribute>
+ </interceptor>
+ <interceptor position="last" class="org.jboss.cache.config.parsing.custominterceptors.BbbCustomInterceptor"/>
+ <interceptor index="3" class="org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor"/>
+ <interceptor before="org.jboss.cache.interceptors.CallInterceptor"
+ class="org.jboss.cache.config.parsing.custominterceptors.BbbCustomInterceptor"/>
+ <interceptor after="org.jboss.cache.interceptors.CallInterceptor"
+ class="org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor"/>
+ </customInterceptors>
+
+ <!-- the number of threads to use for asynchronous cache listeners - defaults to 1 -->
+ <listeners asyncPoolSize="5"/>
+ <invocationBatching enabled="true"/>
+</jbosscache>
16 years, 2 months
JBoss Cache SVN: r6826 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-02 09:55:54 -0400 (Thu, 02 Oct 2008)
New Revision: 6826
Added:
core/tags/1.4.1.SP10/
Log:
Copied: core/tags/1.4.1.SP10 (from rev 6825, core/branches/1.4.X)
16 years, 2 months
JBoss Cache SVN: r6825 - core/branches/1.4.X/tests/functional/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-10-02 06:00:50 -0400 (Thu, 02 Oct 2008)
New Revision: 6825
Removed:
core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java
Log:
removed broken test
Deleted: core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java 2008-10-02 07:47:38 UTC (rev 6824)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/transaction/IsolationLevelReadUncommitedTest.java 2008-10-02 10:00:50 UTC (rev 6825)
@@ -1,105 +0,0 @@
-package org.jboss.cache.transaction;
-
-import EDU.oswego.cs.dl.util.concurrent.Latch;
-
-import javax.transaction.Transaction;
-import javax.transaction.SystemException;
-import javax.transaction.NotSupportedException;
-
-import org.jboss.cache.TreeCache;
-import org.jboss.cache.DummyTransactionManagerLookup;
-import org.jboss.cache.lock.IsolationLevel;
-import junit.framework.TestCase;
-
-/**
- * @author Mircea.Markus(a)jboss.com
- */
-
-// --- Why was this test added in the first place? It was added in r.5178 by mmarkus. Does this pertain to any specific JIRA? - Manik (Oct 2008)
-
-public class IsolationLevelReadUncommitedTest {/*extends TestCase {
-
- private TreeCache cache = null;
-
- private Transaction startTransaction() throws SystemException, NotSupportedException
- {
- DummyTransactionManager mgr = DummyTransactionManager.getInstance();
- mgr.begin();
- return mgr.getTransaction();
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- cache = new TreeCache();
- cache.setCacheMode(TreeCache.LOCAL);
- cache.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
- cache.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
- cache.setLockAcquisitionTimeout(1000);
- cache.startService();
- }
-
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- cache.stopService();
- cache.destroyService();
- cache = null;
- }
-
- /**
- * Tests following scenario:
- * tx1 starts and create /a/b/c
- * tx2 starts and adds a key value under /a/b
- * tx2 commits
- * tx1 rollabcks
- *
- * the key/value added bu tx should be in the cache still, and should not be affected by tx1 rollback.
- */
- /*
- public void testInterlacedTx() throws Exception
- {
- Transaction tx = startTransaction();
- cache.put("/a/b/c", "key", "value");
- System.out.println("Tx1 just added /a/b/c");
- System.out.println(cache.printLockInfo());
- Latch latch = new Latch();
- TxThread txThread = new TxThread(cache, latch);
- txThread.start();
- latch.acquire();
- tx.rollback();
- System.out.println("Tx1 just rolled back");
- System.out.println(cache.printLockInfo());
-
- assertNotNull(cache.get("/a/b"));
- assertNotNull(cache.get("/a/b", "newKey"));
- }
-
- private class TxThread extends Thread
- {
- TreeCache cache;
- Latch latch;
-
- private TxThread(TreeCache cache, Latch latch) {
- this.cache = cache;
- this.latch = latch;
- }
-
- public void run() {
- try {
- Transaction tx = startTransaction();
- cache.put("/a/b","newKey","newValue");
- System.out.println("Tx2 just updated /a/b");
- System.out.println(cache.printLockInfo());
- tx.commit();
- System.out.println("Tx2 commited");
- latch.release();
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException();
- }
- }
- } */
-}
\ No newline at end of file
16 years, 2 months