org.apache.commons.vfs2.cache
Class WeakRefFilesCache

java.lang.Object
  extended by org.apache.commons.vfs2.provider.AbstractVfsComponent
      extended by org.apache.commons.vfs2.cache.AbstractFilesCache
          extended by org.apache.commons.vfs2.cache.SoftRefFilesCache
              extended by org.apache.commons.vfs2.cache.WeakRefFilesCache
All Implemented Interfaces:
FilesCache, VfsComponent

public class WeakRefFilesCache
extends SoftRefFilesCache

This implementation caches every file as long as it is strongly reachable by the java vm. As soon as the object is no longer reachable it will be discarded. In contrast to the SoftRefFilesCache this implementation might free resources faster as it don't wait until a memory limitation.

Author:
Commons VFS team 2005) $
See Also:
WeakReference

Constructor Summary
WeakRefFilesCache()
           
 
Method Summary
protected  java.lang.ref.Reference<FileObject> createReference(FileObject file, java.lang.ref.ReferenceQueue<FileObject> refqueue)
           
 
Methods inherited from class org.apache.commons.vfs2.cache.SoftRefFilesCache
clear, close, getFile, getOrCreateFilesystemCache, putFile, putFileIfAbsent, removeFile, touchFile
 
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

WeakRefFilesCache

public WeakRefFilesCache()
Method Detail

createReference

protected java.lang.ref.Reference<FileObject> createReference(FileObject file,
                                                              java.lang.ref.ReferenceQueue<FileObject> refqueue)
Overrides:
createReference in class SoftRefFilesCache