Interface HstCache


  • public interface HstCache
    HST Cache Interface for cache related activities. Abstraction around physical cache implementation.
    Version:
    $Id$
    • Method Detail

      • get

        CacheElement get​(Object key)
        Returns the CacheElement for key and null otherwise. Please be aware that if the underlying cache such as ehcache BlockingCache sets a lock using the key, then typically you need to free this lock your self.
        Parameters:
        key -
        Returns:
        the CacheElement for key and null otherwise
      • get

        CacheElement get​(Object key,
                         Callable<? extends CacheElement> valueLoader)
                  throws Exception
        Parameters:
        key - the key to get from the cache or to put an object for in the cache when the cache does not yet contain key
        valueLoader - will be used to load the value for key if cache does not yet contain an object for key. The loaded value is put in the cache. The valueLoader is not allowed to return null but is allowed to return a CacheElement with content null.
        Returns:
        the element from the cache, or the just retrieved and stored element through valueloader
        Throws:
        Exception
      • isKeyInCache

        boolean isKeyInCache​(Object key)
      • remove

        boolean remove​(Object key)
      • clear

        void clear()
      • getTimeToIdleSeconds

        int getTimeToIdleSeconds()
      • getTimeToLiveSeconds

        int getTimeToLiveSeconds()
      • getSize

        int getSize()
      • getMaxSize

        int getMaxSize()