Class DefaultKIEModuleCacheBuilder

    • Constructor Detail

      • DefaultKIEModuleCacheBuilder

        public DefaultKIEModuleCacheBuilder​(RuleGlobalsBeanProvider ruleGlobalsBeanProvider,
                                            DroolsKIEModuleModel kieModule,
                                            java.util.function.Function<DroolsKIEBaseModel,​java.lang.Object> kieBaseCacheKeyGenerator,
                                            boolean failOnBeanMismatches)
        Parameters:
        kieModule - the kieModule for this cache builder
        kieBaseCacheKeyGenerator - the cache key generator to be used
        failOnBeanMismatches - throws IllegalArgumentException during processRule(AbstractRuleEngineRuleModel) if the currently processed rule introduces a global with the same identifier but different type
    • Method Detail

      • processRule

        public <T extends AbstractRuleEngineRuleModel> void processRule​(T rule)
        Description copied from interface: KIEModuleCacheBuilder
        processes the given rule by adding it's cache-able data (e.g. it's globals and "static" facts) to its internal caching structures.
        Specified by:
        processRule in interface KIEModuleCacheBuilder
        Parameters:
        rule - the rule for which to add the cache-able data
      • escalateOnBeanMismatchesIfNecessary

        protected void escalateOnBeanMismatchesIfNecessary​(java.lang.String message)
      • getCachedGlobalsForKieBase

        protected java.util.Map<java.lang.String,​java.lang.Object> getCachedGlobalsForKieBase​(DroolsKIEBaseModel kieBase)
        returns the non-null cache segment for the given kie base.
      • getGlobalsCache

        public java.util.Map<java.lang.Object,​java.util.Map<java.lang.String,​java.lang.Object>> getGlobalsCache()
      • getKieBaseCacheKeyGenerator

        protected java.util.function.Function<DroolsKIEBaseModel,​java.lang.Object> getKieBaseCacheKeyGenerator()