Class CacheIndexHolder
java.lang.Object
net.adoptopenjdk.icedteaweb.resources.cache.CacheIndexHolder
Holder of the cached LeastRecentlyUsedCacheIndex data.
The responsibility of this class is to make sure that access to the content of the
LeastRecentlyUsedCacheIndex is synchronized and any changes are written back to the file system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CacheIndexFileprivate static final Loggerprivate final InfrastructureFileDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringconvertOldId(String id) private CacheIndexFile(package private) <T> TgetSynchronized(Function<CacheIndex, T> action) Executes the function passed in action in a synchronized fashion to allow exclusive access to the index.private CacheIndexload(CacheIndexFile cacheFile) Loads the data from the properties file into an index.private CacheIndexFileprivate CacheIndexFileLock the properties file to have exclusive access.private voidpersistChanges(CacheIndexFile cacheFile) Write file to disk.(package private) voidrunSynchronized(Consumer<CacheIndex> action) Executes the code passed in action in a synchronized fashion to allow exclusive access to the index.private voidunlockCacheFile(CacheIndexFile cacheFile) Unlock the properties file.
-
Field Details
-
LOG
-
recentlyUsed
-
cachedCacheFile
-
-
Constructor Details
-
CacheIndexHolder
CacheIndexHolder(InfrastructureFileDescriptor recentlyUsed)
-
-
Method Details
-
runSynchronized
Executes the code passed in action in a synchronized fashion to allow exclusive access to the index. -
getSynchronized
Executes the function passed in action in a synchronized fashion to allow exclusive access to the index.- Returns:
- the result of the passed function.
-
lockCacheFile
Lock the properties file to have exclusive access. -
unlockCacheFile
Unlock the properties file. -
load
Loads the data from the properties file into an index. -
persistChanges
Write file to disk. -
getCacheFile
- Returns:
- the recentlyUsedPropertiesFile
-
loadOldIndex
-
convertOldId
-