craigmcc    01/04/17 10:07:12

  Modified:    catalina/src/share/org/apache/catalina/session
                        ManagerBase.java PersistentManager.java
                        PersistentManagerBase.java StandardManager.java
  Log:
  Add some debugging messages to the Manager implementations.
  
  NOTE:  The recent refactoring of where session storing and loading occurs
  has broken saving and restoring sessions across restarts (to prove it, use
  the "tester" suite and run target "HttpSession").  Kief/Bip/et. al., could
  you help me look at this, please?
  
  Revision  Changes    Path
  1.8       +24 -8     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java
  
  Index: ManagerBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ManagerBase.java  2001/04/12 18:18:57     1.7
  +++ ManagerBase.java  2001/04/17 17:06:58     1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v
 1.7 2001/04/12 18:18:57 kief Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/04/12 18:18:57 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v
 1.8 2001/04/17 17:06:58 craigmcc Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/04/17 17:06:58 $
    *
    * ====================================================================
    *
  @@ -86,7 +86,7 @@
    * be subclassed to create more sophisticated Manager implementations.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.7 $ $Date: 2001/04/12 18:18:57 $
  + * @version $Revision: 1.8 $ $Date: 2001/04/17 17:06:58 $
    */
   
   public abstract class ManagerBase implements Manager {
  @@ -165,6 +165,12 @@
   
   
       /**
  +     * The descriptive name of this Manager implementation (for logging).
  +     */
  +    protected static String name = "ManagerBase";
  +
  +
  +    /**
        * A random number generator to use when generating session identifiers.
        */
       protected Random random = null;
  @@ -406,6 +412,16 @@
   
   
       /**
  +     * Return the descriptive short name of this Manager implementation.
  +     */
  +    public String getName() {
  +
  +        return (name);
  +
  +    }
  +
  +
  +    /**
        * Return the random number generator instance we should use for
        * generating session identifiers.  If there is no such generator
        * currently defined, construct and seed a new one.
  @@ -656,13 +672,13 @@
           if (container != null)
               logger = container.getLogger();
           if (logger != null)
  -            logger.log("Manager[" + container.getName() + "]: "
  +            logger.log(getName() + "[" + container.getName() + "]: "
                          + message);
           else {
               String containerName = null;
               if (container != null)
                   containerName = container.getName();
  -            System.out.println("Manager[" + containerName
  +            System.out.println(getName() + "[" + containerName
                                  + "]: " + message);
           }
   
  @@ -681,13 +697,13 @@
           if (container != null)
               logger = container.getLogger();
           if (logger != null)
  -            logger.log("Manager[" + container.getName() + "] "
  +            logger.log(getName() + "[" + container.getName() + "] "
                          + message, throwable);
           else {
               String containerName = null;
               if (container != null)
                   containerName = container.getName();
  -            System.out.println("Manager[" + containerName
  +            System.out.println(getName() + "[" + containerName
                                  + "]: " + message);
               throwable.printStackTrace(System.out);
           }
  
  
  
  1.8       +20 -4     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManager.java
  
  Index: PersistentManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManager.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PersistentManager.java    2001/04/15 09:33:27     1.7
  +++ PersistentManager.java    2001/04/17 17:07:01     1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManager.java,v
 1.7 2001/04/15 09:33:27 kief Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/04/15 09:33:27 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManager.java,v
 1.8 2001/04/17 17:07:01 craigmcc Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/04/17 17:07:01 $
    *
    * ====================================================================
    *
  @@ -106,7 +106,7 @@
    * <li>Limit the number of active sessions kept in memory by
    *     swapping less active sessions out to disk.</li>
    *
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    * @author Kief Morris ([EMAIL PROTECTED])
    */
   
  @@ -153,6 +153,12 @@
       private int maxIdleSwap = -1;
   
   
  +    /**
  +     * The descriptive name of this Manager implementation (for logging).
  +     */
  +    protected static String name = "PersistentManager";
  +
  +
       // ------------------------------------------------------------- Properties
   
   
  @@ -271,6 +277,16 @@
       }
       
       
  +    /**
  +     * Return the descriptive short name of this Manager implementation.
  +     */
  +    public String getName() {
  +
  +        return (name);
  +
  +    }
  +
  +
       /**
        * Indicates whether sessions are saved when the Manager is shut down
        * properly. This requires the unload() method to be called.
  
  
  
  1.2       +20 -4     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java
  
  Index: PersistentManagerBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PersistentManagerBase.java        2001/04/15 09:33:27     1.1
  +++ PersistentManagerBase.java        2001/04/17 17:07:03     1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java,v
 1.1 2001/04/15 09:33:27 kief Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/04/15 09:33:27 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManagerBase.java,v
 1.2 2001/04/17 17:07:03 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/04/17 17:07:03 $
    *
    * ====================================================================
    *
  @@ -105,7 +105,7 @@
    * <code>stop()</code> methods of this class at the correct times.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2001/04/15 09:33:27 $
  + * @version $Revision: 1.2 $ $Date: 2001/04/17 17:07:03 $
    */
   
   public abstract class PersistentManagerBase
  @@ -141,6 +141,12 @@
   
   
       /**
  +     * The descriptive name of this Manager implementation (for logging).
  +     */
  +    protected static String name = "PersistentManagerBase";
  +
  +
  +    /**
        * Has this component been started yet?
        */
       private boolean started = false;
  @@ -261,6 +267,16 @@
           support.firePropertyChange("maxActiveSessions",
                                      new Integer(oldMaxActiveSessions),
                                      new Integer(this.maxActiveSessions));
  +
  +    }
  +
  +
  +    /**
  +     * Return the descriptive short name of this Manager implementation.
  +     */
  +    public String getName() {
  +
  +        return (name);
   
       }
   
  
  
  
  1.9       +28 -6     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java
  
  Index: StandardManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StandardManager.java      2001/04/15 10:48:55     1.8
  +++ StandardManager.java      2001/04/17 17:07:04     1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java,v
 1.8 2001/04/15 10:48:55 kief Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/04/15 10:48:55 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java,v
 1.9 2001/04/17 17:07:04 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/04/17 17:07:04 $
    *
    * ====================================================================
    *
  @@ -105,7 +105,7 @@
    * <code>stop()</code> methods of this class at the correct times.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.8 $ $Date: 2001/04/15 10:48:55 $
  + * @version $Revision: 1.9 $ $Date: 2001/04/17 17:07:04 $
    */
   
   public class StandardManager
  @@ -141,6 +141,12 @@
   
   
       /**
  +     * The descriptive name of this Manager implementation (for logging).
  +     */
  +    protected static String name = "StandardManager";
  +
  +
  +    /**
        * Path name of the disk file in which active sessions are saved
        * when we stop, and from which these sessions are loaded when we start.
        * A <code>null</code> value indicates that no persistence is desired.
  @@ -271,6 +277,16 @@
   
   
       /**
  +     * Return the descriptive short name of this Manager implementation.
  +     */
  +    public String getName() {
  +
  +        return (name);
  +
  +    }
  +
  +
  +    /**
        * Return the session persistence pathname, if any.
        */
       public String getPathname() {
  @@ -355,10 +371,16 @@
                   loader = container.getLoader();
               if (loader != null)
                   classLoader = loader.getClassLoader();
  -            if (classLoader != null)
  +            if (classLoader != null) {
  +                if (debug >= 1)
  +                    log("Creating custom object input stream for class loader "
  +                        + classLoader);
                   ois = new CustomObjectInputStream(bis, classLoader);
  -            else
  +            } else {
  +                if (debug >= 1)
  +                    log("Creating standard object input stream");
                   ois = new ObjectInputStream(bis);
  +            }
           } catch (FileNotFoundException e) {
               if (debug >= 1)
                   log("No persisted data file found");
  
  
  

Reply via email to