costin      2003/01/27 15:33:10

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardWrapper.java
  Log:
  Remove unneeded param.
  
  Store the startup time instead of displaying it ( will be visible in the jmx console 
)
  
  added missing getter.
  
  Removed the final - duplication the code inside is too painfull.
  
  BTW - in the previous commit, I also made StandardContext serializable. It won't
  work ( a lot of other classes are not serializable ), but in time we may get to a 
point
  where we can cache the configured state of the context and avoid parsing unless 
needed.
  
  Revision  Changes    Path
  1.13      +17 -16    
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java
  
  Index: StandardWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StandardWrapper.java      24 Jan 2003 23:47:45 -0000      1.12
  +++ StandardWrapper.java      27 Jan 2003 23:33:10 -0000      1.13
  @@ -91,6 +91,7 @@
   import org.apache.catalina.util.InstanceSupport;
   import org.apache.tomcat.util.log.SystemLogHandler;
   import org.apache.commons.modeler.Registry;
  +
   /**
    * Standard implementation of the <b>Wrapper</b> interface that represents
    * an individual servlet definition.  No child Containers are allowed, and
  @@ -100,8 +101,7 @@
    * @author Remy Maucherat
    * @version $Revision$ $Date$
    */
  -
  -public final class StandardWrapper
  +public class StandardWrapper
       extends ContainerBase
       implements ServletConfig, Wrapper {
   
  @@ -251,6 +251,7 @@
       // To support jmx attributes
       private StandardWrapperValve swValve;
       private long loadTime=0;
  +    private long classLoadTime=0;
   
       // ------------------------------------------------------------- Properties
   
  @@ -423,9 +424,11 @@
           } catch (NumberFormatException e) {
               setLoadOnStartup(0);
           }
  -
       }
   
  +    public String getLoadOnStartupString() {
  +        return Integer.toString( getLoadOnStartup());
  +    }
   
   
       /**
  @@ -928,10 +931,7 @@
                   ((ContainerServlet) servlet).setWrapper(this);
               }
       
  -            if( System.currentTimeMillis() -t1 > 200 ) {
  -                log.info("Created servlet class " + actualClass + " " +
  -                         (System.currentTimeMillis() - t1 ) );
  -            }
  +            classLoadTime=System.currentTimeMillis() -t1;
               // Call the initialization method of this servlet
               try {
                   instanceSupport.fireInstanceEvent(InstanceEvent.BEFORE_INIT_EVENT,
  @@ -1011,7 +1011,8 @@
                   }
               }
           }
  -        registerJMX((ContainerBase)getParent(), this);
  +        if( oname != null )
  +            registerJMX((ContainerBase)getParent());
           return servlet;
   
       }
  @@ -1441,11 +1442,11 @@
   
       }
   
  -    void registerJMX(ContainerBase ctx, StandardWrapper wrapper) {
  +    protected void registerJMX(ContainerBase ctx) {
           try {
  -            String name=wrapper.getJspFile();
  +            String name=this.getJspFile();
               if( name==null ) {
  -                name=wrapper.getServletName();
  +                name=this.getServletName();
               }
               // it should be full name
               String parentName=ctx.getName();
  @@ -1455,7 +1456,7 @@
               String oname="j2eeType=Servlet,name=" + name + ",WebModule=" +
                       webMod + ctx.getJSR77Suffix();
   
  -            Registry.getRegistry().registerComponent(wrapper,
  +            Registry.getRegistry().registerComponent(this,
                       ctx.getDomain(), "Servlet", oname);
           } catch( Exception ex ) {
               log.info("Error registering servlet with jmx " + this);
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to