Interface CachingStrategy

All Known Implementing Classes:
DefaultCachingStrategy

public interface CachingStrategy
Defines a pluggable caching strategy. Caching strategies must have a public no-arg constructor. [testing, mocking]
Author:
Holger Eichelberger, SSE
  • Method Details

    • setCacheMode

      void setCacheMode(ConnectorParameter.CacheMode mode)
      Defines the actual cache mode.
      Parameters:
      mode - the actual cache mode
    • checkCache

      boolean checkCache(Object data)
      Checks the cache if configured.
      Parameters:
      data - the data to send
      Returns:
      true for sending data, false for not sending data
    • checkCache

      boolean checkCache(String key, Object data)
      Checks a multi-cache if configured.
      Parameters:
      key - a key into the cache
      data - the data to send
      Returns:
      true for sending data, false for not sending data
    • clearCache

      void clearCache()
      Clears the cache.
    • createInstance

      static CachingStrategy createInstance(Class<? extends CachingStrategy> cls)
      Creates a default caching strategy instance based on a public non-arg constructor.
      Parameters:
      cls - the class to create the strategy for, may be null
      Returns:
      the strategy instance or an instance of DefaultCachingStrategy