[jboss-cvs] JBossAS SVN: r80291 - projects/ejb3/dev/Branch_JBoss_Cache_3/core/src/main/java/org/jboss/ejb3/cache/tree.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 30 21:37:34 EDT 2008
Author: manik.surtani at jboss.com
Date: 2008-10-30 21:37:34 -0400 (Thu, 30 Oct 2008)
New Revision: 80291
Modified:
projects/ejb3/dev/Branch_JBoss_Cache_3/core/src/main/java/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
Log:
eviction default values
Modified: projects/ejb3/dev/Branch_JBoss_Cache_3/core/src/main/java/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
===================================================================
--- projects/ejb3/dev/Branch_JBoss_Cache_3/core/src/main/java/org/jboss/ejb3/cache/tree/StatefulTreeCache.java 2008-10-30 22:17:19 UTC (rev 80290)
+++ projects/ejb3/dev/Branch_JBoss_Cache_3/core/src/main/java/org/jboss/ejb3/cache/tree/StatefulTreeCache.java 2008-10-31 01:37:34 UTC (rev 80291)
@@ -29,9 +29,7 @@
import org.jboss.cache.Node;
import org.jboss.cache.Region;
import org.jboss.cache.RegionNotEmptyException;
-import org.jboss.cache.config.EvictionPolicyConfig;
import org.jboss.cache.config.EvictionRegionConfig;
-import org.jboss.cache.eviction.LRUConfiguration;
import org.jboss.cache.notifications.annotation.CacheListener;
import org.jboss.cache.notifications.annotation.NodeActivated;
import org.jboss.cache.notifications.annotation.NodePassivated;
@@ -55,6 +53,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
/**
* Clustered SFSB cache that uses JBoss Cache to cache and replicate
@@ -304,8 +303,13 @@
{
AbortableLRUAlgorithmConfiguration algoCfg = new AbortableLRUAlgorithmConfiguration();
EvictionRegionConfig erc = new EvictionRegionConfig(fqn, algoCfg);
- algoCfg.setTimeToLiveSeconds((int) cacheConfig.idleTimeoutSeconds());
+ algoCfg.setTimeToLive((int) cacheConfig.idleTimeoutSeconds(), TimeUnit.SECONDS);
algoCfg.setMaxNodes(cacheConfig.maxSize());
+
+ // JBC 2.x used '0' to denote no limit; 3.x uses '-1' since '0' now denotes '0'.
+ if (algoCfg.getTimeToLive() == 0) algoCfg.setTimeToLive(-1);
+ if (algoCfg.getMaxNodes() == 0) algoCfg.setMaxNodes(-1);
+
return erc;
}
More information about the jboss-cvs-commits
mailing list