JBoss Cache SVN: r5129 - in pojo/branches/2.1: src/test/java/org/jboss/cache/pojo and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2008-01-14 19:19:02 -0500 (Mon, 14 Jan 2008)
New Revision: 5129
Removed:
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java
Modified:
pojo/branches/2.1/pom.xml
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
Log:
Prepare for a CR3 release
Modified: pojo/branches/2.1/pom.xml
===================================================================
--- pojo/branches/2.1/pom.xml 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/pom.xml 2008-01-15 00:19:02 UTC (rev 5129)
@@ -4,9 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-pojo-version>2.1.0.CR2</jbosscache-pojo-version>
- <jbosscache-core-version>2.1.0.CR2</jbosscache-core-version>
- <jboss.aop.version>2.0.0.beta1</jboss.aop.version>
+ <jbosscache-pojo-version>2.1.0.CR3</jbosscache-pojo-version>
+ <jbosscache-core-version>2.1.0.CR3</jbosscache-core-version>
+ <jboss.aop.version>2.0.0.CR3</jboss.aop.version>
</properties>
<parent>
<groupId>org.jboss.cache</groupId>
@@ -105,11 +105,6 @@
<!-- HACK: AOP project and plugin has broken deps -->
<dependencies>
<dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>2.0.0.Beta4</version>
- </dependency>
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
@@ -119,7 +114,12 @@
<artifactId>jbosscache-core</artifactId>
<version>${jbosscache-core-version}</version>
</dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <version>${jboss.aop.version}</version>
+ </dependency>
+ </dependencies>
<executions>
<execution>
<id>aopc</id>
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalConcurrentTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -18,6 +18,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.lock.UpgradeException;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/LocalTxTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/NewReplicatedTxTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -26,6 +26,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedCircularGraphTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -19,6 +19,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Link;
import org.jboss.cache.pojo.test.NodeManager;
import org.jboss.cache.pojo.test.Person;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedObjectGraphTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -7,6 +7,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.testng.annotations.AfterMethod;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/ReplicatedTxTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -19,6 +19,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
import org.testng.annotations.AfterMethod;
Deleted: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/TestingUtil.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.cache.pojo;
-
-import org.jboss.cache.CacheImpl;
-import org.jgroups.Address;
-
-import java.util.List;
-
-/**
- * Utilities for unit testing JBossCache.
- *
- * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
- * @version $Revision$
- */
-public class TestingUtil
-{
-
- /**
- * @param caches caches which must all have consistent views
- * @param timeout max number of ms to loop
- * @throws RuntimeException if <code>timeout</code> ms have elapse without
- * all caches having the same number of members.
- */
- public static void blockUntilViewsReceived(PojoCache[] caches, long timeout)
- {
- long failTime = System.currentTimeMillis() + timeout;
-
- while (System.currentTimeMillis() < failTime)
- {
- org.jboss.cache.pojo.TestingUtil.sleepThread(100);
- if (org.jboss.cache.pojo.TestingUtil.areCacheViewsComplete(caches))
- return;
- }
-
- throw new RuntimeException("timed out before caches had complete views");
- }
-
- /**
- */
- public static void blockUntilViewReceived(PojoCache cache, int groupSize, long timeout)
- {
- long failTime = System.currentTimeMillis() + timeout;
-
- CacheImpl<Object, Object> tcache = (CacheImpl<Object, Object>) cache.getCache();
- while (System.currentTimeMillis() < failTime)
- {
- org.jboss.cache.pojo.TestingUtil.sleepThread(100);
- if (org.jboss.cache.pojo.TestingUtil.isCacheViewComplete(tcache, groupSize))
- return;
- }
-
- throw new RuntimeException("timed out before caches had complete views");
- }
-
- /**
- * Checks each cache to see if the number of elements in the array
- * returned by {@link org.jboss.cache.CacheImpl#getMembers()} matches the size of
- * the <code>caches</code> parameter.
- *
- * @param caches caches that should form a View
- * @return <code>true</code> if all caches have
- * <code>caches.length</code> members; false otherwise
- * @throws IllegalStateException if any of the caches have MORE view
- * members than caches.length
- */
- public static boolean areCacheViewsComplete(PojoCache[] caches)
- {
- int memberCount = caches.length;
-
- for (int i = 0; i < memberCount; i++)
- {
- CacheImpl<Object, Object> cache = (CacheImpl<Object, Object>) caches[i].getCache();
- return org.jboss.cache.pojo.TestingUtil.isCacheViewComplete(cache, memberCount);
- }
-
- return true;
- }
-
- /**
- * FIXME Comment this
- *
- * @param cache
- * @param memberCount
- */
- public static boolean isCacheViewComplete(CacheImpl<Object, Object> cache, int memberCount)
- {
- List<Address> members = cache.getMembers();
- if (members == null || memberCount > members.size())
- {
- return false;
- }
- else if (memberCount < members.size())
- {
- // This is an exceptional condition
- StringBuffer sb = new StringBuffer("Cache at address ");
- sb.append(cache.getLocalAddress());
- sb.append(" had ");
- sb.append(members.size());
- sb.append(" members; expecting ");
- sb.append(memberCount);
- sb.append(". Members were (");
- for (int j = 0; j < members.size(); j++)
- {
- if (j > 0)
- sb.append(", ");
- sb.append(members.get(j));
- }
- sb.append(')');
-
- throw new IllegalStateException(sb.toString());
- }
-
- return true;
- }
-
-
- /**
- * Puts the current thread to sleep for the desired number of ms, suppressing
- * any exceptions.
- *
- * @param sleeptime number of ms to sleep
- */
- public static void sleepThread(long sleeptime)
- {
- try
- {
- Thread.sleep(sleeptime);
- }
- catch (InterruptedException ie)
- {
- }
- }
-}
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/jmx/NotificationTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -2,7 +2,7 @@
import javax.management.ObjectName;
-import org.jboss.cache.CacheImpl;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
@@ -26,7 +26,7 @@
protected Object createCacheAndJmxWrapper() throws Exception
{
pojoCache = createCache(CLUSTER_NAME);
- cache = (CacheImpl<Object, Object>) pojoCache.getCache();
+ cache = (CacheSPI<Object, Object>)pojoCache.getCache();
return new PojoCacheJmxWrapper(pojoCache);
}
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/memory/ReplicatedTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -19,9 +19,9 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.pojo.test.SerializedAddress;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/optimistic/AbstractOptimisticTestCase.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -370,7 +370,7 @@
System.out.println("*** " + oa.length);
System.arraycopy(oa, 0, na, 0, oa.length);
na[oa.length] = new DefaultDataVersion();
- newList.add(MethodCallFactory.create(MethodDeclarations.getVersionedMethod(c.getMethodId()), na));
+ newList.add(MethodCallFactory.create(c.getMethodId(), na));
}
return newList;
}
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalConcurrentTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -17,9 +17,9 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.lock.UpgradeException;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.TestingUtil;
import org.jboss.cache.pojo.test.Address;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/region/LocalTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -107,7 +107,7 @@
Fqn<String> fqn = new Fqn<String>(Fqn.fromString(REGION), InternalConstant.JBOSS_INTERNAL);
assertTrue("Internal region node should exist ",
cache_.getCache().getRoot().hasChild(fqn));
- System.out.println("Cache content: " +((org.jboss.cache.CacheImpl<Object, Object>)cache_.getCache()).printDetails());
+ //System.out.println("Cache content: " +((org.jboss.cache.CacheImpl<Object, Object>)cache_.getCache()).printDetails());
}
public void testModification() throws Exception
@@ -123,8 +123,8 @@
createPerson("person/test3", "Joe", 32);
cache_.detach("person/test3");
- String str = ((CacheImpl<Object, Object>) cache_.getCache()).printDetails();
- System.out.println("**** Details ***/n" + str);
+ //String str = ((CacheImpl<Object, Object>) cache_.getCache()).printDetails();
+ //System.out.println("**** Details ***/n" + str);
Fqn<String> fqn = new Fqn<String>(Fqn.fromString(REGION), InternalConstant.JBOSS_INTERNAL);
Node<Object, Object> n = cache_.getCache().getRoot().getChild(fqn);
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/rollback/ReplicatedTxTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -26,9 +26,9 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
-import org.jboss.cache.pojo.TestingUtil;
import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.transaction.DummyTransactionManager;
import org.testng.annotations.AfterMethod;
Modified: pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java
===================================================================
--- pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java 2008-01-14 22:50:46 UTC (rev 5128)
+++ pojo/branches/2.1/src/test/java/org/jboss/cache/pojo/statetransfer/ReplicatedTest.java 2008-01-15 00:19:02 UTC (rev 5129)
@@ -79,13 +79,13 @@
cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
Person ben = createPerson("/person/test1", "Ben Wang", 40);
- System.out.println("\n*** I ***");
- System.out.println(((CacheImpl<Object, Object>) cache.getCache()).printDetails());
+ //System.out.println("\n*** I ***");
+ //System.out.println(((CacheImpl<Object, Object>) cache.getCache()).printDetails());
cache1 = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), toStart);
cache1.start();
- System.out.println("\n*** II ***");
- System.out.println(((CacheImpl<Object, Object>) cache1.getCache()).printDetails());
+ //System.out.println("\n*** II ***");
+ //System.out.println(((CacheImpl<Object, Object>) cache1.getCache()).printDetails());
log.info("testSimple() ....");
assertEquals("Ben Wang", ben.getName());
16 years, 12 months
JBoss Cache SVN: r5128 - core/trunk/src/main/java/org/jboss/cache/jmx.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-01-14 17:50:46 -0500 (Mon, 14 Jan 2008)
New Revision: 5128
Modified:
core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
Log:
Avoid NPEs in destroy()
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2008-01-14 21:46:01 UTC (rev 5127)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2008-01-14 22:50:46 UTC (rev 5128)
@@ -680,7 +680,8 @@
// in JMX, even if we didn't register them in create
unregisterInterceptors();
- cache.destroy();
+ if (cache != null)
+ cache.destroy();
}
finally
{
16 years, 12 months
JBoss Cache SVN: r5127 - pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-01-14 16:46:01 -0500 (Mon, 14 Jan 2008)
New Revision: 5127
Modified:
pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
Log:
Avoid NPEs in destroy()
Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-01-14 21:43:41 UTC (rev 5126)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-01-14 21:46:01 UTC (rev 5127)
@@ -251,13 +251,15 @@
{
cacheStatus = CacheStatus.DESTROYING;
- pojoCache.destroy();
+ if (pojoCache != null)
+ pojoCache.destroy();
// The cache is destroyed, so we shouldn't leave it registered
// in JMX even if we didn't register it in create()
unregisterPlainCache();
- plainCacheWrapper.destroy();
+ if (plainCacheWrapper != null)
+ plainCacheWrapper.destroy();
}
finally
{
16 years, 12 months
JBoss Cache SVN: r5126 - pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2008-01-14 16:43:41 -0500 (Mon, 14 Jan 2008)
New Revision: 5126
Modified:
pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
Log:
Avoid NPE if asked to send a notification before plainCacheWrapper is assigned
Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-01-14 16:02:58 UTC (rev 5125)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-01-14 21:43:41 UTC (rev 5126)
@@ -934,17 +934,20 @@
*/
private void sendStateChangeNotification(int oldState, int newState, String msg, Throwable t)
{
- long now = System.currentTimeMillis();
-
- AttributeChangeNotification stateChangeNotification = new AttributeChangeNotification(
- this,
- plainCacheWrapper.getNextNotificationSequenceNumber(), now, msg,
- "State", "java.lang.Integer",
- new Integer(oldState), new Integer(newState)
- );
- stateChangeNotification.setUserData(t);
-
- plainCacheWrapper.sendNotification(stateChangeNotification);
+ if (plainCacheWrapper != null)
+ {
+ long now = System.currentTimeMillis();
+
+ AttributeChangeNotification stateChangeNotification = new AttributeChangeNotification(
+ this,
+ plainCacheWrapper.getNextNotificationSequenceNumber(), now, msg,
+ "State", "java.lang.Integer",
+ new Integer(oldState), new Integer(newState)
+ );
+ stateChangeNotification.setUserData(t);
+
+ plainCacheWrapper.sendNotification(stateChangeNotification);
+ }
}
/**
16 years, 12 months
JBoss Cache SVN: r5125 - in core/tags/2.1.0.CR3: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-14 11:02:58 -0500 (Mon, 14 Jan 2008)
New Revision: 5125
Modified:
core/tags/2.1.0.CR3/pom.xml
core/tags/2.1.0.CR3/src/main/java/org/jboss/cache/Version.java
Log:
UPdated version numbers
Modified: core/tags/2.1.0.CR3/pom.xml
===================================================================
--- core/tags/2.1.0.CR3/pom.xml 2008-01-14 15:59:21 UTC (rev 5124)
+++ core/tags/2.1.0.CR3/pom.xml 2008-01-14 16:02:58 UTC (rev 5125)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>2.1.0-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>2.1.0.CR3</jbosscache-core-version>
</properties>
<parent>
<groupId>org.jboss.cache</groupId>
Modified: core/tags/2.1.0.CR3/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/2.1.0.CR3/src/main/java/org/jboss/cache/Version.java 2008-01-14 15:59:21 UTC (rev 5124)
+++ core/tags/2.1.0.CR3/src/main/java/org/jboss/cache/Version.java 2008-01-14 16:02:58 UTC (rev 5125)
@@ -11,10 +11,10 @@
@Immutable
public class Version
{
- public static final String version = "2.1.0-SNAPSHOT";
+ public static final String version = "2.1.0.CR3";
public static final String codename = "Alegrias";
public static final String cvs = "$Id: Version.java 4592 2007-10-10 16:44:36Z manik.surtani(a)jboss.com $";
- static final byte[] version_id = {'0', '2', '1', '0', 'S'};
+ static final byte[] version_id = {'0', '2', '1', '0', 'C', '3'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
16 years, 12 months
JBoss Cache SVN: r5124 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-14 10:59:21 -0500 (Mon, 14 Jan 2008)
New Revision: 5124
Added:
core/tags/2.1.0.CR3/
Log:
CR3
Copied: core/tags/2.1.0.CR3 (from rev 5123, core/trunk)
16 years, 12 months
JBoss Cache SVN: r5123 - in core/trunk/src: test/java/org/jboss/cache/marshall and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-14 10:34:07 -0500 (Mon, 14 Jan 2008)
New Revision: 5123
Modified:
core/trunk/src/main/java/org/jboss/cache/RegionManager.java
core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
core/trunk/src/test/java/org/jboss/cache/marshall/RegionManagerTest.java
Log:
Fixed default region activation issues
Modified: core/trunk/src/main/java/org/jboss/cache/RegionManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionManager.java 2008-01-14 14:53:44 UTC (rev 5122)
+++ core/trunk/src/main/java/org/jboss/cache/RegionManager.java 2008-01-14 15:34:07 UTC (rev 5123)
@@ -56,20 +56,8 @@
protected final Set<Fqn> activationChangeNodes = Collections.synchronizedSet(new HashSet<Fqn>());
protected Configuration configuration;
- /**
- * Constructs a new instance not attached to a cache.
- */
- public RegionManager()
- {
- // always create a default MARSHALLING region!
- Region r = new RegionImpl(Fqn.ROOT, this);
- r.registerContextClassLoader(Thread.currentThread().getContextClassLoader() == null ? this.getClass().getClassLoader() : Thread.currentThread().getContextClassLoader());
- r.setActive(true);
- regionsRegistry.put(Fqn.ROOT, r);
- }
-
@Inject
- private void injectDependencies(CacheSPI cache, Configuration configuration)
+ void injectDependencies(CacheSPI cache, Configuration configuration)
{
this.cache = cache;
this.configuration = configuration;
@@ -92,8 +80,6 @@
}
setDefaultInactive(configuration.isInactiveOnStartup());
-
- if (defaultInactive) regionsRegistry.get(Fqn.ROOT).setActive(false);
}
@Stop
@@ -319,7 +305,6 @@
{
if (log.isTraceEnabled()) log.trace("Activating region " + fqn);
Region r = getRegion(fqn, false);
- if (r != null && r.getFqn() != null && r.getFqn().isRoot() && !fqn.isRoot() && defaultInactive) return;
if (r != null)
{
if (!defaultInactive && r.getClassLoader() == null)
@@ -363,16 +348,6 @@
{
throw new RuntimeException(e);
}
-
-// if (!fqn.isRoot())
-// {
-// // activate parent regions
-// Region parent = getRegion(fqn.getParent(), false);
-// if (parent != null && !parent.isActive())
-// {
-// activate(parent.getFqn(), suppressRegionNotEmptyException);
-// }
-// }
}
/**
@@ -722,7 +697,6 @@
if (region != null)
{
- if (region.getFqn().isRoot() && !fqn.isRoot() && !defaultInactive) return;
if (defaultInactive && region.getClassLoader() == null)
{
// This region's state will no match that of a non-existent one
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-01-14 14:53:44 UTC (rev 5122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/CacheMarshaller200Test.java 2008-01-14 15:34:07 UTC (rev 5123)
@@ -9,6 +9,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
import org.jboss.cache.RegionManager;
+import org.jboss.cache.factories.ComponentRegistry;
import org.testng.annotations.Test;
import java.io.ByteArrayInputStream;
@@ -82,11 +83,15 @@
// 3. marshall a (primitive response) - case such as a state transfer sending out boolean status
// first create a stream to unmarshall.
- RegionManager rm = new RegionManager();
+// RegionManager rm = new RegionManager();
final CacheMarshaller200 cm200 = new CacheMarshaller200();
+ c.setInactiveOnStartup(false);
c.setUseRegionBasedMarshalling(true);
- cm200.injectDependencies(new RegionManager(), c, getClass().getClassLoader());
- cm200.init();
+ ComponentRegistry cr = new ComponentRegistry(c);
+ cr.registerComponent(cm200, CacheMarshaller200.class);
+ cr.start();
+
+ RegionManager rm = cr.getComponent(RegionManager.class);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
final Fqn region = Fqn.fromString("/hello");
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/RegionManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/RegionManagerTest.java 2008-01-14 14:53:44 UTC (rev 5122)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/RegionManagerTest.java 2008-01-14 15:34:07 UTC (rev 5123)
@@ -82,7 +82,7 @@
assertFalse("Should not be expecting any more regions", expectedRegions.hasNext());
}
- public void testDefaultRegion()
+ public void testNoDefaultRegion()
{
Fqn fqn1 = Fqn.fromString("/a/b/c");
Fqn fqn2 = Fqn.fromString("/a/b/");
@@ -90,10 +90,17 @@
r.getRegion(fqn1, true);
r.getRegion(fqn2, true);
- Region region = r.getRegion("/a", false);
+ Region region = null;
+ try
+ {
+ region = r.getRegion("/a", false);
+ }
+ catch (Exception e)
+ {
+ fail("If we don't set the default region, it still should be ok!");
+ }
- assertNotNull("Default region is not null!", region);
- assert region.getFqn().equals(Fqn.ROOT) : "Should be the default region";
+ assertNull("Default region is not null!", region);
}
@@ -120,28 +127,28 @@
Region r2 = r.getRegion(fqn2, true);
Region r3 = r.getRegion(fqn3, true);
- assertEquals("Expecting 4 regions", 4, r.getAllRegions(Region.Type.ANY).size());
+ assertEquals("Expecting 3 regions", 3, r.getAllRegions(Region.Type.ANY).size());
// test that removal doesn't affect parent traversal.
assertEquals(r3, r.getRegion(fqn3, false));
r.removeRegion(Fqn.fromString(fqn3));
- assertEquals("Expecting 3 regions", 3, r.getAllRegions(Region.Type.ANY).size());
+ assertEquals("Expecting 2 regions", 2, r.getAllRegions(Region.Type.ANY).size());
// test that removal doesn't affect parent traversal.
assertEquals("Should have retrieved parent region", r2, r.getRegion(fqn3, false));
r.removeRegion(Fqn.fromString(fqn2));
- assertEquals("Expecting 2 region", 2, r.getAllRegions(Region.Type.ANY).size());
+ assertEquals("Expecting 1 region", 1, r.getAllRegions(Region.Type.ANY).size());
// test that removal doesn't affect parent traversal.
assertEquals("Should have retrieved parent region", r1, r.getRegion(fqn3, false));
r.removeRegion(Fqn.fromString(fqn1));
- assertEquals("Expecting 1 regions (default region)", 1, r.getAllRegions(Region.Type.ANY).size());
+ assertEquals("Expecting 0 regions", 0, r.getAllRegions(Region.Type.ANY).size());
}
public void testGetRegionsMethods()
@@ -153,7 +160,7 @@
@SuppressWarnings("unused")
Region r1 = r.getRegion(f1, true), r2 = r.getRegion(f2, true), r3 = r.getRegion(f3, true), r4 = r.getRegion(f4, true);
- assertEquals("5 regions should exist", 5, r.getAllRegions(Region.Type.ANY).size());
+ assertEquals("4 regions should exist", 4, r.getAllRegions(Region.Type.ANY).size());
assertEquals("None of the regions should marshalling or active", 0, r.getAllRegions(Region.Type.MARSHALLING).size());
16 years, 12 months
JBoss Cache SVN: r5122 - core/trunk/src/main/java/org/jboss/cache/invocation.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-14 09:53:44 -0500 (Mon, 14 Jan 2008)
New Revision: 5122
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
Log:
JBCACHE-1263 - addChild() adds child even if one exists, causing unnecessary replication.
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-01-14 14:30:23 UTC (rev 5121)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-01-14 14:53:44 UTC (rev 5122)
@@ -273,8 +273,13 @@
// TODO: Revisit. Is this really threadsafe? See comment in putIfAbsent() - same solution should be applied here too.
assertValid();
Fqn nf = new Fqn(getFqn(), f);
- spi.put(nf, null);
- return getChild(f);
+ Node<K, V> child = getChild(f);
+ if (child == null)
+ {
+ spi.put(nf, null);
+ child = getChild(f);
+ }
+ return child;
}
public boolean removeChild(Fqn<?> f)
16 years, 12 months
JBoss Cache SVN: r5121 - core/trunk/src/main/java/org/jboss/cache/config.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-01-14 09:30:23 -0500 (Mon, 14 Jan 2008)
New Revision: 5121
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
Log:
Lazy deserialization configuration option
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-01-14 10:42:35 UTC (rev 5120)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-01-14 14:30:23 UTC (rev 5121)
@@ -186,6 +186,7 @@
private transient RuntimeConfig runtimeConfig;
private String marshallerClass;
private ShutdownHookBehavior shutdownHookBehavior = ShutdownHookBehavior.DEFAULT;
+ private boolean useLazyDeserialization = true;
// ------------------------------------------------------------------------------------------------------------
// SETTERS - MAKE SURE ALL SETTERS PERFORM testImmutability()!!!
@@ -476,6 +477,11 @@
}
}
+ public void setUseLazyDeserialization(boolean useLazyDeserialization)
+ {
+ this.useLazyDeserialization = useLazyDeserialization;
+ }
+
// ------------------------------------------------------------------------------------------------------------
// GETTERS
// ------------------------------------------------------------------------------------------------------------
@@ -617,6 +623,11 @@
return muxStackName;
}
+ public boolean isUseLazyDeserialization()
+ {
+ return useLazyDeserialization;
+ }
+
public synchronized RuntimeConfig getRuntimeConfig()
{
if (runtimeConfig == null)
16 years, 12 months