Class DefaultServerCacheManager

java.lang.Object
io.ebeaninternal.server.cache.DefaultServerCacheManager
All Implemented Interfaces:
SpiCacheManager

public final class DefaultServerCacheManager extends Object implements SpiCacheManager
Manages the bean and query caches.
  • Constructor Details

    • DefaultServerCacheManager

      public DefaultServerCacheManager(CacheManagerOptions builder)
      Create with a cache factory and default cache options.
    • DefaultServerCacheManager

      public DefaultServerCacheManager()
      Construct when l2 cache is disabled.
  • Method Details

    • isLocalL2Caching

      public boolean isLocalL2Caching()
      Description copied from interface: SpiCacheManager
      Return true if the L2 caching is local.

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

      Specified by:
      isLocalL2Caching in interface SpiCacheManager
    • allRegions

      public List<io.ebean.cache.ServerCacheRegion> allRegions()
      Description copied from interface: SpiCacheManager
      Return all the regions.
      Specified by:
      allRegions in interface SpiCacheManager
    • setEnabledRegions

      public void setEnabledRegions(String regions)
      Description copied from interface: SpiCacheManager
      Set the regions that are enabled.
      Specified by:
      setEnabledRegions in interface SpiCacheManager
      Parameters:
      regions - A single region name or a comma delimited list of region names.
    • setAllRegionsEnabled

      public void setAllRegionsEnabled(boolean enabled)
      Description copied from interface: SpiCacheManager
      Enable or disable all cache regions.
      Specified by:
      setAllRegionsEnabled in interface SpiCacheManager
    • getRegion

      public SpiCacheRegion getRegion(String region)
      Description copied from interface: SpiCacheManager
      Return the cache region. We can enable L2 caching by region.
      Specified by:
      getRegion in interface SpiCacheManager
    • visitMetrics

      public void visitMetrics(io.ebean.meta.MetricVisitor visitor)
      Description copied from interface: SpiCacheManager
      Visit and collect the metrics.
      Specified by:
      visitMetrics in interface SpiCacheManager
    • clearAll

      public void clearAll()
      Clear all caches.
      Specified by:
      clearAll in interface SpiCacheManager
    • clearAllLocal

      public void clearAllLocal()
      Description copied from interface: SpiCacheManager
      Clear all local caches.
      Specified by:
      clearAllLocal in interface SpiCacheManager
    • clear

      public void clear(Class<?> beanType)
      Description copied from interface: SpiCacheManager
      Clear the caches for the given bean type.
      Specified by:
      clear in interface SpiCacheManager
    • clearLocal

      public void clearLocal(Class<?> beanType)
      Description copied from interface: SpiCacheManager
      Clear local caches for the given bean type.
      Specified by:
      clearLocal in interface SpiCacheManager
    • getCollectionIdsCache

      public io.ebean.cache.ServerCache getCollectionIdsCache(Class<?> beanType, String collectionProperty)
      Description copied from interface: SpiCacheManager
      Return the cache for associated many properties of a bean type.
      Specified by:
      getCollectionIdsCache in interface SpiCacheManager
    • getNaturalKeyCache

      public io.ebean.cache.ServerCache getNaturalKeyCache(Class<?> beanType)
      Description copied from interface: SpiCacheManager
      Return the cache for mapping natural keys to id values.
      Specified by:
      getNaturalKeyCache in interface SpiCacheManager
    • getQueryCache

      public io.ebean.cache.ServerCache getQueryCache(Class<?> beanType)
      Return the query cache for a given bean type.
      Specified by:
      getQueryCache in interface SpiCacheManager
    • getBeanCache

      public io.ebean.cache.ServerCache getBeanCache(Class<?> beanType)
      Return the bean cache for a given bean type.
      Specified by:
      getBeanCache in interface SpiCacheManager