* Implement calling of User.onLogout in Session.logout().

Fixes bug 579 <http://helma.org/bugs/show_bug.cgi?id=579>
This commit is contained in:
hns 2007-11-30 12:32:42 +00:00
parent 1e783a8c99
commit 70c50c5625

View file

@ -100,9 +100,26 @@ public class Session implements Serializable {
* Remove this sessions's user node. * Remove this sessions's user node.
*/ */
public void logout() { public void logout() {
if (userHandle != null) {
// invoke User.onLogout
RequestEvaluator reval = null;
try {
reval = app.getEvaluator();
reval.invokeInternal(userHandle, "onLogout", new Object[] {sessionId});
} catch (Exception x) {
// errors should already be logged by requestevaluator, but you never know
app.logError("Error in onLogout", x);
} finally {
// do the actual work
userHandle = null; userHandle = null;
uid = null; uid = null;
lastModified = System.currentTimeMillis(); lastModified = System.currentTimeMillis();
// release the evaluator
if (reval != null) {
app.releaseEvaluator(reval);
}
}
}
} }
/** /**