String clClass = parser.getAttributeValue(element, "class");
if (!parser.existsAttribute(clClass))
throw new ConfigurationException("Missing 'class' attribute for cache loader configuration");
CacheLoader cl;
CacheLoaderConfig clc;
try {
cl = (CacheLoader) Util.getInstance(clClass);
clc = Util.getInstance(cl.getConfigurationClass());
} catch (Exception ex) {
throw new ConfigurationException("Unable to instantiate cache loader or configuration",ex);
}
clc.setCacheLoaderClassName(clClass);
Element propertiesElement = parser.getSingleElementInCoreNS("properties", element);
if (propertiesElement == null)
throw new ConfigurationException("loader " + clClass + " is missing properties element");
parser.visitElement(element, (AbstractConfigurationBean) clc);
cBean.addCacheLoaderConfig(clc);