mcconnell    2004/02/10 08:30:16

  Modified:    meta     maven.xml platform.xml project.properties
                        project.xml
               meta/api project.xml
               meta/api/src/java/org/apache/avalon/meta/info
                        DependencyDescriptor.java
               meta/impl project.xml
               meta/impl/src/java/org/apache/avalon/meta/info/builder
                        XMLTypeCreator.java
               meta/impl/src/java/org/apache/avalon/meta/info/verifier
                        Resources.properties TypeVerifier.java
               meta/impl/src/java/org/apache/avalon/meta/info/writer
                        XMLTypeWriter.java
               meta/plugin project.xml
               meta/spi project.xml
               meta/tools project.xml
               meta/tools/src/java/org/apache/avalon/meta/info/builder/tags
                        AbstractTag.java DependencyTag.java
  Log:
  Bump to 1.4-SNAPSHOT in preparation fo permission declaration and constructor 
related mata tags.
  
  Revision  Changes    Path
  1.12      +25 -96    avalon/meta/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/maven.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- maven.xml 14 Jan 2004 12:47:32 -0000      1.11
  +++ maven.xml 10 Feb 2004 16:30:15 -0000      1.12
  @@ -1,14 +1,7 @@
   <project default="avalon:build"  xmlns:maven="jelly:maven" xmlns:j="jelly:core" 
xmlns:util="jelly:util" xmlns:ant="jelly:ant">
   
  -  <ant:property name="meta.plugin.version" value="1.3.2"/>
  -  <ant:property name="meta.plugin.groupId" value="avalon-meta"/>   
  -  <ant:property name="meta.plugin.artifactId" value="avalon-meta-plugin"/>   
  -  <ant:property name="meta.plugin.jar" 
  -    value="${meta.plugin.artifactId}-${meta.plugin.version}.jar"/>   
  -
     <ant:property name="maven.ui.banner.background" value="#fff"/>
     <ant:property name="maven.ui.banner.foreground" value="#000"/>
  -  <ant:property name="maven.docs.src" value="${basedir}/site/xdocs"/>
     <ant:property name="sun.j2se.link" 
value="http://java.sun.com/j2se/1.4/docs/api/"/>
     <ant:property name="framework.api.link" 
value="http://avalon.apache.org/framework/api/"/>
     <ant:property name="maven.javadoc.links" 
value="${sun.j2se.link},${framework.api.link}"/>
  @@ -67,18 +60,27 @@
   
     <goal name="avalon:site" prereqs="avalon:build,xsite"/>
   
  -  <goal name="xsite">
  -    <ant:mkdir dir="${maven.build.dir}"/>
  -    <maven:reactor
  -      basedir="${basedir}"
  -      includes="platform.xml"
  -      goals="license,xjavadoc,site"
  -      banner="Building site:"
  -      ignoreFailures="false"/>
  -  </goal>
  -
  +  <goal name="xsite" prereqs="license,xjavadoc,site"/>
   
     <goal name="xjavadoc">
  +
  +    <maven:reactor basedir="${basedir}"
  +      includes="*/project.xml"
  +      excludes="**/target/**,/project.xml,*/plugin/project.xml"
  +      banner="Site Prep:"
  +      ignoreFailures="false"
  +      postProcessing="true" />
  +
  +    <ant:path id="template.classpath">
  +      <j:forEach var="child" items="${reactorProjects}">
  +        <j:set var="deps" value="${child.dependencies}"/>
  +        <j:forEach var="dep" items="${deps}">
  +          <ant:pathelement 
  +            
path="${maven.repo.local}/${dep.getArtifactDirectory()}/jars/${dep.getArtifact()}"/>
  +        </j:forEach>
  +      </j:forEach>
  +    </ant:path>
  +
       <mkdir dir="${basedir}/target/docs/api" />
       <property name="copyright"
         value="Copyright &amp;copy; ${year} ${pom.organization.name}. All Rights 
Reserved." />
  @@ -90,6 +92,11 @@
         bottom="${copyright}"
         additionalparam="-breakiterator -J-Xmx128m "
         packagenames="*,org.*">
  +
  +        <classpath>
  +          <path refid="template.classpath"/>
  +       </classpath>
  +
           <j:forEach var="packageGroup" items="${pom.packageGroups}">
                  <group title="${packageGroup.title}" 
packages="${packageGroup.packages}"/>
           </j:forEach>
  @@ -97,9 +104,7 @@
           <sourcepath path="${basedir}/spi/src/java"/>
           <sourcepath path="${basedir}/impl/src/java"/>
           <sourcepath path="${basedir}/tools/src/java"/>
  -        <classpath>
  -          <path refid="maven.dependency.classpath"/>
  -       </classpath>
  +
          <link href="${sun.j2se.link}" />
          <link href="${avalon.framework.link}" />
          <link href="${ant.link}" />
  @@ -236,81 +241,5 @@
       </ant:zip>
       <checksum file="${maven.dist.dir}/${maven.final.name}-src.zip"/>
     </goal>
  -
  -  <!--
  -  <postGoal name="java:prepare-filesystem">
  -    <ant:available file="${maven.home}/plugins/${meta.plugin.jar}"
  -      property="metaPluginPresent"/>
  -    <j:if test="${metaPluginPresent != 'true'}">
  -      <ant:echo>
  -#######################################################################
  -#                                                                     #
  -#   WARNING:                                                          #
  -#   You do not have the required version of the avalon-meta           #
  -#   plugin installed on your system.                                  #
  -#   The following command is automatically invoked                    #
  -#                                                                     #
  -#     $ maven avalon:setup                                            #
  -#                                                                     #
  -#   If you are not online, or have problem downloading the required   #
  -#   plugin, please invoke the command above when you have resolved    #
  -#   any network issues.                                               #
  -#######################################################################</ant:echo>
  -      <attainGoal name="avalon:setup"/>
  -    </j:if>
  -  </postGoal>
  -
  -  <goal name="avalon:setup">
  -    <echo>
  -Initiating download and installation of the Avalon Meta Plugin.
  -${meta.plugin.artifactId}-${meta.plugin.version}.jar</echo>
  -    <j:set var="repoList">${maven.repo.remote}</j:set> 
  -    <util:tokenize var="repos" delim=",">${repoList.trim()}</util:tokenize> 
  -    <j:forEach var="repo" items="${repos}"> 
  -      <echo>repository '${repo}'</echo> 
  -      <util:file var="localPlugin" 
name="${maven.home}/plugins/${meta.plugin.artifactId}-${meta.plugin.version}.jar" /> 
  -      <j:if test="${!localPlugin.exists()}"> 
  -        <j:set var="remoteFile" 
value="${repo}/${meta.plugin.groupId}/plugins/${meta.plugin.artifactId}-${meta.plugin.version}.jar"
 /> 
  -        <echo>trying to download ${remoteFile}</echo> 
  -        <j:catch var="ex"> 
  -        <j:invokeStatic var="dummy" method="getFile" 
className="org.apache.maven.util.HttpUtils"> 
  -          <j:arg type="java.lang.String" value="${remoteFile}" /> 
  -          <j:arg type="java.io.File" value="${localPlugin}"/> 
  -          <j:arg type="boolean" value="false"/> 
  -          <j:arg type="boolean" value="true"/> 
  -          <j:arg type="java.lang.String" value="${maven.proxy.host}" /> 
  -          <j:arg type="java.lang.String" value="${maven.proxy.port}" /> 
  -          <j:arg type="java.lang.String" value="${maven.proxy.username}" /> 
  -          <j:arg type="java.lang.String" value="${maven.proxy.password}" /> 
  -          <j:arg type="boolean" value="false"/> 
  -        </j:invokeStatic> 
  -        </j:catch> 
  -      </j:if> 
  -      <j:break test="${localPlugin.exists()}"/> 
  -    </j:forEach>
  -    <j:set var="downloaded" value="${localPlugin.exists()}"/> 
  -    <j:if test="${!downloaded}"> 
  -      <ant:fail message="Unable to find plug-in" /> 
  -    </j:if> 
  -    <j:if test="${downloaded}">
  -      <ant:move file="${localPlugin}" toFile="tmp.jar"/>
  -      <echo>Plugin downloaded, removing other versions</echo> 
  -      <delete verbose="false"> 
  -        <fileset dir="${maven.home}/plugins">
  -          <include name="${meta.plugin.artifactId}-*.jar" /> 
  -          <exclude name="${meta.plugin.artifactId}-${meta.plugin.version}.jar" /> 
  -        </fileset> 
  -      </delete> 
  -      <delete includeEmptyDirs="true" verbose="false"> 
  -        <fileset dir="${maven.plugin.unpacked.dir}"> 
  -          <include name="*.cache"/> 
  -          <include name="**/.processed" /> 
  -          <include name="${meta.plugin.artifactId}-*/**" /> 
  -        </fileset>
  -      </delete>
  -      <ant:move file="tmp.jar" toFile="${localPlugin}"/>
  -    </j:if> 
  -  </goal>
  -  -->
   
   </project>
  
  
  
  1.5       +1 -1      avalon/meta/platform.xml
  
  Index: platform.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/platform.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- platform.xml      2 Feb 2004 16:05:23 -0000       1.4
  +++ platform.xml      10 Feb 2004 16:30:15 -0000      1.5
  @@ -32,7 +32,7 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-impl</artifactId>
  -      <version>1.3.1</version>
  +      <version>1.3.2-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
  
  
  
  1.3       +1 -0      avalon/meta/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/avalon/meta/project.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.properties        12 Nov 2003 04:46:52 -0000      1.2
  +++ project.properties        10 Feb 2004 16:30:15 -0000      1.3
  @@ -11,6 +11,7 @@
   maven.license.licenseFile = LICENSE.txt
   maven.javadoc.stylesheet =${basedir}/site/etc/stylesheet.css
   maven.xdoc.poweredby.image= 
  +maven.docs.src = ${basedir}/site/xdocs
   
   #
   # Declaration of the remote links to assign on javadoc generation.
  
  
  
  1.12      +1 -1      avalon/meta/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/project.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- project.xml       14 Jan 2004 12:47:32 -0000      1.11
  +++ project.xml       10 Feb 2004 16:30:15 -0000      1.12
  @@ -5,7 +5,7 @@
     <name>Avalon Meta</name>
     <groupId>avalon-meta</groupId>
     <id>avalon-meta</id>
  -  <currentVersion>1.3.2</currentVersion>
  +  <currentVersion>1.4-SNAPSHOT</currentVersion>
     <inceptionYear>2000</inceptionYear>
   
     <organization>
  
  
  
  1.6       +1 -1      avalon/meta/api/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/api/project.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- project.xml       18 Dec 2003 01:10:32 -0000      1.5
  +++ project.xml       10 Feb 2004 16:30:16 -0000      1.6
  @@ -6,7 +6,7 @@
     <name>Avalon Meta Model API</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.3</currentVersion>
  +  <!--<currentVersion>1.3</currentVersion>-->
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Meta Model API</shortDescription>
     
  
  
  
  1.3       +36 -1     
avalon/meta/api/src/java/org/apache/avalon/meta/info/DependencyDescriptor.java
  
  Index: DependencyDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/meta/api/src/java/org/apache/avalon/meta/info/DependencyDescriptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DependencyDescriptor.java 24 Jan 2004 23:20:45 -0000      1.2
  +++ DependencyDescriptor.java 10 Feb 2004 16:30:16 -0000      1.3
  @@ -51,6 +51,10 @@
   
       private static final Version DEFAULT_VERSION = Version.getVersion( "1.0" );
   
  +    /**
  +     * The name the component uses to lookup dependency.
  +     */
  +    private final int m_position;
   
       /**
        * The name the component uses to lookup dependency.
  @@ -110,6 +114,23 @@
                                    final boolean optional,
                                    final Properties attributes )
       {
  +        this( role, service, optional, attributes, -1 );
  +    }
  +
  +    /**
  +     * Creation of a new dependency descriptor.
  +     * @param role the role name that will be used by the type when looking up a 
service
  +     * @param service the version insterface service reference
  +     * @param optional TRUE if this depedency is optional
  +     * @param attributes a set of attributes to associate with the dependency
  +     * @param position constructor position
  +     */
  +    public DependencyDescriptor( final String role,
  +                                 final ReferenceDescriptor service,
  +                                 final boolean optional,
  +                                 final Properties attributes, 
  +                                 final int position )
  +    {
           super( attributes );
   
           if ( null == role )
  @@ -125,6 +146,7 @@
           m_key = role;
           m_service = service;
           m_optional = optional;
  +        m_position = position;
       }
   
       /**
  @@ -182,6 +204,17 @@
           return !isOptional();
       }
   
  +    /**
  +     * Return the constructor position.
  +     *
  +     * @return -1 if not constructor else the value 
  +     *   indicates the n'th public constructor
  +     */
  +    public int getPosition()
  +    {
  +        return m_position;
  +    }
  +
       public String toString()
       {
           return "[" + getKey() + "] " + getReference();
  @@ -202,6 +235,7 @@
   
               isEqual = isEqual && m_optional == dep.m_optional;
               isEqual = isEqual && m_service.equals( dep.m_service );
  +            isEqual = isEqual && m_position == dep.m_position;
           }
   
           return isEqual;
  @@ -217,6 +251,7 @@
           hash >>>= 13;
           hash ^= m_service.hashCode();
           hash >>>= ( m_optional ) ? 1 : 0;
  +        hash >>>= m_position;
   
           return hash;
       }
  
  
  
  1.7       +3 -3      avalon/meta/impl/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/impl/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml       1 Jan 2004 21:48:37 -0000       1.6
  +++ project.xml       10 Feb 2004 16:30:16 -0000      1.7
  @@ -6,7 +6,7 @@
     <name>Avalon Meta Model Implementation</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.3.1</currentVersion>
  +  <!--<currentVersion>1.3.2-SNAPSHOT</currentVersion>-->
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Meta Model Builder and Verification Framework</shortDescription>
     
  @@ -30,12 +30,12 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.3</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-spi</artifactId>
  -      <version>1.3</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
   
       <dependency>
  
  
  
  1.9       +3 -1      
avalon/meta/impl/src/java/org/apache/avalon/meta/info/builder/XMLTypeCreator.java
  
  Index: XMLTypeCreator.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/meta/impl/src/java/org/apache/avalon/meta/info/builder/XMLTypeCreator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLTypeCreator.java       24 Jan 2004 23:20:46 -0000      1.8
  +++ XMLTypeCreator.java       10 Feb 2004 16:30:16 -0000      1.9
  @@ -326,6 +326,8 @@
           
           final boolean optional =
              dependency.getAttributeAsBoolean( "optional", false );
  +        final int index =
  +           dependency.getAttributeAsInteger( "index", -1 );
           final Properties attributes =
               buildAttributes( dependency.getChild( "attributes" ) );
   
  
  
  
  1.2       +1 -1      
avalon/meta/impl/src/java/org/apache/avalon/meta/info/verifier/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: 
/home/cvs/avalon/meta/impl/src/java/org/apache/avalon/meta/info/verifier/Resources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Resources.properties      24 Sep 2003 08:15:43 -0000      1.1
  +++ Resources.properties      10 Feb 2004 16:30:16 -0000      1.2
  @@ -1,7 +1,7 @@
   
   # TypeVerifier
   # ============
  -verifier.non-public-ctor.error=The implementation class {1} for the component type 
named "{0}" does not have a public no-argument constructor.
  +verifier.non-public-ctor.error=The implementation class {1} for the component type 
named "{0}" does not have a public constructor.
   verifier.missing-noargs-ctor.error=The implementation class {1} for the component 
type named "{0}" does not have a no-argument constructor.
   verifier.abstract-class.error=The implementation class {1} for the component type 
named "{0}" is abstract.
   verifier.nonpublic-class.error=The implementation class {1} for the component type 
named "{0}" is not public.
  
  
  
  1.3       +15 -3     
avalon/meta/impl/src/java/org/apache/avalon/meta/info/verifier/TypeVerifier.java
  
  Index: TypeVerifier.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/meta/impl/src/java/org/apache/avalon/meta/info/verifier/TypeVerifier.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TypeVerifier.java 24 Jan 2004 23:20:46 -0000      1.2
  +++ TypeVerifier.java 10 Feb 2004 16:30:16 -0000      1.3
  @@ -135,7 +135,7 @@
                                final Class clazz )
           throws VerifyException
       {
  -        verifyNoArgConstructor( name, clazz );
  +        verifyPublicConstructor( name, clazz );
           verifyNonAbstract( name, clazz );
           verifyNonArray( name, clazz );
           verifyNonInterface( name, clazz );
  @@ -300,10 +300,21 @@
        * @throws VerifyException if error thrown on failure and
        *         component fails check
        */
  -    public void verifyNoArgConstructor( final String name,
  +    public void verifyPublicConstructor( final String name,
                                           final Class clazz )
           throws VerifyException
       {
  +        final Constructor[] ctors = clazz.getConstructors();
  +        if( ctors.length < 1 )
  +        {
  +            final String message =
  +              REZ.getString( "verifier.non-public-ctor.error",
  +                name,
  +                clazz.getName() );
  +            throw new VerifyException( message );
  +        }
  +
  +        /*
           try
           {
               final Constructor ctor = clazz.getConstructor( EMPTY_TYPES );
  @@ -324,6 +335,7 @@
                                  clazz.getName() );
               throw new VerifyException( message );
           }
  +        */
       }
   
       /**
  
  
  
  1.8       +6 -1      
avalon/meta/impl/src/java/org/apache/avalon/meta/info/writer/XMLTypeWriter.java
  
  Index: XMLTypeWriter.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/meta/impl/src/java/org/apache/avalon/meta/info/writer/XMLTypeWriter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLTypeWriter.java        1 Jan 2004 23:30:48 -0000       1.7
  +++ XMLTypeWriter.java        10 Feb 2004 16:30:16 -0000      1.8
  @@ -397,6 +397,11 @@
                   writer.write( "\" optional=\"true" );
               }
   
  +            if( dependency.getPosition() > -1 )
  +            {
  +                writer.write( "\" index=\"" + dependency.getPosition() );
  +            }
  +
               final int count = dependency.getAttributeNames().length;
               if( 0 == count )
               {
  
  
  
  1.11      +5 -5      avalon/meta/plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/plugin/project.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- project.xml       14 Jan 2004 12:47:32 -0000      1.10
  +++ project.xml       10 Feb 2004 16:30:16 -0000      1.11
  @@ -5,7 +5,7 @@
     <pomVersion>3</pomVersion>
     <id>avalon-meta-plugin</id>
     <name>Avalon Meta Model Plugin</name>
  -  <currentVersion>1.3.2</currentVersion>
  +  <!--<currentVersion>1.3.2</currentVersion>-->
     <description>Avalon Plugin for Maven</description>
     <shortDescription>Avalon Plugin for Maven</shortDescription>
     <package>org.apache.avalon</package>
  @@ -26,22 +26,22 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.3</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-spi</artifactId>
  -      <version>1.3</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-impl</artifactId>
  -      <version>1.3.1</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-tools</artifactId>
  -      <version>1.3.1</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
   
       <dependency>
  
  
  
  1.6       +2 -2      avalon/meta/spi/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/spi/project.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- project.xml       18 Dec 2003 01:10:32 -0000      1.5
  +++ project.xml       10 Feb 2004 16:30:16 -0000      1.6
  @@ -6,7 +6,7 @@
     <name>Avalon Meta Model SPI</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.3</currentVersion>
  +  <!--<currentVersion>1.3</currentVersion>-->
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Meta Model SPI</shortDescription>
     
  @@ -25,7 +25,7 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.3</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
   
     </dependencies>
  
  
  
  1.9       +4 -4      avalon/meta/tools/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/tools/project.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- project.xml       14 Jan 2004 12:47:32 -0000      1.8
  +++ project.xml       10 Feb 2004 16:30:16 -0000      1.9
  @@ -6,7 +6,7 @@
     <name>Avalon Meta Model Toolkit</name>
     <package>org.apache.avalon.meta</package>
   
  -  <currentVersion>1.3.1</currentVersion>
  +  <!--<currentVersion>1.3.1</currentVersion>-->
     <inceptionYear>2002</inceptionYear>
     <shortDescription>Avalon Meta Model Toolkit</shortDescription>
     
  @@ -39,17 +39,17 @@
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-api</artifactId>
  -      <version>1.3</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-spi</artifactId>
  -      <version>1.3</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>avalon-meta</groupId>
         <artifactId>avalon-meta-impl</artifactId>
  -      <version>1.3.1</version>
  +      <version>1.4-SNAPSHOT</version>
       </dependency>
   
       <dependency>
  
  
  
  1.3       +23 -1     
avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/AbstractTag.java
  
  Index: AbstractTag.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/AbstractTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractTag.java  14 Jan 2004 12:47:33 -0000      1.2
  +++ AbstractTag.java  10 Feb 2004 16:30:16 -0000      1.3
  @@ -332,4 +332,26 @@
           return (JavaMethod[]) list.toArray( new JavaMethod[0] );
   
       }
  +
  +    JavaMethod[] findConstructorMethods( final JavaClass clazz, String key )
  +    {
  +        ArrayList list = new ArrayList();
  +        return findConstructorMethods( clazz, key, list );
  +    }
  +
  +    private JavaMethod[] findConstructorMethods( final JavaClass clazz, String key, 
List list )
  +    {
  +        final JavaMethod[] methods = clazz.getMethods();
  +        for( int i=0; i<methods.length; i++ )
  +        {
  +            JavaMethod method = methods[i];
  +            if( method.isConstructor() && method.isPublic() )
  +            {
  +                final DocletTag tag = 
  +                  method.getTagByName( key );
  +                if( tag != null ) list.add( method );
  +            }
  +        }
  +        return (JavaMethod[]) list.toArray( new JavaMethod[0] );
  +    }
   }
  
  
  
  1.2       +24 -5     
avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/DependencyTag.java
  
  Index: DependencyTag.java
  ===================================================================
  RCS file: 
/home/cvs/avalon/meta/tools/src/java/org/apache/avalon/meta/info/builder/tags/DependencyTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DependencyTag.java        24 Sep 2003 08:16:15 -0000      1.1
  +++ DependencyTag.java        10 Feb 2004 16:30:16 -0000      1.2
  @@ -115,18 +115,23 @@
        */
       public DependencyDescriptor[] getDependencies()
       {
  +        int n = -1;
           final ArrayList deps = new ArrayList();
           final Set marked = new HashSet( 10 );
           for ( int j = 0; j < m_methods.length; j++ )
           {
  +            JavaMethod method = m_methods[j];
  +            boolean flag = method.isConstructor();
  +            if( flag ) n++;
  +
               final DocletTag[] tags =
  -                    m_methods[j].getTagsByName( getNS()
  +                    method.getTagsByName( getNS()
                       + Tags.DELIMITER + KEY );
   
               for ( int i = 0; i < tags.length; i++ )
               {
                   DocletTag tag = tags[i];
  -                DependencyDescriptor dep = getDependency( tag );
  +                DependencyDescriptor dep = getDependency( tag, flag, n );
                   final String key = dep.getKey();
                   if ( !marked.contains( key ) )
                   {
  @@ -139,7 +144,7 @@
                   new DependencyDescriptor[deps.size()] );
       }
   
  -    private DependencyDescriptor getDependency( DocletTag tag )
  +    private DependencyDescriptor getDependency( DocletTag tag, boolean flag, int n )
       {
           final String value = getNamedParameter( tag, TYPE_PARAM );
           final String type = resolveType( value );
  @@ -149,7 +154,14 @@
           final String optional = getNamedParameter( tag, OPTIONAL_PARAM, "false" );
           final boolean isOptional = "true".equals( optional.toLowerCase() );
           final ReferenceDescriptor ref = new ReferenceDescriptor( type, version );
  -        return new DependencyDescriptor( key, ref, isOptional, null );
  +        if( flag )
  +        {
  +            return new DependencyDescriptor( key, ref, isOptional, null, n );
  +        }
  +        else
  +        { 
  +            return new DependencyDescriptor( key, ref, isOptional, null );
  +        }
       }
   
       /**
  @@ -161,6 +173,13 @@
           if ( m_methods.length == 0 )
           {
               m_methods = getLifecycleMethods( "service", SERVICE_MANAGER_CLASS );
  +            if ( m_methods.length == 0 )
  +            {
  +                m_methods = 
  +                  findConstructorMethods( 
  +                   getJavaClass(), 
  +                   getNS() + Tags.DELIMITER + KEY );
  +            }
           }
       }
   }
  
  
  

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

Reply via email to