avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl DefaultContainmentModel.java
Date Sat, 03 Jan 2004 16:12:19 GMT
mcconnell    2004/01/03 08:12:19

  Modified:    merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        Tag: Ver_3_4 DefaultContainmentModel.java
  Log:
  Add model expansion.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.13.2.3  +21 -1     avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java
  
  Index: DefaultContainmentModel.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultContainmentModel.java,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- DefaultContainmentModel.java	3 Jan 2004 16:01:32 -0000	1.13.2.2
  +++ DefaultContainmentModel.java	3 Jan 2004 16:12:19 -0000	1.13.2.3
  @@ -341,7 +341,27 @@
                throw new IllegalStateException( error );
           }
   
  -        return new Model[0];
  +        ArrayList list = new ArrayList();
  +        Model[] models = m_context.getModelRepository().getModels();
  +        for( int i=0; i<models.length; i++ )
  +        {
  +            Model model = models[i];
  +            if( model instanceof Composite )
  +            {
  +                Model[] providers = ((Composite)model).getProviders();
  +                for( int j=0; j<providers.length; j++ )
  +                {
  +                    Model provider = providers[j];
  +                    final String path = provider.getPath();
  +                    final String root = getPartition();
  +                    if( !path.startsWith( root ) )
  +                    {
  +                        list.add( providers[j] );
  +                    }
  +                }
  +            }
  +        }
  +        return (Model[]) list.toArray( new Model[0] );
       }
   
       //--------------------------------------------------------------
  
  
  

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


Mime
View raw message