Interface RuleEngineCacheService
- All Known Implementing Classes:
DefaultCommerceRuleEngineCacheService,DefaultRuleEngineCacheService
public interface RuleEngineCacheService
The 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 (see
createKIEModuleCacheBuilder(DroolsKIEModuleModel). The KIEModuleCacheBuilder is then filled using
its KIEModuleCacheBuilder.processRule(AbstractRuleEngineRuleModel)
during rule module initialization. The addToCache(KIEModuleCacheBuilder) is used to add the cache to the
cache service (and replace any previously existing cache for that module).
During rule evaluation the provideCachedEntities(RuleEvaluationContext) is invoked to enhance the given rule
evaluation context with the cached entities.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCache(KIEModuleCacheBuilder cacheBuilder) adds the cached entities of the given cache builder to the global caching structure.createKIEModuleCacheBuilder(DroolsKIEModuleModel kieModule) creates a KIEModuleCacheBuilder object for the given kieModule.voidis invoked duringDefaultPlatformRuleEngineService.evaluate(de.hybris.platform.ruleengine.RuleEvaluationContext)and adds any cached entities (such as globals or facts) to the given context.
-
Method Details
-
createKIEModuleCacheBuilder
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
adds the cached entities of the given cache builder to the global caching structure.- Parameters:
cacheBuilder- the cache builder to use
-
provideCachedEntities
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
-