Class CacheIndexFile
java.lang.Object
net.adoptopenjdk.icedteaweb.resources.cache.CacheIndexFile
Class to interface with the LRU cache index file.
The following restriction are enforced by the class: - loading and saving can only be done when locked - reading and changing the entities can only be done after loading
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CacheIndexEntriesprivate longtime of last modification, lazy loaded on getPropertyprivate static final Stringprivate final LockableFileprivate booleanprivate final List<CacheAction> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddEntry(CacheIndexEntry entry) private voidprivate voidapplyAndSort(CacheAction action) (package private) voidclear()(package private) List<CacheIndexEntry> private boolean(package private) booleanisDirty()(package private) voidload()(package private) voidlock()(package private) voidmarkAccessed(CacheIndexEntry entry, long lastAccessed) (package private) void(package private) voidremoveEntry(CacheIndexEntry entry) (package private) voidprivate void(package private) voidunlock()(package private) boolean
-
Field Details
-
LINE_END
- See Also:
-
lockableFile
-
unsavedActions
-
lastLoadOrStore
private long lastLoadOrStoretime of last modification, lazy loaded on getProperty -
requestCompression
private boolean requestCompression -
entries
-
-
Constructor Details
-
CacheIndexFile
CacheIndexFile(File file) -
CacheIndexFile
CacheIndexFile(LockableFile lockableFile)
-
-
Method Details
-
usesFile
-
getAllEntries
List<CacheIndexEntry> getAllEntries() -
addEntry
-
markAccessed
-
removeEntry
-
applyAndSort
-
clear
void clear() -
load
- Throws:
IOException
-
isDirty
boolean isDirty() -
requestCompression
void requestCompression() -
persistChanges
- Throws:
IOException
-
appendUnsavedActionsToFile
- Throws:
IOException
-
saveCompactedFile
- Throws:
IOException
-
lock
- Throws:
IOException
-
unlock
- Throws:
IOException
-
hasNeverBeenLoaded
private boolean hasNeverBeenLoaded()
-