use of org.keycloak.quarkus.runtime.storage.infinispan.CacheManagerFactory in project keycloak by keycloak.
the class KeycloakRecorder method createCacheInitializer.
public RuntimeValue<CacheManagerFactory> createCacheInitializer(String config, ShutdownContext shutdownContext) {
try {
CacheManagerFactory cacheManagerFactory = new CacheManagerFactory(config);
shutdownContext.addShutdownTask(new Runnable() {
@Override
public void run() {
DefaultCacheManager cacheManager = cacheManagerFactory.getOrCreate();
if (cacheManager != null) {
cacheManager.stop();
}
}
});
return new RuntimeValue<>(cacheManagerFactory);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations