Interface CachingStrategy
-
- All Known Implementing Classes:
DefaultCachingStrategy
public interface CachingStrategyDefines a pluggable caching strategy. Caching strategies must have a public no-arg constructor. [testing, mocking]- Author:
- Holger Eichelberger, SSE
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheckCache(java.lang.Object data)Checks the cache if configured.booleancheckCache(java.lang.String key, java.lang.Object data)Checks a multi-cache if configured.voidclearCache()Clears the cache.static CachingStrategycreateInstance(java.lang.Class<? extends CachingStrategy> cls)Creates a default caching strategy instance based on a public non-arg constructor.voidsetCacheMode(ConnectorParameter.CacheMode mode)Defines the actual cache mode.
-
-
-
Method Detail
-
setCacheMode
void setCacheMode(ConnectorParameter.CacheMode mode)
Defines the actual cache mode.- Parameters:
mode- the actual cache mode
-
checkCache
boolean checkCache(java.lang.Object data)
Checks the cache if configured.- Parameters:
data- the data to send- Returns:
truefor sendingdata,falsefor not sendingdata
-
checkCache
boolean checkCache(java.lang.String key, java.lang.Object data)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
static CachingStrategy createInstance(java.lang.Class<? extends CachingStrategy> cls)
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
-
-