Class CacheIndexFile


  • class CacheIndexFile
    extends java.lang.Object
    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 Detail

      • unsavedActions

        private final java.util.List<CacheAction> unsavedActions
      • lastLoadOrStore

        private long lastLoadOrStore
        time of last modification, lazy loaded on getProperty
      • requestCompression

        private boolean requestCompression
    • Constructor Detail

      • CacheIndexFile

        CacheIndexFile​(java.io.File file)
      • CacheIndexFile

        CacheIndexFile​(LockableFile lockableFile)
    • Method Detail

      • usesFile

        boolean usesFile​(java.io.File file)
      • markAccessed

        void markAccessed​(CacheIndexEntry entry,
                          long lastAccessed)
      • applyAndSort

        private void applyAndSort​(CacheAction action)
      • clear

        void clear()
      • load

        void load()
           throws java.io.IOException
        Throws:
        java.io.IOException
      • isDirty

        boolean isDirty()
      • requestCompression

        void requestCompression()
      • persistChanges

        void persistChanges()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • appendUnsavedActionsToFile

        private void appendUnsavedActionsToFile()
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • saveCompactedFile

        private void saveCompactedFile()
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • lock

        void lock()
           throws java.io.IOException
        Throws:
        java.io.IOException
      • unlock

        void unlock()
             throws java.io.IOException
        Throws:
        java.io.IOException
      • hasNeverBeenLoaded

        private boolean hasNeverBeenLoaded()