Search in sources :

Example 1 with CachePersistenceException

use of org.ehcache.CachePersistenceException in project cxf by apache.

the class EHCacheXKMSClientCache method close.

public synchronized void close() {
    if (cacheManager.getStatus() == Status.AVAILABLE) {
        cacheManager.removeCache(cacheKey);
        cacheManager.close();
        if (!persistent && cacheManager instanceof PersistentCacheManager) {
            try {
                ((PersistentCacheManager) cacheManager).destroy();
            } catch (CachePersistenceException e) {
                LOG.debug("Error in shutting down persistent cache", e);
            }
            // destroy above
            if (diskstorePath != null) {
                File file = diskstorePath.toFile();
                if (file.exists() && file.canWrite()) {
                    file.delete();
                }
            }
        }
        if (bus != null) {
            bus.getExtension(BusLifeCycleManager.class).unregisterLifeCycleListener(this);
        }
    }
}
Also used : PersistentCacheManager(org.ehcache.PersistentCacheManager) BusLifeCycleManager(org.apache.cxf.buslifecycle.BusLifeCycleManager) CachePersistenceException(org.ehcache.CachePersistenceException) File(java.io.File)

Aggregations

File (java.io.File)1 BusLifeCycleManager (org.apache.cxf.buslifecycle.BusLifeCycleManager)1 CachePersistenceException (org.ehcache.CachePersistenceException)1 PersistentCacheManager (org.ehcache.PersistentCacheManager)1