Interface ICacheStore

    • Method Detail

      • offer

        boolean offer​(String name,
                      Object obj)
        Offer an object to the cache with an associated key. If the named object exists in cache, it will not be accepted.
        Parameters:
        name - string name representing the object
        obj - cacheable object
        Returns:
        true if accepted, false otherwise
      • put

        void put​(String name,
                 Object obj)
        Puts an object in the cache with the associated key.
        Parameters:
        name - string name representing the object
        obj - cacheable object
      • get

        ICacheable get​(String name)
        Return a cached object with the given name.
        Parameters:
        name - the name of the object to return
        Returns:
        the object or null if no such object was found
      • remove

        boolean remove​(ICacheable obj)
        Delete the passed cached object.
        Parameters:
        obj - the object to delete
        Returns:
        true if was removed; false it wasn't in cache to begin with
      • remove

        boolean remove​(String name)
        Delete the cached object with the given name.
        Parameters:
        name - the name of the object to delete
        Returns:
        true if was removed; false it wasn't in cache to begin with
      • getObjectNames

        Iterator<String> getObjectNames()
        Return iterator over the names of all already loaded objects in the storage.
        Returns:
        iterator over all objects names
      • getObjects

        Iterator<SoftReference<? extends ICacheable>> getObjects()
        Return iterator over the already loaded objects in the storage.
        Returns:
        iterator over all objects
      • setMaxEntries

        void setMaxEntries​(int max)
        Sets the maximum number of entries for the cache.
        Parameters:
        max - upper-limit of the cache
      • destroy

        void destroy()
        Allows for cleanup of a cache implementation.