From 9bd30b6a6655c4da956b619f3e188773a45f6ed2 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 8 Nov 2006 13:31:02 +0000 Subject: [PATCH] * Call onStart() directly in calling thread rather than in scheduler to make sure it completed before the application gets mounted. --- src/helma/framework/core/Application.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 9880b61d..8b17dc62 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -430,6 +430,17 @@ public final class Application implements IPathElement, Runnable { public synchronized void start() { starttime = System.currentTimeMillis(); + // as first thing, invoke global onStart() function + RequestEvaluator eval = null; + try { + eval = getEvaluator(); + eval.invokeInternal(null, "onStart", RequestEvaluator.EMPTY_ARGS); + } catch (Exception xcept) { + logError("Error in " + name + "onStart()", xcept); + } finally { + releaseEvaluator(eval); + } + worker = new Thread(this, "Worker-" + name); worker.setPriority(Thread.NORM_PRIORITY + 1); worker.start(); @@ -1456,17 +1467,6 @@ public final class Application implements IPathElement, Runnable { */ public void run() { - // as first thing, invoke global onStart() function - RequestEvaluator eval = null; - try { - eval = getEvaluator(); - eval.invokeInternal(null, "onStart", RequestEvaluator.EMPTY_ARGS); - } catch (Exception xcept) { - logError("Error in " + name + "onStart()", xcept); - } finally { - releaseEvaluator(eval); - } - // interval between session cleanups long lastSessionCleanup = System.currentTimeMillis();