cacheInfo.put(cacheName, new PropertyCacheInfo(propertyFilename, properties, propertyFilename.lastModified()) );
LOG.fine( "storing in cache " + cacheName );
}
public Properties getFromCache( String cacheName ) {
PropertyCacheInfo info = cacheInfo.get( cacheName );
if( info == null ) {
return null;
}
if( !info.getPropertyFilename().exists() ) {
return null;
}
if( info.getPropertyFilename().lastModified() > info.getLastModified() ) {
// property changed invalidate
cacheInfo.remove( cacheName );
LOG.fine( "invalidating from cache " + cacheName );
return null;
}
LOG.fine( "fetching from cache " + cacheName );
return info.getProperties();
}