[jboss-cvs] JBossCache/src/org/jboss/cache/factories ...
Manik Surtani
msurtani at jboss.com
Wed Jan 24 11:33:57 EST 2007
User: msurtani
Date: 07/01/24 11:33:57
Modified: src/org/jboss/cache/factories XmlConfigurationParser.java
Log:
Refactored to remove legacy EvictionPolicyClass element
Revision Changes Path
1.14 +6 -14 JBossCache/src/org/jboss/cache/factories/XmlConfigurationParser.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: XmlConfigurationParser.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/factories/XmlConfigurationParser.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- XmlConfigurationParser.java 19 Jan 2007 02:04:23 -0000 1.13
+++ XmlConfigurationParser.java 24 Jan 2007 16:33:57 -0000 1.14
@@ -75,10 +75,6 @@
ParsedAttributes attributes = extractAttributes(mbeanElement);
- // Special handling for the old separate property for
- // eviction policy -- just cache it and use with the eviction XML
- String defaultEvictionClass = attributes.stringAttribs.remove("EvictionPolicyClass");
-
// Deal with rename of the old property that controlled MBean registration
String keepStats = attributes.stringAttribs.remove("UseMbean");
if (keepStats != null && attributes.stringAttribs.get("ExposeManagementStatistics") == null)
@@ -89,7 +85,7 @@
Configuration c = new Configuration();
setValues(c, attributes.stringAttribs, false);
// Special handling for XML elements -- we hard code the parsing
- setXmlValues(c, attributes.xmlAttribs, defaultEvictionClass);
+ setXmlValues(c, attributes.xmlAttribs);
return c;
}
@@ -193,7 +189,7 @@
}
}
- protected void setXmlValues(Configuration conf, Map<String, Element> attribs, String defaultEvictionClass)
+ protected void setXmlValues(Configuration conf, Map<String, Element> attribs)
{
for (Iterator it = attribs.entrySet().iterator(); it.hasNext();)
{
@@ -214,8 +210,7 @@
else if ("EvictionPolicyConfiguration".equals(propname)
|| "EvictionPolicyConfig".equals(propname))
{
- EvictionConfig ec = parseEvictionConfig((Element) entry.getValue(),
- defaultEvictionClass);
+ EvictionConfig ec = parseEvictionConfig((Element) entry.getValue());
conf.setEvictionConfig(ec);
}
else if ("ClusterConfig".equals(propname))
@@ -323,12 +318,10 @@
return clc;
}
- public static EvictionConfig parseEvictionConfig(Element element, String defaultEvictionClass)
+ public static EvictionConfig parseEvictionConfig(Element element)
{
EvictionConfig ec = new EvictionConfig();
- ec.setDefaultEvictionPolicyClass(defaultEvictionClass);
-
if (element != null)
{
// If they set the default eviction policy in the element, use that
@@ -337,8 +330,7 @@
EvictionConfig.EVICTION_POLICY_CLASS, ATTR, NAME);
if (temp != null && temp.length() > 0)
{
- defaultEvictionClass = temp;
- ec.setDefaultEvictionPolicyClass(defaultEvictionClass);
+ ec.setDefaultEvictionPolicyClass(temp);
}
temp = XmlHelper.getTagContents(element,
@@ -386,7 +378,7 @@
}
try
{
- regionConfigs.add(parseEvictionRegionConfig((Element) node, defaultEvictionClass, eventQueueSize));
+ regionConfigs.add(parseEvictionRegionConfig((Element) node, ec.getDefaultEvictionPolicyClass(), eventQueueSize));
}
catch (MissingPolicyException ignored)
{
More information about the jboss-cvs-commits
mailing list