Class DefaultChildCacheFinder

Object
DefaultChildCacheFinder
All Implemented Interfaces:
ChildCacheFinder

public class DefaultChildCacheFinder extends Object implements ChildCacheFinder
The default strategy for finding children by always directly taking (or creating a child-cache) as necessary.
  • Method Details

    • childCacheFor

      public <V extends FeatureInput> FeatureCalculationCache<V> childCacheFor(FeatureCalculationCache<?> parentCache, CacheCreator factory, ChildCacheName childName, V input)
      Description copied from interface: ChildCacheFinder
      Selects a child-cache given a parent and a child-name.

      This may involve reusing an existing cache, or creating a new one, depending on the strategy.

      Specified by:
      childCacheFor in interface ChildCacheFinder
      Type Parameters:
      V - type-of-input to be used to calculate on the child-cache
      Parameters:
      parentCache - the existing parent-cache
      factory - how to create new caches
      childName - name of child-cache
      input - input to be used for calculations on the child-cache
      Returns:
      an existing or newly created child-cache depending on the strategy.
    • finderForGrandchild

      public ChildCacheFinder finderForGrandchild()
      Description copied from interface: ChildCacheFinder
      What finder to use for children-of-children?
      Specified by:
      finderForGrandchild in interface ChildCacheFinder
      Returns:
      the finder to use.
    • instance

      public static ChildCacheFinder instance()
      Singleton instance of DefaultChildCacheFinder.
      Returns:
      the singleton instance.
    • cachesToAvoidInvalidating

      public Optional<Set<ChildCacheName>> cachesToAvoidInvalidating()
      Description copied from interface: ChildCacheFinder
      If set, these particular-caches are exceptionally not invalidated during the typical invalidation operation on their parent.

      If not-set, there are no exceptions.

      Specified by:
      cachesToAvoidInvalidating in interface ChildCacheFinder
      Returns:
      the names of the caches that are exceptionally not invalidated, if any exist.