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()
  • 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 interface CacheTemplate
      Overrides:
      getObject in class DefaultCacheTemplate
      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 cache
      keyElements - the key elements, used to create the final cache key
      Returns:
      the cached object