{
LOG.info("No cache loader has been defined, thus no need to encapsulate any cache loader.");
}
return;
}
CacheLoaderManager clm =
((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(CacheLoaderManager.class);
if (clm == null)
{
LOG.error("The CacheLoaderManager cannot be found");
return;
}
CacheLoader currentCL = clm.getCacheLoader();
if (currentCL == null)
{
LOG.error("The CacheLoader cannot be found");
return;
}
ControllerCacheLoader ccl = new ControllerCacheLoader(currentCL);
List<IndividualCacheLoaderConfig> newConfig = new ArrayList<IndividualCacheLoaderConfig>(1);
// create CacheLoaderConfig
IndividualCacheLoaderConfig cclConfig = new IndividualCacheLoaderConfig();
// set CacheLoader
cclConfig.setCacheLoader(ccl);
// set parameters
cclConfig.setFetchPersistentState(clm.isFetchPersistentState());
cclConfig.setAsync(false);
cclConfig.setIgnoreModifications(false);
CacheLoaderConfig.IndividualCacheLoaderConfig first = config.getFirstCacheLoaderConfig();
cclConfig.setPurgeOnStartup(first != null && first.isPurgeOnStartup());
newConfig.add(cclConfig);