java.lang.Object
io.ebeaninternal.server.cache.DefaultServerCacheManager
- All Implemented Interfaces:
SpiCacheManager
Manages the bean and query caches.
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct when l2 cache is disabled.Create with a cache factory and default cache options. -
Method Summary
Modifier and TypeMethodDescriptionReturn all the regions.voidClear the caches for the given bean type.voidclearAll()Clear all caches.voidClear all local caches.voidclearLocal(Class<?> beanType) Clear local caches for the given bean type.getBeanCache(Class<?> beanType) Return the bean cache for a given bean type.getCollectionIdsCache(Class<?> beanType, String collectionProperty) Return the cache for associated many properties of a bean type.getNaturalKeyCache(Class<?> beanType) Return the cache for mapping natural keys to id values.getQueryCache(Class<?> beanType) Return the query cache for a given bean type.Return the cache region.booleanReturn true if the L2 caching is local.voidsetAllRegionsEnabled(boolean enabled) Enable or disable all cache regions.voidsetEnabledRegions(String regions) Set the regions that are enabled.voidvisitMetrics(MetricVisitor visitor) Visit and collect the metrics.
-
Constructor Details
-
DefaultServerCacheManager
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:SpiCacheManagerReturn 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:
isLocalL2Cachingin interfaceSpiCacheManager
-
allRegions
Description copied from interface:SpiCacheManagerReturn all the regions.- Specified by:
allRegionsin interfaceSpiCacheManager
-
setEnabledRegions
Description copied from interface:SpiCacheManagerSet the regions that are enabled.- Specified by:
setEnabledRegionsin interfaceSpiCacheManager- Parameters:
regions- A single region name or a comma delimited list of region names.
-
setAllRegionsEnabled
public void setAllRegionsEnabled(boolean enabled) Description copied from interface:SpiCacheManagerEnable or disable all cache regions.- Specified by:
setAllRegionsEnabledin interfaceSpiCacheManager
-
getRegion
Description copied from interface:SpiCacheManagerReturn the cache region. We can enable L2 caching by region.- Specified by:
getRegionin interfaceSpiCacheManager
-
visitMetrics
Description copied from interface:SpiCacheManagerVisit and collect the metrics.- Specified by:
visitMetricsin interfaceSpiCacheManager
-
clearAll
public void clearAll()Clear all caches.- Specified by:
clearAllin interfaceSpiCacheManager
-
clearAllLocal
public void clearAllLocal()Description copied from interface:SpiCacheManagerClear all local caches.- Specified by:
clearAllLocalin interfaceSpiCacheManager
-
clear
Description copied from interface:SpiCacheManagerClear the caches for the given bean type.- Specified by:
clearin interfaceSpiCacheManager
-
clearLocal
Description copied from interface:SpiCacheManagerClear local caches for the given bean type.- Specified by:
clearLocalin interfaceSpiCacheManager
-
getCollectionIdsCache
Description copied from interface:SpiCacheManagerReturn the cache for associated many properties of a bean type.- Specified by:
getCollectionIdsCachein interfaceSpiCacheManager
-
getNaturalKeyCache
Description copied from interface:SpiCacheManagerReturn the cache for mapping natural keys to id values.- Specified by:
getNaturalKeyCachein interfaceSpiCacheManager
-
getQueryCache
Return the query cache for a given bean type.- Specified by:
getQueryCachein interfaceSpiCacheManager
-
getBeanCache
Return the bean cache for a given bean type.- Specified by:
getBeanCachein interfaceSpiCacheManager
-