tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServlet.java JspServletWrapper.java mbeans-descriptors.xml
Date Fri, 16 Apr 2004 23:01:29 GMT
luehe       2004/04/16 16:01:29

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        JspRuntimeContext.java
               jasper2/src/share/org/apache/jasper/servlet JspServlet.java
                        JspServletWrapper.java mbeans-descriptors.xml
  Log:
  Added number of JSPs that have been *re*loaded to set of monitorable attributes
  
  Revision  Changes    Path
  1.22      +26 -2     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspRuntimeContext.java
  
  Index: JspRuntimeContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspRuntimeContext.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JspRuntimeContext.java	17 Mar 2004 19:23:03 -0000	1.21
  +++ JspRuntimeContext.java	16 Apr 2004 23:01:29 -0000	1.22
  @@ -60,6 +60,11 @@
       // Logger
       private static Log log = LogFactory.getLog(JspRuntimeContext.class);
   
  +    /*
  +     * Counts how many times the webapp's JSPs have been reloaded.
  +     */
  +    private int jspReloadCount;
  +
       /**
        * Preload classes required at runtime by a JSP servlet so that
        * we don't get a defineClassInPackage security exception.
  @@ -165,7 +170,7 @@
        */
       private String threadName = "JspRuntimeContext";
   
  -    // ------------------------------------------------------ Protected Methods
  +    // ------------------------------------------------------ Public Methods
   
       /**
        * Add a new JspServletWrapper.
  @@ -251,6 +256,25 @@
               ((JspServletWrapper) servlets.next()).destroy();
           }
       }
  +
  +    /**
  +     * Increments the JSP reload counter.
  +     */
  +    public void incrementJspReloadCount() {
  +        synchronized(this) {
  +            jspReloadCount++;
  +        }
  +    }
  +
  +    /**
  +     * Gets the current value of the JSP reload counter.
  +     *
  +     * @return The current value of the JSP reload counter
  +     */
  +    public int getJspReloadCount() {
  +        return jspReloadCount;
  +    }
  +
   
       // -------------------------------------------------------- Private Methods
   
  
  
  
  1.36      +14 -1     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- JspServlet.java	16 Apr 2004 21:50:49 -0000	1.35
  +++ JspServlet.java	16 Apr 2004 23:01:29 -0000	1.36
  @@ -89,13 +89,26 @@
        * the number of JSPs that have been loaded into the webapp with which
        * this JspServlet is associated.
        *
  -     * This info may be used for monitoring purposes.
  +     * <p>This info may be used for monitoring purposes.
        *
        * @return The number of JSPs that have been loaded into the webapp with
        * which this JspServlet is associated
        */
       public int getJspCount() {
           return this.rctxt.getJspCount();
  +    }
  +
  +
  +    /**
  +     * Gets the number of JSPs that have been reloaded.
  +     *
  +     * <p>This info may be used for monitoring purposes.
  +     *
  +     * @return The number of JSPs (in the webapp with which this JspServlet is
  +     * associated) that have been reloaded
  +     */
  +    public int getJspReloadCount() {
  +        return this.rctxt.getJspReloadCount();
       }
   
   
  
  
  
  1.34      +7 -1      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java
  
  Index: JspServletWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- JspServletWrapper.java	17 Mar 2004 19:23:05 -0000	1.33
  +++ JspServletWrapper.java	16 Apr 2004 23:01:29 -0000	1.34
  @@ -140,7 +140,13 @@
                       }
                       
                       theServlet.init(config);
  -                    firstTime = false;
  +
  +                    if (!firstTime) {
  +                        ctxt.getRuntimeContext().incrementJspReloadCount();
  +                    } else {
  +                        firstTime = false;
  +                    }
  +
                       reload = false;
                   }
               }    
  
  
  
  1.2       +4 -0      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/mbeans-descriptors.xml
  
  Index: mbeans-descriptors.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/mbeans-descriptors.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mbeans-descriptors.xml	8 Mar 2004 16:54:27 -0000	1.1
  +++ mbeans-descriptors.xml	16 Apr 2004 23:01:29 -0000	1.2
  @@ -11,6 +11,10 @@
             description="The number of JSPs that have been loaded into a webapp"
                    type="int"/>
   
  +    <attribute   name="jspReloadCount"
  +          description="The number of JSPs that have been reloaded"
  +                 type="int"/>
  +
     </mbean>
   
   </mbeans-descriptors>
  
  
  

---------------------------------------------------------------------
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