com.avaje.ebean.cache
Interface ServerCacheManager


public interface ServerCacheManager

The cache service for server side caching of beans and query results.


Method Summary
 void clear(Class<?> beanType)
          This clears both the bean and query cache for a given type.
 void clearAll()
          Clear all the caches.
 ServerCache getBeanCache(Class<?> beanType)
          Return the cache for beans of a particular 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 cache for query results of a particular type of bean.
 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 bean cache for this type of bean.
 void setCaching(Class<?> beanType, boolean useCache)
           
 

Method Detail

init

void init(EbeanServer server)
This method is called just after the construction of the ServerCacheManager.

The EbeanServer is provided so that cache implementations can make use of EbeanServer and BackgroundExecutor for automatically populating and background trimming of the cache.


setCaching

void setCaching(Class<?> beanType,
                boolean useCache)

isBeanCaching

boolean isBeanCaching(Class<?> beanType)
Return true if there is an active bean cache for this type of bean.


getNaturalKeyCache

ServerCache getNaturalKeyCache(Class<?> beanType)
Return the cache for mapping natural keys to id values.


getBeanCache

ServerCache getBeanCache(Class<?> beanType)
Return the cache for beans of a particular type.


getCollectionIdsCache

ServerCache getCollectionIdsCache(Class<?> beanType,
                                  String propertyName)

getQueryCache

ServerCache getQueryCache(Class<?> beanType)
Return the cache for query results of a particular type of bean.


clear

void clear(Class<?> beanType)
This clears both the bean and query cache for a given type.


clearAll

void clearAll()
Clear all the caches.



Copyright © 2012. All Rights Reserved.