You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2003/05/19 19:07:29 UTC

cvs commit: avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role AbstractMetaInfoManager.java ServiceMetaManager.java

bloritsch    2003/05/19 10:07:28

  Modified:    fortress/src/java/org/apache/avalon/fortress/impl/role
                        AbstractMetaInfoManager.java
                        ServiceMetaManager.java
  Log:
  Apply patch from Anton Tuganov
  
  Revision  Changes    Path
  1.3       +13 -1     avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/AbstractMetaInfoManager.java
  
  Index: AbstractMetaInfoManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/AbstractMetaInfoManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractMetaInfoManager.java	15 May 2003 18:56:28 -0000	1.2
  +++ AbstractMetaInfoManager.java	19 May 2003 17:07:28 -0000	1.3
  @@ -251,4 +251,16 @@
       {
           return m_loader;
       }
  +    
  +    /**
  +     * Let us know that the meta and dependency info has already been
  +     * loaded for a given class name.
  +     * 
  +     * @param className  The name of the class to check
  +     * @return <code>true</code> if it has been added
  +     */
  +    protected boolean isAlreadyAdded( String className )
  +    {
  +    	return m_classnames.containsKey( className );
  +    }
   }
  
  
  
  1.6       +11 -3     avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/ServiceMetaManager.java
  
  Index: ServiceMetaManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/ServiceMetaManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ServiceMetaManager.java	15 May 2003 20:13:32 -0000	1.5
  +++ ServiceMetaManager.java	19 May 2003 17:07:28 -0000	1.6
  @@ -188,7 +188,7 @@
        * Get all the implementations of a service and set up their meta
        * information.
        *
  -     * @param role
  +     * @param role  The role name we are reading implementations for.
        *
        * @throws ClassNotFoundException if the role or component cannot be found
        */
  @@ -201,7 +201,15 @@
           {
               final String impl = ( (Class) it.next() ).getName();
               getLogger().debug( "Reading meta info for " + impl );
  -            readMeta( role, impl );
  +            if ( ! isAlreadyAdded( impl ) )
  +            {
  +				readMeta( role, impl );
  +            }
  +            else
  +            {
  +            	// Mini-optimization: read meta info only once
  +            	addComponent( role, impl, null, null );
  +            }
           }
       }
   
  
  
  

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