Interface RuleEngineCacheService
-
- All Known Implementing Classes:
DefaultCommerceRuleEngineCacheService,DefaultRuleEngineCacheService
public interface RuleEngineCacheServiceThe RuleEngineCacheService is designed to facilitate the caching of entities like globals or facts that are "static", i.e. that don't change during the life time of a rules module version. The cache service allows to create cache builders for rules module (seecreateKIEModuleCacheBuilder(DroolsKIEModuleModel). TheKIEModuleCacheBuilderis then filled using itsKIEModuleCacheBuilder.processRule(AbstractRuleEngineRuleModel)during rule module initialization. TheaddToCache(KIEModuleCacheBuilder)is used to add the cache to the cache service (and replace any previously existing cache for that module). During rule evaluation theprovideCachedEntities(RuleEvaluationContext)is invoked to enhance the given rule evaluation context with the cached entities.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddToCache(KIEModuleCacheBuilder cacheBuilder)adds the cached entities of the given cache builder to the global caching structure.KIEModuleCacheBuildercreateKIEModuleCacheBuilder(DroolsKIEModuleModel kieModule)creates a KIEModuleCacheBuilder object for the given kieModule.voidprovideCachedEntities(RuleEvaluationContext context)is invoked duringDefaultPlatformRuleEngineService.evaluate(de.hybris.platform.ruleengine.RuleEvaluationContext)and adds any cached entities (such as globals or facts) to the given context.
-
-
-
Method Detail
-
createKIEModuleCacheBuilder
KIEModuleCacheBuilder createKIEModuleCacheBuilder(DroolsKIEModuleModel kieModule)
creates a KIEModuleCacheBuilder object for the given kieModule. The cache builder processes the kie module's rules (seeKIEModuleCacheBuilder.processRule(AbstractRuleEngineRuleModel). In order to add the cache for the module useaddToCache(KIEModuleCacheBuilder).- Parameters:
kieModule- the instance ofDroolsKIEModuleModelfor which to create the cached items- Returns:
- a newly instantiated cache builder for the given kieModule
-
addToCache
void addToCache(KIEModuleCacheBuilder cacheBuilder)
adds the cached entities of the given cache builder to the global caching structure.- Parameters:
cacheBuilder- the cache builder to use
-
provideCachedEntities
void provideCachedEntities(RuleEvaluationContext context)
is invoked duringDefaultPlatformRuleEngineService.evaluate(de.hybris.platform.ruleengine.RuleEvaluationContext)and adds any cached entities (such as globals or facts) to the given context.- Parameters:
context- the context object to enhance with facts
-
-