Interface ICacheEntryValidity

  • All Known Implementing Classes:
    AlwaysValidCacheEntryValidity, NonCacheableCacheEntryValidity, TTLCacheEntryValidity

    public interface ICacheEntryValidity

    Common interface for all objects defining the validity of a template resolution.

    These objects are queried by the Template Cache for knowing whether a template is cacheable or not, and also for determining if an existing cache entry is still valid.

    A typical implementation is TTLCacheEntryValidity, which determines the validity of a cache entry based on a TTL (time-to-live).

    Since:
    1.0
    Author:
    Daniel Fernández
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isCacheable()
      Returns whether the template resolution can be included into the cache or not.
      boolean isCacheStillValid()
      Returns whether this template resolution is still valid or not (and therefore its corresponding cache entry.
    • Method Detail

      • isCacheable

        boolean isCacheable()

        Returns whether the template resolution can be included into the cache or not.

        Returns:
        true if the parsed template can be included into the cache, false if not.
      • isCacheStillValid

        boolean isCacheStillValid()

        Returns whether this template resolution is still valid or not (and therefore its corresponding cache entry. Will only be ever called if isCacheable() returns true.

        This method will be called by the Parsed Template Cache before returning a cache entry, so that it can be invalidated if needed, and so trigger a new template resolution operation.

        Returns:
        whether the template resolution can be still considered valid or not.