Package org.drools.core.impl
Class RuleBaseFactory
java.lang.Object
org.drools.core.impl.RuleBaseFactory
This factory will create and return a KnowledgeBase instance, an optional KnowledgeBaseConfiguration can be provided. The KnowledgeBaseConfiguration is also itself created from this factory.
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
Create sequential KnowledgeBase using the given ClassLoader.
Properties properties = new Properties(); properties.setOption( SequentialOption.YES ); KnowledgeBaseConfiguration kbConf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(properties, myClassLoader); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbConf);
The above could also have used the supported property
properties.setProperty( "org.kie.sequential", "true");
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KieBaseConfigurationCreate a KnowledgeBaseConfiguration on which properties can be set.static KieBaseConfigurationnewKnowledgeBaseConfiguration(Properties properties, ClassLoader... classLoaders) Create a KnowledgeBaseConfiguration on which properties can be set.static KieSessionConfigurationCreate a KnowledgeSessionConfiguration on which properties can be set.static KieSessionConfigurationnewKnowledgeSessionConfiguration(ChainedProperties chained, ClassLoader classLoader) static InternalRuleBaseCreate a new KnowledgeBase using the default KnowledgeBaseConfigurationstatic InternalRuleBasenewRuleBase(String kbaseId) Create a new KnowledgeBase using the default KnowledgeBaseConfiguration and the given KnowledgeBase ID.static InternalRuleBasenewRuleBase(String kbaseId, KieBaseConfiguration conf) Create a new KnowledgeBase using the given KnowledgeBaseConfiguration and the given KnowledgeBase ID.static InternalRuleBaseCreate a new KnowledgeBase using the given KnowledgeBaseConfiguration
-
Constructor Details
-
RuleBaseFactory
public RuleBaseFactory()
-
-
Method Details
-
newRuleBase
Create a new KnowledgeBase using the default KnowledgeBaseConfiguration- Returns:
- The KnowledgeBase
-
newRuleBase
Create a new KnowledgeBase using the default KnowledgeBaseConfiguration and the given KnowledgeBase ID.- Parameters:
kbaseId- A string Identifier for the knowledge base. Specially useful when enabling JMX monitoring and management, as that ID will be used to compose the JMX ObjectName for all related MBeans. The application must ensure all kbase IDs are unique.- Returns:
- The KnowledgeBase
-
newRuleBase
Create a new KnowledgeBase using the given KnowledgeBaseConfiguration- Returns:
- The KnowledgeBase
-
newRuleBase
Create a new KnowledgeBase using the given KnowledgeBaseConfiguration and the given KnowledgeBase ID.- Parameters:
kbaseId- A string Identifier for the knowledge base. Specially useful when enabling JMX monitoring and management, as that ID will be used to compose the JMX ObjectName for all related MBeans. The application must ensure all kbase IDs are unique.- Returns:
- The KnowledgeBase
-
newKnowledgeBaseConfiguration
Create a KnowledgeBaseConfiguration on which properties can be set.- Returns:
- The KnowledgeBaseConfiguration.
-
newKnowledgeBaseConfiguration
public static KieBaseConfiguration newKnowledgeBaseConfiguration(Properties properties, ClassLoader... classLoaders) Create a KnowledgeBaseConfiguration on which properties can be set. Use the given properties file and ClassLoader - either of which can be null.- Returns:
- The KnowledgeBaseConfiguration.
-
newKnowledgeSessionConfiguration
Create a KnowledgeSessionConfiguration on which properties can be set.- Returns:
- The KnowledgeSessionConfiguration.
-
newKnowledgeSessionConfiguration
public static KieSessionConfiguration newKnowledgeSessionConfiguration(ChainedProperties chained, ClassLoader classLoader)
-