JBoss Cache SVN: r4937 - core/trunk/src/main/java/org/jboss/cache/invocation.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-02 06:29:31 -0500 (Wed, 02 Jan 2008)
New Revision: 4937
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
Log:
getInterceptorChain should return unmodifiable list
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-01-02 11:28:57 UTC (rev 4936)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-01-02 11:29:31 UTC (rev 4937)
@@ -113,7 +113,7 @@
public List<Interceptor> getInterceptorChain()
{
- return InterceptorChainFactory.asList(interceptorChain);
+ return Collections.unmodifiableList(InterceptorChainFactory.asList(interceptorChain));
}
public void addInterceptor(Interceptor i, int position)
17 years
JBoss Cache SVN: r4936 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-02 06:28:57 -0500 (Wed, 02 Jan 2008)
New Revision: 4936
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
Log:
Ensure we dont acquire locks for isolation level of NONE
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-01-02 11:28:33 UTC (rev 4935)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-01-02 11:28:57 UTC (rev 4936)
@@ -310,7 +310,7 @@
boolean acquireLockOnParent, boolean reverseRemoveCheck)
throws InterruptedException
{
- if (fqn == null) return false;
+ if (fqn == null || configuration.getIsolationLevel() == IsolationLevel.NONE) return false;
boolean created;
long timeout = zeroLockTimeout ? 0 : ctx.getContextLockAcquisitionTimeout(lock_acquisition_timeout);
17 years
JBoss Cache SVN: r4935 - core/trunk/src/main/java/org/jboss/cache/factories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-02 06:28:33 -0500 (Wed, 02 Jan 2008)
New Revision: 4935
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
Log:
Even after resetting, the SPI should move to state WIRED so operations like start() can be called on it!
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-01-02 11:28:08 UTC (rev 4934)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-01-02 11:28:33 UTC (rev 4935)
@@ -541,6 +541,8 @@
componentLookup.put(CacheImpl.class.getName(), impl);
componentLookup.put(CacheSPI.class.getName(), spi);
+ spi.changeState(WIRED);
+
overallState = null;
}
17 years
JBoss Cache SVN: r4934 - in core/trunk/src/test/java/org/jboss/cache: invalidation and 4 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-02 06:28:08 -0500 (Wed, 02 Jan 2008)
New Revision: 4934
Modified:
core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java
core/trunk/src/test/java/org/jboss/cache/invalidation/VersionInconsistencyTest.java
core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTest.java
core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTestBase.java
core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java
core/trunk/src/test/java/org/jboss/cache/transaction/StatusUnknownTest.java
Log:
Fixed a bunch of unit tests
Modified: core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java 2008-01-02 01:55:51 UTC (rev 4933)
+++ core/trunk/src/test/java/org/jboss/cache/factories/ComponentRegistryFunctionalTest.java 2008-01-02 11:28:08 UTC (rev 4934)
@@ -95,6 +95,7 @@
Marshaller m = cr.getOrCreateComponent(null, componentToTest);
assert m instanceof VersionAwareMarshaller;
VersionAwareMarshaller vam = (VersionAwareMarshaller) m;
+ vam.initReplicationVersions();
m = (Marshaller) TestingUtil.extractField(vam, "defaultMarshaller");
assert m instanceof CacheMarshaller210;
}
@@ -147,6 +148,7 @@
Marshaller m = cr.getOrCreateComponent(null, componentToTest);
assert m instanceof VersionAwareMarshaller;
VersionAwareMarshaller vam = (VersionAwareMarshaller) m;
+ vam.initReplicationVersions();
m = (Marshaller) TestingUtil.extractField(vam, "defaultMarshaller");
assert m instanceof CacheMarshaller200;
}
Modified: core/trunk/src/test/java/org/jboss/cache/invalidation/VersionInconsistencyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/invalidation/VersionInconsistencyTest.java 2008-01-02 01:55:51 UTC (rev 4933)
+++ core/trunk/src/test/java/org/jboss/cache/invalidation/VersionInconsistencyTest.java 2008-01-02 11:28:08 UTC (rev 4934)
@@ -1,7 +1,7 @@
package org.jboss.cache.invalidation;
import org.jboss.cache.Cache;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
@@ -91,7 +91,7 @@
assert val.equals("v-newer");
// test node versions
- NodeSPI n = ((CacheImpl) cache1).peek(node, true, true);
+ NodeSPI n = ((CacheSPI) cache1).peek(node, true, true);
assert ((DefaultDataVersion) n.getVersion()).getRawVersion() == 1 : "Version should be 1";
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTest.java 2008-01-02 01:55:51 UTC (rev 4933)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTest.java 2008-01-02 11:28:08 UTC (rev 4934)
@@ -1,17 +1,5 @@
package org.jboss.cache.jmx;
-import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
-import static org.testng.AssertJUnit.assertSame;
-import static org.testng.AssertJUnit.assertTrue;
-import static org.testng.AssertJUnit.fail;
-
-import java.util.List;
-
-import javax.management.ObjectName;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
import org.jboss.cache.Cache;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheStatus;
@@ -26,13 +14,20 @@
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jgroups.Address;
import org.jgroups.stack.IpAddress;
+import static org.testng.AssertJUnit.*;
+import org.testng.annotations.Test;
+import javax.management.ObjectName;
+import javax.transaction.TransactionManager;
+import java.util.List;
+
/**
* Tests the JMX wrapper class around the cache.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @author Brian Stansberry
*/
+@Test(groups = "functional")
public class CacheJmxWrapperTest extends CacheJmxWrapperTestBase
{
public void testCacheMBeanBinding() throws Exception
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTestBase.java 2008-01-02 01:55:51 UTC (rev 4933)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/CacheJmxWrapperTestBase.java 2008-01-02 11:28:08 UTC (rev 4934)
@@ -22,7 +22,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @author Brian Stansberry
*/
-@Test(groups = {"functional"})
+@Test(groups = "functional")
public abstract class CacheJmxWrapperTestBase
{
public static final String CLUSTER_NAME = "CacheMBeanTest";
Modified: core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java 2008-01-02 01:55:51 UTC (rev 4933)
+++ core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java 2008-01-02 11:28:08 UTC (rev 4934)
@@ -3,7 +3,6 @@
import org.jboss.cache.Cache;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
-import org.jboss.cache.ReplicationException;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.lock.TimeoutException;
@@ -53,7 +52,7 @@
if (cache2 != null) cache2.stop();
}
- @Test(groups = {"functional"}, expectedExceptions = {ReplicationException.class})
+ @Test(groups = {"functional"}, expectedExceptions = {TimeoutException.class})
public void testSyncReplTimeout()
{
cache1.getConfiguration().setSyncReplTimeout(1); // 1ms. this is *bound* to fail.
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java 2008-01-02 01:55:51 UTC (rev 4933)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/StateTransfer200Test.java 2008-01-02 11:28:08 UTC (rev 4934)
@@ -7,7 +7,6 @@
package org.jboss.cache.statetransfer;
-import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
@@ -83,9 +82,6 @@
// Pause to give caches time to see each other
TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
- System.out.println("C1: " + ((CacheImpl) cache1).printLockInfo());
- System.out.println("C2: " + ((CacheImpl) cache2).printLockInfo());
-
// now peek into cache 2 to check that this state has been transferred into the backup subtree
Fqn test = BuddyManager.getBackupFqn(cache1.getLocalAddress(), A_B);
assertEquals("/a/b state should have integrated in backup region " + test, JOE, cache2.get(test, "name"));
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/StatusUnknownTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/StatusUnknownTest.java 2008-01-02 01:55:51 UTC (rev 4933)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/StatusUnknownTest.java 2008-01-02 11:28:08 UTC (rev 4934)
@@ -1,7 +1,7 @@
package org.jboss.cache.transaction;
import org.jboss.cache.Cache;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import static org.testng.AssertJUnit.*;
@@ -29,7 +29,7 @@
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
*/
@SuppressWarnings("unchecked")
-@Test(groups = {"functional"})
+@Test(groups = "functional")
public class StatusUnknownTest
{
private Cache cache;
@@ -56,11 +56,11 @@
Fqn<String> fqn = Fqn.fromString("/a/b/c");
cache.put(fqn, "k", "v");
- assertEquals(4, ((CacheImpl) cache).getNumberOfLocksHeld());
+ assertEquals(4, ((CacheSPI) cache).getNumberOfLocksHeld());
assertTrue(cache.getRoot().hasChild(fqn));
tm.commit();
- assertEquals(0, ((CacheImpl) cache).getNumberOfLocksHeld());
+ assertEquals(0, ((CacheSPI) cache).getNumberOfLocksHeld());
assertFalse(cache.getRoot().hasChild(fqn));
}
17 years
JBoss Cache SVN: r4933 - core/trunk/src/main/java/org/jboss/cache/util/reflect.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-01 20:55:51 -0500 (Tue, 01 Jan 2008)
New Revision: 4933
Modified:
core/trunk/src/main/java/org/jboss/cache/util/reflect/ClasspathScanner.java
Log:
Fixed classpath scanning within jar files
Modified: core/trunk/src/main/java/org/jboss/cache/util/reflect/ClasspathScanner.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/reflect/ClasspathScanner.java 2008-01-02 00:32:16 UTC (rev 4932)
+++ core/trunk/src/main/java/org/jboss/cache/util/reflect/ClasspathScanner.java 2008-01-02 01:55:51 UTC (rev 4933)
@@ -2,6 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.config.ConfigurationException;
import java.io.File;
import java.io.IOException;
@@ -70,11 +71,11 @@
}
catch (IOException ioe)
{
- log.warn("could not read entries", ioe);
+ log.fatal("could not read entries", ioe);
}
catch (ClassNotFoundException e)
{
- log.warn("Unable to load class", e);
+ log.fatal("Unable to load class", e);
}
return classes;
@@ -83,17 +84,19 @@
private URL getURLPathFromClassLoader() throws MalformedURLException
{
URL u2 = classLoader.findResource("org/jboss/cache/Version.class");
+ String u2String = u2.toString();
+ boolean isJar = u2String.startsWith("jar:") && u2String.contains(".jar!/");
+
for (URL u : classLoader.getURLs())
{
- String urlString = u.toString().replaceAll("\\/\\.\\/", "/");
- if (u2.toString().startsWith(urlString))
- {
- return new URL(urlString);
- }
+ String originalUrlString = u.toString().replaceAll("\\/\\.\\/", "/");
+ String urlString = originalUrlString;
+ if (isJar) urlString = "jar:" + urlString + "!/";
+ if (u2String.startsWith(urlString)) return new URL(originalUrlString);
}
- return null;
+ throw new ConfigurationException("Unable to find core JBoss Cache classes on classpath!");
}
17 years
JBoss Cache SVN: r4932 - core/trunk/src/main/java/org/jboss/cache/buddyreplication.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-01 19:32:16 -0500 (Tue, 01 Jan 2008)
New Revision: 4932
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
Log:
Ensure the view changes queue is cleared before starting view change listener thread
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-01-02 00:31:47 UTC (rev 4931)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-01-02 00:32:16 UTC (rev 4932)
@@ -236,6 +236,7 @@
}
}
+ // For now, this is initialised MANUALLY from CacheImpl.internalStart()
public void init() throws CacheException
{
log.debug("Starting BuddyManager");
@@ -260,6 +261,7 @@
// assign buddies based on what we know now
reassignBuddies(cache.getMembers());
+ queue.clear();
asyncViewChangeHandler.start();
}
@@ -1048,6 +1050,7 @@
public void run()
{
+ log.trace("Started");
// don't start this thread until the Buddy Manager has initialised as it cocks things up.
try
{
@@ -1082,6 +1085,7 @@
MembershipChange members = queue.take();
if (members == STOP_NOTIFIER)
{
+ log.trace("Caught stop notifier, time to go home.");
// time to go home
isRunning = false;
return;
@@ -1108,6 +1112,7 @@
log.trace("Not received necessary buddy pool info for all new members yet; waiting on poolInfoNotifierLock.");
while (!receivedBuddyInfo)
poolInfoNotifierLock.wait();
+ log.trace("Notified!!");
receivedBuddyInfo = false;
}
}
17 years
JBoss Cache SVN: r4931 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-01 19:31:47 -0500 (Tue, 01 Jan 2008)
New Revision: 4931
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
Log:
added check to ensure buddy manager is enabled before attempting to initialise
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-01 22:58:36 UTC (rev 4930)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-02 00:31:47 UTC (rev 4931)
@@ -730,7 +730,7 @@
{
log.info("CacheImpl local address is " + channel.getLocalAddress());
}
- if (buddyManager != null)
+ if (buddyManager != null && buddyManager.isEnabled())
{
//buddyManager.init(this);
buddyManager.init();
17 years
JBoss Cache SVN: r4930 - core/trunk/src/test/java/org/jboss/cache/api.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-01 17:58:36 -0500 (Tue, 01 Jan 2008)
New Revision: 4930
Modified:
core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
Log:
Fixed broken test
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-01-01 22:48:04 UTC (rev 4929)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeReplicatedMoveTest.java 2008-01-01 22:58:36 UTC (rev 4930)
@@ -7,7 +7,6 @@
package org.jboss.cache.api;
import org.jboss.cache.Cache;
-import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -132,7 +131,7 @@
private void assertInvalidated(Cache cache, Fqn fqn, String msg)
{
assert cache.getRoot().getChild(fqn) == null : msg;
- NodeSPI n = ((CacheImpl) cache).peek(fqn, true, true);
+ NodeSPI n = ((CacheSPI) cache).peek(fqn, true, true);
assert n != null : msg;
assert !n.isValid() : msg;
}
17 years
JBoss Cache SVN: r4929 - in core/trunk/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-01-01 17:48:04 -0500 (Tue, 01 Jan 2008)
New Revision: 4929
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java
core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java
Log:
Fixed PLI issue with not differentiating between a 1 phase prepare and a 2 phase prepare.
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-01-01 22:27:17 UTC (rev 4928)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-01-01 22:48:04 UTC (rev 4929)
@@ -131,6 +131,9 @@
protected Object handlePrepareMethod(InvocationContext ctx, GlobalTransaction gtx, List modification, Address coordinator, boolean onePhaseCommit) throws Throwable
{
+ // 2-phase commit prepares are no-ops here.
+ if (!onePhaseCommit) return nextInterceptor(ctx);
+
// commit propagated up from the tx interceptor
commit(ctx.getGlobalTransaction());
Object retVal = nextInterceptor(ctx);
@@ -140,16 +143,13 @@
protected Object handleOptimisticPrepareMethod(InvocationContext ctx, GlobalTransaction gtx, List modifications, Map data, Address address, boolean onePhaseCommit) throws Throwable
{
- return handlePrepareMethod(ctx, gtx, modifications, address, onePhaseCommit);
+ throw new UnsupportedOperationException("Optimistic prepare methods should never be received by the pessimistic lock interceptor!!");
}
protected Object handleCommitMethod(InvocationContext ctx, GlobalTransaction globalTransaction) throws Throwable
{
commit(globalTransaction);
- if (log.isTraceEnabled())
- {
- log.trace("bypassed locking as method commit() doesn't require locking");
- }
+ log.trace("bypassed locking as method commit() doesn't require locking");
Object retVal = nextInterceptor(ctx);
tx_table.cleanup(globalTransaction);
return retVal;
Modified: core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java 2008-01-01 22:27:17 UTC (rev 4928)
+++ core/trunk/src/test/java/org/jboss/cache/lock/AcquireAllTest.java 2008-01-01 22:48:04 UTC (rev 4929)
@@ -1,10 +1,12 @@
package org.jboss.cache.lock;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.misc.TestingUtil;
+import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
@@ -16,7 +18,7 @@
@Test(groups = {"functional"})
public class AcquireAllTest
{
- CacheImpl cache = null, cache2;
+ CacheSPI<Object, Object> cache = null, cache2;
final Fqn FQN = Fqn.fromString("/myNode");
final String KEY = "key";
final String VALUE = "value";
@@ -24,12 +26,7 @@
@AfterMethod(alwaysRun = true)
public void tearDown() throws Exception
{
- if (cache != null)
- {
- cache.stop();
- cache.destroy();
- cache = null;
- }
+ TestingUtil.killCaches(cache, cache2);
}
@@ -82,12 +79,12 @@
}
- private CacheImpl createCache(Configuration.CacheMode mode, IsolationLevel level)
+ private CacheSPI<Object, Object> createCache(Configuration.CacheMode mode, IsolationLevel level)
{
- CacheImpl c = (CacheImpl) new DefaultCacheFactory().createCache(false);
+ CacheSPI<Object, Object> c = (CacheSPI<Object, Object>) new DefaultCacheFactory<Object, Object>().createCache(false);
c.getConfiguration().setCacheMode(mode);
c.getConfiguration().setIsolationLevel(level);
- c.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ c.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
c.create();
c.start();
return c;
Modified: core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java 2008-01-01 22:27:17 UTC (rev 4928)
+++ core/trunk/src/test/java/org/jboss/cache/lock/BreakDeadMemberLocksTest.java 2008-01-01 22:48:04 UTC (rev 4929)
@@ -22,7 +22,6 @@
package org.jboss.cache.lock;
-import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -176,20 +175,7 @@
protected void stopCache(String id)
{
- CacheImpl cache = (CacheImpl) caches.get(id);
- if (cache != null)
- {
- try
- {
- cache.stop();
- cache.destroy();
- }
- catch (Exception e)
- {
- System.out.println("Exception stopping cache " + e.getMessage());
- e.printStackTrace(System.out);
- }
- }
+ TestingUtil.killCaches(caches.get(id));
}
class HangSync implements Synchronization
17 years
JBoss Cache SVN: r4928 - in core/trunk/src: test/java/org/jboss/cache/transaction/isolationlevels and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-01 17:27:17 -0500 (Tue, 01 Jan 2008)
New Revision: 4928
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/test/java/org/jboss/cache/transaction/isolationlevels/NoneTest.java
Log:
Fixed PLI not creating nonexistent nodes when isolation level is none
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-12-30 21:45:04 UTC (rev 4927)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-01-01 22:27:17 UTC (rev 4928)
@@ -91,7 +91,7 @@
private Object handlePutMethod(InvocationContext ctx, Fqn fqn)
throws Throwable
{
- if (ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isSuppressLocking())
+ if ((ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isSuppressLocking()) || configuration.getIsolationLevel() == IsolationLevel.NONE)
{
log.trace("Suppressing locking");
log.trace("Creating nodes if necessary");
@@ -310,10 +310,8 @@
boolean acquireLockOnParent, boolean reverseRemoveCheck)
throws InterruptedException
{
- if (fqn == null || configuration.getIsolationLevel() == IsolationLevel.NONE)
- {
- return false;
- }
+ if (fqn == null) return false;
+
boolean created;
long timeout = zeroLockTimeout ? 0 : ctx.getContextLockAcquisitionTimeout(lock_acquisition_timeout);
// make sure we can bail out of this loop
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/isolationlevels/NoneTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/isolationlevels/NoneTest.java 2007-12-30 21:45:04 UTC (rev 4927)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/isolationlevels/NoneTest.java 2008-01-01 22:27:17 UTC (rev 4928)
@@ -1,11 +1,13 @@
package org.jboss.cache.transaction.isolationlevels;
import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.Test;
/**
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 2.0.0
*/
+@Test(groups = {"functional", "transaction"})
public class NoneTest extends IsolationLevelTestBase
{
public NoneTest()
17 years