From 6919ade74ef65c1ccfc01a701e66cee42560580e Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 11 Jan 2006 16:45:15 +0000 Subject: [PATCH] * Implement invocation of global onStop() when the application is stopped, analogous to onStart() when the app is started. * Some minor cleanup and obsolete code removal. --- src/helma/framework/core/Application.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index fa971bf8..c10b198a 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -431,6 +431,18 @@ public final class Application implements IPathElement, Runnable { * This is called to shut down a running application. */ public synchronized void stop() { + // invoke global onStop() function + RequestEvaluator eval = null; + try { + eval = getEvaluator(); + eval.invokeInternal(null, "onStop", new Object[0]); + } catch (Exception x) { + logError("Error in " + name + "/onStop()", x); + } finally { + releaseEvaluator(eval); + } + + // mark app as stopped running = false; // stop all threads, this app is going down @@ -622,13 +634,10 @@ public final class Application implements IPathElement, Runnable { * Execute a request coming in from a web client. */ public ResponseTrans execute(RequestTrans req) { - System.setProperty("request.start", String.valueOf(System.currentTimeMillis())); - requestCount += 1; // get user for this request's session Session session = createSession(req.getSession()); - session.touch(); ResponseTrans res = null;