donaldp     2002/08/02 02:34:49

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/factory
                        DefaultComponentFactory.java
  Log:
  Make factory logEnabled and make sure it passes logger to infoBuilder
  
  Revision  Changes    Path
  1.4       +12 -3     
jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/factory/DefaultComponentFactory.java
  
  Index: DefaultComponentFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/factory/DefaultComponentFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultComponentFactory.java      2 Aug 2002 09:11:09 -0000       1.3
  +++ DefaultComponentFactory.java      2 Aug 2002 09:34:49 -0000       1.4
  @@ -9,6 +9,8 @@
   
   import java.util.Map;
   import java.util.WeakHashMap;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.Logger;
   import org.apache.excalibur.containerkit.infobuilder.ComponentInfoBuilder;
   import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
   
  @@ -20,19 +22,18 @@
    * @version $Revision$ $Date$
    */
   public class DefaultComponentFactory
  +    extends AbstractLogEnabled
       implements ComponentFactory
   {
       /**
        * Cache of ComponentInfo objects.
        */
       private final Map m_infos = new WeakHashMap();
  -
       /**
        * The utility class that is used when building info
        * objects for Components.
        */
       private final ComponentInfoBuilder m_infoBuilder = new 
ComponentInfoBuilder();
  -
       /**
        * The classloader from which all resources are loaded.
        */
  @@ -52,6 +53,12 @@
           m_classLoader = classLoader;
       }
   
  +    public void enableLogging( final Logger logger )
  +    {
  +        super.enableLogging( logger );
  +        setupLogger( m_infoBuilder, "info" );
  +    }
  +
       /**
        * Create a component by creating info for class
        * with specified name and loaded from factorys ClassLoader.
  @@ -61,6 +68,8 @@
       public ComponentInfo createInfo( final String implementationKey )
           throws Exception
       {
  +        System.out.println( "DefaultComponentFactory.createInfo" );
  +        System.out.println( "implementationKey = " + implementationKey );
           ComponentInfo info = (ComponentInfo)m_infos.get( implementationKey );
           if( null == info )
           {
  
  
  

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

Reply via email to