Package io.ebean.cache
Interface ServerCacheManager
-
public interface ServerCacheManager
The cache service for server side caching of beans and query results.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description List<ServerCacheRegion>
allRegions()
Return all the cache regions.void
allRegionsEnabled(boolean enabled)
Enable or disable all the cache regions.ServerCache
beanCache(Class<?> beanType)
Return the cache for beans of a particular type.void
clear(Class<?> beanType)
This clears both the bean and query cache for a given type.void
clearAll()
Clear all the caches.void
clearAllLocal()
Clear all the local caches.void
clearLocal(Class<?> beanType)
Clear the local caches for this bean type.ServerCache
collectionIdsCache(Class<?> beanType, String propertyName)
Return the cache for associated many properties of a bean type.void
enabledRegions(String regions)
Set the regions that are enabled.default ServerCache
getBeanCache(Class<?> beanType)
Deprecated.default ServerCache
getCollectionIdsCache(Class<?> beanType, String propertyName)
Deprecated.default ServerCache
getNaturalKeyCache(Class<?> beanType)
Deprecated.default ServerCache
getQueryCache(Class<?> beanType)
Deprecated.default ServerCacheRegion
getRegion(String name)
Deprecated.default boolean
isLocalL2Caching()
Deprecated.boolean
localL2Caching()
Return true if the L2 caching is local.ServerCache
naturalKeyCache(Class<?> beanType)
Return the cache for mapping natural keys to id values.ServerCache
queryCache(Class<?> beanType)
Return the cache for query results of a particular type of bean.ServerCacheRegion
region(String name)
Return the cache region by name.default void
setAllRegionsEnabled(boolean enabled)
Deprecated.default void
setEnabledRegions(String regions)
Deprecated.void
visitMetrics(MetricVisitor visitor)
Visit the metrics for all the server caches.
-
-
-
Method Detail
-
visitMetrics
void visitMetrics(MetricVisitor visitor)
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 default boolean isLocalL2Caching()
Deprecated.Deprecated migrate to localL2Caching().
-
allRegions
List<ServerCacheRegion> allRegions()
Return all the cache regions.
-
enabledRegions
void enabledRegions(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.
-
setEnabledRegions
@Deprecated default void setEnabledRegions(String regions)
Deprecated.Deprecated migrate to enabledRegions().
-
allRegionsEnabled
void allRegionsEnabled(boolean enabled)
Enable or disable all the cache regions.
-
setAllRegionsEnabled
@Deprecated default void setAllRegionsEnabled(boolean enabled)
Deprecated.Deprecated migrate to allRegionsEnabled().
-
region
ServerCacheRegion region(String name)
Return the cache region by name. Typically, to enable or disable the region.
-
getRegion
@Deprecated default ServerCacheRegion getRegion(String name)
Deprecated.
-
naturalKeyCache
ServerCache naturalKeyCache(Class<?> beanType)
Return the cache for mapping natural keys to id values.
-
getNaturalKeyCache
@Deprecated default ServerCache getNaturalKeyCache(Class<?> beanType)
Deprecated.
-
beanCache
ServerCache beanCache(Class<?> beanType)
Return the cache for beans of a particular type.
-
getBeanCache
@Deprecated default ServerCache getBeanCache(Class<?> beanType)
Deprecated.
-
collectionIdsCache
ServerCache collectionIdsCache(Class<?> beanType, String propertyName)
Return the cache for associated many properties of a bean type.
-
getCollectionIdsCache
@Deprecated default ServerCache getCollectionIdsCache(Class<?> beanType, String propertyName)
Deprecated.
-
queryCache
ServerCache queryCache(Class<?> beanType)
Return the cache for query results of a particular type of bean.
-
getQueryCache
@Deprecated default ServerCache getQueryCache(Class<?> beanType)
Deprecated.
-
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
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.
-
-