Author: manik.surtani(a)jboss.com
Date: 2008-02-05 14:08:13 -0500 (Tue, 05 Feb 2008)
New Revision: 5298
Modified:
core/trunk/src/main/java/org/jboss/cache/RegionManager.java
core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java
Log:
JBCACHE-1281 - deferred validation till start time
Modified: core/trunk/src/main/java/org/jboss/cache/RegionManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionManager.java 2008-02-05 19:07:26 UTC
(rev 5297)
+++ core/trunk/src/main/java/org/jboss/cache/RegionManager.java 2008-02-05 19:08:13 UTC
(rev 5298)
@@ -8,6 +8,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.config.EvictionConfig;
+import org.jboss.cache.config.EvictionPolicyConfig;
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.eviction.EvictionTimerTask;
import org.jboss.cache.eviction.RegionNameConflictException;
@@ -72,6 +73,13 @@
if (configuration.getEvictionConfig() != null
&& configuration.getEvictionConfig().isValidConfig())
{
+ // validate individual region configs now
+ for (EvictionRegionConfig erc :
configuration.getEvictionConfig().getEvictionRegionConfigs())
+ {
+ EvictionPolicyConfig epc = erc.getEvictionPolicyConfig();
+ if (epc != null) epc.validate();
+ }
+
setEvictionConfig(configuration.getEvictionConfig());
setUsingEvictions(true);
}
Modified: core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java 2008-02-05
19:07:26 UTC (rev 5297)
+++ core/trunk/src/main/java/org/jboss/cache/config/EvictionRegionConfig.java 2008-02-05
19:08:13 UTC (rev 5298)
@@ -69,9 +69,9 @@
{
addChildConfig((ConfigurationComponent) config);
}
- if (config != null)
- config.validate();
+ // don't validate here - instead validate when we start things up. See
RegionManager.start()
+
this.evictionPolicyConfig = config;
}