Class ClasspathDecisionLoader

java.lang.Object
io.gorules.zen.loader.ClasspathDecisionLoader
All Implemented Interfaces:
DecisionLoader

public class ClasspathDecisionLoader extends Object implements DecisionLoader
Loads decision models from classpath resources.
  • Constructor Details

    • ClasspathDecisionLoader

      public ClasspathDecisionLoader(String rootPath)
      Create classpath loader with default caching enabled.
      Parameters:
      rootPath - Root classpath path
    • ClasspathDecisionLoader

      public ClasspathDecisionLoader(String rootPath, boolean useCache)
      Create classpath loader with caching option.
      Parameters:
      rootPath - Root classpath path
      useCache - Whether to cache loaded decisions
  • Method Details

    • load

      public CompletableFuture<io.gorules.zen_engine.JsonBuffer> load(String key)
      Description copied from interface: DecisionLoader
      Load a decision by its key.
      Specified by:
      load in interface DecisionLoader
      Parameters:
      key - Decision key/filename
      Returns:
      CompletableFuture with decision content as JsonBuffer
    • clearCache

      public void clearCache()
      Clear the cache.
    • evict

      public void evict(String key)
      Evict a specific decision from cache.
      Parameters:
      key - Decision key to evict