diff --git a/src/main/java/io/bootique/jcache/JCacheFactory.java b/src/main/java/io/bootique/jcache/JCacheFactory.java index 02b06ee..21bba02 100644 --- a/src/main/java/io/bootique/jcache/JCacheFactory.java +++ b/src/main/java/io/bootique/jcache/JCacheFactory.java @@ -64,10 +64,10 @@ public CacheManager createManager(Map> configs, Shut "You must place a JCache 1.0 provider on classpath explicitly.", e); } - shutdownManager.addShutdownHook(provider); + shutdownManager.onShutdown(provider); CacheManager manager = getConfigUri().map(u -> provider.getCacheManager(u, null)).orElse(provider.getCacheManager()); - shutdownManager.addShutdownHook(manager); + shutdownManager.onShutdown(manager); // now load contributed configs configs.forEach(manager::createCache);