Skip to content

Commit

Permalink
[incubator-kie-issues#1753] Load SessionConfiguration at startup in p…
Browse files Browse the repository at this point in the history
…roject templates; remove outdated comment in ChainedProperties
  • Loading branch information
martinweiler committed Jan 15, 2025
1 parent 0fee971 commit d47db18
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -88,7 +90,6 @@ private KieBase getKieBaseForSession(String sessionName) {
}

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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -89,7 +91,6 @@ private KieBase getKieBaseForSession(String sessionName) {
}

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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -89,7 +91,6 @@ private KieBase getKieBaseForSession(String sessionName) {
}

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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
* <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
Expand Down

0 comments on commit d47db18

Please sign in to comment.