user.onLogout() is called again, at least for automatic session

timeouts.
This commit is contained in:
hns 2002-06-11 15:54:10 +00:00
parent 6c32d0f073
commit 5e34cfdcc7
2 changed files with 16 additions and 4 deletions

View file

@ -27,7 +27,9 @@ import java.rmi.server.*;
* requests from the Web server or XML-RPC port and dispatches them to
* the evaluators.
*/
public final class Application extends UnicastRemoteObject implements IRemoteApp, IPathElement, IReplicatedApp, Runnable {
public final class Application
extends UnicastRemoteObject
implements IRemoteApp, IPathElement, IReplicatedApp, Runnable {
private String name;
SystemProperties props, dbProps;
@ -1091,10 +1093,10 @@ public final class Application extends UnicastRemoteObject implements IRemoteApp
for (Enumeration e = cloned.elements (); e.hasMoreElements (); ) {
Session session = (Session) e.nextElement ();
if (now - session.lastTouched () > sessionTimeout * 60000) {
INode usernode = session.getUserNode ();
if (usernode != null) {
NodeHandle userhandle = session.userHandle;
if (userhandle != null) {
try {
eval.invokeFunction (usernode, "onLogout", new Object[0]);
eval.invokeFunction (userhandle, "onLogout", new Object[0]);
} catch (Exception ignore) {}
}
destroySession(session);

View file

@ -367,6 +367,16 @@ public final class RequestEvaluator implements Runnable {
// Just a human readable descriptor of this invocation
String funcdesc = app.getName()+":internal/"+method;
// if thisObject is an instance of NodeHandle, get the node object itself.
if (thisObject != null && thisObject instanceof NodeHandle) {
thisObject = ((NodeHandle) thisObject).getNode (app.nmgr.safe);
// see if a valid node was returned
if (thisObject == null) {
reqtype = NONE;
break;
}
}
// avoid going into transaction if called function doesn't exist
boolean functionexists = true;
functionexists = scriptingEngine.hasFunction (thisObject, method);