avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel DefaultKernel.java
Date Thu, 12 Dec 2002 00:36:08 GMT
mcconnell    2002/12/11 16:36:08

  Modified:    merlin/src/java/org/apache/avalon/merlin/kernel
                        DefaultKernel.java
  Log:
  Addition of error handling and logging for block deployment.
  
  Revision  Changes    Path
  1.8       +21 -9     avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/kernel/DefaultKernel.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultKernel.java	11 Dec 2002 08:12:25 -0000	1.7
  +++ DefaultKernel.java	12 Dec 2002 00:36:08 -0000	1.8
  @@ -282,17 +282,29 @@
               getLogger().debug( "block assembly" );
           }
   
  -        ClasspathDescriptor path = 
  -          CREATOR.createClasspathDescriptor( m_config.getChild( "blocks" ) );
  -        URL[] urls = ClasspathDescriptor.expand( m_home, path );
  -
  -        if( getLogger().isDebugEnabled() )
  +        try
           {
  -            getLogger().debug( "blocks: " + urls.length );
  -        }
  +            ClasspathDescriptor path = 
  +              CREATOR.createClasspathDescriptor( m_config.getChild( "blocks" ) );
  +            URL[] urls = ClasspathDescriptor.expand( m_home, path );
   
  -        Block[] blocks = install( m_engine, m_home, urls );
  +            if( getLogger().isDebugEnabled() )
  +            {
  +               getLogger().debug( "blocks: " + urls.length );
  +            }
   
  +            Block[] blocks = install( m_engine, m_home, urls );
  +        }
  +        catch( Throwable e )
  +        {
  +            final String error = "Block deployment failure.";
  +            String log = ExceptionHelper.packException( error, e );
  +            if( getLogger().isErrorEnabled() )
  +            {
  +                getLogger().error( log );
  +            }
  +            throw new KernelException( error, 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