Interface CacheController

All Known Implementing Classes:
DefaultCacheController

public interface CacheController
Main point connecting platform with cache.
Implementing class is responsible for:
  • Processes adding from cache.
  • Processes invalidating cache units.
  • Clearing cache units.
  • Method Details

    • getWithLoader

      <T> T getWithLoader(CacheKey key, CacheValueLoader<T> loader) throws CacheValueLoadException
      Gets stored value from cache. If value is not available loader is invoked.
      Throws:
      CacheValueLoadException
    • get

      <T> T get(CacheKey key)
      Gets value stored in the cache. If value is not already loaded returns NULL.
    • invalidate

      void invalidate(CacheKey key)
      Performs key invalidation from cache.
      Method checks invalidation filters and cache registry.
    • getRegions

      Collection<CacheRegion> getRegions()
      Returns all regions used in this controller.
    • remove

      void remove(CacheKey key)
      Removes key
    • clearCache

      void clearCache(CacheRegion region)
      Clears cache
    • addLifecycleCallback

      void addLifecycleCallback(CacheLifecycleCallback callback)
      registers a lifecycle callback. Callbacks are executed in order of registration.
    • removeLifecycleCallback

      void removeLifecycleCallback(CacheLifecycleCallback callback)
      Removes a registered lifecycle callback.
    • setStatsEnabled

      void setStatsEnabled(boolean enabled)
      Allows to enable or disable collecting of statistics for all regions in one step. Collection of cache statistics has negative impact on cache performance.
    • registerTenant

      void registerTenant(String tenantId)
      Setups registry for tenant