1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs.cache;
18
19 import org.apache.commons.vfs.FileObject;
20
21 import java.lang.ref.Reference;
22 import java.lang.ref.ReferenceQueue;
23 import java.lang.ref.WeakReference;
24
25 /***
26 * This implementation caches every file as long as it is strongly reachable by
27 * the java vm. As soon as the object is no longer reachable it will be discarded.
28 * In contrast to the SoftRefFilesCache this implementation might free resources faster
29 * as it don't wait until a memory limitation.
30 *
31 * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
32 * @version $Revision: 485638 $ $Date: 2005-09-30 09:02:41 +0200 (Fr, 30 Sep
33 * 2005) $
34 * @see java.lang.ref.WeakReference
35 */
36 public class WeakRefFilesCache extends SoftRefFilesCache
37 {
38 protected Reference createReference(FileObject file, ReferenceQueue refqueue)
39 {
40 return new WeakReference(file, refqueue);
41 }
42 }