From f6663fe987f79ed0b92a8f4f3b167a2632d9abad Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 6 May 2009 12:47:10 +0000 Subject: [PATCH] Delay creation of request evaluators until app node has been initialized. --- src/helma/framework/core/Application.java | 46 +++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index a6ceeeec..9dcef48a 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -393,29 +393,6 @@ public final class Application implements Runnable { freeThreads = new Stack(); allThreads = new Vector(); - // preallocate minThreads request evaluators - int minThreads = 0; - - try { - minThreads = Integer.parseInt(props.getProperty("minThreads")); - } catch (Exception ignore) { - // not parsable as number, keep 0 - } - - if (minThreads > 0) { - logEvent("Starting "+minThreads+" evaluator(s) for " + name); - } - - for (int i = 0; i < minThreads; i++) { - RequestEvaluator ev = new RequestEvaluator(Application.this); - - if (i == 0) { - ev.initScriptingEngine(); - } - freeThreads.push(ev); - allThreads.addElement(ev); - } - activeRequests = new Hashtable(); activeCronJobs = new Hashtable(); customCronJobs = new Hashtable(); @@ -473,6 +450,29 @@ public final class Application implements Runnable { releaseEvaluator(ev); } } + + // preallocate minThreads request evaluators + int minThreads = 0; + + try { + minThreads = Integer.parseInt(props.getProperty("minThreads")); + } catch (Exception ignore) { + // not parsable as number, keep 0 + } + + if (minThreads > 0) { + logEvent("Starting "+minThreads+" evaluator(s) for " + name); + } + + for (int i = 0; i < minThreads; i++) { + RequestEvaluator ev = new RequestEvaluator(Application.this); + + if (i == 0) { + ev.initScriptingEngine(); + } + freeThreads.push(ev); + allThreads.addElement(ev); + } } }