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 Thu, 01 Apr 2004 20:18:15 GMT
jfarcand    2004/04/01 12:18:15

  Modified:    catalina/src/share/org/apache/catalina Globals.java
               catalina/src/share/org/apache/catalina/session
                        StandardSession.java
  Log:
  Re-add initinal work since it doesn't seems to work (my bad)
  
  Thanks to daniel_andefors at hotmail.com
  
  Revision  Changes    Path
  1.9       +2 -2      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java
  
  Index: Globals.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Globals.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Globals.java	1 Apr 2004 17:39:53 -0000	1.8
  +++ Globals.java	1 Apr 2004 20:18:15 -0000	1.9
  @@ -287,7 +287,7 @@
       /**
        * The subject under which the AccessControlContext is running.
        */
  -    public static transient final String SUBJECT_ATTR =
  +    public static final String SUBJECT_ATTR =
           "javax.security.auth.subject";
   
       
  
  
  
  1.43      +25 -1     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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- StandardSession.java	1 Apr 2004 17:39:53 -0000	1.42
  +++ StandardSession.java	1 Apr 2004 20:18:15 -0000	1.43
  @@ -160,6 +160,14 @@
   
   
       /**
  +     * Set of attribute names which are not allowed to be persisted.
  +     */
  +    private static final String[] excludedAttributes = {
  +        Globals.SUBJECT_ATTR
  +    };
  +
  +
  +    /**
        * We are currently processing a session expiration, so bypass
        * certain IllegalStateException tests.  NOTE:  This value is not
        * included in the serialized version of this object.
  @@ -1385,7 +1393,8 @@
               }
               if (value == null)
                   continue;
  -            else if ( (value instanceof Serializable) ) {
  +            else if ( (value instanceof Serializable) 
  +                    && (!exclude(keys[i]) )) {
                   saveNames.add(keys[i]);
                   saveValues.add(value);
               } else {
  @@ -1413,6 +1422,21 @@
               }
           }
   
  +    }
  +
  +
  +    /**
  +     * Exclude attribute that cannot be serialized.
  +     * @param name the attribute's name
  +     */
  +    protected boolean exclude(String name){
  +
  +        for (int i = 0; i < excludedAttributes.length; i++) {
  +            if (name.equalsIgnoreCase(excludedAttributes[i]))
  +                return true;
  +        }
  +
  +        return false;
       }
   
   
  
  
  

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


Mime
View raw message