Class DefaultKieSessionHelper<T>

    • Constructor Detail

      • DefaultKieSessionHelper

        public DefaultKieSessionHelper()
    • Method Detail

      • initializeSession

        public T initializeSession​(java.lang.Class<T> kieSessionClass,
                                   RuleEvaluationContext context,
                                   org.kie.api.runtime.KieContainer kieContainer)
        Description copied from interface: KieSessionHelper
        given the RuleEvaluationContext and currently active instance of KieContainer, initializes the KieSessionHelper kie session for evaluation of rules
        Specified by:
        initializeSession in interface KieSessionHelper<T>
        Parameters:
        kieSessionClass - implementation class of the Kie session (KieSession or StatelessKieSession)
        context - instance of RuleEvaluationContext
        kieContainer - currently active instance of KieContainer
        Returns:
        initialized instance of KieSession
      • initializeStatelessKieSessionInternal

        protected org.kie.api.runtime.StatelessKieSession initializeStatelessKieSessionInternal​(RuleEvaluationContext context,
                                                                                                DroolsRuleEngineContextModel ruleEngineContext,
                                                                                                org.kie.api.runtime.KieContainer kieContainer)
      • assertKieSessionClass

        protected void assertKieSessionClass​(java.lang.Class<T> kieSessionClass)
      • assertSessionIsStateless

        protected void assertSessionIsStateless​(DroolsKIESessionModel kieSession)
      • registerKieSessionListeners

        protected void registerKieSessionListeners​(RuleEvaluationContext context,
                                                   org.kie.api.runtime.KieSession session,
                                                   java.lang.Long maximumExecutions)
      • registerStatelessKieSessionListeners

        protected void registerStatelessKieSessionListeners​(RuleEvaluationContext context,
                                                            org.kie.api.runtime.StatelessKieSession session,
                                                            java.lang.Long maximumExecutions)
      • teardownSessionsPools

        @PreDestroy
        protected void teardownSessionsPools()
      • getKieContainerSessionsPool

        protected org.kie.api.runtime.KieSessionsPool getKieContainerSessionsPool​(org.kie.api.runtime.KieContainer kieContainer,
                                                                                  boolean stateless)
      • shutdownKieSessionPools

        public void shutdownKieSessionPools​(java.lang.String moduleName,
                                            java.lang.String version)
        removes all old kieContainers (same artifactId but other versions) after successful swapping
        Specified by:
        shutdownKieSessionPools in interface KieSessionHelper<T>
        Parameters:
        moduleName - the rule module name
        version - the rule module version
      • getKieSessionsPools

        protected java.util.Map<org.kie.api.runtime.KieContainer,​org.kie.api.runtime.KieSessionsPool> getKieSessionsPools()
      • setRuleExecutionCounterClass

        public void setRuleExecutionCounterClass​(java.lang.Class<? extends RuleExecutionCountListener> ruleExecutionCounterClass)
      • getKieSessionPoolInitialCapacity

        protected int getKieSessionPoolInitialCapacity()
      • setKieSessionPoolInitialCapacity

        public void setKieSessionPoolInitialCapacity​(int kieSessionPoolInitialCapacity)
      • isKeepOnlyOneSessionPoolVersion

        protected boolean isKeepOnlyOneSessionPoolVersion()
      • setKeepOnlyOneSessionPoolVersion

        public void setKeepOnlyOneSessionPoolVersion​(boolean keepOnlyOneSessionPoolVersion)
      • isKieSessionPoolEnabled

        protected boolean isKieSessionPoolEnabled()
      • setKieSessionPoolEnabled

        public void setKieSessionPoolEnabled​(boolean kieSessionPoolEnabled)