String algorithmClassName = getAttributeValue(element, "algorithmClass");
EvictionAlgorithmConfig algorithmConfig = null; // every eviction region config needs an algorithm config.
if (existsAttribute(algorithmClassName))
{
EvictionAlgorithm algorithm;
Class<? extends EvictionAlgorithm> algorithmClass;
// try using a 'getInstance()' factory.
try
{
algorithmClass = Util.loadClass(algorithmClassName);
}
catch (Exception e)
{
throw new RuntimeException("Unable to load eviction algorithm class [" + algorithmClassName + "]", e);
}
try
{
algorithm = Util.getInstance(algorithmClass);
}
catch (Exception e)
{
throw new ConfigurationException("Unable to construct eviction algorithm class [" + algorithmClassName + "]", e);
}
try
{
algorithmConfig = Util.getInstance(algorithm.getConfigurationClass());
}
catch (Exception e)
{
throw new RuntimeException("Failed to instantiate eviction algorithm configuration class [" +
algorithm.getConfigurationClass() + "]", e);
}
}
else
{
if (!isDefault)