Package de.caluga.morphium.cache
Interface MorphiumCache
-
- All Known Implementing Classes:
MorphiumCacheImpl,MorphiumCacheJCacheImpl
public interface MorphiumCacheUser: Stephan Bösebeck Date: 07.03.13 Time: 09:57 Cache interface . you can set your own cache implementation to morphium if it implements this interface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCacheListener(CacheListener cl)<T> voidaddToCache(String k, Class<? extends T> type, List<T> ret)voidclearCachefor(Class<?> cls)voidclearCacheIfNecessary(Class cls)voidclose()Set<Class<?>>getCachedTypes()StringgetCacheKey(Query q)StringgetCacheKey(Class type, Map<String,Object> qo, Map<String,Integer> sort, Map<String,Object> project, String collection, int skip, int limit)javax.cache.CacheManagergetCacheManager()<T> List<T>getFromCache(Class<? extends T> type, String k)<T> TgetFromIDCache(Class<? extends T> type, Object id)Map<String,Integer>getSizes()booleanisCached(Class<?> type, String k)booleanisListenerRegistered(CacheListener cl)voidremoveCacheListener(CacheListener cl)voidremoveEntryFromCache(Class cls, Object id)voidremoveEntryFromIdCache(Class cls, Object id)voidresetCache()voidsetAnnotationAndReflectionHelper(AnnotationAndReflectionHelper hlp)voidsetCacheManager(javax.cache.CacheManager cacheManager)voidsetDefaultCacheTime(Class type)reset cache time settings to default, if settings were cahnged using setValidCacheTimevoidsetGlobalCacheTimeout(int tm)voidsetHouskeepingIntervalPause(int p)voidsetValidCacheTime(Class type, int time)override the settings given in @Cache annotation with this value this is useful to change cache behaviour during runtime
-
-
-
Method Detail
-
getCacheKey
String getCacheKey(Class type, Map<String,Object> qo, Map<String,Integer> sort, Map<String,Object> project, String collection, int skip, int limit)
-
clearCachefor
void clearCachefor(Class<?> cls)
-
resetCache
void resetCache()
-
close
void close()
-
clearCacheIfNecessary
void clearCacheIfNecessary(Class cls)
-
addCacheListener
void addCacheListener(CacheListener cl)
-
removeCacheListener
void removeCacheListener(CacheListener cl)
-
isListenerRegistered
boolean isListenerRegistered(CacheListener cl)
-
setGlobalCacheTimeout
void setGlobalCacheTimeout(int tm)
-
setAnnotationAndReflectionHelper
void setAnnotationAndReflectionHelper(AnnotationAndReflectionHelper hlp)
-
setHouskeepingIntervalPause
void setHouskeepingIntervalPause(int p)
-
setValidCacheTime
void setValidCacheTime(Class type, int time)
override the settings given in @Cache annotation with this value this is useful to change cache behaviour during runtime- Parameters:
type-time-
-
setDefaultCacheTime
void setDefaultCacheTime(Class type)
reset cache time settings to default, if settings were cahnged using setValidCacheTime- Parameters:
type-
-
setCacheManager
void setCacheManager(javax.cache.CacheManager cacheManager)
-
getCacheManager
javax.cache.CacheManager getCacheManager()
-
-