Class NoopCacheTemplate

java.lang.Object
org.craftercms.core.util.cache.impl.DefaultCacheTemplate
org.craftercms.core.util.cache.impl.NoopCacheTemplate
All Implemented Interfaces:
CacheTemplate

public class NoopCacheTemplate extends DefaultCacheTemplate
Extension of DefaultCacheTemplate that executes the given Callback without additional checks.
Since:
3.1.18
Author:
joseross
  • Constructor Details

    • NoopCacheTemplate

      public NoopCacheTemplate(CacheService cacheService)
  • Method Details

    • getObject

      public <T> T getObject(Context context, CachingOptions options, org.craftercms.commons.lang.Callback<T> callback, Object... keyElements)
      Description copied from class: DefaultCacheTemplate
      Retrieves 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:
      getObject in interface CacheTemplate
      Overrides:
      getObject in class DefaultCacheTemplate
      Type Parameters:
      T - the type of the object
      Parameters:
      context - the cache context
      options - the caching options to use
      callback - the callback to load the object if not present
      keyElements - elements to generate the key from
      Returns:
      the cached or loaded object