@Override public boolean delete() { boolean deleteResult = webResource.delete(); if (deleteResult) { cache.removeCacheEntry(webAppPath); } return deleteResult; }
@Override public boolean delete() { boolean deleteResult = webResource.delete(); if (deleteResult) { cache.removeCacheEntry(webAppPath); } return deleteResult; }
private long evict(long targetSize, Iterator<CachedResource> iter) { long now = System.currentTimeMillis(); long newSize = size.get(); while (newSize > targetSize && iter.hasNext()) { CachedResource resource = iter.next(); // Don't expire anything that has been checked within the TTL if (resource.getNextCheck() > now) { continue; } // Remove the entry from the cache removeCacheEntry(resource.getWebappPath()); newSize = size.get(); } return newSize; }
private long evict(long targetSize, Iterator<CachedResource> iter) { long now = System.currentTimeMillis(); long newSize = size.get(); while (newSize > targetSize && iter.hasNext()) { CachedResource resource = iter.next(); // Don't expire anything that has been checked within the TTL if (resource.getNextCheck() > now) { continue; } // Remove the entry from the cache removeCacheEntry(resource.getWebappPath(), true); newSize = size.get(); } return newSize; }
private long evict(long targetSize, Iterator<CachedResource> iter) { long now = System.currentTimeMillis(); long newSize = size.get(); while (newSize > targetSize && iter.hasNext()) { CachedResource resource = iter.next(); // Don't expire anything that has been checked within the TTL if (resource.getNextCheck() > now) { continue; } // Remove the entry from the cache removeCacheEntry(resource.getWebappPath()); newSize = size.get(); } return newSize; }
@Override public boolean write(String path, InputStream is, boolean overwrite) { path = validate(path); if (!overwrite && preResourceExists(path)) { return false; } boolean writeResult = main.write(path, is, overwrite); if (writeResult && isCachingAllowed()) { // Remove the entry from the cache so the new resource is visible cache.removeCacheEntry(path); } return writeResult; }
@Override public boolean mkdir(String path) { path = validate(path); if (preResourceExists(path)) { return false; } boolean mkdirResult = main.mkdir(path); if (mkdirResult && isCachingAllowed()) { // Remove the entry from the cache so the new directory is visible cache.removeCacheEntry(path); } return mkdirResult; }
@Override public boolean write(String path, InputStream is, boolean overwrite) { path = validate(path); if (!overwrite && preResourceExists(path)) { return false; } boolean writeResult = main.write(path, is, overwrite); if (writeResult && isCachingAllowed()) { // Remove the entry from the cache so the new resource is visible cache.removeCacheEntry(path); } return writeResult; }
@Override public boolean mkdir(String path) { path = validate(path); if (preResourceExists(path)) { return false; } boolean mkdirResult = main.mkdir(path); if (mkdirResult && isCachingAllowed()) { // Remove the entry from the cache so the new directory is visible cache.removeCacheEntry(path); } return mkdirResult; }
removeCacheEntry(path); cacheEntry = null; removeCacheEntry(path); log.warn(sm.getString("cache.addFail", path));
removeCacheEntry(path); cacheEntry = null; removeCacheEntry(path); log.warn(sm.getString("cache.addFail", path));
removeCacheEntry(path); cacheEntry = null; removeCacheEntry(path); log.warn(sm.getString("cache.addFail", path, root.getContext().getName()));
removeCacheEntry(path, true); cacheEntry = null; removeCacheEntry(path, true); log.warn(sm.getString("cache.addFail", path));
removeCacheEntry(path); cacheEntry = null; removeCacheEntry(path); log.warn(sm.getString("cache.addFail", path, root.getContext().getName()));