diff --git a/changelog.txt b/changelog.txt index 1f24ef84a6..749b86cad0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -19,6 +19,7 @@ Changes in version 0.6 (2004-xx-xx) * Fixed AbstractProcessingFilter to handle servlet spec container differences * Fixed AbstractIntegrationFilter to resolve a Weblogic compatibility issue * Fixed CasAuthenticationToken if proxy granting ticket callback not requested +* Fixed EH-CACHE handling on web context refresh * Documentation improvements Changes in version 0.51 (2004-06-06) diff --git a/contributors.txt b/contributors.txt index 43887be10f..ccb1eee248 100644 --- a/contributors.txt +++ b/contributors.txt @@ -26,6 +26,8 @@ contributions to the Acegi Security System for Spring project: * Scott Evans contributed improvements to the tablig package. +* Travis Gregg contributed a fix to EH-CACHE usage after web context refresh. + * Anyone else I've forgotten (please let me know so I can correct this). Plus of course all the people who use the project and provide feedback, bug 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 31d76e9565..6fc5f37965 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 @@ -95,15 +95,16 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache, public void afterPropertiesSet() throws Exception { if (CacheManager.getInstance().cacheExists(CACHE_NAME)) { - CacheManager.getInstance().removeCache(CACHE_NAME); + // don’t remove the cache + } else { + manager = CacheManager.create(); + + // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle + cache = new Cache(CACHE_NAME, Integer.MAX_VALUE, false, false, + minutesToIdle * 60, minutesToIdle * 60); + + manager.addCache(cache); } - - manager = CacheManager.create(); - - // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle - cache = new Cache(CACHE_NAME, Integer.MAX_VALUE, false, false, - minutesToIdle * 60, minutesToIdle * 60); - manager.addCache(cache); } public void destroy() throws Exception { diff --git a/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java b/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java index 5403069e59..e511d3b8aa 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java @@ -96,15 +96,16 @@ public class EhCacheBasedUserCache implements UserCache, InitializingBean, public void afterPropertiesSet() throws Exception { if (CacheManager.getInstance().cacheExists(CACHE_NAME)) { - CacheManager.getInstance().removeCache(CACHE_NAME); + // don’t remove the cache + } else { + manager = CacheManager.create(); + + // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle + cache = new Cache(CACHE_NAME, Integer.MAX_VALUE, false, false, + minutesToIdle * 60, minutesToIdle * 60); + + manager.addCache(cache); } - - manager = CacheManager.create(); - - // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle - cache = new Cache(CACHE_NAME, Integer.MAX_VALUE, false, false, - minutesToIdle * 60, minutesToIdle * 60); - manager.addCache(cache); } public void destroy() throws Exception {