[jboss-cvs] JBossCache/src/org/jboss/cache/eviction ...
Manik Surtani
msurtani at jboss.com
Tue Jul 18 06:50:45 EDT 2006
User: msurtani
Date: 06/07/18 06:50:45
Modified: src/org/jboss/cache/eviction
ElementSizeConfiguration.java
EvictionConfiguration.java FIFOConfiguration.java
LFUConfiguration.java LRUConfiguration.java
MRUConfiguration.java RegionManager.java
Log:
Checked in new Habanero interfaces
Updated codebase to deal with new interfaces
Revision Changes Path
1.2 +5 -5 JBossCache/src/org/jboss/cache/eviction/ElementSizeConfiguration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ElementSizeConfiguration.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/ElementSizeConfiguration.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ElementSizeConfiguration.java 7 May 2006 03:34:39 -0000 1.1
+++ ElementSizeConfiguration.java 18 Jul 2006 10:50:45 -0000 1.2
@@ -8,13 +8,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.ConfigureException;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Element;
/**
* @author Daniel Huang
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ElementSizeConfiguration implements EvictionConfiguration
{
@@ -55,12 +55,12 @@
* @param element DOM XML containing Element Size Policy configuration.
* @throws ConfigureException
*/
- public void parseXMLConfig(Element element) throws ConfigureException
+ public void parseXMLConfig(Element element) throws ConfigurationException
{
String name = element.getAttribute(EvictionConfiguration.NAME);
if (name == null || name.equals(""))
{
- throw new ConfigureException("Name is required for the eviction region");
+ throw new ConfigurationException("Name is required for the eviction region");
}
String maxNodes = XmlHelper.getAttr(element, EvictionConfiguration.MAX_NODES,
@@ -78,7 +78,7 @@
EvictionConfiguration.ATTR, EvictionConfiguration.NAME);
if (maxElementsPerNode == null)
{
- throw new ConfigureException("ElementSizeConfiguration.parseXMLConfig(): Null maxElementsPerNode element");
+ throw new ConfigurationException("ElementSizeConfiguration.parseXMLConfig(): Null maxElementsPerNode element");
}
setMaxElementsPerNode(Integer.parseInt(maxElementsPerNode));
1.5 +3 -3 JBossCache/src/org/jboss/cache/eviction/EvictionConfiguration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EvictionConfiguration.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/EvictionConfiguration.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- EvictionConfiguration.java 7 May 2006 03:34:39 -0000 1.4
+++ EvictionConfiguration.java 18 Jul 2006 10:50:45 -0000 1.5
@@ -6,7 +6,7 @@
*/
package org.jboss.cache.eviction;
-import org.jboss.cache.ConfigureException;
+import org.jboss.cache.config.ConfigurationException;
import org.w3c.dom.Element;
/**
@@ -17,7 +17,7 @@
* It also encapsulates XML parsing and configuration of a given type of EvictionPolicy.
*
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public interface EvictionConfiguration
{
@@ -53,5 +53,5 @@
* @param element DOM element for the region. <region name="abc"></region>
* @throws ConfigureException
*/
- public void parseXMLConfig(Element element) throws ConfigureException;
+ public void parseXMLConfig(Element element) throws ConfigurationException;
}
1.4 +5 -5 JBossCache/src/org/jboss/cache/eviction/FIFOConfiguration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FIFOConfiguration.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/FIFOConfiguration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- FIFOConfiguration.java 7 May 2006 03:34:39 -0000 1.3
+++ FIFOConfiguration.java 18 Jul 2006 10:50:45 -0000 1.4
@@ -8,15 +8,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.ConfigureException;
import org.jboss.cache.xml.XmlHelper;
+import org.jboss.cache.config.ConfigurationException;
import org.w3c.dom.Element;
/**
* FIFO Configuration for FIFO Eviction Policy.
*
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class FIFOConfiguration implements EvictionConfiguration
{
@@ -52,13 +52,13 @@
* @param element XML DOM element containing the proper FIFO configuration XML.
* @throws ConfigureException
*/
- public void parseXMLConfig(Element element) throws ConfigureException
+ public void parseXMLConfig(Element element) throws ConfigurationException
{
String name = element.getAttribute(NAME);
if (name == null || name.equals(""))
{
- throw new ConfigureException("Name is required for the eviction region");
+ throw new ConfigurationException("Name is required for the eviction region");
}
String maxNodes = XmlHelper.getAttr(element,
@@ -70,7 +70,7 @@
}
else
{
- throw new ConfigureException("FIFOConfiguration requires maxNodes attribute");
+ throw new ConfigurationException("FIFOConfiguration requires maxNodes attribute");
}
if (log.isDebugEnabled())
1.4 +4 -4 JBossCache/src/org/jboss/cache/eviction/LFUConfiguration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LFUConfiguration.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/LFUConfiguration.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- LFUConfiguration.java 7 May 2006 03:34:39 -0000 1.3
+++ LFUConfiguration.java 18 Jul 2006 10:50:45 -0000 1.4
@@ -8,7 +8,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.ConfigureException;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Element;
@@ -16,7 +16,7 @@
* LFU Configuration implementation for LFU Policy.
*
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class LFUConfiguration implements EvictionConfiguration
{
@@ -58,12 +58,12 @@
* @param element XML DOM object containing LFU configuration.
* @throws ConfigureException
*/
- public void parseXMLConfig(Element element) throws ConfigureException
+ public void parseXMLConfig(Element element) throws ConfigurationException
{
String name = element.getAttribute(EvictionConfiguration.NAME);
if (name == null || name.equals(""))
{
- throw new ConfigureException("Name is required for the eviction region");
+ throw new ConfigurationException("Name is required for the eviction region");
}
String maxNodes = XmlHelper.getAttr(element,
1.2 +5 -5 JBossCache/src/org/jboss/cache/eviction/LRUConfiguration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LRUConfiguration.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/LRUConfiguration.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- LRUConfiguration.java 5 Dec 2005 03:17:13 -0000 1.1
+++ LRUConfiguration.java 18 Jul 2006 10:50:45 -0000 1.2
@@ -8,7 +8,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.ConfigureException;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Element;
@@ -16,7 +16,7 @@
* LRU Configuration implementation.
*
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class LRUConfiguration implements EvictionConfiguration
{
@@ -70,12 +70,12 @@
* @param element DOM XML containing LFU Policy configuration.
* @throws ConfigureException
*/
- public void parseXMLConfig(Element element) throws ConfigureException
+ public void parseXMLConfig(Element element) throws ConfigurationException
{
String name = element.getAttribute(EvictionConfiguration.NAME);
if (name == null || name.equals(""))
{
- throw new ConfigureException("Name is required for the eviction region");
+ throw new ConfigurationException("Name is required for the eviction region");
}
String maxNodes = XmlHelper.getAttr(element, EvictionConfiguration.MAX_NODES,
@@ -95,7 +95,7 @@
timeToLive = XmlHelper.getAttr(element, EvictionConfiguration.TIME_TO_LIVE_SECONDS,
EvictionConfiguration.ATTR, EvictionConfiguration.NAME);
if (timeToLive == null)
- throw new ConfigureException("LRUConfiguration.parseXMLConfig(): Null timeToLiveSeconds element");
+ throw new ConfigurationException("LRUConfiguration.parseXMLConfig(): Null timeToLiveSeconds element");
}
setTimeToLiveSeconds(Integer.parseInt(timeToLive));
1.3 +5 -6 JBossCache/src/org/jboss/cache/eviction/MRUConfiguration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MRUConfiguration.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/MRUConfiguration.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- MRUConfiguration.java 15 Apr 2006 00:21:13 -0000 1.2
+++ MRUConfiguration.java 18 Jul 2006 10:50:45 -0000 1.3
@@ -8,7 +8,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.ConfigureException;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Element;
@@ -16,7 +16,7 @@
* MRUConfiguration EvictionConfiguration implementation for MRUPolicy.
*
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class MRUConfiguration implements EvictionConfiguration
{
@@ -48,14 +48,13 @@
* </region>
*
* @param element The MRUPolicy configuration XML DOM element.
- * @throws ConfigureException
*/
- public void parseXMLConfig(Element element) throws ConfigureException
+ public void parseXMLConfig(Element element) throws ConfigurationException
{
String name = element.getAttribute(EvictionConfiguration.NAME);
if (name == null || name.equals(""))
{
- throw new ConfigureException("Name is required for the eviction region");
+ throw new ConfigurationException("Name is required for the eviction region");
}
String maxNodes = XmlHelper.getAttr(element, EvictionConfiguration.MAX_NODES,
@@ -66,7 +65,7 @@
}
else
{
- throw new ConfigureException("Cannot have 0 for maxNodes on a MRUAlgorithm");
+ throw new ConfigurationException("Cannot have 0 for maxNodes on a MRUAlgorithm");
}
if (log.isDebugEnabled())
1.17 +8 -36 JBossCache/src/org/jboss/cache/eviction/RegionManager.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RegionManager.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/RegionManager.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- RegionManager.java 8 Jun 2006 17:37:39 -0000 1.16
+++ RegionManager.java 18 Jul 2006 10:50:45 -0000 1.17
@@ -9,13 +9,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.ConfigureException;
+import org.jboss.cache.AbstractCacheListener;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.TreeCache;
-import org.jboss.cache.TreeCacheListener;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.optimistic.FqnComparator;
import org.jboss.cache.xml.XmlHelper;
-import org.jgroups.View;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -34,7 +34,7 @@
*
* @author Ben Wang 02-2004
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: RegionManager.java,v 1.16 2006/06/08 17:37:39 dhuang Exp $
+ * @version $Id: RegionManager.java,v 1.17 2006/07/18 10:50:45 msurtani Exp $
*/
public class RegionManager
{
@@ -379,7 +379,7 @@
configuration.parseXMLConfig(regionConfig);
return configuration;
}
- catch (ConfigureException e)
+ catch (ConfigurationException e)
{
throw new RuntimeException("Error configuring Eviction Policy", e);
}
@@ -455,33 +455,9 @@
return super.toString() + " regions=" + regionMap_;
}
- class EvictionTreeCacheListener implements TreeCacheListener
+ class EvictionTreeCacheListener extends AbstractCacheListener
{
- public void nodeCreated(Fqn fqn)
- {
- }
-
- public void nodeRemoved(Fqn fqn)
- {
- }
-
- public void nodeLoaded(Fqn fqn)
- {
- }
-
- public void nodeEvicted(Fqn fqn)
- {
- }
-
- public void nodeModified(Fqn fqn)
- {
- }
-
- public void nodeVisited(Fqn fqn)
- {
- }
-
- public void cacheStarted(TreeCache cache)
+ public void cacheStarted(CacheSPI cache)
{
log_.info("Starting eviction timer");
evictionThread_ = new Timer();
@@ -489,17 +465,13 @@
RegionManager.this.getEvictionThreadWakeupIntervalSeconds() * 1000);
}
- public void cacheStopped(TreeCache cache)
+ public void cacheStopped(CacheSPI cache)
{
log_.info("Stopping eviction timer ... ");
if (evictionThread_ != null)
evictionThread_.cancel();
evictionThread_ = null;
}
-
- public void viewChange(View new_view) // might be MergeView after merging
- {
- }
}
static class RegionComparator implements Comparator
More information about the jboss-cvs-commits
mailing list