public class FileCacheRaf.Raf extends java.lang.Object implements FileCacheable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the FileCacheable, release all resources.
|
java.lang.String |
getLocation()
The location of the FileCacheable, used only for debug and log messages.
|
RandomAccessFile |
getRaf() |
void |
setFileCache(FileCache fileCache)
If the FileCache is set, the FileCacheable object must store it and call FileCache.release() on FileCacheable.close():
|
boolean |
sync()
Sync() is called when the FileCacheable is found in the cache, before returning the object to the
application.
|
public java.lang.String getLocation()
FileCacheablegetLocation in interface FileCacheablepublic RandomAccessFile getRaf()
public void close()
throws java.io.IOException
FileCacheableclose in interface FileCacheablejava.io.IOExceptionpublic boolean sync()
throws java.io.IOException
FileCacheablesync in interface FileCacheablejava.io.IOException - on i/o error.public void setFileCache(FileCache fileCache)
FileCacheable
public synchronized void close() throws java.io.IOException {
if (isClosed) return;
if (cache != null) {
cache.release(this);
} else {
reallyClose();
}
isClosed = true;
setFileCache in interface FileCacheablefileCache - must store this, use it on close as above.