tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfarc...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session StandardSession.java
Date Tue, 26 Nov 2002 19:56:10 GMT
jfarcand    2002/11/26 11:56:10

  Modified:    catalina/src/share/org/apache/catalina/session
                        StandardSession.java
  Log:
  Change HttpSessionListener.sessionDestroyed() from notifying after the invalidation to notifying
before the invalidation (Servlet 2.4 spec change).
  
  Revision  Changes    Path
  1.6       +23 -23    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java
  
  Index: StandardSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StandardSession.java	29 Aug 2002 22:23:38 -0000	1.5
  +++ StandardSession.java	26 Nov 2002 19:56:09 -0000	1.6
  @@ -611,27 +611,11 @@
        *  this session?
        */
       public void expire(boolean notify) {
  -
           // Mark this session as "being expired" if needed
           if (expiring)
               return;
           expiring = true;
  -        setValid(false);
  -
  -        // Remove this session from our manager's active sessions
  -        if (manager != null)
  -            manager.remove(this);
  -
  -        // Unbind any objects associated with this session
  -        String keys[] = keys();
  -        for (int i = 0; i < keys.length; i++)
  -            removeAttribute(keys[i], notify);
  -
  -        // Notify interested session event listeners
  -        if (notify) {
  -            fireSessionEvent(Session.SESSION_DESTROYED_EVENT, null);
  -        }
  -
  +        
           // Notify interested application event listeners
           // FIXME - Assumes we call listeners in reverse order
           Context context = (Context) manager.getContainer();
  @@ -666,6 +650,21 @@
                   }
               }
           }
  +        setValid(false);
  +
  +        // Remove this session from our manager's active sessions
  +        if (manager != null)
  +            manager.remove(this);
  +
  +        // Unbind any objects associated with this session
  +        String keys[] = keys();
  +        for (int i = 0; i < keys.length; i++)
  +            removeAttribute(keys[i], notify);
  +
  +        // Notify interested session event listeners
  +        if (notify) {
  +            fireSessionEvent(Session.SESSION_DESTROYED_EVENT, null);
  +        }
   
           // We have completed expire of this session
           expiring = false;
  @@ -1516,7 +1515,6 @@
        * @param data Event data
        */
       public void fireSessionEvent(String type, Object data) {
  -
           if (listeners.size() < 1)
               return;
           SessionEvent event = new SessionEvent(this, type, data);
  @@ -1524,8 +1522,10 @@
           synchronized (listeners) {
               list = (SessionListener[]) listeners.toArray(list);
           }
  -        for (int i = 0; i < list.length; i++)
  +
  +        for (int i = 0; i < list.length; i++){
               ((SessionListener) list[i]).sessionEvent(event);
  +        }
   
       }
   
  
  
  

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


Mime
View raw message