|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.cache.AbstractFilesCache
org.apache.commons.vfs2.cache.SoftRefFilesCache
public class SoftRefFilesCache
This implementation caches every file as long as it is strongly reachable by the java vm. As soon as the vm needs memory - every softly reachable file will be discarded.
SoftReference| Constructor Summary | |
|---|---|
SoftRefFilesCache()
|
|
| Method Summary | |
|---|---|
void |
clear(FileSystem filesystem)
purge the entries corresponding to the filesystem. |
void |
close()
Closes the provider. |
protected Reference<FileObject> |
createReference(FileObject file,
ReferenceQueue<FileObject> refqueue)
|
FileObject |
getFile(FileSystem filesystem,
FileName name)
retrieve a file from the cache by its name. |
protected Map<FileName,Reference<FileObject>> |
getOrCreateFilesystemCache(FileSystem filesystem)
|
void |
putFile(FileObject file)
add a fileobject to the cache. |
boolean |
putFileIfAbsent(FileObject file)
add a fileobject to the cache if it isn't already present. |
void |
removeFile(FileSystem filesystem,
FileName name)
removes a file from cache. |
void |
touchFile(FileObject file)
|
| Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent |
|---|
getContext, getLogger, init, setContext, setLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SoftRefFilesCache()
| Method Detail |
|---|
public void putFile(FileObject file)
FilesCache
file - the filepublic boolean putFileIfAbsent(FileObject file)
FilesCache
file - the file
protected Reference<FileObject> createReference(FileObject file,
ReferenceQueue<FileObject> refqueue)
public FileObject getFile(FileSystem filesystem,
FileName name)
FilesCache
filesystem - The FileSystem.name - the name
public void clear(FileSystem filesystem)
FilesCache
filesystem - The FileSystem.public void close()
AbstractVfsComponent
close in interface FilesCacheclose in interface VfsComponentclose in class AbstractVfsComponent
public void removeFile(FileSystem filesystem,
FileName name)
FilesCache
filesystem - filesystemname - filenamepublic void touchFile(FileObject file)
protected Map<FileName,Reference<FileObject>> getOrCreateFilesystemCache(FileSystem filesystem)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||