org.fcrepo.server.storage
Class DOReaderCache
java.lang.Object
java.lang.Thread
org.fcrepo.server.storage.DOReaderCache
- All Implemented Interfaces:
- Runnable
public class DOReaderCache
- extends Thread
|
Constructor Summary |
DOReaderCache(int maxReaders,
int maxCachedSeconds)
|
|
Method Summary |
void |
close()
|
DOReader |
get(String pid)
Get a DOReader from the cache. |
void |
put(DOReader reader)
Add a DOReader to the cache. |
void |
remove(String pid)
Remove a DOReader from the cache. |
void |
run()
Until closed, check for and remove any expired entries every second. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
DOReaderCache
public DOReaderCache(int maxReaders,
int maxCachedSeconds)
run
public void run()
- Until closed, check for and remove any expired entries every second.
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
remove
public void remove(String pid)
- Remove a DOReader from the cache. If it doesn't exist in the cache, do
nothing.
put
public void put(DOReader reader)
- Add a DOReader to the cache. If it already exists in the cache, refresh
the DOReader in the cache.
get
public DOReader get(String pid)
- Get a DOReader from the cache. If it doesn't exist in the cache, return
null. If it does exist, set its time to the current time and return it.
close
public void close()
Copyright © 2012 DuraSpace. All Rights Reserved.