Interface CachingStrategy
- All Known Implementing Classes:
DefaultCachingStrategy
public interface CachingStrategy
Defines a pluggable caching strategy. Caching strategies must have a public no-arg constructor. [testing, mocking]
- Author:
- Holger Eichelberger, SSE
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckCache(Object data) Checks the cache if configured.booleancheckCache(String key, Object data) Checks a multi-cache if configured.voidClears the cache.static CachingStrategycreateInstance(Class<? extends CachingStrategy> cls) Creates a default caching strategy instance based on a public non-arg constructor.voidDefines the actual cache mode.
-
Method Details
-
setCacheMode
Defines the actual cache mode.- Parameters:
mode- the actual cache mode
-
checkCache
Checks the cache if configured.- Parameters:
data- the data to send- Returns:
truefor sendingdata,falsefor not sendingdata
-
checkCache
Checks a multi-cache if configured.- Parameters:
key- a key into the cachedata- the data to send- Returns:
truefor sendingdata,falsefor not sendingdata
-
clearCache
void clearCache()Clears the cache. -
createInstance
Creates a default caching strategy instance based on a public non-arg constructor.- Parameters:
cls- the class to create the strategy for, may be null- Returns:
- the strategy instance or an instance of
DefaultCachingStrategy
-