示例#1
0
 /** Gets the user Node from this Application's NodeManager. */
 public INode getUserNode() {
   if (userHandle != null) {
     return userHandle.getNode(app.getWrappedNodeManager());
   } else {
     return null;
   }
 }
示例#2
0
 /** Remove this sessions's user node. */
 public void logout() {
   if (userHandle != null) {
     try {
       // Invoke User.onLogout() iff this is a transactor request with a request
       // evaluator already associated (i.e., if this is called from an app/script).
       // Otherwise, we assume being called from the scheduler thread, which takes
       // care of calling User.onLogout().
       RequestEvaluator reval = app.getCurrentRequestEvaluator();
       if (reval != null) {
         Node userNode = userHandle.getNode(app.nmgr.safe);
         if (userNode != null)
           reval.invokeDirectFunction(userNode, "onLogout", new Object[] {sessionId});
       }
     } catch (Exception x) {
       // errors should already be logged by request evaluator, but you never know
       app.logError("Error in onLogout", x);
     } finally {
       // do log out
       userHandle = null;
       uid = null;
       lastModified = System.currentTimeMillis();
       modifiedInRequest = true;
     }
   }
 }