Class NoopCacheTemplate
java.lang.Object
org.craftercms.core.util.cache.impl.DefaultCacheTemplate
org.craftercms.core.util.cache.impl.NoopCacheTemplate
- All Implemented Interfaces:
CacheTemplate
Extension of
DefaultCacheTemplate
that executes the given Callback
without additional checks.- Since:
- 3.1.18
- Author:
- joseross
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
getObject
(Context context, CachingOptions options, org.craftercms.commons.lang.Callback<T> callback, Object... keyElements) Executes the template, using the specified callback to load the object to cache, if it's not already in the cache.Methods inherited from class org.craftercms.core.util.cache.impl.DefaultCacheTemplate
doGet, doPut, getCacheLoader, getCacheService, getKey, getObject, hasObject, loadAndPutInCache, logGetFailure, logPutFailure, setCacheService
-
Constructor Details
-
NoopCacheTemplate
public NoopCacheTemplate()
-
-
Method Details
-
getObject
public <T> T getObject(Context context, CachingOptions options, org.craftercms.commons.lang.Callback<T> callback, Object... keyElements) Description copied from interface:CacheTemplate
Executes the template, using the specified callback to load the object to cache, if it's not already in the cache.- Specified by:
getObject
in interfaceCacheTemplate
- Overrides:
getObject
in classDefaultCacheTemplate
- Parameters:
context
- the context (needed by the cache service)options
- the options used for caching.callback
- the callback to use in case the object is not in the cachekeyElements
- the key elements, used to create the final cache key- Returns:
- the cached object
-