Package org.drools.core
Class RuleBaseConfiguration
- java.lang.Object
-
- org.drools.core.BaseConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption>
-
- org.drools.core.RuleBaseConfiguration
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,org.kie.api.conf.KieBaseOptionsConfiguration
,org.kie.api.conf.OptionsConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption>
,org.kie.api.KieBaseConfiguration
,org.kie.api.PropertiesConfiguration
,org.kie.internal.conf.InternalPropertiesConfiguration
public class RuleBaseConfiguration extends BaseConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption> implements org.kie.api.KieBaseConfiguration, java.io.Externalizable
Available configuration options:drools.maintainTms = <true|false> drools.sequential = <true|false> drools.sequential.agenda = <sequential|dynamic> drools.removeIdentities = <true|false> drools.shareAlphaNodes = <true|false> drools.shareBetaNodes = <true|false> drools.alphaNodeHashingThreshold = <1...n> drools.alphaNodeRangeIndexThreshold = <1...n> drools.betaNodeRangeIndexEnabled = <true|false> drools.sessionPool = <1...n> drools.compositeKeyDepth = <1..3> drools.indexLeftBetaMemory = <true/false> drools.indexRightBetaMemory = <true/false> drools.equalityBehavior = <identity|equality> drools.conflictResolver = <qualified class name> drools.consequenceExceptionHandler = <qualified class name> drools.ruleBaseUpdateHandler = <qualified class name> drools.sessionClock = <qualified class name> drools.mbeans = <enabled|disabled> drools.classLoaderCacheEnabled = <true|false> drools.declarativeAgendaEnabled = <true|false> drools.permgenThreshold = <1...n> drools.jittingThreshold = <1...n>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RuleBaseConfiguration.AssertBehaviour
static class
RuleBaseConfiguration.SequentialAgenda
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_PHREAK
static boolean
DEFAULT_SESSION_CACHE
static java.lang.String
DEFAULT_SIGN_ON_SERIALIZATION
static org.kie.api.conf.ConfigurationKey<RuleBaseConfiguration>
KEY
protected static org.slf4j.Logger
logger
-
Fields inherited from class org.drools.core.BaseConfiguration
compConfig
-
-
Constructor Summary
Constructors Constructor Description RuleBaseConfiguration(org.kie.internal.conf.CompositeConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption> compConfig)
A constructor that sets the classloader to be used as the parent classloader of this rule base classloaders, and the properties to be used as base configuration options
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActivationListener(java.lang.String name, ActivationListenerFactory factory)
void
enforceSingleThreadEvaluation()
ActivationListenerFactory
getActivationListenerFactory(java.lang.String name)
int
getAlphaNodeHashingThreshold()
int
getAlphaNodeRangeIndexThreshold()
RuleBaseConfiguration.AssertBehaviour
getAssertBehaviour()
int
getCompositeKeyDepth()
java.lang.String
getConsequenceExceptionHandler()
org.kie.api.conf.EventProcessingOption
getEventProcessingMode()
org.kie.internal.conf.IndexPrecedenceOption
getIndexPrecedenceOption()
java.lang.String
getInternalProperty(java.lang.String name)
int
getJittingThreshold()
int
getMaxThreads()
Returns the configured number of maximum threads to use for concurrent propagation when multi-thread evaluation is enabled.<T extends org.kie.api.conf.SingleValueKieBaseOption>
TgetOption(org.kie.api.conf.OptionKey<T> option)
java.lang.String
getRuleBaseUpdateHandler()
RuleBaseConfiguration.SequentialAgenda
getSequentialAgenda()
int
getSessionPoolSize()
boolean
isBetaNodeRangeIndexEnabled()
boolean
isDeclarativeAgenda()
boolean
isIndexLeftBetaMemory()
boolean
isIndexRightBetaMemory()
boolean
isMaintainTms()
boolean
isMultithreadEvaluation()
Returns true if the partitioning of the rulebase is enabled and false otherwise.boolean
isRemoveIdentities()
boolean
isSequential()
boolean
isShareAlphaNodes()
boolean
isShareBetaNodes()
void
readExternal(java.io.ObjectInput in)
void
setAlphaNodeHashingThreshold(int alphaNodeHashingThreshold)
void
setAlphaNodeRangeIndexThreshold(int alphaNodeRangeIndexThreshold)
void
setAssertBehaviour(RuleBaseConfiguration.AssertBehaviour assertBehaviour)
void
setBetaNodeRangeIndexEnabled(boolean betaNodeRangeIndexEnabled)
void
setCompositeKeyDepth(int compositeKeyDepth)
void
setConsequenceExceptionHandler(java.lang.String consequenceExceptionHandler)
void
setDeclarativeAgendaEnabled(boolean enabled)
Enable declarative agendavoid
setEventProcessingMode(org.kie.api.conf.EventProcessingOption mode)
void
setIndexLeftBetaMemory(boolean indexLeftBetaMemory)
void
setIndexPrecedenceOption(org.kie.internal.conf.IndexPrecedenceOption precedence)
void
setIndexRightBetaMemory(boolean indexRightBetaMemory)
boolean
setInternalProperty(java.lang.String name, java.lang.String value)
void
setJittingThreshold(int jittingThreshold)
void
setMaintainTms(boolean maintainTms)
void
setMaxThreads(int maxThreads)
If multi-thread evaluation is enabled, this parameter configures the maximum number of threads each session can use for concurrent Rete propagation.void
setMultithreadEvaluation(boolean enableMultithread)
Defines if the RuleBase should be executed using a pool of threads for evaluating the rules ("true"), or if the rulebase should work in classic single thread mode ("false").void
setOption(org.kie.api.conf.KieBaseOption option)
void
setRemoveIdentities(boolean removeIdentities)
void
setRuleBaseUpdateHandler(java.lang.String ruleBaseUpdateHandler)
void
setSequential(boolean sequential)
void
setSequentialAgenda(RuleBaseConfiguration.SequentialAgenda sequentialAgenda)
void
setSessionPoolSize(int sessionPoolSize)
void
setShareAlphaNodes(boolean shareAlphaNodes)
void
setShareBetaNodes(boolean shareBetaNodes)
void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class org.drools.core.BaseConfiguration
as, checkCanChange, getChainedProperties, getClassLoader, getProperties, getProperty, getPropertyValue, isImmutable, makeImmutable, setClassLoader, setProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
KEY
public static final org.kie.api.conf.ConfigurationKey<RuleBaseConfiguration> KEY
-
DEFAULT_PHREAK
public static final boolean DEFAULT_PHREAK
- See Also:
- Constant Field Values
-
DEFAULT_SESSION_CACHE
public static final boolean DEFAULT_SESSION_CACHE
- See Also:
- Constant Field Values
-
DEFAULT_SIGN_ON_SERIALIZATION
public static final java.lang.String DEFAULT_SIGN_ON_SERIALIZATION
- See Also:
- Constant Field Values
-
logger
protected static final transient org.slf4j.Logger logger
-
-
Constructor Detail
-
RuleBaseConfiguration
public RuleBaseConfiguration(org.kie.internal.conf.CompositeConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption> compConfig)
A constructor that sets the classloader to be used as the parent classloader of this rule base classloaders, and the properties to be used as base configuration options
-
-
Method Detail
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classBaseConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption>
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classBaseConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption>
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
getOption
public <T extends org.kie.api.conf.SingleValueKieBaseOption> T getOption(org.kie.api.conf.OptionKey<T> option)
- Specified by:
getOption
in interfaceorg.kie.api.conf.OptionsConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption>
-
setOption
public void setOption(org.kie.api.conf.KieBaseOption option)
- Specified by:
setOption
in interfaceorg.kie.api.conf.OptionsConfiguration<org.kie.api.conf.KieBaseOption,org.kie.api.conf.SingleValueKieBaseOption,org.kie.api.conf.MultiValueKieBaseOption>
-
setInternalProperty
public boolean setInternalProperty(java.lang.String name, java.lang.String value)
- Specified by:
setInternalProperty
in interfaceorg.kie.internal.conf.InternalPropertiesConfiguration
-
getInternalProperty
public java.lang.String getInternalProperty(java.lang.String name)
- Specified by:
getInternalProperty
in interfaceorg.kie.internal.conf.InternalPropertiesConfiguration
-
setSequential
public void setSequential(boolean sequential)
-
isSequential
public boolean isSequential()
-
isMaintainTms
public boolean isMaintainTms()
-
setMaintainTms
public void setMaintainTms(boolean maintainTms)
-
isRemoveIdentities
public boolean isRemoveIdentities()
-
setRemoveIdentities
public void setRemoveIdentities(boolean removeIdentities)
-
isShareAlphaNodes
public boolean isShareAlphaNodes()
-
setShareAlphaNodes
public void setShareAlphaNodes(boolean shareAlphaNodes)
-
isShareBetaNodes
public boolean isShareBetaNodes()
-
setShareBetaNodes
public void setShareBetaNodes(boolean shareBetaNodes)
-
getJittingThreshold
public int getJittingThreshold()
-
setJittingThreshold
public void setJittingThreshold(int jittingThreshold)
-
getAlphaNodeHashingThreshold
public int getAlphaNodeHashingThreshold()
-
setAlphaNodeHashingThreshold
public void setAlphaNodeHashingThreshold(int alphaNodeHashingThreshold)
-
getAlphaNodeRangeIndexThreshold
public int getAlphaNodeRangeIndexThreshold()
-
setAlphaNodeRangeIndexThreshold
public void setAlphaNodeRangeIndexThreshold(int alphaNodeRangeIndexThreshold)
-
isBetaNodeRangeIndexEnabled
public boolean isBetaNodeRangeIndexEnabled()
-
setBetaNodeRangeIndexEnabled
public void setBetaNodeRangeIndexEnabled(boolean betaNodeRangeIndexEnabled)
-
getSessionPoolSize
public int getSessionPoolSize()
-
setSessionPoolSize
public void setSessionPoolSize(int sessionPoolSize)
-
getAssertBehaviour
public RuleBaseConfiguration.AssertBehaviour getAssertBehaviour()
-
setAssertBehaviour
public void setAssertBehaviour(RuleBaseConfiguration.AssertBehaviour assertBehaviour)
-
getEventProcessingMode
public org.kie.api.conf.EventProcessingOption getEventProcessingMode()
-
setEventProcessingMode
public void setEventProcessingMode(org.kie.api.conf.EventProcessingOption mode)
-
getCompositeKeyDepth
public int getCompositeKeyDepth()
-
setCompositeKeyDepth
public void setCompositeKeyDepth(int compositeKeyDepth)
-
isIndexLeftBetaMemory
public boolean isIndexLeftBetaMemory()
-
setIndexLeftBetaMemory
public void setIndexLeftBetaMemory(boolean indexLeftBetaMemory)
-
isIndexRightBetaMemory
public boolean isIndexRightBetaMemory()
-
setIndexRightBetaMemory
public void setIndexRightBetaMemory(boolean indexRightBetaMemory)
-
getIndexPrecedenceOption
public org.kie.internal.conf.IndexPrecedenceOption getIndexPrecedenceOption()
-
setIndexPrecedenceOption
public void setIndexPrecedenceOption(org.kie.internal.conf.IndexPrecedenceOption precedence)
-
getConsequenceExceptionHandler
public java.lang.String getConsequenceExceptionHandler()
-
setConsequenceExceptionHandler
public void setConsequenceExceptionHandler(java.lang.String consequenceExceptionHandler)
-
getRuleBaseUpdateHandler
public java.lang.String getRuleBaseUpdateHandler()
-
setRuleBaseUpdateHandler
public void setRuleBaseUpdateHandler(java.lang.String ruleBaseUpdateHandler)
-
getSequentialAgenda
public RuleBaseConfiguration.SequentialAgenda getSequentialAgenda()
-
setSequentialAgenda
public void setSequentialAgenda(RuleBaseConfiguration.SequentialAgenda sequentialAgenda)
-
setMultithreadEvaluation
public void setMultithreadEvaluation(boolean enableMultithread)
Defines if the RuleBase should be executed using a pool of threads for evaluating the rules ("true"), or if the rulebase should work in classic single thread mode ("false").- Parameters:
enableMultithread
- true for multi-thread or false for single-thread. Default is false.
-
enforceSingleThreadEvaluation
public void enforceSingleThreadEvaluation()
-
isMultithreadEvaluation
public boolean isMultithreadEvaluation()
Returns true if the partitioning of the rulebase is enabled and false otherwise. Default is false.- Returns:
-
setMaxThreads
public void setMaxThreads(int maxThreads)
If multi-thread evaluation is enabled, this parameter configures the maximum number of threads each session can use for concurrent Rete propagation.- Parameters:
maxThreads
- the maximum number of threads to use. If 0 or a negative number is set, the engine will use number of threads equal to the number of partitions in the rule base. Default number of threads is 0.
-
getMaxThreads
public int getMaxThreads()
Returns the configured number of maximum threads to use for concurrent propagation when multi-thread evaluation is enabled. Default is zero.- Returns:
-
isDeclarativeAgenda
public boolean isDeclarativeAgenda()
-
setDeclarativeAgendaEnabled
public void setDeclarativeAgendaEnabled(boolean enabled)
Enable declarative agenda- Parameters:
enabled
-
-
addActivationListener
public void addActivationListener(java.lang.String name, ActivationListenerFactory factory)
-
getActivationListenerFactory
public ActivationListenerFactory getActivationListenerFactory(java.lang.String name)
-
-