public class SoftRefFilesCache extends AbstractFilesCache
SoftReference
Constructor and Description |
---|
SoftRefFilesCache() |
Modifier and Type | Method and Description |
---|---|
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) |
getContext, getLogger, init, setContext, setLogger
public void putFile(FileObject file)
FilesCache
file
- the filepublic boolean putFileIfAbsent(FileObject file)
FilesCache
file
- the fileprotected Reference<FileObject> createReference(FileObject file, ReferenceQueue<FileObject> refqueue)
public FileObject getFile(FileSystem filesystem, FileName name)
FilesCache
filesystem
- The FileSystem.name
- the namepublic void clear(FileSystem filesystem)
FilesCache
filesystem
- The FileSystem.public void close()
AbstractVfsComponent
close
in interface FilesCache
close
in interface VfsComponent
close
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)
Copyright © 2002-2016 The Apache Software Foundation. All Rights Reserved.