/** * Called after a request has been handled. * * @param reval the request evaluator that handled the request */ public void commit(RequestEvaluator reval, SessionManager smgr) { if (modifiedInRequest || cacheLastModified != cacheNode.lastModified()) { if (!registered) { smgr.registerSession(this); registered = true; } modifiedInRequest = false; cacheLastModified = cacheNode.lastModified(); } }
/** Set the cache node for this session. */ public void setCacheNode(INode node) { if (node == null) { throw new NullPointerException("cache node is null"); } this.cacheNode = node; this.cacheLastModified = cacheNode.lastModified(); }
/** * Creates a new Session object. * * @param sessionId ... * @param app ... */ public Session(String sessionId, Application app) { this.sessionId = sessionId; this.app = app; this.uid = null; this.userHandle = null; cacheNode = new TransientNode(app, "session"); cacheLastModified = cacheNode.lastModified(); // HACK - decrease timestamp by 1 to notice modifications // taking place immediately after object creation onSince = System.currentTimeMillis() - 1; lastTouched = lastModified = onSince; }