geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo Main.java
Date Sun, 24 Aug 2003 21:10:35 GMT
jdillon     2003/08/24 14:10:35

  Modified:    modules/core/src/java/org/apache/geronimo Main.java
  Log:
   o Use StopWatch and Duration to produce more readable stats on how quickly
     we started.
  
  Revision  Changes    Path
  1.10      +14 -7     incubator-geronimo/modules/core/src/java/org/apache/geronimo/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/Main.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Main.java	24 Aug 2003 11:23:14 -0000	1.9
  +++ Main.java	24 Aug 2003 21:10:35 -0000	1.10
  @@ -57,8 +57,10 @@
   
   import java.net.MalformedURLException;
   import java.net.URL;
  +
   import java.util.Iterator;
   import java.util.Set;
  +
   import javax.management.MBeanServer;
   import javax.management.ObjectInstance;
   import javax.management.ObjectName;
  @@ -66,6 +68,10 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.commons.logging.impl.LogFactoryImpl;
  +
  +import org.apache.geronimo.common.StopWatch;
  +import org.apache.geronimo.common.Duration;
  +
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.geronimo.jmx.JMXKernel;
   
  @@ -102,14 +108,14 @@
        * Main entry point
        */
       public void run() {
  +        StopWatch watch = new StopWatch(true);
  +        
           Object[] deployArgs = {bootURL};
           JMXKernel kernel = null;
           ShutdownThread hook = new ShutdownThread("Shutdown-Thread", Thread.currentThread());
           try {
               Runtime.getRuntime().addShutdownHook(hook);
               try {
  -                long start = System.currentTimeMillis();
  -
                   log.info("Starting JMXKernel");
                   kernel = new JMXKernel(domainName);
   
  @@ -145,10 +151,11 @@
                   log.info("Deploying Bootstrap Services from " + bootURL);
                   MBeanServer mbServer = kernel.getMBeanServer();
                   mbServer.invoke(controllerName, "deploy", deployArgs, DEPLOY_ARG_TYPES);
  -
  -                long end = System.currentTimeMillis();
  -                log.info("Started Server in " + (end - start) + "ms.");
  -            } catch (Throwable e) {
  +                
  +                watch.stop();
  +                log.info("Started Server in " + new Duration(watch.getTime()));
  +            }
  +            catch (Throwable e) {
                   log.error("Error starting Server", e);
                   return;
               }
  
  
  

Mime
View raw message