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

This commit is contained in:
Ben Alex 2004-05-31 02:08:34 +00:00
parent e300a90890
commit b6cb84e937
1 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,10 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache,
} }
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
if (CacheManager.getInstance().cacheExists(CACHE_NAME)) {
CacheManager.getInstance().removeCache(CACHE_NAME);
}
manager = CacheManager.create(); manager = CacheManager.create();
// Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle