tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r711720 - in /tomcat/trunk/java/org/apache/catalina: authenticator/SingleSignOn.java manager/ManagerServlet.java manager/util/SessionUtils.java session/PersistentManagerBase.java valves/PersistentValve.java
Date Wed, 05 Nov 2008 22:15:53 GMT
Author: rjung
Date: Wed Nov  5 14:15:53 2008
New Revision: 711720

URL: http://svn.apache.org/viewvc?rev=711720&view=rev
Log:
Now make the classes checking session idleness
use thisAccessedTime.
This is not for invalidation, only for displaying
idle times and making persistance decisions.

Modified:
    tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
    tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
    tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java
    tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java
    tomcat/trunk/java/org/apache/catalina/valves/PersistentValve.java

Modified: tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java?rev=711720&r1=711719&r2=711720&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java (original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOn.java Wed Nov  5 14:15:53
2008
@@ -323,7 +323,7 @@
         // SSO.  If the session was logged out, we'll log out
         // of all session associated with the SSO.
         if (((session.getMaxInactiveInterval() > 0)
-            && (System.currentTimeMillis() - session.getLastAccessedTimeInternal()
>=
+            && (System.currentTimeMillis() - session.getThisAccessedTimeInternal()
>=
                 session.getMaxInactiveInterval() * 1000)) 
             || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))) {
             removeSession(ssoId, session);

Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=711720&r1=711719&r2=711720&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Wed Nov  5 14:15:53
2008
@@ -1064,7 +1064,7 @@
 
     /**
      * Session information for the web application at the specified context path.
-     * Displays a profile of session lastAccessedTime listing number
+     * Displays a profile of session thisAccessedTime listing number
      * of sessions for each 10 minute interval up to 10 hours.
      *
      * @param writer Writer to render to
@@ -1118,7 +1118,7 @@
             int expired = 0;
             long now = System.currentTimeMillis();
             for (int i = 0; i < sessions.length; i++) {
-                int time = (int)((now-sessions[i].getLastAccessedTimeInternal())/1000);
+                int time = (int)((now-sessions[i].getThisAccessedTimeInternal())/1000);
                 if (idle >= 0 && time >= idle*60) {
                     sessions[i].expire();
                     idle++;
@@ -1161,7 +1161,7 @@
 
     /**
      * Session information for the web application at the specified context path.
-     * Displays a profile of session lastAccessedTime listing number
+     * Displays a profile of session thisAccessedTime listing number
      * of sessions for each 10 minute interval up to 10 hours.
      *
      * @param writer Writer to render to

Modified: tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java?rev=711720&r1=711719&r2=711720&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/util/SessionUtils.java Wed Nov  5 14:15:53
2008
@@ -237,7 +237,7 @@
 
     public static long getUsedTimeForSession(Session in_session) {
         try {
-            long diffMilliSeconds = in_session.getLastAccessedTime() - in_session.getCreationTime();
+            long diffMilliSeconds = in_session.getThisAccessedTime() - in_session.getCreationTime();
             return diffMilliSeconds;
         } catch (IllegalStateException ise) {
             //ignore: invalidated session
@@ -247,7 +247,7 @@
 
     public static long getTTLForSession(Session in_session) {
         try {
-            long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis()
- in_session.getLastAccessedTime());
+            long diffMilliSeconds = (1000*in_session.getMaxInactiveInterval()) - (System.currentTimeMillis()
- in_session.getThisAccessedTime());
             return diffMilliSeconds;
         } catch (IllegalStateException ise) {
             //ignore: invalidated session
@@ -257,7 +257,7 @@
 
     public static long getInactiveTimeForSession(Session in_session) {
         try {
-            long diffMilliSeconds =  System.currentTimeMillis() - in_session.getLastAccessedTime();
+            long diffMilliSeconds =  System.currentTimeMillis() - in_session.getThisAccessedTime();
             return diffMilliSeconds;
         } catch (IllegalStateException ise) {
             //ignore: invalidated session

Modified: tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java?rev=711720&r1=711719&r2=711720&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java Wed Nov  5 14:15:53
2008
@@ -1048,7 +1048,7 @@
                     if (!session.isValid())
                         continue;
                     int timeIdle = // Truncate, do not round up
-                        (int) ((timeNow - session.getLastAccessedTime()) / 1000L);
+                        (int) ((timeNow - session.getThisAccessedTime()) / 1000L);
                     if (timeIdle > maxIdleSwap && timeIdle > minIdleSwap) {
                         if (log.isDebugEnabled())
                             log.debug(sm.getString
@@ -1092,7 +1092,7 @@
         for (int i = 0; i < sessions.length && toswap > 0; i++) {
             synchronized (sessions[i]) {
                 int timeIdle = // Truncate, do not round up
-                    (int) ((timeNow - sessions[i].getLastAccessedTime()) / 1000L);
+                    (int) ((timeNow - sessions[i].getThisAccessedTime()) / 1000L);
                 if (timeIdle > minIdleSwap) {
                     if(log.isDebugEnabled())
                         log.debug(sm.getString
@@ -1130,7 +1130,7 @@
                     if (!session.isValid())
                         continue;
                     int timeIdle = // Truncate, do not round up
-                        (int) ((timeNow - session.getLastAccessedTime()) / 1000L);
+                        (int) ((timeNow - session.getThisAccessedTime()) / 1000L);
                     if (timeIdle > maxIdleBackup) {
                         if (log.isDebugEnabled())
                             log.debug(sm.getString

Modified: tomcat/trunk/java/org/apache/catalina/valves/PersistentValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/PersistentValve.java?rev=711720&r1=711719&r2=711720&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/PersistentValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/PersistentValve.java Wed Nov  5 14:15:53
2008
@@ -200,7 +200,7 @@
         int maxInactiveInterval = session.getMaxInactiveInterval();
         if (maxInactiveInterval >= 0) {
             int timeIdle = // Truncate, do not round up
-                (int) ((timeNow - session.getLastAccessedTime()) / 1000L);
+                (int) ((timeNow - session.getThisAccessedTime()) / 1000L);
             if (timeIdle >= maxInactiveInterval)
                 return true;
         }



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


Mime
View raw message