Skip navigation links
NASA World Wind

Class BasicRasterServerCache

    • Field Detail


        protected static final int DEFAULT_INACCESSIBLE_MEMORY_SIZE
        See Also:
        Constant Field Values

        protected static final long DEFAULT_LEAST_RECENTLY_USED_TIMEOUT_NSEC
        See Also:
        Constant Field Values

        protected static final long DEFAULT_PRUNER_THREAD_TIMEOUT_MSEC
        See Also:
        Constant Field Values
      • inaccessibleMemorySize

        protected AtomicInteger inaccessibleMemorySize
      • timeoutLeastRecentUseInNanoSeconds

        protected long timeoutLeastRecentUseInNanoSeconds
    • Constructor Detail

      • BasicRasterServerCache

        public BasicRasterServerCache()
        Constructs a new cache which uses entire memory, but will immediately drop all cached entries ones there is a need for more memory by anyone else.
      • BasicRasterServerCache

        public BasicRasterServerCache(int inaccessibleMemorySize)
    • Method Detail

      • add

        public boolean add(Object key,
                           Object clientObject,
                           long clientObjectSize)
        Description copied from class: BasicMemoryCache
        Adds an object to the cache. The add fails if the object or key is null, or if the size is zero, negative or greater than the maximmum capacity.
        Specified by:
        add in interface MemoryCache
        add in class BasicMemoryCache
        key - The unique reference key that identifies this object.
        clientObject - The actual object to be cached.
        clientObjectSize - The size of the object in cache units.
        returns true if clientObject was added, false otherwise.
      • getLeastRecentUseTimeout

        public long getLeastRecentUseTimeout()
      • removeExpiredEntries

        protected void removeExpiredEntries()
      • setLeastRecentUseTimeout

        public void setLeastRecentUseTimeout(long nanoSeconds)
      • updateMemorySemaphore

        protected void updateMemorySemaphore()