public void flush(String path, boolean flushSubtree) {
if (logger.isDebugEnabled()) {
logger.debug("Flushing dependencies for path : " + path);
}
Cache cache = cacheProvider.getDependenciesCache();
Element element = cache.get(path);
if (element != null) {
if (logger.isDebugEnabled()) {
logger.debug("Flushing path : " + path);
}
cacheProvider.invalidate(path);
cache.remove(element.getKey());
}
if (flushSubtree) {
List keys = cache.getKeys();
for (Object key : keys) {
if (key.toString().startsWith(path)) {
cacheProvider.invalidate(key.toString());
cache.remove(key);
}
}
}
}