thredds.filesystem
Class CacheManager
java.lang.Object
thredds.filesystem.CacheManager
@ThreadSafe
public class CacheManager
- extends Object
Handles caching using ehcache.
Must be thread safe.
Uses ehcache underneath.
- Since:
- Mar 21, 2009
- Author:
- caron
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CacheManager
public CacheManager(String cacheName)
getEhcache
public static net.sf.ehcache.CacheManager getEhcache()
makeStandardCacheManager
public static void makeStandardCacheManager(String configFile,
String cacheDir)
throws IOException
- Throws:
IOException
makeTestCacheManager
public static void makeTestCacheManager(String cacheDir)
makeReadOnlyCacheManager
public static void makeReadOnlyCacheManager(String cacheDir,
String cacheName)
shutdown
public static void shutdown()
add
public void add(Serializable path,
Serializable value)
show
public static String show(String cacheName)
get
public CacheDirectory get(String path,
boolean recheck)
- Get a CacheDirectory from the path. If not in cache, read OS and put in cache.
- Parameters:
path
- file pathrecheck
- if true, check that directory hasnt changed, otherwise ok to use cached element without chcking
- Returns:
- CacheDirectory
close
public void close()
showKeys
public void showKeys()
stats
public void stats()
populateFiles
public void populateFiles(String root)
populateFilesProto
public void populateFilesProto(String root)
populateDirs
public void populateDirs(String root)
populateDirsProto
public void populateDirsProto(String root)
main
public static void main(String[] args)
throws IOException
- Throws:
IOException
Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.