* more resilient just in case, probably not necessary

This commit is contained in:
Reinhard Pointner 2013-09-15 03:36:23 +00:00
parent 5b9ab0826a
commit f68170c243
1 changed files with 7 additions and 1 deletions

View File

@ -51,12 +51,18 @@ public class Cache {
try {
cache.remove(key);
} catch (Exception e1) {
Logger.getLogger(Cache.class.getName()).log(Level.WARNING, e1.getMessage());
Logger.getLogger(Cache.class.getName()).log(Level.SEVERE, e1.getMessage());
try {
Logger.getLogger(Cache.class.getName()).log(Level.INFO, "Cached data has become invalid: Clearing cache now");
cache.removeAll();
} catch (Exception e2) {
Logger.getLogger(Cache.class.getName()).log(Level.SEVERE, e2.getMessage());
try {
Logger.getLogger(Cache.class.getName()).log(Level.INFO, "Cache has become invalid: Reset all caches");
cache.getCacheManager().clearAll();
} catch (Exception e3) {
Logger.getLogger(Cache.class.getName()).log(Level.SEVERE, e3.getMessage());
}
}
}
}