Interface FunctionCache

All Known Implementing Classes:
MapFunctionCache

public interface FunctionCache
A contract that provides caching of a function object from a repository based on a unique name.
Since:
1.0.0
Author:
Przemek Hertel
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String functionName)
    Returns a function with a defined name functionName or null, if function does not exist at cache.
    void
    Evicts all functions from a cache
    void
    invalidate(String functionName)
    Evicts function functionName from a cache
    Returs all cache entries as snapshot.
    void
    put(String functionName, Function function)
    Inserts a function function under a key functionName.
    void
    putAll(Map<String,Function> functions)
     
  • Method Details

    • put

      void put(String functionName, Function function)
      Inserts a function function under a key functionName.
      Parameters:
      functionName - unique function name, used as a key for a cache
      function - function from a reposiotry
    • putAll

      void putAll(Map<String,Function> functions)
    • get

      Function get(String functionName)
      Returns a function with a defined name functionName or null, if function does not exist at cache.
      Parameters:
      functionName - name of a function
      Returns:
      function from a cache
    • invalidate

      void invalidate(String functionName)
      Evicts function functionName from a cache
      Parameters:
      functionName - name of a function
    • invalidate

      void invalidate()
      Evicts all functions from a cache
    • list

      Returs all cache entries as snapshot. All modification to this snapshot will not modify cache state.
      Returns:
      all cache entries as snapshot