Interface ServerCacheManager


public interface ServerCacheManager
The cache service for server side caching of beans and query results.
  • Method Details

    • visitMetrics

      void visitMetrics​(MetricVisitor visitor)
      Visit the metrics for all the server caches.
    • isLocalL2Caching

      boolean isLocalL2Caching()
      Return true if the L2 caching is local.

      Local L2 caching means that the cache updates should occur in foreground rather than background processing.

    • allRegions

      Return all the cache regions.
    • setEnabledRegions

      void setEnabledRegions​(String regions)
      Set the regions that are enabled.

      Typically this is set on startup and at runtime (via dynamic configuration).

      Parameters:
      regions - A region name or comma delimited list of region names.
    • setAllRegionsEnabled

      void setAllRegionsEnabled​(boolean enabled)
      Enable or disable all the cache regions.
    • getRegion

      Return the cache region by name. Typically to enable or disable the region.
    • getNaturalKeyCache

      Return the cache for mapping natural keys to id values.
    • getBeanCache

      ServerCache getBeanCache​(Class<?> beanType)
      Return the cache for beans of a particular type.
    • getCollectionIdsCache

      ServerCache getCollectionIdsCache​(Class<?> beanType, String propertyName)
      Return the cache for associated many properties of a bean type.
    • getQueryCache

      ServerCache getQueryCache​(Class<?> beanType)
      Return the cache for query results of a particular type of bean.
    • clear

      void clear​(Class<?> beanType)
      This clears both the bean and query cache for a given type.
    • clearAll

      void clearAll()
      Clear all the caches.
    • clearAllLocal

      Clear all the local caches.

      This is used when the L2 Cache is based on clustered near-caches (Like Ebean-K8s-L2Cache). It is not used when the L2 cache is a distributed cache such as HazelCast or Ignite etc.

    • clearLocal

      void clearLocal​(Class<?> beanType)
      Clear the local caches for this bean type.

      This is used when the L2 Cache is based on clustered near-caches (Like Ebean-K8s-L2Cache). It is not used when the L2 cache is a distributed cache such as HazelCast or Ignite etc.