Skip to content

Commit

Permalink
Merge pull request #291 from cristal-ise/feature/Issue290_ProxyManage…
Browse files Browse the repository at this point in the history
…rClearCache

#290 ProxyManager.clearCache() implementation
  • Loading branch information
kovax committed Oct 29, 2019
2 parents 89ba2ac + 6090ce0 commit 361657c
Showing 1 changed file with 26 additions and 0 deletions.
Expand Up @@ -300,4 +300,30 @@ public void reportCurrentProxies(int logLevel) {
Logger.msg(logLevel, "Proxy cache modified. Aborting.");
}
}

/**
* Clears all entries from the cache
*/
public void clearCache() {
synchronized(proxyPool) {
proxyPool.clear();
}
Logger.msg(8, "ProxyManager.clearCache() - DONE");
}

/**
* Clears the given Item from the cache
* @param item the UUID
*/
public void clearCache(ItemPath item) {
if (proxyPool.containsKey(item)) {
synchronized(proxyPool) {
proxyPool.remove(item);
}
Logger.msg(8, "ProxyManager.clearCache() - '%s' was removed from cache", item);
}
else {
Logger.msg(8, "ProxyManager.clearCache() - '%s' was not cached", item);
}
}
}

0 comments on commit 361657c

Please sign in to comment.