public class DefaultServerCacheManager extends Object implements ServerCacheManager
| Constructor and Description |
|---|
DefaultServerCacheManager(ServerCacheFactory cacheFactory,
ServerCacheOptions defaultBeanOptions,
ServerCacheOptions defaultQueryOptions)
Create with a cache factory and default cache options.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Class<?> beanType)
Clear both the bean cache and the query cache for a
given bean type.
|
void |
clearAll()
Clear all the caches.
|
ServerCache |
getBeanCache(Class<?> beanType)
Return the bean cache for a given bean type.
|
ServerCache |
getCollectionIdsCache(Class<?> beanType,
String propertyName) |
ServerCache |
getNaturalKeyCache(Class<?> beanType)
Return the cache for mapping natural keys to id values.
|
ServerCache |
getQueryCache(Class<?> beanType)
Return the query cache for a given bean type.
|
void |
init(EbeanServer server)
This method is called just after the construction of the
ServerCacheManager.
|
boolean |
isBeanCaching(Class<?> beanType)
Return true if there is an active cache for the given bean type.
|
boolean |
isCollectionIdsCaching(Class<?> beanType) |
boolean |
isNaturalKeyCaching(Class<?> beanType) |
boolean |
isQueryCaching(Class<?> beanType) |
void |
setCaching(Class<?> beanType,
boolean useCache) |
public DefaultServerCacheManager(ServerCacheFactory cacheFactory, ServerCacheOptions defaultBeanOptions, ServerCacheOptions defaultQueryOptions)
public void init(EbeanServer server)
ServerCacheManagerThe EbeanServer is provided so that cache implementations can make use of EbeanServer and BackgroundExecutor for automatically populating and background trimming of the cache.
init in interface ServerCacheManagerpublic void setCaching(Class<?> beanType, boolean useCache)
setCaching in interface ServerCacheManagerpublic void clear(Class<?> beanType)
clear in interface ServerCacheManagerpublic void clearAll()
ServerCacheManagerclearAll in interface ServerCacheManagerpublic ServerCache getCollectionIdsCache(Class<?> beanType, String propertyName)
getCollectionIdsCache in interface ServerCacheManagerpublic boolean isCollectionIdsCaching(Class<?> beanType)
public ServerCache getNaturalKeyCache(Class<?> beanType)
ServerCacheManagergetNaturalKeyCache in interface ServerCacheManagerpublic boolean isNaturalKeyCaching(Class<?> beanType)
public ServerCache getQueryCache(Class<?> beanType)
getQueryCache in interface ServerCacheManagerpublic ServerCache getBeanCache(Class<?> beanType)
getBeanCache in interface ServerCacheManagerpublic boolean isBeanCaching(Class<?> beanType)
isBeanCaching in interface ServerCacheManagerpublic boolean isQueryCaching(Class<?> beanType)
Copyright © 2014. All Rights Reserved.