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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertKieSessionClass(Class<T> kieSessionClass) protected voidassertSessionIsStateful(DroolsKIESessionModel kieSession) protected voidassertSessionIsStateless(DroolsKIESessionModel kieSession) protected RuleExecutionCountListenerprotected org.kie.api.runtime.KieSessionsPoolgetKieContainerSessionsPool(org.kie.api.runtime.KieContainer kieContainer, boolean stateless) protected intprotected Map<org.kie.api.runtime.KieContainer,org.kie.api.runtime.KieSessionsPool> protected Class<? extends RuleExecutionCountListener>protected org.kie.api.runtime.KieSessioninitializeKieSessionInternal(RuleEvaluationContext context, DroolsRuleEngineContextModel ruleEngineContext, org.kie.api.runtime.KieContainer kieContainer) initializeSession(Class<T> kieSessionClass, RuleEvaluationContext context, org.kie.api.runtime.KieContainer kieContainer) given theRuleEvaluationContextand currently active instance ofKieContainer, initializes theKieSessionHelperkie session for evaluation of rulesprotected org.kie.api.runtime.StatelessKieSessioninitializeStatelessKieSessionInternal(RuleEvaluationContext context, DroolsRuleEngineContextModel ruleEngineContext, org.kie.api.runtime.KieContainer kieContainer) protected booleanprotected booleanprotected voidregisterKieSessionListeners(RuleEvaluationContext context, org.kie.api.event.KieRuntimeEventManager session, Long maximumExecutions) voidsetKeepOnlyOneSessionPoolVersion(boolean keepOnlyOneSessionPoolVersion) voidsetKieSessionPoolEnabled(boolean kieSessionPoolEnabled) voidsetKieSessionPoolInitialCapacity(int kieSessionPoolInitialCapacity) voidsetRuleExecutionCounterClass(Class<? extends RuleExecutionCountListener> ruleExecutionCounterClass) voidshutdownKieSessionPools(String moduleName, String version) removes all old kieContainers (same artifactId but other versions) after successful swappingprotected voidMethods inherited from class de.hybris.platform.ruleengine.drools.impl.DefaultModuleReleaseIdAware
getDeployedKieModuleReleaseId, getDummyReleaseId, getRuleEngineKieModuleSwapper, setRuleEngineKieModuleSwapper, validateRuleEvaluationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.ruleengine.drools.ModuleReleaseIdAware
getDeployedKieModuleReleaseId
-
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:KieSessionHelpergiven theRuleEvaluationContextand currently active instance ofKieContainer, initializes theKieSessionHelperkie session for evaluation of rules- Specified by:
initializeSessionin interfaceKieSessionHelper<T>- Parameters:
kieSessionClass- implementation class of the Kie session (KieSessionorStatelessKieSession)context- instance ofRuleEvaluationContextkieContainer- currently active instance ofKieContainer- 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
-
assertSessionIsStateless
-
assertSessionIsStateful
-
registerKieSessionListeners
protected void registerKieSessionListeners(RuleEvaluationContext context, org.kie.api.event.KieRuntimeEventManager session, Long maximumExecutions) -
createRuleExecutionCounterListener
-
teardownSessionsPools
@PreDestroy protected void teardownSessionsPools() -
getKieContainerSessionsPool
protected org.kie.api.runtime.KieSessionsPool getKieContainerSessionsPool(org.kie.api.runtime.KieContainer kieContainer, boolean stateless) -
shutdownKieSessionPools
removes all old kieContainers (same artifactId but other versions) after successful swapping- Specified by:
shutdownKieSessionPoolsin interfaceKieSessionHelper<T>- Parameters:
moduleName- the rule module nameversion- the rule module version
-
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)
-