tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Catalina.java
Date Tue, 06 Aug 2002 16:50:38 GMT
costin      2002/08/06 09:50:38

  Modified:    catalina/src/share/org/apache/catalina/startup Catalina.java
  Log:
  2 changes:
  - log information about startup time. I'm trying to reduce it - and the first
  step is to identify the hotspots.
  
  - change the default for the parentClassLoader. All wrappers are setting
  it after constructing the shared loader - however if no wrapper is used
  ( for example single-jar case or load from ant ) we'll use the default,
  and the 'system' loader will not work.
  This fix make jasper work again if tomcat is started single-jar.
  
  Revision  Changes    Path
  1.2       +23 -14    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Catalina.java	18 Jul 2002 16:47:47 -0000	1.1
  +++ Catalina.java	6 Aug 2002 16:50:38 -0000	1.2
  @@ -125,7 +125,7 @@
        * The shared extensions class loader for this server.
        */
       protected ClassLoader parentClassLoader =
  -        ClassLoader.getSystemClassLoader();
  +        Catalina.class.getClassLoader();
   
   
       /**
  @@ -275,7 +275,7 @@
        * Create and configure the Digester we will be using for startup.
        */
       protected Digester createStartDigester() {
  -
  +        long t1=System.currentTimeMillis();
           // Initialize the digester
           Digester digester = new Digester();
           if (debug)
  @@ -357,11 +357,13 @@
           digester.addRuleSet(new ContextRuleSet("Server/Service/Engine/Host/"));
           digester.addRuleSet(new NamingRuleSet("Server/Service/Engine/Host/Context/"));
   
  +        // When the 'engine' is found, set the parentClassLoader.
           digester.addRule("Server/Service/Engine",
                            new SetParentClassLoaderRule(digester,
                                                         parentClassLoader));
   
  -
  +        long t2=System.currentTimeMillis();
  +        log.info("Digester for server.xml created " + ( t2-t1 ));
           return (digester);
   
       }
  @@ -436,9 +438,9 @@
        * Start a new server instance.
        */
       protected void start() {
  -
           // Create and execute our Digester
           Digester digester = createStartDigester();
  +        long t1=System.currentTimeMillis();
           File file = configFile();
           try {
               InputSource is =
  @@ -453,7 +455,9 @@
               e.printStackTrace(System.out);
               System.exit(1);
           }
  -
  +        long t2=System.currentTimeMillis();
  +        log.info( "Server.xml processed " + (t2-t1 ));
  +        
           // Setting additional variables
           if (!useNaming) {
               System.setProperty("catalina.useNaming", "false");
  @@ -497,17 +501,21 @@
           }
   
           // Replace System.out and System.err with a custom PrintStream
  -        SystemLogHandler log = new SystemLogHandler(System.out);
  -        System.setOut(log);
  -        System.setErr(log);
  +        SystemLogHandler systemlog = new SystemLogHandler(System.out);
  +        System.setOut(systemlog);
  +        System.setErr(systemlog);
   
           Thread shutdownHook = new CatalinaShutdownHook();
   
  +        long t3=System.currentTimeMillis();
  +
           // Start the new server
           if (server instanceof Lifecycle) {
               try {
                   server.initialize();
                   ((Lifecycle) server).start();
  +                long t4=System.currentTimeMillis();
  +                log.info( "server.start " + server + " " + (t4-t3 ));
                   try {
                       // Register shutdown hook
                       Runtime.getRuntime().addShutdownHook(shutdownHook);
  @@ -548,7 +556,6 @@
                   }
               }
           }
  -
       }
   
   
  @@ -633,7 +640,9 @@
           }
   
       }
  -
  +    
  +    private static org.apache.commons.logging.Log log=
  +        org.apache.commons.logging.LogFactory.getLog( Catalina.class );
   
   }
   
  
  
  

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