Package io.ebean.cache
Interface ServerCacheManager
public interface ServerCacheManager
The cache service for server side caching of beans and query results.
-
Method Summary
Modifier and Type Method Description List<ServerCacheRegion>allRegions()Return all the cache regions.voidallRegionsEnabled(boolean enabled)Enable or disable all the cache regions.ServerCachebeanCache(Class<?> beanType)Return the cache for beans of a particular type.voidclear(Class<?> beanType)This clears both the bean and query cache for a given type.voidclearAll()Clear all the caches.voidclearAllLocal()Clear all the local caches.voidclearLocal(Class<?> beanType)Clear the local caches for this bean type.ServerCachecollectionIdsCache(Class<?> beanType, String propertyName)Return the cache for associated many properties of a bean type.voidenabledRegions(String regions)Set the regions that are enabled.default ServerCachegetBeanCache(Class<?> beanType)Deprecated.default ServerCachegetCollectionIdsCache(Class<?> beanType, String propertyName)Deprecated.default ServerCachegetNaturalKeyCache(Class<?> beanType)Deprecated.default ServerCachegetQueryCache(Class<?> beanType)Deprecated.default ServerCacheRegiongetRegion(String name)Deprecated.default booleanisLocalL2Caching()Deprecated.booleanlocalL2Caching()Return true if the L2 caching is local.ServerCachenaturalKeyCache(Class<?> beanType)Return the cache for mapping natural keys to id values.ServerCachequeryCache(Class<?> beanType)Return the cache for query results of a particular type of bean.ServerCacheRegionregion(String name)Return the cache region by name.default voidsetAllRegionsEnabled(boolean enabled)Deprecated.default voidsetEnabledRegions(String regions)Deprecated.voidvisitMetrics(MetricVisitor visitor)Visit the metrics for all the server caches.
-
Method Details
-
visitMetrics
Visit the metrics for all the server caches. -
localL2Caching
boolean localL2Caching()Return true if the L2 caching is local.Local L2 caching means that the cache updates should occur in foreground rather than background processing.
-
isLocalL2Caching
Deprecated.Deprecated migrate to localL2Caching(). -
allRegions
Return all the cache regions. -
enabledRegions
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.
-
setEnabledRegions
Deprecated.Deprecated migrate to enabledRegions(). -
allRegionsEnabled
Enable or disable all the cache regions. -
setAllRegionsEnabled
Deprecated.Deprecated migrate to allRegionsEnabled(). -
region
Return the cache region by name. Typically, to enable or disable the region. -
getRegion
Deprecated. -
naturalKeyCache
Return the cache for mapping natural keys to id values. -
getNaturalKeyCache
Deprecated. -
beanCache
Return the cache for beans of a particular type. -
getBeanCache
Deprecated. -
collectionIdsCache
Return the cache for associated many properties of a bean type. -
getCollectionIdsCache
Deprecated. -
queryCache
Return the cache for query results of a particular type of bean. -
getQueryCache
Deprecated. -
clear
This clears both the bean and query cache for a given type. -
clearAll
void clearAll()Clear all the caches. -
clearAllLocal
void 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
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.
-