Package io.gorules.zen.loader
Class ClasspathDecisionLoader
java.lang.Object
io.gorules.zen.loader.ClasspathDecisionLoader
- All Implemented Interfaces:
DecisionLoader
Loads decision models from classpath resources.
-
Constructor Summary
ConstructorsConstructorDescriptionClasspathDecisionLoader(String rootPath) Create classpath loader with default caching enabled.ClasspathDecisionLoader(String rootPath, boolean useCache) Create classpath loader with caching option. -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the cache.voidEvict a specific decision from cache.CompletableFuture<io.gorules.zen_engine.JsonBuffer> Load a decision by its key.
-
Constructor Details
-
ClasspathDecisionLoader
Create classpath loader with default caching enabled.- Parameters:
rootPath- Root classpath path
-
ClasspathDecisionLoader
Create classpath loader with caching option.- Parameters:
rootPath- Root classpath pathuseCache- Whether to cache loaded decisions
-
-
Method Details
-
load
Description copied from interface:DecisionLoaderLoad a decision by its key.- Specified by:
loadin interfaceDecisionLoader- Parameters:
key- Decision key/filename- Returns:
- CompletableFuture with decision content as JsonBuffer
-
clearCache
public void clearCache()Clear the cache. -
evict
Evict a specific decision from cache.- Parameters:
key- Decision key to evict
-