From b6cb84e9370950d6b14a741dab84a76bc3951177 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Mon, 31 May 2004 02:08:34 +0000 Subject: [PATCH] Improve robustness so if ApplicationContext not shutdown correctly (thus destroy() not called) the cache will not fail on subsequent startups. --- .../providers/cas/cache/EhCacheBasedTicketCache.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCache.java b/core/src/main/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCache.java index f934d48748..31d76e9565 100644 --- a/core/src/main/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCache.java +++ b/core/src/main/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCache.java @@ -94,6 +94,10 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache, } public void afterPropertiesSet() throws Exception { + if (CacheManager.getInstance().cacheExists(CACHE_NAME)) { + CacheManager.getInstance().removeCache(CACHE_NAME); + } + manager = CacheManager.create(); // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle