}
private static EvictionRegionConfig parseEvictionRegionConfig(Element element, String defaultEvPolicyClassName, int defaultQueueCapacity)
{
EvictionRegionConfig erc = new EvictionRegionConfig();
erc.setRegionName(element.getAttribute(EvictionRegionConfig.NAME));
String temp = element.getAttribute("eventQueueSize");
if (temp != null && temp.length() > 0)
{
erc.setEventQueueSize(Integer.parseInt(temp));
}
else
{
erc.setEventQueueSize(defaultQueueCapacity);
}
String evictionClass = element.getAttribute("policyClass");
if (evictionClass == null || evictionClass.length() == 0)
{
evictionClass = defaultEvPolicyClassName;
// if it's still null... what do we setCache?
if (evictionClass == null || evictionClass.length() == 0)
{
throw new MissingPolicyException(
"There is no Eviction Policy Class specified on the region or for the entire cache!");
}
}
EvictionAlgorithmConfig algorithmConfig = getEvictionAlgorithmConfig(evictionClass);
parseEvictionPolicyConfig(element, algorithmConfig);
erc.setEvictionAlgorithmConfig(algorithmConfig);
return erc;
}