Преглед на файлове

Improve robustness so if ApplicationContext not shutdown correctly (thus destroy() not called) the cache will not fail on subsequent startups.

Ben Alex преди 21 години
родител
ревизия
b6cb84e937
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      core/src/main/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCache.java

+ 4 - 0
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