org.ligoj.bootstrap.resource.system.configuration.ConfigurationCache Maven / Gradle / Ivy
/*
* Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
*/
package org.ligoj.bootstrap.resource.system.configuration;
import java.util.function.Function;
import org.ligoj.bootstrap.resource.system.cache.CacheManagerAware;
import org.springframework.stereotype.Component;
import com.hazelcast.cache.HazelcastCacheManager;
import com.hazelcast.config.CacheConfig;
/**
* "Configuration" values cache configuration.
*/
@Component
public class ConfigurationCache implements CacheManagerAware {
@Override
public void onCreate(HazelcastCacheManager cacheManager, final Function> provider) {
cacheManager.createCache("configuration", provider.apply("configuration"));
cacheManager.createCache("hooks", provider.apply("hooks"));
}
}