bloritsch    01/12/27 18:35:04

  Modified:    src/java/org/apache/avalon/excalibur/component
                        ExcaliburComponentManager.java
  Log:
  Remove unnecessary check for RoleManager and erroneous logging for the 
'missing' RoleManager
  
  Revision  Changes    Path
  1.14      +24 -30    
jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManager.java
  
  Index: ExcaliburComponentManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManager.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ExcaliburComponentManager.java    2001/12/12 20:26:07     1.13
  +++ ExcaliburComponentManager.java    2001/12/28 02:35:04     1.14
  @@ -33,7 +33,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a>
  - * @version CVS $Revision: 1.13 $ $Date: 2001/12/12 20:26:07 $
  + * @version CVS $Revision: 1.14 $ $Date: 2001/12/28 02:35:04 $
    * @since 4.0
    */
   public class ExcaliburComponentManager
  @@ -261,24 +261,22 @@
                   }
               }
   
  -            if ( null != m_roles )
  -            {
  -                final String className = m_roles.getDefaultClassNameForRole( 
role );
  +            final String className = m_roles.getDefaultClassNameForRole( 
role );
   
  -                if ( null != className )
  +            if ( null != className )
  +            {
  +                if (getLogger().isDebugEnabled())
                   {
  -                    if (getLogger().isDebugEnabled())
  -                    {
  -                        getLogger().debug( "Could not find ComponentHandler, 
attempting to create one for role: " + role );
  -                    }
  +                    getLogger().debug( "Could not find ComponentHandler, 
attempting to create one for role: " + role );
  +                }
   
  -                    try
  -                    {
  -                        final Class componentClass = m_loader.loadClass( 
className );
  +                try
  +                {
  +                    final Class componentClass = m_loader.loadClass( 
className );
   
  -                        final Configuration configuration = new 
DefaultConfiguration( "", "-" );
  +                    final Configuration configuration = new 
DefaultConfiguration( "", "-" );
   
  -                        handler =
  +                    handler =
                               ComponentHandler.getComponentHandler( 
componentClass,
                                                                     
configuration,
                                                                     this,
  @@ -286,27 +284,22 @@
                                                                     m_roles,
                                                                     m_logkit);
   
  -                        handler.setLogger( getLogger() );
  -                        handler.initialize();
  -                    }
  -                    catch( final Exception e )
  +                    handler.setLogger( getLogger() );
  +                    handler.initialize();
  +                }
  +                catch( final Exception e )
  +                {
  +                    final String message = "Could not find component";
  +                    if( getLogger().isErrorEnabled() )
                       {
  -                        final String message = "Could not find component";
  -                        if( getLogger().isErrorEnabled() )
  -                        {
  -                            getLogger().debug( message + " for role: " + 
role, e );
  -                        }
  -                        throw new ComponentException( message, e );
  +                        getLogger().debug( message + " for role: " + role, e 
);
                       }
  -
  -                    m_componentHandlers.put( role, handler );
  +                    throw new ComponentException( message, e );
                   }
  +
  +                m_componentHandlers.put( role, handler );
               }
           }
  -        else
  -        {
  -            getLogger().debug( "The Role Manager has not been set!" );
  -        }
   
           if ( null == handler )
           {
  @@ -369,6 +362,7 @@
               role_info.setLogger( getLogger() );
               role_info.configure( configuration );
               m_roles = role_info;
  +            getLogger().debug("No RoleManager given, deriving one from 
configuration");
           }
   
           // Set components
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to