Package io.gorules.zen.loader
Class FilesystemDecisionLoader
java.lang.Object
io.gorules.zen.loader.FilesystemDecisionLoader
- All Implemented Interfaces:
DecisionLoader
Loads decision models from the filesystem.
-
Constructor Summary
ConstructorsConstructorDescriptionFilesystemDecisionLoader(String rootPath) Create filesystem loader with default caching enabled.FilesystemDecisionLoader(String rootPath, boolean useCache) Create filesystem 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
-
FilesystemDecisionLoader
Create filesystem loader with default caching enabled.- Parameters:
rootPath- Root directory path
-
FilesystemDecisionLoader
Create filesystem loader with caching option.- Parameters:
rootPath- Root directory 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
-