* 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:
parent
1e783a8c99
commit
70c50c5625
1 changed files with 20 additions and 3 deletions
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue