Fix EH-CACHE after web context refresh (patch thanks to Travis Gregg).

This commit is contained in:
Ben Alex 2004-07-26 22:56:00 +00:00
parent d1fa12a312
commit 3648073461
4 changed files with 21 additions and 16 deletions

View File

@ -19,6 +19,7 @@ Changes in version 0.6 (2004-xx-xx)
* Fixed AbstractProcessingFilter to handle servlet spec container differences * Fixed AbstractProcessingFilter to handle servlet spec container differences
* Fixed AbstractIntegrationFilter to resolve a Weblogic compatibility issue * Fixed AbstractIntegrationFilter to resolve a Weblogic compatibility issue
* Fixed CasAuthenticationToken if proxy granting ticket callback not requested * Fixed CasAuthenticationToken if proxy granting ticket callback not requested
* Fixed EH-CACHE handling on web context refresh
* Documentation improvements * Documentation improvements
Changes in version 0.51 (2004-06-06) Changes in version 0.51 (2004-06-06)

View File

@ -26,6 +26,8 @@ contributions to the Acegi Security System for Spring project:
* Scott Evans contributed improvements to the tablig package. * 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). * 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 Plus of course all the people who use the project and provide feedback, bug

View File

@ -95,15 +95,16 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache,
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
if (CacheManager.getInstance().cacheExists(CACHE_NAME)) { if (CacheManager.getInstance().cacheExists(CACHE_NAME)) {
CacheManager.getInstance().removeCache(CACHE_NAME); // dont 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 { public void destroy() throws Exception {

View File

@ -96,15 +96,16 @@ public class EhCacheBasedUserCache implements UserCache, InitializingBean,
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
if (CacheManager.getInstance().cacheExists(CACHE_NAME)) { if (CacheManager.getInstance().cacheExists(CACHE_NAME)) {
CacheManager.getInstance().removeCache(CACHE_NAME); // dont 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 { public void destroy() throws Exception {