You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2002/08/31 10:17:01 UTC

cvs commit: jakarta-avalon-excalibur/info/src/xdocs/stylesheets project.xml

donaldp     2002/08/31 01:17:01

  Added:       info     .cvsignore ant.properties.sample build.xml
                        default.properties
               info/lib/xdoclet LICENSE.xdoclet.txt commons-logging.jar
                        log4j-core.jar xdoclet-20020825.jar
                        xjavadoc-20020825.jar
               info/src/java/org/apache/avalon/framework/info
                        ComponentBundle.java ComponentDescriptor.java
                        ComponentInfo.java ContextDescriptor.java
                        DependencyDescriptor.java EntryDescriptor.java
                        FeatureDescriptor.java LoggerDescriptor.java
                        ServiceDescriptor.java ServiceDesignator.java
                        package.html
               info/src/java/org/apache/avalon/framework/info/doc-files
                        entries.html uml.gif
               info/src/java/org/apache/avalon/framework/tools/ant
                        SerializeInfoTask.java
               info/src/java/org/apache/avalon/framework/tools/infobuilder
                        ComponentInfoBuilder.java ConfigurationBuilder.java
                        DTDInfo.java DTDResolver.java InfoCreator.java
                        Resources.properties SerializedInfoCreator.java
                        XMLInfoCreator.java componentinfo.dtd package.html
               info/src/java/org/apache/avalon/framework/tools/infobuilder/doc-files
                        ComponentInfoBuilder.gif
               info/src/java/org/apache/avalon/framework/tools/xdoclet
                        AvalonTagHandler.java AvalonXDoclet.java
                        ComponentInfoSubTask.java
                        IsServiceProvisionFilter.java componentinfo.xdt
               info/src/test README.txt
               info/src/xdocs index.xml menu.xml
               info/src/xdocs/stylesheets project.xml
  Log:
  Start separating out the component info stuff.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/info/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  ant.properties
  build
  checkstyle.cache
  distributions
  dist
  excalibur-*
  *.el
  *.ipr
  
  
  
  1.1                  jakarta-avalon-excalibur/info/ant.properties.sample
  
  Index: ant.properties.sample
  ===================================================================
  # -----------------------------------------------------------------------------
  # Component ant.properties.sample
  #
  # This is an example "ant.properties" file, used to customize the building of
  # the component for your local environment.  It defines the location of all
  # external modules that this component depend on.  Copy this file to
  # "ant.properties" in the source directory, and customize it as needed.
  #
  # The ant.properties values in this directory apply only to this component.
  # It is overridden by ../ant.properties and ~/build.properties
  # It overrides all default.properties files and ~/.ant.properties
  #
  # $Id: ant.properties.sample,v 1.1 2002/08/31 08:17:00 donaldp Exp $
  # -----------------------------------------------------------------------------
  
  # ----- Compile Control Flags -----
  build.debug=on
  build.optimize=off
  build.deprecation=off
  #build.compiler=jikes
  
  # ----- Base Directory in which all the packages are stored -----
  base.path=${basedir}/../..
  
  # --------------------------------------------------
  #                REQUIRED LIBRARIES
  # --------------------------------------------------
  
  
  
  # --------------------------------------------------
  #                OPTIONAL LIBRARIES
  # --------------------------------------------------
  
  # ----- JUnit Unit Test Suite, version 3.7 or later. -----
  #  Not needed if junit.jar is in $ANT_HOME/lib 
  junit.home=${base.path}/junit3.7
  junit.lib=${junit.home}
  junit.jar=${junit.lib}/junit.jar
  
  
  # ----- Checkstyle, version 2.1 or later -----
  # Uncomment the 'do.checkstyle' flag property to enable checkstyle
  # do.checkstyle=
  checkstyle.home=${base.path}/checkstyle-2.1
  checkstyle.lib=${checkstyle.home}
  checkstyle.jar=${checkstyle.lib}/checkstyle-all-2.1.jar
  
  
  
  1.1                  jakarta-avalon-excalibur/info/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project name="Excalibur Info" default="main" basedir=".">
  
      <property file="${user.home}/build.properties"/>
      <property file="${basedir}/../ant.properties"/>
      <property file="${basedir}/ant.properties"/>
      <property file="${user.home}/.ant.properties"/>
      <property file="${basedir}/../default.properties"/>
      <property file="${basedir}/default.properties"/>
  
      <!-- Classpath for product -->
      <path id="project.class.path">
          <pathelement location="${build.classes}"/>
          <pathelement location="${avalon-framework.jar}"/>
          <pathelement location="${excalibur-i18n.jar}"/>
          <pathelement location="${checkstyle.jar}"/>
          <pathelement location="${xml-apis.jar}"/>
          <pathelement path="${java.class.path}"/>
          <fileset dir="lib" includes="**/*.jar"/>
      </path>
  
      <path id="tools.class.path">
          <pathelement location="${junit.jar}"/>
          <pathelement location="${tools.jar}"/>
          <fileset dir="${tools.dir}/lib"/>
          <fileset dir="${tools.dir}/ext"/>
      </path>
  
      <path id="test.class.path">
          <pathelement location="${build.testclasses}"/>
          <pathelement location="${junit.jar}"/>
          <path refid="project.class.path"/>
      </path>
      <property name="cp" refid="test.class.path"/>
  
      <target name="main" depends="jar" description="Build the project"/>
      <target name="rebuild" depends="clean,main" description="Rebuild the project"/>
  
      <target name="dependencies" description="Check dependencies" unless="skip.dependencies">
          <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkCommon"/>
          <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkFramework"/>
          <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkI18N"/>
      </target>
  
      <target name="dependencies-test" depends="dist-jar, dependencies"
          description="Check unit test dependencies" unless="skip.dependencies">
          <!-- Need the jar to prevent recursive deps. -->
  
          <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkJUnit"/>
      </target>
  
  
      <!-- Compiles the source code -->
      <target name="compile" depends="dependencies" description="Compiles the source code">
  
          <mkdir dir="${build.classes}"/>
  
          <!-- Compile all classes excluding the tests. -->
          <javac srcdir="${java.dir}"
              destdir="${build.classes}"
              debug="${build.debug}"
              optimize="${build.optimize}"
              deprecation="${build.deprecation}"
              target="1.2">
              <classpath refid="project.class.path" />
              <include name="**/*.java"/>
          </javac>
  
          <!-- copy resources to same location as .class files -->
          <copy todir="${build.classes}">
              <fileset dir="${java.dir}">
                  <exclude name="**/*.java"/>
                  <exclude name="**/package.html"/>
              </fileset>
          </copy>
  
      </target>
  
      <!-- Compiles the unit test source code -->
      <target name="compile-test" depends="compile, dependencies-test" description="Compiles the source code">
          <mkdir dir="${build.testsrc}"/>
  
          <!-- Copy over all of the tests applying test filters -->
          <copy todir="${build.testsrc}">
              <fileset dir="${test.dir}"/>
          </copy>
  
          <mkdir dir="${build.testclasses}"/>
  
          <!-- Compile all test classes. -->
          <javac srcdir="${build.testsrc}"
              destdir="${build.testclasses}"
              debug="${build.debug}"
              optimize="${build.optimize}"
              deprecation="${build.deprecation}"
              target="1.2">
              <classpath refid="test.class.path" />
              <include name="**/*.java"/>
          </javac>
  
          <copy todir="${build.testclasses}">
              <fileset dir="${test.dir}">
                  <exclude name="**/*.java"/>
                  <exclude name="**/package.html"/>
              </fileset>
          </copy>
  
      </target>
  
      <!-- Copies and filters the license. Used by jar and dist -->
      <target name="prepare-conf">
          <mkdir dir="${build.conf}"/>
          <copy todir="${build.conf}" flatten="true">
              <fileset dir="../" includes="LICENSE.txt"/>
              <filterset>
                  <filter token="year" value="${year}"/>
              </filterset>
          </copy>
      </target>
  
      <!-- Creates all the .jar file -->
      <target name="jar" depends="compile, prepare-conf" description="Generates the jar files">
  
          <mkdir dir="${build.lib}"/>
  
          <jar jarfile="${build.lib}/${jar.name}"
              basedir="${build.classes}"
              compress="${build.compress}">
              <manifest>
                  <attribute name="Extension-Name" value="${name}"/>
                  <attribute name="Specification-Vendor" value="Apache Software Foundation"/>
                  <attribute name="Specification-Version" value="1.0"/>
                  <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
                  <attribute name="Implementation-Version" value="${package-version}"/>
              </manifest>
              <exclude name="**/test/**"/>
              <zipfileset dir="${build.conf}" prefix="META-INF/">
                  <include name="LICENSE.txt"/>
              </zipfileset>
          </jar>
      </target>
  
      <!-- Creates all the Javadocs -->
      <target name="javadocs" depends="compile" description="Generates the javadocs" unless="skip.javadocs">
  
          <mkdir dir="${dist.javadocs}"/>
          <javadoc packagenames="org.apache.*"
              sourcepath="${java.dir}"
              destdir="${dist.javadocs}">
              <classpath refid="project.class.path" />
              <group title="Info API" packages="org.apache.avalon.framework.info.*" />
              <group title="Info Tools API" packages="org.apache.avalon.framework.tools.*" />
              <tag name="todo" description="To do:" scope="all" />
              <tag name="avalon.component" enabled="false" description="Component:" scope="types" />
              <tag name="avalon.service" enabled="false" description="Service:" scope="types" />
              <tag name="avalon.context" enabled="false" description="Context:" scope="methods" />
              <tag name="avalon.entry" enabled="false" description="Context:" scope="methods" />
              <tag name="avalon.dependency" enabled="false" description="Context:" scope="methods" />
              <doclet name="com.sun.tools.doclets.standard.Standard">
                  <param name="-author"/>
                  <param name="-version"/>
                  <param name="-doctitle" value="${Name}"/>
                  <param name="-windowtitle" value="${Name} API"/>
                  <param name="-link" value="http://java.sun.com/j2se/1.4/docs/api/"/>
                  <param name="-link" value="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
                  <param name="-link" value="http://jakarta.apache.org/avalon/api/"/>
                  <param name="-bottom"
                      value="&quot;Copyright &#169; ${year} Apache Jakarta Project. All Rights Reserved.&quot;"/>
              </doclet>
  
          </javadoc>
      </target>
  
      <target name="test" depends="compile-test" description="Perform the unit tests" unless="skip.tests">
  
          <echo message="Performing Unit Tests" />
  
          <mkdir dir="${build.tests}"/>
  
          <junit fork="true"
              haltonfailure="${junit.failonerror}"
              printsummary="yes"
              dir="${build.tests}">
              <classpath refid="test.class.path"/>
  
              <formatter type="xml"/>    <!-- xml reports for junitreport -->
              <formatter type="plain" usefile="false"/>  <!-- text reports for humans     -->
  
              <batchtest todir="${build.tests}">
                  <fileset dir="${build.testclasses}">
                      <include name="**/test/*TestCase.class"/>
                      <exclude name="**/Abstract*"/>
                  </fileset>
              </batchtest>
          </junit>
  
      </target>
  
      <target name="test-reports" depends="test" description="Generate Reports for the unit tests">
  
          <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkBSF"/>
  
          <mkdir dir="${build.reports}/junit"/>
  
          <junitreport todir="${build.reports}/junit">
              <fileset dir="${build.tests}">
                  <include name="TEST-*.xml"/>
              </fileset>
              <report format="frames" todir="${build.reports}/junit"/>
          </junitreport>
  
          <!-- Clean up the xml reports used by the junitreport task -->
          <!--
          <delete>
              <fileset dir="${build.tests}" includes="TEST-*.xml"/>
              <fileset dir="${build.tests}" includes="TESTS-*.xml"/>
          </delete>
          -->
  
      </target>
  
      <target name="checkstyle" if="do.checkstyle" description="Checkstyle">
  
          <!-- this invocation of checkstyle requires that checkstyle be downloaded and setup -->
          <!-- thats why you are required to define do.checkstyle property to generate the report -->
          <taskdef name="checkstyle"
              classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
              <classpath refid="project.class.path"/>
          </taskdef>
          <checkstyle
              lcurlyType="nl"
              lcurlyMethod="nl"
              lcurlyOther="nl"
              rcurly="ignore"
              allowProtected="false"
              allowPackage="false"
              allowNoAuthor="false"
              maxLineLen="100"
              maxMethodLen="100"
              maxConstructorLen="100"
              memberPattern="^m_[a-z][a-zA-Z0-9]*$"
              staticPattern="^c_[a-z][a-zA-Z0-9]*$"
              constPattern="(^c_[a-z][a-zA-Z0-9]*$)|([A-Z_]*$)"
              ignoreImportLen="true"
              allowTabs="false"
              javadocScope="protected"
              ignoreWhitespace="true"
              cacheFile="checkstyle.cache"
              failOnViolation="false"
              ignoreCastWhitespace="true">
              <fileset dir="${java.dir}">
                  <include name="**/*.java"/>
              </fileset>
              <formatter type="plain"/>
              <formatter type="xml" toFile="${build.dir}/checkstyle-results.xml"/>
          </checkstyle>
      </target>
  
      <target name="checkstyle-report"
          depends="checkstyle"
          if="do.checkstyle"
          description="Generate Checkstyle Report">
  
          <mkdir dir="${build.reports}/checkstyle"/>
          <property name="checkstyle.pathhack" location="."/>
          <style style="${tools.dir}/etc/checkstyle-frames.xsl" in="${build.dir}/checkstyle-results.xml"
              out="${build.reports}/checkstyle/delete-me.html">
              <param name="pathhack" expression="${checkstyle.pathhack}"/>
          </style>
  
      </target>
  
      <target name="xdoclet" depends="main" description="Generates the XML descriptors">
          <taskdef name="avalon-xinfo"
              classname="org.apache.excalibur.containerkit.tools.xdoclet.AvalonXDoclet">
              <classpath>
                  <path refid="project.class.path"/>
                  <pathelement location="${build.classes}"/>
              </classpath>
          </taskdef>
          <taskdef name="serialize-info"
              classname="org.apache.excalibur.containerkit.tools.ant.SerializeInfoTask">
              <classpath>
                  <path refid="project.class.path"/>
                  <pathelement location="${build.classes}"/>
              </classpath>
          </taskdef>
  
          <mkdir dir="gen"/>
          <avalon-xinfo force="true" destdir="gen" >
              <fileset dir="${java.dir}">
                  <include name="**/demo/components/*.java" />
              </fileset>
              <componentinfo/>
          </avalon-xinfo>
  
          <serialize-info destDir="gen">
              <fileset dir="gen">
                  <include name="**/*.xinfo" />
              </fileset>
          </serialize-info>
      </target>
  
      <!-- Creates the distribution -->
      <target name="dist"
          depends="dist-jar, test-reports, checkstyle-report, docs, javadocs"
          description="Generates a distribution (jar + docs + javadocs + unit tests + checkstyle reports)">
  
          <copy file="${build.conf}/LICENSE.txt" todir="${dist.dir}"/>
          <copy file="../KEYS" todir="${dist.dir}"/>
          <copy file="README.txt" todir="${dist.dir}"/>
  
          <zip zipfile="${dist.dir}/src.zip" compress="false">
              <zipfileset dir="src/java"/>
          </zip>
  
          <mkdir dir="${dist.base}"/>
  
          <zip zipfile="${dist.base}/${dist.name}.zip" compress="true">
              <zipfileset dir="${dist.dir}" prefix="${dist.name}"/>
              <zipfileset dir="${docs.dir}" prefix="${dist.name}/docs"/>
          </zip>
      </target>
  
      <!-- Creates a mini jar-only distribution -->
      <target name="dist-jar" depends="jar">
          <mkdir dir="${dist.dir}"/>
          <copy todir="${dist.dir}">
              <fileset dir="${build.lib}">
                  <include name="*.jar"/>
              </fileset>
          </copy>
      </target>
  
      <!-- Creates a minimal distribution -->
      <target name="dist.lite"
          depends="dist-jar, test, javadocs"
          description="Generates a minimal distribution (jar + javadocs)">
  
          <copy file="../LICENSE.txt" todir="${dist.dir}"/>
          <copy file="../KEYS" todir="${dist.dir}"/>
          <copy file="README.txt" todir="${dist.dir}"/>
  
      </target>
  
      <!-- Setup the filters -->
      <target name="setup-filters">
          <filter token="Name" value="Avalon ${Name}"/>
          <filter token="name" value="${dir-name}"/>
          <filter token="version" value="${version}"/>
          <filter token="year" value="${year}"/>
          <filter token="status" value="${status}"/>
          <filter token="release" value="${release}"/>
          <filter token="short-version" value="${short.version}"/>
  
          <property name="avalon.base" value="http://jakarta.apache.org/avalon"/>
          <property name="framework.base" value="http://jakarta.apache.org/avalon/framework"/>
          <property name="phoenix.base" value="http://jakarta.apache.org/avalon/phoenix"/>
          <property name="cornerstone.base" value="http://jakarta.apache.org/avalon/cornerstone"/>
          <property name="logkit.base" value="http://jakarta.apache.org/avalon/logkit"/>
          <property name="testlet.base" value="http://jakarta.apache.org/avalon/testlet"/>
  
          <filter token="year" value="${year}"/>
          <filter token="AVALON_BASE" value="${avalon.base}"/>
          <filter token="FRAMEWORK_BASE" value="${framework.base}"/>
          <filter token="PHOENIX_BASE" value="${phoenix.base}"/>
          <filter token="CORNERSTONE_BASE" value="${cornerstone.base}"/>
          <filter token="LOGKIT_BASE" value="${logkit.base}"/>
          <filter token="TESTLET_BASE" value="${testlet.base}"/>
      </target>
  
  
      <!-- Prepares the documentation directory -->
      <target name="docs" depends="setup-filters" description="Generates the Docs">
      <ant antfile="${basedir}/../cocoonbuild.xml"/>
  
        <copy todir="${docs.dir}">
          <fileset dir="${build.docs}">
            <include name="**"/>
          </fileset>
        </copy>    
  
      </target>
      
      <target name="site" depends="javadocs, docs" description=" Places Docs ready for hosting on website">
  
          <mkdir dir="../site/dist/docs/${dir-name}"/>
          <copy todir="../site/dist/docs/${dir-name}">
              <fileset dir="${docs.dir}">
                  <include name="**"/>
              </fileset>
          </copy>
  
      </target>
  
      <!-- Cleans up build and distribution directories -->
      <target name="clean" description="Cleans up the project">
          <delete file="checkstyle.cache"/>
          <delete dir="${build.dir}" />
          <delete dir="${dist.dir}" />
          <delete dir="${docs.dir}" />
          <delete dir="test" /> <!-- unit testing output directory -->
          <delete>
              <fileset dir="." includes="velocity.*"/>
              <fileset dir="." includes="**/*~" defaultexcludes="no"/>
          </delete>
      </target>
  
      <target name="real-clean" depends="clean" description="Cleans up the project, including distributions">
          <delete dir="${dist.base}" />
      </target>
  
  </project>
  
  
  
  1.1                  jakarta-avalon-excalibur/info/default.properties
  
  Index: default.properties
  ===================================================================
  # -------------------------------------------------------------------
  # B U I L D  P R O P E R T I E S
  # -------------------------------------------------------------------
  # Specifies default property values
  # Overridden by ../default.properties and all ant.properties
  # Not user-editable; use ant.properties files instead
  
  name=excalibur-info
  Name=Excalibur Info
  dir-name=info
  version=1.0a
  package-version=0.99
  year=2000-2002
  
  # --------------------------------------------------
  #                REQUIRED LIBRARIES
  # --------------------------------------------------
  
  # ----- Avalon Framework, version 4.1 or later -----
  avalon-framework.home=${basedir}/../../jakarta-avalon
  avalon-framework.lib=${avalon-framework.home}/build/lib
  avalon-framework.jar=${avalon-framework.lib}/avalon-framework.jar
  
  # ----- Excalibur i18n, version 1.0 or later -----
  excalibur-i18n.home=${basedir}/../i18n/dist
  excalibur-i18n.lib=${excalibur-i18n.home}
  excalibur-i18n.jar=${excalibur-i18n.lib}/excalibur-i18n-1.0.jar
  
  # --------------------------------------------------
  
  #  Settings used to configure compile environment
  build.debug = on
  build.optimize = off
  build.deprecation = off
  build.compress = false
  junit.failonerror = false
  
  #  location of intermediate products
  build.dir = build
  build.testsrc = ${build.dir}/testsrc
  build.testclasses = ${build.dir}/testclasses
  build.lib = ${build.dir}/lib
  build.conf = ${build.dir}/conf
  build.classes = ${build.dir}/classes
  build.tests = ${build.dir}/tests
  build.reports = ${build.dir}/reports
  
  #  Set the properties for source directories
  src.dir = src
  java.dir = ${src.dir}/java
  conf.dir = ${src.dir}/conf
  test.dir = ${src.dir}/test
  
  #  needed by Cocoon
  build.context = ${build.dir}/documentation
  build.docs = ${build.dir}/docs
  build.xdocs = ${build.dir}/xdocs
  context.dir = ../../jakarta-avalon/src/documentation
  tools.dir = ../../jakarta-avalon/tools
  tools.jar = ${java.home}/../lib/tools.jar
  docs.dir = docs
  
  #  Set the properties for distribution directories
  dist.dir = dist
  dist.javadocs = ${docs.dir}/api
  
  #  name of .zip/.tar.gz/.bz2 files and their top-level directory
  dist.name = ${name}-${version}
  
  #  name of jar file
  jar.name = ${name}-${version}.jar
  
  #  property indicating directory where all distribution archives are placed
  dist.base = distributions
  
  depchecker.prefix=.
  
  
  
  
  1.1                  jakarta-avalon-excalibur/info/lib/xdoclet/LICENSE.xdoclet.txt
  
  Index: LICENSE.xdoclet.txt
  ===================================================================
   Copyright (c) 2000-2002, XDoclet team
   All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modification, 
   are permitted provided that the following conditions are met:
  
   Redistributions of source code must retain the above copyright notice, this list 
   of conditions and the following disclaimer.
  
   Redistributions in binary form must reproduce the above copyright notice, this list 
   of conditions and the following disclaimer in the documentation and/or other materials
   provided with the distribution.
  
   Neither the name of the XDoclet team nor the names of its contributors may be used 
   to endorse or promote products derived from this software without specific prior
   written permission.
  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY 
   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
   SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  
  1.1                  jakarta-avalon-excalibur/info/lib/xdoclet/commons-logging.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/info/lib/xdoclet/log4j-core.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/info/lib/xdoclet/xdoclet-20020825.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/info/lib/xdoclet/xjavadoc-20020825.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentBundle.java
  
  Index: ComponentBundle.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.io.InputStream;
  
  /**
   * The ComponentBundle gives access to the sum total of all the
   * metadata and resources about a component. This includes all
   * the resources associated with a particular component and the
   * associated {@link ComponentInfo}.
   *
   * <p>Additional resources that may be associated with a component
   * include but are not limited to;</p>
   *
   * <ul>
   *   <li>Resource property files for i18n of {@link ComponentInfo}</li>
   *   <li>XML schema or DTD that is used when validating a components
   *       configuration, such as in Phoenix.</li>
   *   <li>Descriptor used to define management interface of
   *       component.</li>
   *   <li>Prototype used to define a component profile.</li>
   * </ul>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public interface ComponentBundle
  {
      /**
       * Return the {@link ComponentInfo} that describes the
       * component.
       *
       * @return the {@link ComponentInfo} that describes the component.
       */
      ComponentInfo getComponentInfo();
  
      /**
       * Return an input stream for a resource associated with
       * component. The resource name can be relative or absolute.
       * Absolute names being with a '/' character.
       *
       * <p>When the component is implemented via a Java class (as
       * opposed to a remote SOAP/RMI/JMX/other service), the resources
       * are loaded from the same <code>ClassLoader</code> as
       * implementation. The resources are loaded relative to the
       * implementaion classes package and are often named after the
       * classname of the component.</p>
       *
       * <p>For example, a component <code>com.biz.Foo</code> may have
       * resources such as <code>com/biz/Foo-schema.xsd</code>,
       * <code>com/biz/Foo.mxinfo</code> or
       * <code>com/biz/Foo-profile.xml</code>.</p>
       *
       * @return the input stream for associated resource, or null
       *         if no such resource
       */
      InputStream getResourceAsStream( String resource );
  }
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentDescriptor.java
  
  Index: ComponentDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.util.Properties;
  import org.apache.avalon.framework.Version;
  
  /**
   * This class is used to provide explicit information to assembler
   * and administrator about the Component. It includes information
   * such as;
   *
   * <ul>
   *   <li>a symbolic name</li>
   *   <li>classname</li>
   *   <li>version</li>
   * </ul>
   *
   * <p>The ComponentDescriptor also includes an arbitrary set
   * of attributes about component. Usually these are container
   * specific attributes that can store arbitrary information.
   * The attributes should be stored with keys based on package
   * name of container. ie You could use the following</p>
   *
   * <pre>
   * public class CocoonKeys
   * {
   *     private final static String PACKAGE =
   *         CocoonKeys.class.getPackage().getName();
   *
   *     //Is object Multi-thread safe, sharable between components
   *     public final static String LIFESTYLE = PACKAGE + ".Lifestyle";
   *
   *     //Is object scoped per-request, per-session, per-page etc
   *     public final static String SCOPE = PACKAGE + ".Scope";
   * }
   *
   * ...
   *
   * ComponentDescriptor cd = ...;
   * String lifestyle = cd.getAttribute( LIFESTYLE, "single-threaded" );
   * String scope = cd.getAttribute( LIFESTYLE, null );
   * </pre>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public final class ComponentDescriptor
      extends FeatureDescriptor
  {
      /**
       * The short name of the Component Type. Useful for displaying
       * human readable strings describing the type in
       * assembly tools or generators.
       */
      private final String m_name;
  
      /**
       * The implementation key for component (usually classname).
       */
      private final String m_implementationKey;
  
      /**
       * The version of component that descriptor describes.
       */
      private final Version m_version;
  
      public ComponentDescriptor( final String name,
                                  final String implementationKey,
                                  final Version version,
                                  final Properties attributes )
      {
          super( attributes );
  
          if( implementationKey.indexOf("/") > -1 )
          {
              throw new IllegalArgumentException( "implementationKey: " + implementationKey );
          }
  
          m_name = name;
          m_implementationKey = implementationKey;
          m_version = version;
      }
  
      /**
       * Return the symbolic name of component.
       *
       * @return the symbolic name of component.
       */
      public String getName()
      {
          return m_name;
      }
  
      /**
       * Return the implementation key for component (usually classname).
       *
       * @return the implementation key for component (usually classname).
       */
      public String getImplementationKey()
      {
          return m_implementationKey;
      }
  
      /**
       * Return the version of component.
       *
       * @return the version of component.
       */
      public Version getVersion()
      {
          return m_version;
      }
  }
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentInfo.java
  
  Index: ComponentInfo.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.io.Serializable;
  import org.apache.avalon.framework.info.ServiceDesignator;
  import org.apache.avalon.framework.info.ContextDescriptor;
  
  /**
   * This class contains the meta information about a particular
   * component type. It describes;
   *
   * <ul>
   *   <li>Human presentable meta data such as name, version, description etc
   *   useful when assembling the system.</li>
   *   <li>the context object capabilities that this component requires</li>
   *   <li>the services that this component type is capable of providing</li>
   *   <li>the services that this component type requires to operate (and the
   *   names via which services are accessed)</li>
   * </ul>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public class ComponentInfo
      implements Serializable
  {
      private final ComponentDescriptor m_descriptor;
      private final ContextDescriptor m_context;
      private final ServiceDescriptor[] m_services;
      private final DependencyDescriptor[] m_dependencies;
      private final LoggerDescriptor[] m_loggers;
  
      /**
       * Basic constructor that takes as parameters all parts.
       */
      public ComponentInfo( final ComponentDescriptor descriptor,
                            final LoggerDescriptor[] loggers,
                            final ContextDescriptor context,
                            final ServiceDescriptor[] services,
                            final DependencyDescriptor[] dependencies )
      {
          if( null == descriptor )
          {
              throw new NullPointerException( "descriptor" );
          }
          if( null == loggers )
          {
              throw new NullPointerException( "loggers" );
          }
          if( null == context )
          {
              throw new NullPointerException( "context" );
          }
          if( null == services )
          {
              throw new NullPointerException( "services" );
          }
          if( null == dependencies )
          {
              throw new NullPointerException( "dependencies" );
          }
          m_descriptor = descriptor;
          m_loggers = loggers;
          m_context = context;
          m_services = services;
          m_dependencies = dependencies;
      }
  
      /**
       * Return the Component descriptor.
       *
       * @return the Component descriptor.
       */
      public ComponentDescriptor getComponentDescriptor()
      {
          return m_descriptor;
      }
  
      /**
       * Return the set of Logger that this Component will use.
       *
       * @return the set of Logger that this Component will use.
       */
      public LoggerDescriptor[] getLoggers()
      {
          return m_loggers;
      }
  
      /**
       * Return the ContextDescriptor for Component, may be null.
       * If null then this component does not implement Contextualizable.
       *
       * @return the ContextDescriptor for Component, may be null.
       */
      public ContextDescriptor getContextDescriptor()
      {
          return m_context;
      }
  
      /**
       * Return the set of Services that this Component is capable of providing.
       *
       * @return the set of Services that this Component is capable of providing.
       */
      public ServiceDescriptor[] getServices()
      {
          return m_services;
      }
  
      /**
       * Return the set of Dependencies that this Component requires to operate.
       *
       * @return the set of Dependencies that this Component requires to operate.
       */
      public DependencyDescriptor[] getDependencies()
      {
          return m_dependencies;
      }
  
      /**
       * Retrieve a dependency with a particular role.
       *
       * @param role the role
       * @return the dependency or null if it does not exist
       */
      public DependencyDescriptor getDependency( final String role )
      {
          for( int i = 0; i < m_dependencies.length; i++ )
          {
              if( m_dependencies[ i ].getRole().equals( role ) )
              {
                  return m_dependencies[ i ];
              }
          }
  
          return null;
      }
  
      /**
       * Retrieve a service matching the supplied classname.
       *
       * @param classname the service classname
       * @return the service descriptor or null if it does not exist
       */
      public ServiceDescriptor getService( final String classname )
      {
          for( int i = 0; i < m_services.length; i++ )
          {
              final ServiceDesignator service =
                  m_services[ i ].getServiceDesignator();
              if( service.getClassname().equals( classname ) )
              {
                  return m_services[ i ];
              }
          }
          return null;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ContextDescriptor.java
  
  Index: ContextDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.util.Properties;
  
  /**
   * A descriptor describing the Context that the Component
   * is passed to describe information about Runtime environment
   * of Component. It contains information such as;
   * <ul>
   *   <li>classname: the classname of the Context type if it
   *       differs from base Context class (ie BlockContext).</li>
   *   <li>entrys: a list of entrys contained in context</li>
   * </ul>
   *
   * <p>Also associated with each Context is a set of arbitrary
   * attributes that can be used to store extra information
   * about Context requirements.</p>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public class ContextDescriptor
      extends FeatureDescriptor
  {
      private final String m_type;
      private final EntryDescriptor[] m_entrys;
  
      /**
       * Create a descriptor sans attributes.
       */
      public ContextDescriptor( final String type,
                                final EntryDescriptor[] entrys )
      {
          this( type, entrys, null );
      }
  
      /**
       * Create a descriptor.
       * @exception java.lang.NullPointerException if type or entrys argument is null
       * @exception java.lang.IllegalArgumentException if the classname format is invalid
       */
      public ContextDescriptor( final String type,
                                final EntryDescriptor[] entrys,
                                final Properties attributes )
      {
          super( attributes );
  
          if( null == type )
          {
              throw new NullPointerException( "type" );
          }
  
          if( null == entrys )
          {
              throw new NullPointerException( "entrys" );
          }
  
          if( type.indexOf("/") > -1 )
          {
              throw new IllegalArgumentException( "classname: " + type );
          }
  
          m_type = type;
          m_entrys = entrys;
      }
  
      /**
       * Return the type of Context class.
       *
       * @return the type of Context class.
       */
      public String getType()
      {
          return m_type;
      }
  
      /**
       * Return the entrys contained in the context.
       *
       * @return the entrys contained in the context.
       */
      public EntryDescriptor[] getEntrys()
      {
          return m_entrys;
      }
  
      /**
       * Return the entry with specified key.
       *
       * @return the entry with specified key.
       */
      public EntryDescriptor getEntry( final String key )
      {
          for( int i = 0; i < m_entrys.length; i++ )
          {
              final EntryDescriptor entry = m_entrys[ i ];
              if( entry.getKey().equals( key ) )
              {
                  return entry;
              }
          }
          return null;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java
  
  Index: DependencyDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.util.Properties;
  import org.apache.avalon.framework.info.ServiceDesignator;
  
  /**
   * A descriptor that describes dependency information for
   * a particular Component. This class contains information
   * about;
   * <ul>
   *   <li>role: the name component uses to look up dependency</li>
   *   <li>service: the class/interface that the dependency must provide</li>
   * </ul>
   *
   * <p>Also associated with each dependency is a set of arbitrary
   * attributes that can be used to store extra information
   * about dependency. See {@link org.apache.avalon.framework.info.ComponentDescriptor} for example
   * of how to declare the container specific attributes.</p>
   *
   * <p>Possible uses for the attributes are to declare container
   * specific constraints of component. For example a dependency on
   * a Corba ORB may also require that the Corba ORB contain the
   * TimeServer and PersistenceStateService at initialization. Or it
   * may require that the componenet be multi-thread safe or that
   * it is persistent etc. These are all container specific
   * demands.</p>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public final class DependencyDescriptor
      extends FeatureDescriptor
  {
      /**
       * The name the component uses to lookup dependency.
       */
      private final String m_role;
  
      /**
       * The service class/interface that the dependency must provide.
       */
      private final ServiceDesignator m_service;
  
      /**
       * True if dependency is optional, false otherwise.
       */
      private final boolean m_optional;
  
      /**
       * Constructor a dependency sans Attributes.
       */
      public DependencyDescriptor( final String role,
                                   final ServiceDesignator service )
      {
          this( role, service, false, null );
      }
  
      /**
       * Constructor that has all parts sans parent.
       */
      public DependencyDescriptor( final String role,
                                   final ServiceDesignator service,
                                   final boolean optional,
                                   final Properties attributes )
      {
          super( attributes );
  
          if( null == role )
          {
              throw new NullPointerException( "role" );
          }
  
          if( null == service )
          {
              throw new NullPointerException( "service" );
          }
  
          m_role = role;
          m_service = service;
          m_optional = optional;
      }
  
      /**
       * Return the name the component uses to lookup dependency.
       *
       * @return the name the component uses to lookup dependency.
       */
      public String getRole()
      {
          return m_role;
      }
  
      /**
       * Return the service class/interface descriptor that describes the
       * dependency must fulfilled by a provider.
       *
       * @return a reference to service descriptor that describes the fulfillment
       *  obligations that must be met by a service provider.
       */
      public ServiceDesignator getService()
      {
          return m_service;
      }
  
      /**
       * Return true if dependency is optional, false otherwise.
       *
       * @return true if dependency is optional, false otherwise.
       */
      public boolean isOptional()
      {
          return m_optional;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/EntryDescriptor.java
  
  Index: EntryDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.io.Serializable;
  
  /**
   * A descriptor that describes a value that must be placed
   * in components Context. It contains information about;
   * <ul>
   *   <li>key: the key that component uses to look up entry</li>
   *   <li>type: the class/interface of the entry</li>
   *   <li>isOptional: true if entry is optional rather than required</li>
   * </ul>
   *
   * <p>See the <a href="doc-files/entries.html">Entries</a> document
   * for a list of widely recognized entry values and a recomended
   * naming scheme for other attributes.</p>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public final class EntryDescriptor
      implements Serializable
  {
      /**
       * The name the component uses to lookup entry.
       */
      private final String m_key;
  
      /**
       * The class/interface of the Entry.
       */
      private final String m_type;
  
      /**
       * True if entry is optional, false otherwise.
       */
      private final boolean m_optional;
  
      /**
       * Construct an Entry.
       */
      public EntryDescriptor( final String key,
                              final String type )
      {
          this( key, type, false );
      }
  
      /**
       * Construct an Entry.
       */
      public EntryDescriptor( final String key,
                              final String type,
                              final boolean optional )
      {
          if( null == key )
          {
              throw new NullPointerException( "key" );
          }
  
          if( null == type )
          {
              throw new NullPointerException( "type" );
          }
  
          m_key = key;
          m_type = type;
          m_optional = optional;
      }
  
      /**
       * Return the key that Component uses to lookup entry.
       *
       * @return the key that Component uses to lookup entry.
       */
      public String getKey()
      {
          return m_key;
      }
  
      /**
       * Return the key type of value that is stored in Context.
       *
       * @return the key type of value that is stored in Context.
       */
      public String getType()
      {
          return m_type;
      }
  
      /**
       * Return true if entry is optional, false otherwise.
       *
       * @return true if entry is optional, false otherwise.
       */
      public boolean isOptional()
      {
          return m_optional;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/FeatureDescriptor.java
  
  Index: FeatureDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.util.Properties;
  import java.io.Serializable;
  
  /**
   * This is the Abstract class for all feature feature descriptors.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public abstract class FeatureDescriptor
      implements Serializable
  {
      private static final String[] EMPTY_SET = new String[0];
  
      /**
       * The arbitrary set of attributes associated with Component.
       */
      private final Properties m_attributes;
  
      protected FeatureDescriptor( final Properties attributes )
      {
          m_attributes = attributes;
      }
  
      /**
       * Return the attribute for specified key.
       *
       * @return the attribute for specified key.
       */
      public String getAttribute( final String key )
      {
          if( null == m_attributes )
          {
              return null;
          }
          else
          {
              return m_attributes.getProperty( key );
          }
      }
  
      /**
       * Return the attribute for specified key.
       *
       * @return the attribute for specified key.
       */
      public String getAttribute( final String key,
                                  final String defaultValue )
      {
          if( null == m_attributes )
          {
              return defaultValue;
          }
          else
          {
              return m_attributes.getProperty( key, defaultValue );
          }
      }
  
      /**
      * Returns the set of attribute names available under this descriptor.
      *
      * @return an array of the properties names held by the descriptor.
      */
      public String[] getAttributeNames()
      {
          if( null == m_attributes )
          {
              return EMPTY_SET;
          }
          else
          {
              return (String[]) m_attributes.keySet().toArray( EMPTY_SET );
          }
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/LoggerDescriptor.java
  
  Index: LoggerDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.util.Properties;
  
  /**
   * A descriptor describing the Loggers that the Component
   * will use. The name of each Logger is relative to the
   * Logger passed to the component (namespace separator is '.').
   * "" names root logger.
   *
   * <p>Also associated with each Logger is a set of arbitrary
   * attributes that can be used to store extra information
   * about Logger requirements.</p>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public class LoggerDescriptor
      extends FeatureDescriptor
  {
      private final String m_name;
  
      /**
       * Create a descriptor for Logger.
       *
       * @exception java.lang.NullPointerException if name argument is null
       */
      public LoggerDescriptor( final String name,
                               final Properties attributes )
      {
          super( attributes );
          if( null == name )
          {
              throw new NullPointerException( "name" );
          }
  
          m_name = name;
      }
  
      /**
       * Return the name of logger.
       *
       * @return the name of Logger.
       */
      public String getName()
      {
          return m_name;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ServiceDescriptor.java
  
  Index: ServiceDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.util.Properties;
  import org.apache.avalon.framework.info.ServiceDesignator;
  
  /**
   * This descriptor defines the type of service offerend or required
   * by a component. The type corresponds to the class name of the
   * class/interface implemented by component. Associated with each
   * classname is a version object so that different versions of same
   * interface can be represented.
   *
   * <p>Also associated with each service is a set of arbitrary
   * attributes that can be used to store extra information
   * about service. See {@link org.apache.avalon.framework.info.ComponentDescriptor} for example
   * of how to declare the container specific attributes.</p>
   *
   * <p>Possible uses for the attributes are to declare a service
   * as "stateless", "pass-by-value", "remotable" or even to attach
   * attributes such as security or transaction constraints. These
   * attributes are container specific and should not be relied
   * upon to work in all containers.</p>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public final class ServiceDescriptor
      extends FeatureDescriptor
  {
      /**
       * The service reference that descriptor is describing.
       */
      private final ServiceDesignator m_designator;
  
      /**
       * Construct a service descriptor for specified ServiceDesignator.
       *
       * @param designator the ServiceDesignator
       */
      public ServiceDescriptor( final ServiceDesignator designator )
      {
          this( designator, null );
      }
  
      /**
       * Construct a service with specified name, version and attributes.
       *
       * @param designator the ServiceDesignator
       * @param attributes the attributes of service
       */
      public ServiceDescriptor( final ServiceDesignator designator,
                                final Properties attributes )
      {
          super( attributes );
  
          if( null == designator )
          {
              throw new NullPointerException( "designator" );
          }
  
          m_designator = designator;
      }
  
      /**
       * Retrieve the service that service descriptor refers to.
       *
       * @return the service that service descriptor refers to.
       */
      public ServiceDesignator getServiceDesignator()
      {
          return m_designator;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ServiceDesignator.java
  
  Index: ServiceDesignator.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import org.apache.avalon.framework.Version;
  import java.io.Serializable;
  
  /**
   * This service reference defines the type of service required
   * by a component. The type corresponds to the class name of the
   * class/interface implemented by component. Associated with each
   * classname is a version object so that different versions of same
   * interface can be represented.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:00 $
   */
  public final class ServiceDesignator
      implements Serializable
  {
      /**
       * The name of service class.
       */
      private final String m_classname;
  
      /**
       * The version of service class.
       */
      private final Version m_version;
  
      /**
       * Construct a service with specified name, version and attributes.
       *
       * @param classname the name of the service
       * @param version the version of service
       */
      public ServiceDesignator( final String classname,
                                final Version version )
      {
          if( null == classname )
          {
              throw new NullPointerException( "classname" );
          }
  
          if( null == version )
          {
              throw new NullPointerException( "version" );
          }
  
          m_classname = classname;
          m_version = version;
      }
  
      /**
       * Return classname of Service (which coresponds to the interface
       * name eg org.apache.block.WebServer)
       *
       * @return the classname of the Service
       */
      public String getClassname()
      {
          return m_classname;
      }
  
      /**
       * Return the version of interface
       *
       * @return the version of interface
       */
      public Version getVersion()
      {
          return m_version;
      }
  
      /**
       * Determine if specified service will match this service.
       * To match a service has to have same name and must comply with version.
       *
       * @param other the other ServiceInfo
       * @return true if matches, false otherwise
       */
      public boolean matches( final ServiceDesignator other )
      {
          return
              other.getClassname().equals( getClassname() ) &&
              other.getVersion().complies( getVersion() );
      }
  
      /**
       * Convert to a string of format name/version
       *
       * @return string describing service
       */
      public String toString()
      {
          return getClassname() + "/" + getVersion();
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/package.html
  
  Index: package.html
  ===================================================================
  <html>
  <body>
  A set of classes supporting the representation of information about a
  component type.
  
  <h3>Overview</h3>
  <p>This package includes a set of classes supporting the representation of
  information about a component type.  This information is refered to as
  component meta-info.  Component meta-info deals primarily with the
  declaration of the services implemented by a component type, the service
  dependecies that a component type has on other components, and lastly,
  general information of the component including its name, implementation
  version and related attributes.<p>
  
  <h3>Package Structure (UML)</h3>
  <p><img src=doc-files/uml.gif border=0></p>
  
  <p>The info package allows many of the descriptors to contain
  extra attributes. These attributes offer mechanisms via which
  the container can determine learn extra information about a
  component. This information may or may not determine the behaviour
  of the container towards the component.</p>
  
  <p>For example a component that declared an attribute "mx:enabled=true"
  on a service it provided would indicate to the container that the service
  is part of the management interface of the component. However it is up to
  the container to recognize the significance of the attribute and if supported
  the attribute should be acted.</p>
  
  <p>To ease the development of containers and components this document will
  document a set of common attributes that are common across containers.
  However it should be noted that any container provider is allowed to create
  a set of new attributes that the particular container is capable of handling.
  It should be noted that these attributes will usually be in a container
  specific namespace.</p>
  
  <p>The name of each attribute is made up of two components, the namespace
  and the local name of the attribute. The namespace is separated from the
  local name by either a ";" character or a "." character. So the attribute
  name "mx:enabled" is equivelent to "mx.enabled" as far as the container is
  concerned.</p>
  
  <p>Any container is welcome to create their own namespace in which they can
  define any attributes they see fit. The namespace should be equal to the
  shortname of the container. For example if the
  <a href="http://jakarta.apache.org/avalon/phoenix">Phoenix</a> container wanted
  to add extra attributes it would use a namespace "phoenix" while the Fortress
  container would use the "fortress" namespace.</p>
  
  <p>Besides the namespace separator the attribute name may only be made up of
  alphanumeric values, '_' and '-'. Neither the local name or the namespace may
  being with a numeric value.</p>
  
  <p>The following is a table of standard attributes. It is not necessary that
  a container support all these attributes (or any of them) however if the
  container does support such notions it is recomended that they use the
  following attributes to enable interoperability between containers.</p>
  
  <h3>Avalon namespace</h3>
  
  <table border="1" cellpadding="2" cellspacing="0" width="100%">
  <tr bgcolor="#CCCCCCS">
  <td><b>Attribute</b></td>
  <td><b>Values</b></td>
  <td><b>Defaul</b></td>
  <td><b>Description</b></td>
  <td><b>Relevence</b></td>
  </tr>
  <tr>
  <td>avalon.version</td>
  <td>dewey decimal with three places</td>
  <td>1.0.0</td>
  <td>
    The version of a particular component or service.
  </td>
  <td>component or service</td>
  </tr>
  
  <tr>
  <td>avalon.stateless</td>
  <td>true or false</td>
  <td>false</td>
  <td>
    This attribute can be applied at either the service or the component level.
    It indicated that the particular artefact is stateless. This means that the
    order of the method calls will not have an effect on the results of call.
    If applied at the component level it indicates that all services are
    stateless.
  </td>
  <td>component or service</td>
  </tr>
  <tr>
    <td>avalon.pass-by-value</td>
    <td>true or false</td>
    <td>false</td>
    <td>
    This attribute can be applied at the service level. If true, it indicates
    that the parameters passed to methods of service are not modified by the
    service.
    </td>
    <td>service</td>
  </tr>
  <tr>
    <td>avalon.features</td>
    <td>comma separated list of features</td>
    <td>false</td>
    <td>
    This attribute can be applied at the service level. If true, it indicates
    that the parameters passed to methods of service are not modified by the
    service.
    </td>
    <td>service</td>
  </tr>
  </table>
  
  <h3>Partition namespace</h3>
  
  <h3>Component namespace</h3>
  
  </body>
  
  </html>
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/doc-files/entries.html
  
  Index: entries.html
  ===================================================================
  <html>
  <head>
    <title>Context Entries</title>
  </head>
  <body>
  
  <h3>Overview</h3>
  <p>The Context interface gives the component writer an interface via
  which to access resources that are provided by the container. Each
  component declares the resources it requires (or will use if present)
  under a specific key with a specific type.</p>
  
  <p>The list of context keys that is supported by the container is
  extensible and follows the namespacing conventions outlined in the
  <a href="namespaces.html">Namespace</a> document. However there are
  a set of standard key-value pairs. It is recomended that container
  recognize these if they support the particular feature.</p>
  
  <h3>Entry Definitions</h3>
  
  <table border="1" cellpadding="2" cellspacing="0" width="100%">
  <tr bgcolor="#CCCCCCS">
  <td><b>Key</b></td>
  <td><b>Type</b></td>
  <td><b>Description</b></td>
  </tr>
  <tr>
    <td>component:name</td>
    <td><code>java.lang.String</code></td>
    <td>This entry defines the name of the component.</td>
  </tr>
  <tr>
    <td>component:home.dir</td>
    <td><code>java.io.File</code></td>
    <td>The location to store persistent data relevent to the
    component. Often identical to the "application:home.dir"
    and "partition:home.dir" entrys.</td>
  </tr>
  <tr>
    <td>component:work.dir</td>
    <td><code>java.io.File</code></td>
    <td>This directory in which to store temporary or working
    information. It may not persist over restarts of
    the component. Often identical to the "application:work.dir"
    and "partition:work.dir" entrys.</td>
  </tr>
  <tr>
    <td>component:classloader</td>
    <td><code>java.lang.ClassLoader</code></td>
    <td>The classloader via which the component was loaded. May
    differ from the ClassLoader returned by getClass().getClassLoader()
    if the component was loaded from parent classloader.</td>
  </tr>
  
  <tr>
    <td>partition:name</td>
    <td><code>java.lang.String</code></td>
    <td>This entry defines the name of the partition.</td>
  </tr>
  <tr>
    <td>partition:home.dir</td>
    <td><code>java.io.File</code></td>
    <td>The location to store persistent data relevent to the
    partition. Often identical to the "application:home.dir"
    and "component:home.dir" entrys.</td>
  </tr>
  <tr>
    <td>partition:work.dir</td>
    <td><code>java.io.File</code></td>
    <td>This directory in which to store temporary or working
    information. It may not persist over restarts of
    the partition. Often identical to the "application:work.dir"
    and "component:work.dir" entrys.</td>
  </tr>
  <tr>
    <td>partition:classloader</td>
    <td><code>java.lang.ClassLoader</code></td>
    <td>The classloader via which the partition was loaded. May
    differ from the ClassLoader returned by getClass().getClassLoader()
    from any component. Components may have been loaded parent
    classloader. Often this classloader value is also set as
    Thread.getContextClassLoader()</td>
  </tr>
  
  <tr>
    <td>application:name</td>
    <td><code>java.lang.String</code></td>
    <td>This entry defines the name of the application.</td>
  </tr>
  <tr>
    <td>application:home.dir</td>
    <td><code>java.io.File</code></td>
    <td>The location to store persistent data relevent to the
    application. Often identical to the "partition:home.dir"
    and "component:home.dir" entrys.</td>
  </tr>
  <tr>
    <td>application:work.dir</td>
    <td><code>java.io.File</code></td>
    <td>This directory in which to store temporary or working
    information. It may not persist over restarts of
    the application. Often identical to the "partition:work.dir"
    and "component:work.dir" entrys.</td>
  </tr>
  
  </table>
  
  </body>
  
  </html>
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/doc-files/uml.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/ant/SerializeInfoTask.java
  
  Index: SerializeInfoTask.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.ant;
  
  import org.apache.avalon.framework.info.ComponentInfo;
  import org.apache.avalon.framework.tools.infobuilder.XMLInfoCreator;
  import org.apache.tools.ant.Task;
  import org.apache.tools.ant.BuildException;
  import org.apache.tools.ant.types.FileSet;
  import org.apache.tools.ant.DirectoryScanner;
  import org.apache.avalon.framework.logger.ConsoleLogger;
  import java.util.ArrayList;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.io.ObjectOutputStream;
  import java.io.FileOutputStream;
  import java.io.OutputStream;
  
  /**
   * Simple task to load an XML descriptor into {@link org.apache.avalon.framework.info.ComponentInfo}
   * object and then serialize object to file.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public class SerializeInfoTask
      extends Task
  {
      private final ArrayList m_fileSets = new ArrayList();
      private File m_destDir;
  
      public void setDestDir( final File destDir )
      {
          m_destDir = destDir;
      }
  
      public void addFileset( final FileSet fileSet )
      {
          m_fileSets.add( fileSet );
      }
  
      public void execute()
        throws BuildException
      {
          if( null == m_destDir )
          {
              m_destDir = getProject().resolveFile( "." );
          }
  
          final XMLInfoCreator infoCreator = new XMLInfoCreator();
          infoCreator.enableLogging( new ConsoleLogger() );
  
          final int count = m_fileSets.size();
          for( int i = 0; i < count; i++ )
          {
              final FileSet fileSet = (FileSet)m_fileSets.get( i );
              final DirectoryScanner scanner = fileSet.getDirectoryScanner( getProject() );
              final File baseDir = fileSet.getDir( getProject() );
  
              final String[] srcFiles = scanner.getIncludedFiles();
              for( int j = 0; j < srcFiles.length; j++ )
              {
                  final String srcFilename = srcFiles[ j ];
                  final String baseName =
                      srcFilename.substring( 0, srcFilename.length() - 5 );
                  final String classname = baseName.replace( File.separatorChar, '.' );
                  final String destFilename = baseName + "-info.ser";
                  final File src = new File( baseDir, srcFilename );
                  final File dest = new File( m_destDir, destFilename );
                  FileInputStream inputStream = null;
                  OutputStream outputStream = null;
                  try
                  {
                      inputStream = new FileInputStream( src );
                      final ComponentInfo info =
                          infoCreator.createComponentInfo( classname, inputStream );
                      inputStream.close();
                      outputStream = new FileOutputStream( dest );
                      final ObjectOutputStream oos = new ObjectOutputStream( outputStream );
                      oos.writeObject( info );
                      oos.close();
  
                  }
                  catch( Exception e )
                  {
                      throw new BuildException( e.getMessage(), e );
                  }
                  finally
                  {
                      if( null != inputStream )
                      {
                          try
                          {
                              inputStream.close();
                          }
                          catch( IOException e )
                          {
                          }
                      }
                      if( null != outputStream )
                      {
                          try
                          {
                              outputStream.close();
                          }
                          catch( IOException e )
                          {
                          }
                      }
                  }
              }
          }
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/ComponentInfoBuilder.java
  
  Index: ComponentInfoBuilder.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.infobuilder;
  
  import java.io.InputStream;
  import org.apache.avalon.excalibur.i18n.ResourceManager;
  import org.apache.avalon.excalibur.i18n.Resources;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.info.ComponentInfo;
  
  /**
   * A ComponentInfoBuilder is responsible for building {@link org.apache.avalon.framework.info.ComponentInfo}
   * objects from Configuration objects. The format for Configuration object
   * is specified in the <a href="package-summary.html#external">package summary</a>.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public final class ComponentInfoBuilder
      extends AbstractLogEnabled
  {
      private static final Resources REZ =
          ResourceManager.getPackageResources( ComponentInfoBuilder.class );
  
      private final InfoCreator m_xmlInfoCreator = createXMLInfoCreator();
      private final InfoCreator m_serialInfoCreator = new SerializedInfoCreator();
  
      /**
       * Setup logging for all subcomponents
       */
      public void enableLogging( final Logger logger )
      {
          super.enableLogging( logger );
          setupLogger( m_serialInfoCreator );
          if( null != m_xmlInfoCreator )
          {
              setupLogger( m_xmlInfoCreator );
          }
      }
  
      /**
       * Create a {@link ComponentInfo} object for specified Class.
       *
       * @param clazz The class of Component
       * @return the created ComponentInfo
       * @throws ConfigurationException if an error occurs
       */
      public ComponentInfo build( final Class clazz )
          throws Exception
      {
          return build( clazz.getName(), clazz.getClassLoader() );
      }
  
      /**
       * Create a {@link ComponentInfo} object for specified
       * classname, in specified ClassLoader.
       *
       * @param classname The classname of Component
       * @param classLoader the ClassLoader to load info from
       * @return the created ComponentInfo
       * @throws ConfigurationException if an error occurs
       */
      public ComponentInfo build( final String classname,
                                  final ClassLoader classLoader )
          throws Exception
      {
          final ComponentInfo info = buildFromSerDescriptor( classname, classLoader );
          if( null != info )
          {
              return info;
          }
          else
          {
              return buildFromXMLDescriptor( classname, classLoader );
          }
      }
  
      /**
       * Build ComponentInfo from the XML descriptor format.
       *
       * @param classname The classname of Component
       * @param classLoader the ClassLoader to load info from
       * @return the created ComponentInfo
       * @throws Exception if an error occurs
       */
      private ComponentInfo buildFromSerDescriptor( final String classname,
                                                    final ClassLoader classLoader )
          throws Exception
      {
          final String xinfo =
              classname.replace( '.', '/' ) + "-info.ser";
          final InputStream inputStream =
              classLoader.getResourceAsStream( xinfo );
          if( null == inputStream )
          {
              return null;
          }
  
          return m_serialInfoCreator.createComponentInfo( classname, inputStream );
      }
  
      /**
       * Build ComponentInfo from the XML descriptor format.
       *
       * @param classname The classname of Component
       * @param classLoader the ClassLoader to load info from
       * @return the created ComponentInfo
       * @throws Exception if an error occurs
       */
      private ComponentInfo buildFromXMLDescriptor( final String classname,
                                                    final ClassLoader classLoader )
          throws Exception
      {
          final String xinfo =
              classname.replace( '.', '/' ) + "-info.xml";
          final InputStream inputStream =
              classLoader.getResourceAsStream( xinfo );
          if( null == inputStream )
          {
              final String message =
                  REZ.getString( "builder.missing-info.error",
                                 classname );
              throw new Exception( message );
          }
  
          final InfoCreator xmlInfoCreator = getXMLInfoCreator( classname );
          return xmlInfoCreator.createComponentInfo( classname, inputStream );
      }
  
      /**
       * Utility to get xml info builder, else throw
       * an exception if missing descriptor.
       *
       * @return the InfoCreator
       */
      private InfoCreator getXMLInfoCreator( final String classname )
          throws Exception
      {
          if( null != m_xmlInfoCreator )
          {
              return m_xmlInfoCreator;
          }
          else
          {
              final String message =
                  REZ.getString( "builder.missing-xml-creator.error",
                                 classname );
              throw new Exception( message );
          }
      }
  
      /**
       * Utility to get XMLInfoCreator if XML files are on
       * ClassPath.
       *
       * @return the XML {@link InfoCreator}
       */
      private static InfoCreator createXMLInfoCreator()
      {
          InfoCreator xmlInfoCreator = null;
          try
          {
              xmlInfoCreator = new XMLInfoCreator();
          }
          catch( final Exception e )
          {
              //Ignore it if ClassNot found due to no
              //XML Classes on classpath
          }
          return xmlInfoCreator;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/ConfigurationBuilder.java
  
  Index: ConfigurationBuilder.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.infobuilder;
  
  import java.io.IOException;
  import javax.xml.parsers.ParserConfigurationException;
  import javax.xml.parsers.SAXParser;
  import javax.xml.parsers.SAXParserFactory;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  import org.xml.sax.XMLReader;
  
  /**
   * Utility class used to load Configuration trees from XML files.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  class ConfigurationBuilder
  {
      private static final DTDInfo[] c_dtdInfo = new DTDInfo[]
      {
          new DTDInfo( "-//AVALON/Component Info DTD Version 1.0//EN",
                       "http://jakarta.apache.org/avalon/componentinfo_1_0.dtd",
                       "org/apache/excalibur/containerkit/tools/infobuilder/componentinfo.dtd" ),
      };
  
      private static final DTDResolver c_resolver =
          new DTDResolver( c_dtdInfo, ConfigurationBuilder.class.getClassLoader() );
  
      /**
       * Private constructor to block instantiation.
       */
      private ConfigurationBuilder()
      {
      }
  
      /**
       * Utility method to create a new XML reader.
       */
      private static XMLReader createXMLReader()
          throws SAXException, ParserConfigurationException
      {
          final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
          saxParserFactory.setNamespaceAware( false );
          final SAXParser saxParser = saxParserFactory.newSAXParser();
          return saxParser.getXMLReader();
      }
  
      /**
       * Internally sets up the XMLReader
       */
      private static void setupXMLReader( final XMLReader reader,
                                          final SAXConfigurationHandler handler )
      {
          reader.setEntityResolver( c_resolver );
          reader.setContentHandler( handler );
          reader.setErrorHandler( handler );
      }
  
      /**
       * Build a configuration object using an URI
       * @param uri an input source system identifier
       * @exception SAXException is a parser exception is encountered
       * @exception ParserConfigurationException if a parser configuration failure occurs
       * @exception IOException if an IO exception occurs while attempting to read the
       *    resource identified by the system identifier
       */
      public static Configuration build( final String uri )
          throws SAXException, ParserConfigurationException, IOException
      {
          return build( new InputSource( uri ) );
      }
  
      /**
       * Build a configuration object using an XML InputSource object
       * @param input an input source
       * @exception SAXException is a parser exception is encountered
       * @exception ParserConfigurationException if a parser configuration failure occurs
       * @exception IOException if an IO exception occurs while attempting to read the
       *    resource associated with the input source
       */
      public static Configuration build( final InputSource input )
          throws SAXException, ParserConfigurationException, IOException
      {
          final XMLReader reader = createXMLReader();
          final SAXConfigurationHandler handler = new SAXConfigurationHandler();
          setupXMLReader( reader, handler );
          reader.parse( input );
          return handler.getConfiguration();
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/DTDInfo.java
  
  Index: DTDInfo.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.infobuilder;
  
  /**
   * Holds information about a given DTD.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  class DTDInfo
  {
      /**
       * The public identifier. Null if unknown.
       */
      private final String m_publicId;
  
      /**
       * The system identifier.  Null if unknown.
       */
      private final String m_systemId;
  
      /**
       * The resource name, if a copy of the document is available.
       */
      private final String m_resource;
  
      public DTDInfo( final String publicId,
                      final String systemId,
                      final String resource )
      {
          m_publicId = publicId;
          m_systemId = systemId;
          m_resource = resource;
      }
  
      public String getPublicId()
      {
          return m_publicId;
      }
  
      public String getSystemId()
      {
          return m_systemId;
      }
  
      public String getResource()
      {
          return m_resource;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/DTDResolver.java
  
  Index: DTDResolver.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.infobuilder;
  
  import java.io.IOException;
  import java.io.InputStream;
  import org.xml.sax.EntityResolver;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  import org.apache.avalon.framework.tools.infobuilder.DTDInfo;
  
  /**
   * A Class to help to resolve Entitys for items such as DTDs or
   * Schemas.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  class DTDResolver
      implements EntityResolver
  {
      /**
       * The list of DTDs that can be resolved by this class.
       */
      private final DTDInfo[] m_dtdInfos;
  
      /**
       * The ClassLoader to use when loading resources for DTDs.
       */
      private final ClassLoader m_classLoader;
  
      /**
       * Construct a resolver using specified DTDInfos where resources are loaded
       * from specified ClassLoader.
       */
      public DTDResolver( final DTDInfo[] dtdInfos, final ClassLoader classLoader )
      {
          m_dtdInfos = dtdInfos;
          m_classLoader = classLoader;
      }
  
      /**
       * Resolve an entity in the XML file.
       * Called by parser to resolve DTDs.
       */
      public InputSource resolveEntity( final String publicId, final String systemId )
          throws IOException, SAXException
      {
          for( int i = 0; i < m_dtdInfos.length; i++ )
          {
              final DTDInfo info = m_dtdInfos[ i ];
  
              if( ( publicId != null && publicId.equals( info.getPublicId() ) ) ||
                  ( systemId != null && systemId.equals( info.getSystemId() ) ) )
              {
                  final ClassLoader classLoader = getClassLoader();
                  final InputStream inputStream =
                      classLoader.getResourceAsStream( info.getResource() );
                  return new InputSource( inputStream );
              }
          }
  
          return null;
      }
  
      /**
       * Return CLassLoader to load resource from.
       * If a ClassLoader is specified in the constructor use that,
       * else use ContextClassLoader unless that is null in which case
       * use the current classes ClassLoader.
       */
      private ClassLoader getClassLoader()
      {
          ClassLoader classLoader = m_classLoader;
          if( null == classLoader )
          {
              classLoader = Thread.currentThread().getContextClassLoader();
          }
          if( null == classLoader )
          {
              classLoader = getClass().getClassLoader();
          }
          return classLoader;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/InfoCreator.java
  
  Index: InfoCreator.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.infobuilder;
  
  import org.apache.avalon.framework.info.ComponentInfo;
  import java.io.InputStream;
  
  /**
   * Simple interface used to create {@link org.apache.avalon.framework.info.ComponentInfo}
   * from stream. This abstraction was primarily created so
   * that the ComponentInfo could be built from non-XML
   * sources and no XML classes need be in the classpath.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public interface InfoCreator
  {
      /**
       * Create a {@link org.apache.avalon.framework.info.ComponentInfo} from stream
       *
       * @param implementationKey the name of component type that we are looking up
       * @param inputStream the stream that the resource is loaded from
       * @return the newly created {@link org.apache.avalon.framework.info.ComponentInfo}
       * @throws Exception
       */
      ComponentInfo createComponentInfo( String implementationKey,
                                         InputStream inputStream )
          throws Exception;
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  builder.redundent-role.notice=Warning: ComponentInfo for class {0} redundently specifies role name "{1}" in dependency when it is identical to the name of service. It is recomended that the <role/> section be elided.
  builder.creating-info.notice=Creating a ComponentInfo for class "{0}".
  builder.created-info.notice=Constructed ComponentInfo object for class {0}. ComponentInfo contains {1} services, {2} dependencies, {3} context entrys and {4} loggers.
  builder.bad-toplevel-element.error=Error the component implemented by "{0}" has an invalid element at top level of component info descriptor. Expected: "component-info". Actual: "{1}"
  builder.missing-info.error=Unable to locate resource from which to load info for component implemented by class "{0}".
  builder.missing-xml-creator.error=Unable to create XMLInfoCreator, usually due to not having XML classes on Classpath. Thus unable to lookup XML descriptor for component type "{0}".
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/SerializedInfoCreator.java
  
  Index: SerializedInfoCreator.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.infobuilder;
  
  import org.apache.avalon.framework.info.ComponentInfo;
  import java.io.InputStream;
  import java.io.ObjectInputStream;
  
  /**
   * Create {@link org.apache.avalon.framework.info.ComponentInfo} from stream made up of
   * serialized object.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public class SerializedInfoCreator
      implements InfoCreator
  {
      public ComponentInfo createComponentInfo( final String implementationKey,
                                                final InputStream inputStream )
          throws Exception
      {
          final ObjectInputStream ois = new ObjectInputStream( inputStream );
          return (ComponentInfo)ois.readObject();
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoCreator.java
  
  Index: XMLInfoCreator.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.infobuilder;
  
  import java.io.InputStream;
  import java.util.ArrayList;
  import java.util.Properties;
  import org.apache.avalon.excalibur.i18n.ResourceManager;
  import org.apache.avalon.excalibur.i18n.Resources;
  import org.apache.avalon.framework.Version;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.info.ComponentDescriptor;
  import org.apache.avalon.framework.info.ComponentInfo;
  import org.apache.avalon.framework.info.ContextDescriptor;
  import org.apache.avalon.framework.info.DependencyDescriptor;
  import org.apache.avalon.framework.info.EntryDescriptor;
  import org.apache.avalon.framework.info.LoggerDescriptor;
  import org.apache.avalon.framework.info.ServiceDescriptor;
  import org.apache.avalon.framework.info.ServiceDesignator;
  import org.xml.sax.InputSource;
  
  /**
   * A ComponentInfoBuilder is responsible for building {@link ComponentInfo}
   * objects from Configuration objects. The format for Configuration object
   * is specified in the <a href="package-summary.html#external">package summary</a>.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public final class XMLInfoCreator
      extends AbstractLogEnabled
      implements InfoCreator
  {
      private static final Resources REZ =
          ResourceManager.getPackageResources( XMLInfoCreator.class );
  
      /**
       * Create a {@link ComponentInfo} object for specified
       * classname, loaded from specified {@link InputStream}.
       *
       * @param implementationKey The classname of Component
       * @param inputStream the InputStream to load ComponentInfo from
       * @return the created ComponentInfo
       * @throws ConfigurationException if an error occurs
       */
      public ComponentInfo createComponentInfo( final String implementationKey,
                                                final InputStream inputStream )
          throws Exception
      {
          final InputSource input = new InputSource( inputStream );
          final Configuration configuration = ConfigurationBuilder.build( input );
          return build( implementationKey, configuration );
      }
  
      /**
       * Create a {@link ComponentInfo} object for specified classname from
       * specified configuration data.
       *
       * @param classname The classname of Component
       * @param info the ComponentInfo configuration
       * @return the created ComponentInfo
       * @throws ConfigurationException if an error occurs
       */
      private ComponentInfo build( final String classname,
                                   final Configuration info )
          throws Exception
      {
          if( getLogger().isDebugEnabled() )
          {
              final String message =
                  REZ.getString( "builder.creating-info.notice",
                                 classname );
              getLogger().debug( message );
          }
  
          final String topLevelName = info.getName();
          if( !topLevelName.equals( "component-info" ) )
          {
              final String message =
                  REZ.getString( "builder.bad-toplevel-element.error",
                                 classname,
                                 topLevelName );
              throw new ConfigurationException( message );
          }
  
          Configuration configuration = null;
  
          configuration = info.getChild( "loggers" );
          final LoggerDescriptor[] loggers = buildLoggers( configuration );
  
          configuration = info.getChild( "context" );
          final ContextDescriptor context = buildContext( configuration );
  
          configuration = info.getChild( "services" );
          final ServiceDescriptor[] services = buildServices( configuration );
  
          configuration = info.getChild( "dependencies" );
          final DependencyDescriptor[] dependencies = buildDependencies( classname, configuration );
  
          configuration = info.getChild( "component" );
          final ComponentDescriptor descriptor =
              buildComponentDescriptor( classname, configuration );
  
          if( getLogger().isDebugEnabled() )
          {
              final String message =
                  REZ.getString( "builder.created-info.notice",
                                 classname,
                                 new Integer( services.length ),
                                 new Integer( dependencies.length ),
                                 new Integer( context.getEntrys().length ),
                                 new Integer( loggers.length ) );
              getLogger().debug( message );
          }
  
          return new ComponentInfo( descriptor, loggers, context, services, dependencies );
      }
  
      /**
       * A utility method to build an array of {@link LoggerDescriptor} objects
       * from specified configuraiton.
       *
       * @param configuration the loggers configuration
       * @return the created LoggerDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private LoggerDescriptor[] buildLoggers( final Configuration configuration )
          throws ConfigurationException
      {
          final Configuration[] elements = configuration.getChildren( "logger" );
          final ArrayList loggers = new ArrayList();
  
          for( int i = 0; i < elements.length; i++ )
          {
              final LoggerDescriptor logger = buildLogger( elements[ i ] );
              loggers.add( logger );
          }
  
          return (LoggerDescriptor[])loggers.toArray( new LoggerDescriptor[ loggers.size() ] );
      }
  
      /**
       * A utility method to build a {@link LoggerDescriptor}
       * object from specified configuraiton.
       *
       * @param logger the Logger configuration
       * @return the created LoggerDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private LoggerDescriptor buildLogger( Configuration logger )
          throws ConfigurationException
      {
          final Properties attributes = buildAttributes( logger.getChild( "attributes" ) );
          final String name = logger.getAttribute( "name", "" );
          return new LoggerDescriptor( name, attributes );
      }
  
      /**
       * A utility method to build an array of {@link DependencyDescriptor}
       * objects from specified configuration and classname.
       *
       * @param classname The classname of Component (used for logging purposes)
       * @param configuration the dependencies configuration
       * @return the created DependencyDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private DependencyDescriptor[] buildDependencies( final String classname,
                                                        final Configuration configuration )
          throws ConfigurationException
      {
          final Configuration[] elements = configuration.getChildren( "dependency" );
          final ArrayList dependencies = new ArrayList();
  
          for( int i = 0; i < elements.length; i++ )
          {
              final DependencyDescriptor dependency =
                  buildDependency( classname, elements[ i ] );
              dependencies.add( dependency );
          }
  
          return (DependencyDescriptor[])dependencies.toArray( new DependencyDescriptor[ 0 ] );
      }
  
      /**
       * A utility method to build a {@link DependencyDescriptor}
       * object from specified configuraiton.
       *
       * @param classname The classname of Component (used for logging purposes)
       * @param dependency the dependency configuration
       * @return the created DependencyDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private DependencyDescriptor buildDependency( final String classname,
                                                    final Configuration dependency )
          throws ConfigurationException
      {
          final ServiceDesignator service =
              buildServiceDesignator( dependency.getChild( "service-ref" ) );
          final boolean optional =
              dependency.getAttributeAsBoolean( "optional", false );
  
          final Properties attributes =
              buildAttributes( dependency.getChild( "attributes" ) );
  
          String role = dependency.getChild( "role" ).getValue( null );
  
          //default to name of service if role unspecified
          if( null == role )
          {
              role = service.getClassname();
          }
          else
          {
              //If role is specified and it is the same as
              //service name then warn that it is redundent.
              if( role.equals( service.getClassname() ) )
              {
                  final String message =
                      REZ.getString( "builder.redundent-role.notice",
                                     classname,
                                     role );
                  getLogger().warn( message );
              }
          }
  
          return new DependencyDescriptor( role, service, optional, attributes );
      }
  
      /**
       * A utility method to build a {@link ContextDescriptor}
       * object from specified configuraiton.
       *
       * @param context the dependency configuration
       * @return the created ContextDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ContextDescriptor buildContext( final Configuration context )
          throws ConfigurationException
      {
          final EntryDescriptor[] entrys =
              buildEntrys( context.getChildren( "entry" ) );
  
          final Properties attributes =
              buildAttributes( context.getChild( "attributes" ) );
  
          final String type =
              context.getAttribute( "type",
                                    Context.class.getName() );
  
          return new ContextDescriptor( type, entrys, attributes );
      }
  
      /**
       * A utility method to build an array of {@link EntryDescriptor}
       * objects from specified configuraiton.
       *
       * @param entrySet the set of entrys to build
       * @return the created {@link EntryDescriptor}s
       * @throws ConfigurationException if an error occurs
       */
      private EntryDescriptor[] buildEntrys( final Configuration[] entrySet )
          throws ConfigurationException
      {
          final ArrayList entrys = new ArrayList();
  
          for( int i = 0; i < entrySet.length; i++ )
          {
              final EntryDescriptor service = buildEntry( entrySet[ i ] );
              entrys.add( service );
          }
  
          return (EntryDescriptor[])entrys.toArray( new EntryDescriptor[ entrys.size() ] );
      }
  
      /**
       * Create a {@link EntryDescriptor} from configuration.
       *
       * @param config the configuration
       * @return the created {@link EntryDescriptor}
       * @throws ConfigurationException if an error occurs
       */
      private EntryDescriptor buildEntry( final Configuration config )
          throws ConfigurationException
      {
          final String key = config.getAttribute( "key" );
          final String type = config.getAttribute( "type" );
          final boolean optional =
              config.getAttributeAsBoolean( "optional", false );
  
          return new EntryDescriptor( key, type, optional );
      }
  
      /**
       * A utility method to build an array of {@link ServiceDescriptor}
       * objects from specified configuraiton.
       *
       * @param servicesSet the services configuration
       * @return the created ServiceDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ServiceDescriptor[] buildServices( final Configuration servicesSet )
          throws ConfigurationException
      {
          final Configuration[] elements = servicesSet.getChildren( "service" );
          final ArrayList services = new ArrayList();
  
          for( int i = 0; i < elements.length; i++ )
          {
              final ServiceDescriptor service = buildService( elements[ i ] );
              services.add( service );
          }
  
          return (ServiceDescriptor[])services.toArray( new ServiceDescriptor[ 0 ] );
      }
  
      /**
       * A utility method to build a {@link ServiceDesignator}
       * object from specified configuraiton data.
       *
       * @param service the service Configuration
       * @return the created ServiceDesignator
       * @throws ConfigurationException if an error occurs
       */
      private ServiceDesignator buildServiceDesignator( final Configuration service )
          throws ConfigurationException
      {
          final String name = service.getAttribute( "type" );
          final String versionString = service.getAttribute( "version", "1.0" );
          final Version version = buildVersion( versionString );
          return new ServiceDesignator( name, version );
      }
  
      /**
       * A utility method to build a {@link ServiceDescriptor}
       * object from specified configuraiton data.
       *
       * @param service the service Configuration
       * @return the created ServiceDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ServiceDescriptor buildService( final Configuration service )
          throws ConfigurationException
      {
          final Configuration serviceRef = service.getChild( "service-ref" );
          final ServiceDesignator designator = buildServiceDesignator( serviceRef );
          final Properties attributes =
              buildAttributes( service.getChild( "attributes" ) );
          return new ServiceDescriptor( designator, attributes );
      }
  
      /**
       * Build up a list of attributes from specific config tree.
       *
       * @param config the attributes config
       * @return the Properties object representing attributes
       */
      private Properties buildAttributes( final Configuration config )
          throws ConfigurationException
      {
          final Properties attributes = new Properties();
          final Configuration[] children = config.getChildren( "attribute" );
          for( int i = 0; i < children.length; i++ )
          {
              Configuration child = children[ i ];
              final String key = child.getAttribute( "key" );
              String value = child.getAttribute( "value", null );
              if( null == value )
              {
                  value = child.getValue();
              }
              attributes.setProperty( key, value );
          }
          return attributes;
      }
  
      /**
       * A utility method to build a {@link ComponentDescriptor}
       * object from specified configuraiton data and classname.
       *
       * @param classname The classname of Component (used to create descriptor)
       * @param component the Component Configuration
       * @return the created ComponentDescriptor
       * @throws ConfigurationException if an error occurs
       */
      private ComponentDescriptor buildComponentDescriptor( final String classname,
                                                            final Configuration component )
          throws ConfigurationException
      {
          final String name = component.getChild( "name" ).getValue( null );
          final Version version = buildVersion( component.getChild( "version" ).getValue( "1.0" ) );
          final Properties attributes =
              buildAttributes( component.getChild( "attributes" ) );
  
          return new ComponentDescriptor( name, classname, version, attributes );
      }
  
      /**
       * A utility method to parse a Version object from specified string.
       *
       * @param version the version string
       * @return the created Version object
       */
      private Version buildVersion( final String version )
      {
          return Version.getVersion( version );
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/componentinfo.dtd
  
  Index: componentinfo.dtd
  ===================================================================
  <!--
  
     This is the DTD defining the Avalon ComponentInfo 1.0
     descriptor (XML) file format/syntax.
  
     Author: Peter Donald <peter at apache.org>
  
     A BlockInfo is an XML file used to describe Components and located side-by-side with
     the Component .class file. It describes the services the Component requires to operate,
     the services the Component is capable of offerring other Component, the context entrys
     that Component requires and other support meta data.
  
     Copyright (C) The Apache Software Foundation. All rights reserved.
  
     This software is published under the terms of the Apache Software License
     version 1.1, a copy of which has been included  with this distribution in
     the LICENSE.txt file.
  
    -->
  
  <!--
  The component-info is the document root, it defines:
  
  component    the specifc details about this component
  loggers      the loggers used by this component
  context      the context required by this component
  services     the services offered by this component
  dependencies the services that this component require to operate
  -->
  <!ELEMENT component-info (component, loggers?, context?, services?, dependencies?)>
  <!--
    !ATTLIST component-info id ID #IMPLIED
            xmlns CDATA #FIXED "http://jakarta.apache.org/avalon/componentinfo_1_0.dtd"
   -->
  
  <!--
  The component element describes the component, it defines:
  
  name	        the human readable name of component type. Must be a string
               containing alphanumeric characters, '.', '_' and starting
               with a letter.
  version	     the version of the component in (in the format #.#.#, #.# or # where
               # is a integer
  -->
  <!ELEMENT component      (name?,version,attributes?)>
    <!ELEMENT name         (#PCDATA) >
    <!ELEMENT version      (#PCDATA) >
  
  <!--
  The logger element defines the loggers that are available to component.
  The element has one attribute specifying name of Logger. It contains:
  
  attributes	  Optional attributes about logger
  -->
  <!ELEMENT logger   (attributes?) >
    <!ATTLIST logger name CDATA #IMPLIED >
  
  <!--
  The context element defines what values and type of context
  is available to component.
  It contains:
  
  entrys    	  Key value pairs that component uses
  attributes	  Optional attributes about service
  -->
  <!ELEMENT context   (entry*,attributes?) >
    <!ATTLIST context type CDATA #IMPLIED >
  
  <!--
  The service element defines a service that the component
  can provide to other component.
  It contains:
  
  service-ref  the reference to service.
  attributes	  Optional attributes about service
  -->
  <!ELEMENT service   (service-ref,attributes?) >
  
  <!--
  The service element defines a reference to a service that the component
  can provide to other component, or this component depends upon.
  It defines:
  
  type         the name of the service. This must be equal to the class name of the
               interface that defines the service.
  version	     the version of the block in (in the format #.#.#, #.# or # where
               # is a integer
  -->
  <!ELEMENT service-ref   EMPTY >
    <!ATTLIST service-ref
         type CDATA #REQUIRED
         version CDATA #IMPLIED >
  
  <!--
  The service dependency describes a service that the component
  requires. It defines:
  
  role         the role of the service. This is the value that is used to lookup the
               service in the ComponentManager. If not provided it defaults to the
               value specified in the name attribute of service element
  service-ref  the service that is required
  -->
  <!ELEMENT dependency  (role?,service-ref,attributes?) >
    <!ATTLIST dependency optional CDATA #IMPLIED >
    <!ELEMENT role        (#PCDATA) >
  
  <!--
  The loggers element contains a list of loggers that component uses.
  -->
  <!ELEMENT loggers    (logger*)>
  
  <!--
  The services element contains a list of services that this component supports.
  It contains service elements.
  -->
  <!ELEMENT services    (service*)>
  
  <!--
  The dependencies element contains a list of services that this component requires.
  It contains dependency elements.
  -->
  <!ELEMENT dependencies    (dependency*)>
  
  <!--
  The attributes element contains a list of attributes for feature.
  -->
  <!ELEMENT attributes    (attribute*)>
  
  <!--
  The attribute element defines an attribute (an opaque key-value pair for a feature).
  It defines:
  
  key          the key for attribute.
  value  	     the value of attribute.
  -->
  <!ELEMENT attribute   (#PCDATA) >
    <!ATTLIST attribute
         key CDATA #REQUIRED
         value CDATA #IMPLIED
    >
  
  <!--
  The entry element defines entry in context.
  It defines:
  
  key          the key for entry.
  value  	     the value of entry.
  optional     is entry optional
  -->
  <!ELEMENT entry   EMPTY >
    <!ATTLIST entry
         key CDATA #REQUIRED
         type CDATA #REQUIRED
         optional CDATA #IMPLIED
    >
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/package.html
  
  Index: package.html
  ===================================================================
  <html><body>
  <p>Component information builder that handels internalization of an component type description supplied as a configuration instance.</P>
  
  <h3>Package Structure (UML)</h3>
  <p><img src=doc-files/ComponentInfoBuilder.gif border=0></p>
  
  <a name="external"><h3>External Form (XML)</h3></a>
  <p>Configuration instances supplied to the builder shall correspond to the <a href="http://home.osm.net/componentinfo.dtd">component-info DTD</a>.  
  The structure of a component-info XML document is is described below:</p>
  
  <pre>
  
  <font color="gray"><i>&lt;!--
  Example of a component meta info external XML form. 
  The element contains the information required to construct an instance of
  org.apache.excalibur.containerkit.metainfo.ComponentInfo.  It includes 
  information about the component type, the service it provides, and the 
  services it is dependent on.
  --&gt;</i></font>
  
  &lt;component-info&gt;
  
  
    <font color="gray"><i>&lt;!--
    Defintion of a single component descriptor.
    --&gt;</i></font>
  
    &lt;component&gt;
  
      <font color="gray"><i>&lt;!-- the name of the component (character restriction appply) --&gt;</i></font>
  
      &lt;name&gt;<font color="darkred">my-component</font>&lt;/name&gt;
  
      <font color="gray"><i>&lt;!-- the implementation version --&gt;</i></font>
  
      &lt;version&gt;</strong><font color="darkred">1.2.1</font>&lt;/version&gt;
  
      <font color="gray"><i>&lt;!-- the set of attribibutes associated with the type
           (attribute names and values are examples only) --&gt;</i></font>
  
      &lt;attributes&gt;
  
         &lt;attribute key="<font color="darkred">avalon:display-name-i18n</font>" value="<font color="darkred">display-name</font>"/&gt;
         &lt;attribute key="<font color="darkred">avalon:lifestyle</font>" value="<font color="darkred">THREAD_SAFE</font>"/&gt;
  
      &lt;/attributes&gt;
  
    &lt;/component&gt;
  
    <font color="gray"><i>&lt;!-- 
    Declaration of the context constraints for the component type.
    The "type" attribute is the name of an interface derived from the default
    contenxt interface org.apache.avalon.framework.context.Context 
    --&gt;</i></font>
  
    &lt;context type="<font color="darkred">MyContextInterface</font>"&gt;
  
      <font color="gray"><i>&lt;!-- 
      Declaration of an entry in a context object, the "key" is
      the key used by a component to locate the context entry,
      the "type" is the classname of value (typically an interface)
      or primative type.  The default value is java.lang.String.
      The "optional" attribute is a boolean value derived from the 
      TRUE or FALSE that indicates if the context value must be 
      provided or not (default is FALSE). 
      --&gt;</i></font>
  
      &lt;entry key="<font color="darkred">base</font>" type="<font color="darkred">java.io.File</font>"/&gt;
      &lt;entry key="<font color="darkred">mode</font>" optional="<font color="darkred">TRUE</font>"/&gt;
  
    &lt;/context&gt;
  
    <font color="gray"><i>&lt;!--
    Declaration of the set of services that this component is capable 
    of supplying.  Each service declarared under the services element
    may be referenced by other component info descriptions as a 
    dependecy.  A container is responsible for the assemably of 
    components based on the connection of supply components to 
    consumer components via a common service description. 
    --&gt;</i></font>
  
    &lt;services&gt;
  
        <font color="gray"><i>&lt;!-- 
        The service type is the classname of an interface and the
        version identifier qualifes the interface version.  The 
        default version value is 1.0.
        --&gt;</i></font>
  
        &lt;service&gt;
  
          &lt;service-ref type="<font color="darkred">SimpleService</font>" version="<font color="darkred">3.2</font>"&gt;
  
          &lt;attributes&gt;
  
             <font color="gray"><i>&lt;!--
             Service type attributes go here.
             Need some relevant examples. 
             --&gt;</i></font>
  
          &lt;/attributes&gt;
  
        &lt;/service&gt;
  
    &lt;/services&gt;
  
  
    <font color="gray"><i>&lt;!-- 
    Declaration of the set of dependecies that this component type has on 
    component suppliers.  Dependency declarations define the role name 
    that the component will use to access a service via a service
    or component manager.  The service element identifies a service 
    descriptor that is publised by a potential supplier component. 
    A dependecy may be declared as optional by setting the optional 
    attribute value to TRUE.  The default value for optional is FALSE.
    --&gt;</i></font>
  
    &lt;dependencies&gt;
  
      <font color="gray"><i>&lt;!-- 
      A dependecy declaration. In the following example the optional 
      attribute is redundant as it is equivalent to the default value
      but is included here for completness.
      --&gt;</i></font>
  
      &lt;dependency optional="<font color="darkred">FALSE</font>"&gt;
  
        <font color="gray"><i>&lt;!-- 
        The role name that the component will use as the argument to 
        lookup. The default value is the value of the service type 
        attribute listed below.
        --&gt;</i></font>
  
        &lt;role&gt;<font color="darkred">my-transformer</font>&lt;/role&gt;
  
        <font color="gray"><i>&lt;!-- 
        service reference containing the classname of the service interface
        and the version value where version defaults to 1.0 
        --&gt;</i></font>
  
        &lt;service-ref type="<font color="darkred">org.apache.cocoon.api.Transformer</font>" version="<font color="darkred">1.1</font>"/&gt;
  
        <font color="gray"><i>&lt;!-- the set of attributes associated with the dependecy --&gt;</i></font>
  
        &lt;attributes&gt;
  
             <font color="gray"><i>&lt;!-- 
             Service type constraints go here.
             Need some relevant examples. 
             --&gt;</i></font>
  
        &lt;/attributes&gt;
  
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
  
  &lt;/component-info&gt;
  
  </pre>
  
  </body></html>
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/doc-files/ComponentInfoBuilder.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/xdoclet/AvalonTagHandler.java
  
  Index: AvalonTagHandler.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.xdoclet;
  
  import java.util.Collection;
  import java.util.Iterator;
  import java.util.Properties;
  import java.util.StringTokenizer;
  import org.apache.commons.logging.Log;
  import xdoclet.XDocletException;
  import xdoclet.XDocletTagSupport;
  import xdoclet.util.LogUtil;
  import xjavadoc.XClass;
  import xjavadoc.XDoc;
  import xjavadoc.XMethod;
  import xjavadoc.XPackage;
  import xjavadoc.XTag;
  
  /**
   * A simpler tag handler to walk over attributes in a class.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public class AvalonTagHandler
      extends XDocletTagSupport
  {
      private static final String CONTEXT_METHOD =
          "contextualize(org.apache.avalon.framework.context.Context)";
      private static String c_attribute;
  
      public void forAllServices( final String template )
          throws XDocletException
      {
          final XDoc doc = getCurrentClass().getDoc();
          final Collection tags =
              doc.getTags( "avalon.service" );
          final Iterator iterator = tags.iterator();
          while( iterator.hasNext() )
          {
              final XTag tag = (XTag)iterator.next();
              setCurrentClassTag( tag );
              generate( template );
          }
      }
  
      public void forAllDeps( final String template )
          throws XDocletException
      {
          final IsServiceProvisionFilter filter = new IsServiceProvisionFilter();
          final Collection methods =
              getCurrentClass().getMethods( filter, false );
          final Iterator iterator = methods.iterator();
          while( iterator.hasNext() )
          {
              final XMethod method = (XMethod)iterator.next();
              setCurrentMethod( method );
              final XDoc doc = method.getDoc();
              final Iterator tags =
                  doc.getTags( "avalon.dependency" ).iterator();
              while( tags.hasNext() )
              {
                  final XTag tag = (XTag)tags.next();
                  setCurrentMethodTag( tag );
                  generate( template );
              }
          }
      }
  
      public void forContextDef( final String template )
          throws XDocletException
      {
          final XMethod method =
              getCurrentClass().getMethod( CONTEXT_METHOD, false );
          if( null != method )
          {
              setCurrentMethod( method );
              generate( template );
          }
      }
  
      public void forAllClassAttributes( final String template,
                                         final Properties attributes )
          throws XDocletException
      {
          setupClass( attributes );
          final XTag tag = getCurrentClassTag();
          forAllAttributes( tag, template, attributes );
      }
  
      private void setupClass( final Properties attributes )
      {
          final String property = attributes.getProperty( "tag", null );
          if( null != property )
          {
              final XClass currentClass = getCurrentClass();
              final XTag xTag = currentClass.getDoc().getTag( property );
              setCurrentClassTag( xTag );
          }
      }
  
      public void forAllMethodAttributes( final String template,
                                          final Properties attributes )
          throws XDocletException
      {
          setupMethod( attributes );
          final XTag tag = getCurrentMethodTag();
          forAllAttributes( tag, template, attributes );
      }
  
      private void setupMethod( final Properties attributes )
      {
          final String attribute = attributes.getProperty( "tag", null );
          if( null != attribute )
          {
              final XMethod method = getCurrentMethod();
              final XTag xTag = method.getDoc().getTag( attribute );
              setCurrentMethodTag( xTag );
          }
      }
  
      private void forAllAttributes( final XTag tag,
                                     final String template,
                                     final Properties attributes )
          throws XDocletException
      {
          final String[] skips = getSkips( attributes );
          final Iterator attributeNames = tag.getAttributeNames().iterator();
          while( attributeNames.hasNext() )
          {
              final String name = (String)attributeNames.next();
              if( !matchesSkip( name, skips ) )
              {
                  c_attribute = name;
                  generate( template );
              }
          }
          c_attribute = null;
      }
  
      private boolean matchesSkip( final String name,
                                   final String[] skips )
      {
          for( int i = 0; i < skips.length; i++ )
          {
              if( skips[ i ].equals( name ) )
              {
                  return true;
              }
          }
          return false;
      }
  
      private String[] getSkips( final Properties attributes )
      {
          final String skipList =
              attributes.getProperty( "skip", "" );
          return split( skipList, ", " );
      }
  
      public String getClassAttributeValueAsType( final Properties attributes )
      {
          setupClass( attributes );
          final XTag tag = getCurrentClassTag();
          return getAttributeValueAsType( tag, attributes );
      }
  
      public String getMethodAttributeValueAsType( final Properties attributes )
      {
          setupMethod( attributes );
          final XTag tag = getCurrentMethodTag();
          return getAttributeValueAsType( tag, attributes );
      }
  
      private String getAttributeValueAsType( final XTag tag, final Properties attributes )
      {
          final Log log =
              LogUtil.getLog( AvalonTagHandler.class, "getAttributeValueAsType" );
          final String name = attributes.getProperty( "name", "" );
          final String value = tag.getAttributeValue( name );
          if( null == value )
          {
              log.fatal( "Missing attribute value with key '" +
                         name + "' in tag" + tag + " in class " +
                         getCurrentClass() );
              return "";
          }
  
          return getQualifiedTypeName( value );
      }
  
      private String getQualifiedTypeName( final String typeName )
      {
          if( -1 != typeName.indexOf( '.' ) )
          {
              //User has specified full
              return typeName;
          }
          else
          {
              final XClass currentClass = getCurrentClass();
  
              XClass xClass = null;
              Collection classes = null;
  
              classes =
                  currentClass.getImportedClasses();
              xClass = findClass( typeName, classes );
              if( null != xClass )
              {
                  return xClass.getQualifiedName();
              }
  
              classes =
                  currentClass.getContainingPackage().getClasses();
              xClass = findClass( typeName, classes );
              if( null != xClass )
              {
                  return xClass.getQualifiedName();
              }
  
              final Iterator xPackages =
                  currentClass.getImportedPackages().iterator();
              while( xPackages.hasNext() )
              {
                  final XPackage xPackage = (XPackage)xPackages.next();
                  classes = xPackage.getClasses();
                  xClass = findClass( typeName, classes );
                  if( null != xClass )
                  {
                      return xClass.getQualifiedName();
                  }
              }
  
              classes = getDefaultPackage().getClasses();
              xClass = findClass( typeName, classes );
              if( null != xClass )
              {
                  return xClass.getQualifiedName();
              }
  
              return typeName;
          }
      }
  
      public String getAttributeName()
      {
          return c_attribute;
      }
  
      public String getClassAttributeValue( final Properties attributes )
      {
          final XTag tag = getCurrentClassTag();
          return getAttributeValue( tag );
      }
  
      public String getMethodAttributeValue( final Properties attributes )
      {
          final XTag tag = getCurrentMethodTag();
          return getAttributeValue( tag );
      }
  
      private String getAttributeValue( final XTag tag )
      {
          if( null == c_attribute )
          {
              return "";
          }
          else
          {
              return tag.getAttributeValue( c_attribute );
          }
      }
  
      /**
       * Splits the string on every token into an array of strings.
       *
       * @param string the string
       * @param onToken the token
       * @return the resultant array
       */
      private static final String[] split( final String string, final String onToken )
      {
          final StringTokenizer tokenizer = new StringTokenizer( string, onToken );
          final String[] result = new String[ tokenizer.countTokens() ];
  
          for( int i = 0; i < result.length; i++ )
          {
              result[ i ] = tokenizer.nextToken();
          }
  
          return result;
      }
  
      private XPackage getDefaultPackage()
      {
          XClass xClass = getCurrentClass().getSuperclass();
          XClass newXClass = xClass;
          while( null != newXClass &&
              !newXClass.getQualifiedName().equals( "java.lang.Object" ) )
          {
              xClass = newXClass;
              newXClass = getCurrentClass().getSuperclass();
          }
          return xClass.getContainingPackage();
      }
  
      private XClass findClass( final String name,
                                final Collection classes )
      {
          XClass xClass = null;
          final Iterator iterator = classes.iterator();
          while( iterator.hasNext() )
          {
              final XClass singleImport = (XClass)iterator.next();
              final String classname = singleImport.getName();
              if( classname.equals( name ) )
              {
                  xClass = singleImport;
                  break;
              }
          }
          return xClass;
      }
  }
  
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/xdoclet/AvalonXDoclet.java
  
  Index: AvalonXDoclet.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.xdoclet;
  
  import xdoclet.DocletTask;
  
  /**
   * A simple XDoclet task that generates the .xinfo files for
   * services.
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public class AvalonXDoclet
      extends DocletTask
  {
      private ComponentInfoSubTask m_componentInfoSubTask;
  
      public ComponentInfoSubTask createComponentInfo()
      {
          m_componentInfoSubTask = new ComponentInfoSubTask();
          addTemplate( m_componentInfoSubTask );
          return m_componentInfoSubTask;
      }
  }
  
  
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/xdoclet/ComponentInfoSubTask.java
  
  Index: ComponentInfoSubTask.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.xdoclet;
  
  import java.net.URL;
  import xdoclet.TemplateSubTask;
  import xdoclet.XDocletException;
  import xdoclet.template.TemplateException;
  
  /**
   * Generates ComponentInfo 'xinfo' files for Components.
   *
   * @author <a href="mailto:vinay_chandran@users.sourceforge.net">Vinay Chandrasekharan</a>
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public class ComponentInfoSubTask
      extends TemplateSubTask
  {
      public ComponentInfoSubTask()
      {
          setupParams();
      }
  
      private void setupParams()
      {
          final String resourceName =
              getPackagePath() + "/componentinfo.xdt";
          final URL resource =
              getClass().getResource( resourceName );
          setTemplateURL( resource );
          setDestinationFile( "{0}-info.xml" );
          setHavingClassTag( "avalon.component" );
          setAcceptAbstractClasses( false );
          setSubTaskName( "componentinfo" );
      }
  
      /**
       * Initialises the subtask.  Add a tag handler for avalon type tags.
       */
      public void init() throws XDocletException
      {
          super.init();
          try
          {
              final AvalonTagHandler tagHandler = new AvalonTagHandler();
              getEngine().setTagHandlerFor( "Avalon", tagHandler );
          }
          catch( final TemplateException e )
          {
              throw new XDocletException( e, e.getMessage() );
          }
      }
  
      private static final String getPackagePath()
      {
          final String name = ComponentInfoSubTask.class.getName();
          final int index = name.lastIndexOf( '.' );
          return "/" + name.substring( 0, index ).replace( '.', '/' );
      }
  }
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/xdoclet/IsServiceProvisionFilter.java
  
  Index: IsServiceProvisionFilter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.tools.xdoclet;
  
  import java.util.Collection;
  import xjavadoc.Filter;
  import xjavadoc.XMethod;
  import xjavadoc.XParameter;
  import xjavadoc.XProgramElement;
  
  /**
   * Filter for getting Service Provision methods (ie Serviceable/Composable).
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/31 08:17:01 $
   */
  public class IsServiceProvisionFilter
      implements Filter
  {
      private static final String SM_NAME =
          "org.apache.avalon.framework.service.ServiceManager";
      private static final String CM_NAME =
          "org.apache.avalon.framework.component.ComponentManager";
  
      public boolean accept( final XProgramElement element )
      {
          final String name = element.getName();
          final boolean serviceName = name.equals( "service" );
          final boolean composeName = name.equals( "compose" );
          if( !serviceName && !composeName )
          {
              //Need to be named service/compose
              return false;
          }
  
          //need to be a method
          if( !(element instanceof XMethod) )
          {
              return false;
          }
  
          final XMethod method = (XMethod)element;
          final Collection parameters = method.getParameters();
          if( 1 != parameters.size() )
          {
              return false;
          }
  
          final XParameter parameter = (XParameter)parameters.iterator().next();
  
          final String paramType = parameter.getType().getQualifiedName();
          if( serviceName && !paramType.equals( SM_NAME ) )
          {
              return false;
          }
          else if( composeName && !paramType.equals( CM_NAME ) )
          {
              return false;
          }
  
          return true;
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/xdoclet/componentinfo.xdt
  
  Index: componentinfo.xdt
  ===================================================================
  <?xml version="1.0" encoding="utf-8" ?>
  
  <!DOCTYPE component-info
        PUBLIC "-//AVALON/Component Info DTD Version 1.0//EN"
        "http://jakarta.apache.org/avalon/componentinfo_1.0.dtd" >
  
  <!-- Autogenerated by XDoclet. Do not Edit! -->
  <component-info>
  
    <!-- section to describe Component -->
    <component>
      <XDtClass:ifHasClassTag tagName="avalon.component" paramName="name"><name><XDtClass:classTagValue tagName="avalon.component" paramName="name"/></name></XDtClass:ifHasClassTag>
      <version><XDtClass:classTagValue tagName="avalon.component" paramName="version" default="1.0"/></version>
      <attributes>
        <XDtAvalon:forAllClassAttributes tag="avalon.component" skip="interface,version,role">
        <attribute key="<XDtAvalon:getAttributeName/>" value="<XDtAvalon:getClassAttributeValue/>"/>
        </XDtAvalon:forAllClassAttributes>
      </attributes>
    </component>
  
    <!-- Context in which this Component operates -->
    <XDtAvalon:forContextDef>
    <context<XDtMethod:ifHasMethodTag tagName="avalon.context" paramName="type"> type="<XDtAvalon:getMethodAttributeValueAsType tag="avalon.context" name="type"/>"</XDtMethod:ifHasMethodTag>>
        <XDtMethod:forAllMethodTags tagName="avalon.entry">
      <entry key="<XDtMethod:methodTagValue tagName="avalon.entry" paramName="key"/>" type="<XDtAvalon:getMethodAttributeValueAsType name="type"/>"<XDtMethod:ifHasMethodTag tagName="avalon.entry" paramName="isOptional"> optional="<XDtMethod:methodTagValue tagName="avalon.entry" paramName="isOptional"/>"</XDtMethod:ifHasMethodTag>/>
        </XDtMethod:forAllMethodTags>
      <XDtMethod:ifHasMethodTag tagName="avalon.context">
      <attributes>
          <XDtAvalon:forAllMethodAttributes tag="avalon.context" skip="type">
        <attribute key="<XDtAvalon:getAttributeName/>" value="<XDtAvalon:getMethodAttributeValue/>"/>
          </XDtAvalon:forAllMethodAttributes>
      </attributes>
      </XDtMethod:ifHasMethodTag>
    </context>
    </XDtAvalon:forContextDef>
  
    <!-- services that are offered by this Component -->
    <services>
      <XDtAvalon:forAllServices>
      <service>
        <service-ref type="<XDtAvalon:getClassAttributeValueAsType name="interface"/>"<XDtClass:ifHasClassTag tagName="avalon.service" paramName="version"> version="<XDtClass:classTagValue tagName="avalon.service" paramName="version"/>"</XDtClass:ifHasClassTag>/>
        <attributes>
        <XDtAvalon:forAllClassAttributes skip="interface,version,role">
          <attribute key="<XDtAvalon:getAttributeName/>" value="<XDtAvalon:getClassAttributeValue/>"/>
        </XDtAvalon:forAllClassAttributes>
        </attributes>
      </service>
      </XDtAvalon:forAllServices>
    </services>
  
    <!-- services that are required by this Component -->
    <dependencies>
    <XDtAvalon:forAllDeps>
      <dependency<XDtMethod:ifHasMethodTag tagName="avalon.dependency" paramName="optional"> optional="<XDtMethod:methodTagValue tagName="avalon.dependency" paramName="optional"/>"</XDtMethod:ifHasMethodTag>>
        <XDtMethod:ifHasMethodTag tagName="avalon.dependency" paramName="role"><role><XDtMethod:methodTagValue tagName="avalon.dependency" paramName="role"/></role></XDtMethod:ifHasMethodTag>
        <service-ref type="<XDtAvalon:getMethodAttributeValueAsType name="interface"/>"<XDtMethod:ifHasMethodTag tagName="avalon.dependency" paramName="version"> version="<XDtMethod:methodTagValue tagName="avalon.dependency" paramName="version"/>"</XDtMethod:ifHasMethodTag>/>
        <attributes>
        <XDtAvalon:forAllMethodAttributes skip="interface,version,role,optional">
          <attribute key="<XDtAvalon:getAttributeName/>" value="<XDtAvalon:getMethodAttributeValue/>"/>
        </XDtAvalon:forAllMethodAttributes>
        </attributes>
      </dependency>
    </XDtAvalon:forAllDeps>
    </dependencies>
  
  </component-info>
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/test/README.txt
  
  Index: README.txt
  ===================================================================
  Tests will be placed here in time.
  
  
  1.1                  jakarta-avalon-excalibur/info/src/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <document>
      <properties>
          <title>Excalibur Info - Overview</title>
          <author email="peter at apache.org">Peter Donald</author>
      </properties>
      <body>
          <section name="Introduction">
              <p>The Info API is a set of utilities aimed at
              helping developers develope inter-operable
              components.</p>
          </section>
      </body>
  </document>
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/xdocs/menu.xml
  
  Index: menu.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <project
      href="http://jakarta.apache.org/avalon/excalibur/info/"
      name="Avalon Info">
  
      <title>Avalon Info</title>
      <body>
          <menu name="About">
              <item name="Overview" href="index.html"/>
              <item name="Excalibur Home" href="http://jakarta.apache.org/avalon/excalibur/index.html"/>
              <item name="Download" href="http://jakarta.apache.org/builds/jakarta-avalon-excalibur/release"/>
              <item name="API Docs" href="api/"/>
          </menu>
      </body>
  </project>
  
  
  
  1.1                  jakarta-avalon-excalibur/info/src/xdocs/stylesheets/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <project
      href="http://jakarta.apache.org/avalon/???"
      name="Excalibur ???">
  
      <title>Excalibur ??</title>
      <body>
          <item href="/../index.html" name="Back to Excalibur"/>
          <menu name="About">
              <item name="Overview" href="/index.html"/>
              <item name="Excalibur Home" href="http://jakarta.apache.org/avalon/excalibur/index.html"/>
              <item name="Download" href="http://jakarta.apache.org/builds/jakarta-avalon-excalibur/release/???"/>
              <item name="API Docs" href="/api/index.html"/>
          </menu>
      </body>
  </project>
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>