Package org.xj3d.impl.core.loading
Class WeakRefFileCache
java.lang.Object
org.xj3d.impl.core.loading.WeakRefFileCache
- All Implemented Interfaces:
FileCache
The file cache implementation uses the standard
WeakHashMap
as the storage mechanism.
Items are stored in the WeakHashMap so that when an item no longer needs data, that item can be discarded.
The internal implementation is thread safe, choosing to synchronize on the internal mapping structures. This prevents one thread from loading something into the cache and then having another thread interrupt it half way through and get bogus data.
- Version:
- $Revision: 1.1 $
- Author:
- Justin Couch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Store the item in the cache.checkForFile
(String uri) Check the cache for the file nominated by this URI string.
-
Constructor Details
-
WeakRefFileCache
public WeakRefFileCache()Construct a default instance of this class.
-
-
Method Details
-
checkForFile
Check the cache for the file nominated by this URI string. Always returns null.- Specified by:
checkForFile
in interfaceFileCache
- Parameters:
uri
- The uri to check for- Returns:
- The details of the item in cache or null
-
cacheFile
Store the item in the cache. Request is ignored
-