for (CacheLoaderConfig clc : legacy.getCacheLoaders()) {
LoaderConfigurationBuilder loaderBuilder = builder.loaders().addCacheLoader();
loaderBuilder.cacheLoader(Util.<CacheLoader>getInstance(clc.getCacheLoaderClassName(), legacy.getClassLoader()));
if (clc instanceof CacheStoreConfig) {
CacheStoreConfig csc = (CacheStoreConfig) clc;
loaderBuilder.fetchPersistentState(csc.isFetchPersistentState());
loaderBuilder.ignoreModifications(csc.isIgnoreModifications());
loaderBuilder.purgeOnStartup(csc.isPurgeOnStartup());
loaderBuilder.purgerThreads(csc.getPurgerThreads());
loaderBuilder.purgeSynchronously(csc.isPurgeSynchronously());
loaderBuilder.async().enabled(csc.getAsyncStoreConfig().isEnabled());
loaderBuilder.async().flushLockTimeout(csc.getAsyncStoreConfig().getFlushLockTimeout());
loaderBuilder.async().modificationQueueSize(csc.getAsyncStoreConfig().getModificationQueueSize());
loaderBuilder.async().shutdownTimeout(csc.getAsyncStoreConfig().getShutdownTimeout());
loaderBuilder.async().threadPoolSize(csc.getAsyncStoreConfig().getThreadPoolSize());
loaderBuilder.singletonStore().enabled(csc.getSingletonStoreConfig().isSingletonStoreEnabled());
loaderBuilder.singletonStore().pushStateTimeout(csc.getSingletonStoreConfig().getPushStateTimeout());
loaderBuilder.singletonStore().pushStateWhenCoordinator(csc.getSingletonStoreConfig().isPushStateWhenCoordinator());
}
if (clc instanceof AbstractCacheStoreConfig) {
loaderBuilder.withProperties(((AbstractCacheLoaderConfig) clc).getProperties());
}
}