Interface CacheEngine

All Known Implementing Classes:
AbstractCacheEngine, BlackHoleCacheEngine, MemoryCacheEngine

public interface CacheEngine
The cache engine is responsible for adding, retrieving and managing the lifetime of cached items. All cache engine implementation must implements this interface.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String cacheKey)
    Retrieves a value from cache.
    void
    remove(String cacheKey)
    Removes a value from cache.
    void
    set(String cacheKey, Object value, int timeToLive)
    Sets a value to the cache.
  • Method Details

    • get

      Object get(String cacheKey)
      Retrieves a value from cache.
      Parameters:
      cacheKey - The key
      Returns:
      The value, otherwise, null
      Since:
      1.0.0
    • set

      void set(String cacheKey, Object value, int timeToLive)
      Sets a value to the cache.
      Parameters:
      cacheKey - The key
      value - The value
      timeToLive - Retention time (in seconds)
      Since:
      1.0.0
    • remove

      void remove(String cacheKey)
      Removes a value from cache.
      Parameters:
      cacheKey - The key
      Since:
      1.0.1