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
-
Field Summary
Fields inherited from class org.craftercms.core.util.cache.impl.DefaultCacheTemplate
cacheService, lockByKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetObject(Context context, CachingOptions options, org.craftercms.commons.lang.Callback<T> callback, Object... keyElements) Retrieves an object from the cache, or loads and caches it using the given callback and caching options if not present.Methods inherited from class org.craftercms.core.util.cache.impl.DefaultCacheTemplate
doGet, doPut, getCacheLoader, getCacheService, getKey, getObject, hasObject, loadAndPutInCache, logGetFailure, logPutFailure
-
Constructor Details
-
NoopCacheTemplate
-
-
Method Details
-
getObject
public <T> T getObject(Context context, CachingOptions options, org.craftercms.commons.lang.Callback<T> callback, Object... keyElements) Description copied from class:DefaultCacheTemplateRetrieves an object from the cache, or loads and caches it using the given callback and caching options if not present. Ensures only one thread loads the object per key at a time.- Specified by:
getObjectin interfaceCacheTemplate- Overrides:
getObjectin classDefaultCacheTemplate- Type Parameters:
T- the type of the object- Parameters:
context- the cache contextoptions- the caching options to usecallback- the callback to load the object if not presentkeyElements- elements to generate the key from- Returns:
- the cached or loaded object
-