avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component ExcaliburComponentManagerCreator.java
Date Tue, 20 Aug 2002 10:33:13 GMT
leif        2002/08/20 03:33:13

  Modified:    component/src/java/org/apache/avalon/excalibur/component
                        ExcaliburComponentManagerCreator.java
  Log:
  Fix a problem where the IM was not being shutdown correctly if the ECM threw
  any exceptions on startup.
  
  Revision  Changes    Path
  1.3       +33 -9     jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManagerCreator.java
  
  Index: ExcaliburComponentManagerCreator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManagerCreator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExcaliburComponentManagerCreator.java	18 Aug 2002 01:59:12 -0000	1.2
  +++ ExcaliburComponentManagerCreator.java	20 Aug 2002 10:33:13 -0000	1.3
  @@ -200,10 +200,19 @@
           //  Unfortunately, there is not a very good place to make this settable.
           m_primordialLogger = new ConsoleLogger( ConsoleLogger.LEVEL_INFO );
           
  -        initializeLoggerManager( loggerManagerConfig );
  -        initializeRoleManager( roleManagerConfig );
  -        initializeInstrumentManager( instrumentManagerConfig );
  -        initializeComponentManager( componentManagerConfig );
  +        try
  +        {
  +            initializeLoggerManager( loggerManagerConfig );
  +            initializeRoleManager( roleManagerConfig );
  +            initializeInstrumentManager( instrumentManagerConfig );
  +            initializeComponentManager( componentManagerConfig );
  +        }
  +        catch ( Exception e )
  +        {
  +            // Clean up after the managers which were set up.
  +            dispose();
  +            throw e;
  +        }
       }
       
       /**
  @@ -289,10 +298,25 @@
           // Clean up all of the objects that we created in the propper order.
           try
           {
  -            ContainerUtil.shutdown( m_componentManager );
  -            ContainerUtil.shutdown( m_instrumentManager );
  -            ContainerUtil.shutdown( m_roleManager );
  -            ContainerUtil.shutdown( m_loggerManager );
  +            if ( m_componentManager != null )
  +            {
  +                ContainerUtil.shutdown( m_componentManager );
  +            }
  +            
  +            if ( m_instrumentManager != null )
  +            {
  +                ContainerUtil.shutdown( m_instrumentManager );
  +            }
  +            
  +            if ( m_roleManager != null )
  +            {
  +                ContainerUtil.shutdown( m_roleManager );
  +            }
  +            
  +            if ( m_loggerManager != null )
  +            {
  +                ContainerUtil.shutdown( m_loggerManager );
  +            }
           }
           catch ( Exception e )
           {
  
  
  

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