This is an automated email from the ASF dual-hosted git repository.
mweiler pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git
The following commit(s) were added to refs/heads/main by this push:
new d481f227ad [incubator-kie-issues#1753] Load SessionConfiguration at
startup in project templates; remove outdated comment in ChainedProperties
(#6218)
d481f227ad is described below
commit d481f227ad55dbb56af138e26f6b390f6c30d794
Author: Martin Weiler <[email protected]>
AuthorDate: Mon Jan 20 09:54:16 2025 -0700
[incubator-kie-issues#1753] Load SessionConfiguration at startup in project
templates; remove outdated comment in ChainedProperties (#6218)
---
.../resources/class-templates/rules/ProjectRuntimeJavaTemplate.java | 3 ++-
.../class-templates/rules/ProjectRuntimeQuarkusTemplate.java | 3 ++-
.../class-templates/rules/ProjectRuntimeSpringTemplate.java | 3 ++-
.../src/main/java/org/kie/internal/utils/ChainedProperties.java | 5 -----
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git
a/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeJavaTemplate.java
b/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeJavaTemplate.java
index f6363b63c4..79c9cdb135 100644
---
a/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeJavaTemplate.java
+++
b/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeJavaTemplate.java
@@ -33,6 +33,8 @@ public class ProjectRuntime implements KieRuntimeBuilder {
private static final ProjectModel model = new ProjectModel();
private static final java.util.Map<String, KieBase> kbases =
initKieBases();
+ private org.drools.core.SessionConfiguration conf =
org.drools.core.impl.RuleBaseFactory.newKnowledgeSessionConfiguration().as(SessionConfiguration.KEY);
+
public static final ProjectRuntime INSTANCE = new ProjectRuntime();
private static java.util.Map<String, KieBase> initKieBases() {
@@ -88,7 +90,6 @@ public class ProjectRuntime implements KieRuntimeBuilder {
}
private org.kie.api.runtime.KieSessionConfiguration
getConfForSession(String sessionName) {
- org.drools.core.SessionConfiguration conf =
org.drools.core.impl.RuleBaseFactory.newKnowledgeSessionConfiguration().as(SessionConfiguration.KEY);
switch(sessionName) {
// populated via codegen
}
diff --git
a/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeQuarkusTemplate.java
b/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeQuarkusTemplate.java
index 5f4da3847b..8efae48eda 100644
---
a/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeQuarkusTemplate.java
+++
b/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeQuarkusTemplate.java
@@ -34,6 +34,8 @@ public class ProjectRuntime implements KieRuntimeBuilder {
private static final ProjectModel model = new ProjectModel();
private static final java.util.Map<String, KieBase> kbases =
initKieBases();
+ private org.drools.core.SessionConfiguration conf =
org.drools.core.impl.RuleBaseFactory.newKnowledgeSessionConfiguration().as(SessionConfiguration.KEY);
+
public static final ProjectRuntime INSTANCE = new ProjectRuntime();
private static java.util.Map<String, KieBase> initKieBases() {
@@ -89,7 +91,6 @@ public class ProjectRuntime implements KieRuntimeBuilder {
}
private org.kie.api.runtime.KieSessionConfiguration
getConfForSession(String sessionName) {
- org.drools.core.SessionConfiguration conf =
org.drools.core.impl.RuleBaseFactory.newKnowledgeSessionConfiguration().as(SessionConfiguration.KEY);
switch(sessionName) {
// populated via codegen
}
diff --git
a/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeSpringTemplate.java
b/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeSpringTemplate.java
index 13ac7e0e26..c83245ff03 100644
---
a/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeSpringTemplate.java
+++
b/drools-model/drools-model-codegen/src/main/resources/class-templates/rules/ProjectRuntimeSpringTemplate.java
@@ -34,6 +34,8 @@ public class ProjectRuntime implements KieRuntimeBuilder {
private static final ProjectModel model = new ProjectModel();
private static final java.util.Map<String, KieBase> kbases =
initKieBases();
+ private org.drools.core.SessionConfiguration conf =
org.drools.core.impl.RuleBaseFactory.newKnowledgeSessionConfiguration().as(SessionConfiguration.KEY);
+
public static final ProjectRuntime INSTANCE = new ProjectRuntime();
private static java.util.Map<String, KieBase> initKieBases() {
@@ -89,7 +91,6 @@ public class ProjectRuntime implements KieRuntimeBuilder {
}
private org.kie.api.runtime.KieSessionConfiguration
getConfForSession(String sessionName) {
- org.drools.core.SessionConfiguration conf =
org.drools.core.impl.RuleBaseFactory.newKnowledgeSessionConfiguration().as(SessionConfiguration.KEY);
switch(sessionName) {
// populated via codegen
}
diff --git
a/kie-internal/src/main/java/org/kie/internal/utils/ChainedProperties.java
b/kie-internal/src/main/java/org/kie/internal/utils/ChainedProperties.java
index 5718641c38..85b84bc256 100644
--- a/kie-internal/src/main/java/org/kie/internal/utils/ChainedProperties.java
+++ b/kie-internal/src/main/java/org/kie/internal/utils/ChainedProperties.java
@@ -43,11 +43,6 @@ import org.slf4j.LoggerFactory;
* <li>META-INF/ of provided classLoader</li>
* </ul>
* <br/>
- * To improve performance in frequent session creation cases, chained
properties can be cached by it's conf file name
- * and requesting classloader. To take advantage of the case it must be
enabled via system property:<br/>
- * <code>org.kie.property.cache.enabled</code> that needs to be set to
<code>true</code>
- * Cache entries are by default limited to 100 to reduce memory consumption
but can be fine tuned by system property:<br/>
- * <code>org.kie.property.cache.size</code> that needs to be set to valid
integer value
*/
public class ChainedProperties
implements
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]