Interface GlobalCacheService

    • Field Detail

      • ROLE

        static final String ROLE
        Avalon role - used to id the component within the manager
    • Method Detail

      • addObject

        <T> void addObject​(String objectId,
                           CachedObject<T> object)
        Adds an object to the cache.
        Type Parameters:
        T - type of object to add
        Parameters:
        objectId - The String id for the object.
        object - The object to add to the cache.
      • removeObject

        void removeObject​(String objectId)
        Removes an object from the cache.
        Parameters:
        objectId - The String id for the object.
      • getKeys

        List<StringgetKeys()
        Returns a copy of keys to objects in the cache as a list. Note that keys to expired objects are not returned.
        Returns:
        A List of String's representing the keys to objects in the cache.
      • getCachedObjects

        List<CachedObject<?>> getCachedObjects()
        Returns a copy of the non-expired CachedObjects in the cache as a list.
        Returns:
        A List of CachedObject objects held in the cache
      • getCacheSize

        int getCacheSize()
                  throws IOException
        Returns the current size of the cache.
        Returns:
        int representing current cache size in number of bytes
        Throws:
        IOException - if unable to return cache size
      • getNumberOfObjects

        int getNumberOfObjects()
        Returns the number of objects in the cache.
        Returns:
        int The current number of objects in the cache.
      • flushCache

        void flushCache()
        Flush the cache of all objects.