tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r711711 - /tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
Date Wed, 05 Nov 2008 21:56:53 GMT
Author: rjung
Date: Wed Nov  5 13:56:52 2008
New Revision: 711711

URL: http://svn.apache.org/viewvc?rev=711711&view=rev
Log:
Give thisAccessedTime and lastAccessedTime for sessions
a clear semantics:

- thisAccessedTime will be updated at the beginning and
  at the end of session use
- lastAccessedTime will only be updated at the end of
  session use

This means:

- lastAccessedTime is the last access time of a session
  disregarding any request still being processed on.
  So this is good to use even from within a request
  to detect when its own session has been used last before.
- thisAccessedTime already gets updated when a new request 
  disregarding any request still being processed on.
  So this is better for any idleness check or information.
- thisAccessedTime >= lastAccessedTime always

Modified:
    tomcat/trunk/java/org/apache/catalina/session/StandardSession.java

Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=711711&r1=711710&r2=711711&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Wed Nov  5 13:56:52
2008
@@ -617,9 +617,8 @@
      */
     public void access() {
 
-        this.lastAccessedTime = this.thisAccessedTime;
         this.thisAccessedTime = System.currentTimeMillis();
-        
+
         if (ACTIVITY_CHECK) {
             accessCount.incrementAndGet();
         }
@@ -633,6 +632,8 @@
     public void endAccess() {
 
         isNew = false;
+        this.thisAccessedTime = System.currentTimeMillis();
+        this.lastAccessedTime = this.thisAccessedTime;
 
         if (ACTIVITY_CHECK) {
             accessCount.decrementAndGet();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message