Class DefaultKieSessionHelper<T>

java.lang.Object
de.hybris.platform.ruleengine.drools.impl.DefaultModuleReleaseIdAware
de.hybris.platform.ruleengine.drools.impl.DefaultKieSessionHelper<T>
All Implemented Interfaces:
KieSessionHelper<T>, ModuleReleaseIdAware

public class DefaultKieSessionHelper<T> extends DefaultModuleReleaseIdAware implements KieSessionHelper<T>
Default implementation of KieSessionHelper
  • Constructor Details

    • DefaultKieSessionHelper

      public DefaultKieSessionHelper()
  • Method Details

    • initializeSession

      public T initializeSession(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
    • initializeKieSessionInternal

      protected org.kie.api.runtime.KieSession initializeKieSessionInternal(RuleEvaluationContext context, DroolsRuleEngineContextModel ruleEngineContext, org.kie.api.runtime.KieContainer kieContainer)
    • initializeStatelessKieSessionInternal

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

      protected void assertKieSessionClass(Class<T> kieSessionClass)
    • assertSessionIsStateless

      protected void assertSessionIsStateless(DroolsKIESessionModel kieSession)
    • assertSessionIsStateful

      protected void assertSessionIsStateful(DroolsKIESessionModel kieSession)
    • registerKieSessionListeners

      protected void registerKieSessionListeners(RuleEvaluationContext context, org.kie.api.event.KieRuntimeEventManager session, Long maximumExecutions)
    • createRuleExecutionCounterListener

      protected RuleExecutionCountListener createRuleExecutionCounterListener()
    • 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(String moduleName, 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
    • getRuleExecutionCounterClass

      protected Class<? extends RuleExecutionCountListener> getRuleExecutionCounterClass()
    • getKieSessionsPools

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

      public void setRuleExecutionCounterClass(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)