* 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.
This commit is contained in:
parent
39f8bbe85e
commit
6919ade74e
1 changed files with 12 additions and 3 deletions
|
@ -431,6 +431,18 @@ public final class Application implements IPathElement, Runnable {
|
||||||
* This is called to shut down a running application.
|
* This is called to shut down a running application.
|
||||||
*/
|
*/
|
||||||
public synchronized void stop() {
|
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;
|
running = false;
|
||||||
|
|
||||||
// stop all threads, this app is going down
|
// 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.
|
* Execute a request coming in from a web client.
|
||||||
*/
|
*/
|
||||||
public ResponseTrans execute(RequestTrans req) {
|
public ResponseTrans execute(RequestTrans req) {
|
||||||
System.setProperty("request.start", String.valueOf(System.currentTimeMillis()));
|
|
||||||
|
|
||||||
requestCount += 1;
|
requestCount += 1;
|
||||||
|
|
||||||
// get user for this request's session
|
// get user for this request's session
|
||||||
Session session = createSession(req.getSession());
|
Session session = createSession(req.getSession());
|
||||||
|
|
||||||
session.touch();
|
session.touch();
|
||||||
|
|
||||||
ResponseTrans res = null;
|
ResponseTrans res = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue