avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel Main.java
Date Sun, 07 Jul 2002 23:17:07 GMT
mcconnell    2002/07/07 16:17:07

  Modified:    assembly/src/java/org/apache/excalibur/merlin/kernel
                        Main.java
  Log:
  minor changes
  
  Revision  Changes    Path
  1.5       +18 -18    jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/Main.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Main.java	7 Jul 2002 04:28:31 -0000	1.4
  +++ Main.java	7 Jul 2002 23:17:07 -0000	1.5
  @@ -65,8 +65,6 @@
   import org.apache.log.Priority;
   import org.apache.log.output.io.StreamTarget;
   
  -import org.apache.excalibur.merlin.registry.DefaultRegistry;
  -
   /**
    * Application bootstrap.
    *
  @@ -82,7 +80,7 @@
       private static final String DEFAULT_FORMAT =
           "[%7.7{priority}] (%{category}): %{message}\\n%{throwable}";
       private static final Resources REZ =
  -        ResourceManager.getPackageResources( DefaultRegistry.class );
  +        ResourceManager.getPackageResources( Main.class );
   
      /**
       * Creation of a root type registry.
  @@ -92,6 +90,22 @@
   
           final DefaultKernel kernel = new DefaultKernel();
   
  +        //
  +        // add a shutdown hook so we can stop services and target and invoke shutdown
  +        //
  +
  +        Runtime.getRuntime().addShutdownHook(
  +            new Thread()
  +            {
  +                public void run()
  +                {
  +                    if( kernel != null )
  +                      kernel.shutdown();
  +                }
  +            }
  +        );
  +
  +
           // get a configuration object containing the kernel profile
           // from which we can establish the logger and extensions directory
   
  @@ -123,20 +137,6 @@
               logger.error("Unexpected error while processing kernel lifecycle.", e);
               System.exit(0);
           }
  -
  -        //
  -        // add a shutdown hook so we can stop services and target and invoke shutdown
  -        //
  -
  -        Runtime.getRuntime().addShutdownHook(
  -            new Thread()
  -            {
  -                public void run()
  -                {
  -                    kernel.shutdown();
  -                }
  -            }
  -        );
   
           // invoke the registry demo
           try
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message