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

cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground BasicComponent.java BasicComponent.xconfig BasicComponent.xinfo BasicComponent.xprofile BasicContext.java BasicContextInterface.java BasicService.java ComplexComponent.java ComplexComponent.xinfo CustomContainer.java CustomContainer.xinfo CustomContainer.xprofile DemoManager.java DemoManager.xinfo Demonstratable.java EmbeddedDemo.java EmbeddedDemo.xconfig EmbeddedDemo.xinfo Exploitable.java ExploitationManager.java ExploitationManager.xinfo InvalidComponent.java InvalidComponent.xinfo SimpleComponent.java SimpleComponent.xconfig SimpleComponent.xinfo SimpleService.java TerminalComponent.java TerminalComponent.xinfo

mcconnell    2002/08/20 16:23:09

  Modified:    assembly build.xml default.properties kernel.sh merlin.bat
               assembly/src/etc kernel.xml project.mf
               assembly/src/java/org/apache/excalibur/merlin/assembly
                        TypeManager.java
               assembly/src/java/org/apache/excalibur/merlin/container
                        ContainerFactory.java DefaultContainer.java
               assembly/src/java/org/apache/excalibur/merlin/kernel
                        DefaultKernel.java
               assembly/src/java/org/apache/excalibur/merlin/resource
                        DefaultServiceManager.java
  Added:       assembly/src/java/org/apache/excalibur/playground
                        BasicComponent.java BasicComponent.xconfig
                        BasicComponent.xinfo BasicComponent.xprofile
                        BasicContext.java BasicContextInterface.java
                        BasicService.java ComplexComponent.java
                        ComplexComponent.xinfo CustomContainer.java
                        CustomContainer.xinfo CustomContainer.xprofile
                        DemoManager.java DemoManager.xinfo
                        Demonstratable.java EmbeddedDemo.java
                        EmbeddedDemo.xconfig EmbeddedDemo.xinfo
                        Exploitable.java ExploitationManager.java
                        ExploitationManager.xinfo InvalidComponent.java
                        InvalidComponent.xinfo SimpleComponent.java
                        SimpleComponent.xconfig SimpleComponent.xinfo
                        SimpleService.java TerminalComponent.java
                        TerminalComponent.xinfo
  Removed:     assembly/demo/src/etc demo.mf
  Log:
  Synchronization with the external excalibur/meta and excalibur/container
  
  Revision  Changes    Path
  1.45      +425 -325  jakarta-avalon-excalibur/assembly/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/build.xml,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- build.xml	19 Aug 2002 23:05:05 -0000	1.44
  +++ build.xml	20 Aug 2002 23:23:07 -0000	1.45
  @@ -1,328 +1,428 @@
  +<?xml version="1.0"?>
   
  -<!-- 
  -Copyright 2001-2002 OSM SARL, All Rights Reserved.
  --->
  -
  -<project name="assembly" default="deploy" basedir=".">
  -
  -  <property file="local.properties"/>
  -  <property file="build.properties"/>
  -  <property file="default.properties"/>
  -
  -  <target name="help" >
  -    <echo>
  -
  -      Description
  -      -----------
  -
  -      ${project.title}
  -      
  -      General Targets:
  -      ----------------
  -
  -      all              - clean, build, dist and docs (everything)
  -      build            - compilation and jar creation
  -      deploy           - places internal and external jars into an extensions directory
  -      javadoc          - javadoc API generation
  -      docs             - projects documentation
  -      clean            - destroy the build, dist and extensions directory
  -      help             - this message
  -      
  -    </echo>
  -  </target>
  -
  -  <property name="apps.path" value="../../jakarta-avalon-apps" />
  -  <property name="excalibur.path" value="../../jakarta-avalon-excalibur" />
  -  <property name="avalon.tools.path" value="../../jakarta-avalon/tools" />
  -
  -  <property name="lib" value="lib" />
  -  <property name="src.dir" value="src" />
  -  <property name="xdocs.dir" value="${src.dir}/xdocs" />
  -  <property name="etc" value="${src.dir}/etc" />
  -  <property name="build"  value="build" />
  -  <property name="dist.dir"  value="dist" />
  -  <property name="docs.dir" value="${dist.dir}/docs" />
  -  <property name="extensions"  value="extensions" />
  -  <property name="tools"  value="tools" />
  -
  -  <property name="javadoc.root.path"  value="${dist.dir}/docs/api" />
  -  <property name="avalon.href"  value="http://jakarta.apache.org/avalon/api/" />
  -  <property name="jdk.href"  value="http://java.sun.com/j2se/1.4/docs/api/" />
  -  <property name="meta.href"  value="../meta" />
  -  <property name="overview.html" value="${etc}/overview.html" />
  -  <property name="project.manifest" value="project.mf" />
  -  <property name="meta.jar" value="avalon-meta.jar" />
  -  <property name="merlin.page" value="${src.dir}/etc/merlin.html" />
  -  <property name="meta.page" value="${src.dir}/etc/meta.html" />
  -  <property name="merlin.jar" value="merlin.jar" />
  -
  -  <!-- classpath -->
  -
  -  <path id="project.class.path">
  -      <fileset dir="${lib}">
  -        <include name="*.jar" />
  -      </fileset>
  -      <fileset dir="${lib}/xdoclet">
  -        <include name="*.jar" />
  -      </fileset>
  -  </path>
  -
  -  <!-- MAIN TARGETS -->
  -
  -  <target name="dist" depends="build"/>
  -  <target name="meta" depends="meta.javadoc"/>
  -  <target name="merlin" depends="merlin.javadoc"/>
  -  <target name="all" depends="clean,deploy,javadocs,docs"/>
  -  <target name="javadocs" depends="meta.javadoc,merlin.javadoc" />
  -  <target name="javadoc" depends="meta.javadoc,merlin.javadoc" />
  -
  -  <target name="docs">
  -    <ant antfile="docs.xml"/>
  -  </target>
  -
  -  <target name="docs-release" depends="javadocs">
  -    <ant antfile="docs.xml" target="release"/>
  -  </target>
  -
  -  <target name="clean">
  -     <delete dir="${build}"/>
  -     <delete dir="${dist.dir}"/>
  -     <delete dir="${extensions}"/>
  -  </target>
  -
  -  <!-- PREPARE -->
  -
  -  <target name="prepare"  >
  -    <mkdir dir="${build}" />
  -    <mkdir dir="${build}" />
  -    <mkdir dir="${dist.dir}" />
  -  </target>
  -
  -  <!-- BLOCK -->
  -
  -  <target name="build" depends="demo.build,merlin.build"/>
  -
  -  <target name="merlin.context" depends="prepare">
  -    <mkdir dir="dist"/>
  -    <uptodate property="uptodate" targetfile="${dist.dir}/${merlin.jar}">
  -      <srcfiles dir="${src.dir}/java">
  -         <include name="**/merlin/**/*.*"/>
  -         <include name="**/excalibur/container/**/*.*"/>
  -         <include name="**/avalon/phoenix/**/*.*"/>
  -      </srcfiles>
  -      <srcfiles dir="${etc}">
  -         <include name="${project.manifest}"/>
  -      </srcfiles>
  -    </uptodate>
  -  </target>
  -
  -  <target name="merlin.build" depends="merlin.context,meta.build" unless="uptodate" >
  -      <echo message="Building Merlin"/>
  -      <mkdir dir="${build}/main"/>
  -      <javac debug="off" destdir="${build}/main" deprecation="false"
  -        excludes="org/apache/excalibur/meta/**">
  -        <classpath>
  -	    <path refid="project.class.path" />
  -          <pathelement path="${dist.dir}/${meta.jar}" />
  -	  </classpath>
  -        <src path="${src.dir}/java" />
  -      </javac>
  -      <copy todir="${build}/main">
  -        <fileset dir="${src.dir}/java">
  -          <exclude name="org/apache/excalibur/meta/**/*"/>
  -          <include name="**/merlin/**/*.xml"/>
  -          <include name="**/merlin/**/*.properties"/>
  -          <include name="**/merlin/**/*.xinfo"/>
  -          <include name="**/merlin/**/*.xprofile"/>
  -          <include name="**/merlin/**/*.xconfig"/>
  -        </fileset>
  -      </copy>
  -      <jar jarfile="${dist.dir}/${merlin.jar}" 
  -         basedir="${build}/main" manifest="${etc}/${project.manifest}" 
  -         excludes="org/apache/excalibur/merlin/toolkit/**"/>
  -
  -      <!-- need to seperate next action out into a different build environment -->
  -
  -      <jar jarfile="${dist.dir}/tools.jar" 
  -         basedir="${build}/main" 
  -         includes="org/apache/excalibur/merlin/toolkit/**/*"/>
  -
  -  </target>
  -
  -
  -  <target name="meta.context" depends="prepare">
  -    <mkdir dir="dist"/>
  -    <uptodate property="meta.uptodate" targetfile="${dist.dir}/${meta.jar}">
  -      <srcfiles dir="${src.dir}">
  -         <include name="**/meta/**/*.*"/>
  -         <include name="etc/meta.mf"/>
  -         <include name="etc/xdoclet.xml"/>
  -      </srcfiles>
  -    </uptodate>
  -  </target>
  -
  -  <target name="meta.build" depends="meta.context" unless="meta.uptodate" >
  -      <echo message="Building Meta Info Model"/>
  -      <mkdir dir="${build}/meta"/>
  -      <javac debug="off" destdir="${build}/meta" deprecation="true"
  -        includes="org/apache/excalibur/meta/**">
  -        <classpath>
  -	    <path refid="project.class.path" />
  -	  </classpath>
  -        <src path="${src.dir}/java" />
  -      </javac>
  -      <copy todir="${build}/meta">
  -        <fileset dir="${src.dir}/java">
  -          <include name="**/meta/**/*.xinfo"/>
  -          <include name="**/meta/**/*.xml"/>
  -          <include name="**/meta/**/*.properties"/>
  -          <include name="**/meta/**/*.dtd"/>
  -          <include name="**/meta/**/*.xdt"/>
  -        </fileset>
  -      </copy>
  -      <mkdir dir="${build}/meta/META-INF"/>
  -      <copy todir="${build}/meta/META-INF">
  -        <fileset dir="${src.dir}/etc">
  -          <include name="xdoclet.xml"/>
  -        </fileset>
  -      </copy>
  -
  -      <jar jarfile="${dist.dir}/${meta.jar}" 
  -         basedir="${build}/meta" manifest="${etc}/meta.mf"/>
  -  </target>
  -
  -
  -  <target name="demo.context" depends="prepare">
  -    <mkdir dir="dist"/>
  -    <uptodate property="demo.uptodate" targetfile="${dist.dir}/demo.jar">
  -      <srcfiles dir="demo/src/java">
  -         <include name="**/*.*"/>
  -      </srcfiles>
  -      <srcfiles dir="demo/src/etc">
  -         <include name="demo.mf"/>
  -      </srcfiles>
  -    </uptodate>
  -  </target>
  -
  -  <target name="demo.build" depends="merlin.build,demo.context" unless="demo.uptodate" >
  -      <echo message="Building Demo"/>
  -      <mkdir dir="${build}/demo"/>
  -      <javac debug="off" destdir="${build}/demo" deprecation="true">
  -        <classpath>
  -	    <path refid="project.class.path" />
  -          <pathelement path="${dist.dir}/${meta.jar}" />
  -          <pathelement path="${dist.dir}/${merlin.jar}" />
  -	  </classpath>
  -        <src path="demo/src/java" />
  -      </javac>
  -      <copy todir="${build}/demo">
  -        <fileset dir="demo/src/java">
  -          <include name="**/*.xinfo"/>
  -          <include name="**/*.xml"/>
  -          <include name="**/*.properties"/>
  -          <include name="**/*.xprofile"/>
  -          <include name="**/*.xconfig"/>
  -        </fileset>
  -      </copy>
  -      <jar jarfile="${dist.dir}/demo.jar" basedir="${build}/demo" manifest="demo/src/etc/demo.mf"/>
  -  </target>
  -
  -  <!-- UTILITY TARGETS -->
  -
  -  <target name="support">
  -    <copy todir="${dist.dir}">
  -       <fileset dir="${etc}">
  -         <include name="LICENSE.TXT"/>
  -         <include name="README.TXT"/>
  -       </fileset>
  -    </copy>
  -  </target>
  -
  -  <target name="merlin.javadoc" depends="build" >
  -    <echo message="path: ${docs.dir}/api/${ant.project.name}"/>
  -    <mkdir dir="${docs.dir}/api/${ant.project.name}" />
  -    <javadoc destdir="${docs.dir}/api/${ant.project.name}" 
  -	doctitle="&lt;h1&gt;${project.title}&lt;/h1&gt;" 
  -      noindex="false" author="false" 
  -      use="true"
  -	windowtitle="Merlin" 
  -      additionalparam="-breakiterator -J-Xmx128m"
  -      packagenames="org.apache.excalibur.merlin.*,org.apache.excalibur.container.*" 
  -      overview="${merlin.page}"
  -      >
  -        <sourcepath path="${src.dir}/java"/>
  -        <classpath>
  -	    <path refid="project.class.path" />
  -          <pathelement path="${dist.dir}/${merlin.jar}" />
  -          <pathelement path="${dist.dir}/${meta.jar}" />
  -	  </classpath>
  -	  <link href="${jdk.href}" />
  -	  <link href="${avalon.href}" />
  -	  <link href="${meta.href}" />
  -    </javadoc>
  -    <copy todir="${docs.dir}/api/${ant.project.name}">
  -      <fileset dir="${src.dir}/etc">
  -        <include name="*.gif"/>
  -        <include name="*.xml"/>
  -      </fileset>
  -    </copy>
  -  </target>
  -
  -  <target name="meta.javadoc" depends="meta.build" >
  -    <echo message="path: ${docs.dir}/api/meta"/>
  -    <mkdir dir="${docs.dir}/api/meta" />
  -    <javadoc destdir="${docs.dir}/api/meta" 
  -	doctitle="&lt;h1&gt;Avalon Component Meta Model&lt;/h1&gt;" 
  -      noindex="false" author="false" 
  -      use="true"
  -	windowtitle="Avalon Component Meta Model" 
  -      additionalparam="-breakiterator -J-Xmx128m"
  -      packagenames="org.apache.excalibur.meta.*" 
  -      overview="${meta.page}"
  -      >
  -        <sourcepath path="${src.dir}/java"/>
  -        <classpath>
  -	    <path refid="project.class.path" />
  -          <pathelement path="${dist.dir}/${meta.jar}" />
  -	  </classpath>
  -	  <link href="${jdk.href}" />
  -	  <link href="${avalon.href}" />
  -    </javadoc>
  -    <copy todir="${docs.dir}/api/meta" file="${src.dir}/etc/meta.gif"/>
  -  </target>
  -
  -  <target name="deploy" depends="dist">
  -     <mkdir dir="${extensions}"/>
  -     <copy todir="${extensions}" preservelastmodified="true">
  -       <fileset dir="${dist.dir}">
  -         <include name="${meta.jar}"/>
  -         <include name="${merlin.jar}"/>
  -       </fileset>
  -       <fileset dir="${lib}">
  -         <include name="logkit.jar"/>
  -         <include name="avalon-framework.jar"/>
  -         <include name="excalibur-i18n-1.0.jar" />
  -         <include name="excalibur-extension-1.0a.jar" />
  -         <include name="excalibur-configuration-1.0.jar" />
  -         <include name="excalibur-logger-1.0.jar" />
  -         <include name="excalibur-event-1.0a.jar" />
  -         <include name="excalibur-collections-1.0.jar" />
  -         <include name="excalibur-concurrent-1.0.jar" />
  -         <include name="excalibur-threadcontext-1.0.jar" />
  -         <include name="excalibur-util-1.0.jar" />
  -         <include name="xerces-2.0.1.jar"/>
  -         <include name="xml-apis.jar"/>
  -         <include name="xalan-2.3.1.jar"/>
  -       </fileset>
  -     </copy>
  -  </target>
  -
  -  <target name="patch">
  -    <replace dir="src" 
  -       token="ExtensionsDescriptor"
  -       value="LibraryDescriptor" >
  -     <include name="**/*.*"/>
  -    </replace>
  -  </target>
  +<project name="Merlin 2" 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="${logkit.jar}"/>
  +        <pathelement location="${avalon-framework.jar}"/>
  +        <pathelement location="${excalibur-i18n.jar}"/>
  +        <pathelement location="${excalibur-configuration.jar}"/>
  +        <pathelement location="${excalibur-container.jar}"/>
  +        <pathelement location="${excalibur-meta.jar}"/>
  +        <pathelement location="${excalibur-extension.jar}"/>
  +        <pathelement location="${excalibur-logger.jar}"/>
  +        <pathelement location="${excalibur-event.jar}"/>
  +        <pathelement location="${build.classes}"/>
  +        <pathelement location="${checkstyle.jar}"/>
  +        <pathelement location="${xml-apis.jar}"/>
  +        <pathelement path="${java.class.path}"/>
  +    </path>
  +
  +    <path id="tools.class.path">
  +        <pathelement location="${junit.jar}"/>
  +        <fileset dir="${jakarta-site.dir}/lib"/>
  +    </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="checkLogkit"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkFramework"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkI18N"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkConfiguration"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkContainer"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkMeta"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkExtension"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkLogger"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkEvent"/>
  +
  +        <!-- secondary depedencies -->
  +
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkUtil"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkCollections"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkThreadcontext"/>
  +        <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkConcurrent"/>
  +
  +    </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>
  +
  +    <target name="deploy" > <!--depends="jar" -->
  +       <mkdir dir="${extension.dir}"/>
  +       <copy todir="${extension.dir}" file="${build.lib}/${jar.name}"/>
  +       <copy todir="${extension.dir}" file="${logkit.jar}"/>
  +       <copy todir="${extension.dir}" file="${avalon-framework.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-i18n.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-container.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-configuration.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-extension.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-logger.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-meta.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-event.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-collections.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-concurrent.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-threadcontext.jar}"/>
  +       <copy todir="${extension.dir}" file="${excalibur-util.jar}"/>
  +       <copy todir="${extension.dir}" preservelastmodified="true">
  +         <fileset dir="${lib.dir}">
  +           <include name="xerces-2.0.1.jar"/>
  +           <include name="xml-apis.jar"/>
  +           <include name="xalan-2.3.1.jar"/>
  +         </fileset>
  +       </copy>
  +    </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="${src.dir}/etc/project.mf">
  +            <exclude name="**/test/**"/>
  +            <exclude name="**/playground/**"/>
  +            <zipfileset dir="${build.conf}" prefix="META-INF/">
  +                <include name="LICENSE.txt"/>
  +            </zipfileset>
  +        </jar>
  +
  +        <jar jarfile="${build.lib}/${demo.jar}"
  +            basedir="${build.classes}"
  +            compress="${build.compress}"
  +            manifest="${src.dir}/etc/demo.mf">
  +            <exclude name="**/merlin/**"/>
  +            <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" />
  +            <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>
  +
  +    <!-- Creates the distribution -->
  +    <target name="dist"
  +        depends="dist-jar, test-reports, checkstyle-report, javadocs"
  +        description="Generates a distribution (jar + javadocs + unit tests + checkstyle reports)">
  +
  +        <copy file="${build.conf}/LICENSE.txt" todir="${dist.dir}"/>
  +        <copy file="../KEYS" 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}"/>
  +        </zip>
  +
  +        <delete dir="${dist.dir}" />
  +
  +    </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}"/>
  +
  +    </target>
  +
  +    <target name="anakia-avail">
  +        <available classname="org.apache.velocity.anakia.AnakiaTask"
  +            property="AnakiaTask.present">
  +            <classpath refid="tools.class.path"/>
  +        </available>
  +    </target>
  +
  +    <target name="anakia-check" depends="anakia-avail" unless="AnakiaTask.present">
  +        <echo>
  +            AnakiaTask is not present! Please check to make sure that
  +            velocity.jar is in your classpath. The easiest way to build
  +            the documentation is to checkout jakarta-site CVS and specify
  +            jakarta-site.dir property.
  +        </echo>
  +    </target>
  +
  +    <target name="docs" depends="anakia-check" description="Generate documentation and website">
  +        <taskdef name="anakia"
  +            classname="org.apache.velocity.anakia.AnakiaTask">
  +            <classpath refid="tools.class.path"/>
  +        </taskdef>
  +
  +        <anakia basedir="${xdocs.dir}"
  +            destdir="${docs.dir}"
  +            style="docs.vsl"
  +            projectfile="stylesheets/project.xml"
  +            includes="**/*.xml"
  +            excludes="stylesheets/**"
  +            velocitypropertiesfile="../site/src/stylesheets/velocity.properties"
  +            />
  +
  +        <copy todir="${docs.dir}" filtering="off">
  +            <fileset dir="../site/src" includes="css/*.css" />
  +            <fileset dir="${xdocs.dir}">
  +                <include name="**/images/**"/>
  +                <include name="**/*.gif"/>
  +                <include name="**/*.jpg"/>
  +                <include name="**/*.png"/>
  +                <include name="**/*.css"/>
  +                <include name="**/*.js"/>
  +            </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="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.3       +70 -1     jakarta-avalon-excalibur/assembly/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/default.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- default.properties	17 Jul 2002 13:48:37 -0000	1.2
  +++ default.properties	20 Aug 2002 23:23:07 -0000	1.3
  @@ -8,10 +8,11 @@
   name=merlin
   Name=Merlin
   dir-name=assembly
  -version=2.0-alpha
  +version=2.0a
   package-version=0.99
   year=2000-2002
   
  +
   # --------------------------------------------------
   #                REQUIRED LIBRARIES
   # --------------------------------------------------
  @@ -21,6 +22,66 @@
   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
  +
  +# ----- Excalibur Configuration -----
  +excalibur-configuration.home=${basedir}/../configuration
  +excalibur-configuration.lib=${excalibur-configuration.home}/build/lib
  +excalibur-configuration.jar=${excalibur-configuration.lib}/excalibur-configuration-1.0.jar
  +
  +# ----- Excalibur Container -----
  +excalibur-container.home=${basedir}/../container
  +excalibur-container.lib=${excalibur-container.home}/build/lib
  +excalibur-container.jar=${excalibur-container.lib}/excalibur-container-1.0.jar
  +
  +# ----- Excalibur Meta -----
  +excalibur-meta.home=${basedir}/../meta
  +excalibur-meta.lib=${excalibur-meta.home}/build/lib
  +excalibur-meta.jar=${excalibur-meta.lib}/excalibur-meta-1.0.jar
  +
  +# ----- Excalibur Extension -----
  +excalibur-extension.home=${basedir}/../extension
  +excalibur-extension.lib=${excalibur-extension.home}/build/lib
  +excalibur-extension.jar=${excalibur-extension.lib}/excalibur-extension-1.0a.jar
  +
  +# ----- Excalibur event, version 1.0 or later -----
  +excalibur-event.home=${basedir}/../event/dist
  +excalibur-event.lib=${excalibur-event.home}
  +excalibur-event.jar=${excalibur-event.lib}/excalibur-event-1.0a.jar
  +
  +# ----- Excalibur collections, version 1.0 or later -----
  +excalibur-collections.home=${basedir}/../collections/dist
  +excalibur-collections.lib=${excalibur-collections.home}
  +excalibur-collections.jar=${excalibur-collections.lib}/excalibur-collections-1.0.jar
  +
  +# ----- Excalibur concurrent, version 1.0 or later -----
  +excalibur-concurrent.home=${basedir}/../concurrent/dist
  +excalibur-concurrent.lib=${excalibur-concurrent.home}
  +excalibur-concurrent.jar=${excalibur-concurrent.lib}/excalibur-concurrent-1.0.jar
  +
  +# ----- Excalibur threadcontext, version 1.0 or later -----
  +excalibur-threadcontext.home=${basedir}/../threadcontext/dist
  +excalibur-threadcontext.lib=${excalibur-threadcontext.home}
  +excalibur-threadcontext.jar=${excalibur-threadcontext.lib}/excalibur-threadcontext-1.0.jar
  +
  +# ----- Excalibur util, version 1.0 or later -----
  +excalibur-util.home=${basedir}/../util/dist
  +excalibur-util.lib=${excalibur-util.home}
  +excalibur-util.jar=${excalibur-util.lib}/excalibur-util-1.0.jar
  +
  +# ----- Excalibur logger, version 1.0 or later -----
  +excalibur-logger.home=${basedir}/../logger/dist
  +excalibur-logger.lib=${excalibur-logger.home}
  +excalibur-logger.jar=${excalibur-logger.lib}/excalibur-logger-1.0.jar
  +
  +# ----- Logkit -----
  +logkit.home=${basedir}/../../jakarta-avalon-logkit
  +logkit.lib=${logkit.home}/build/lib
  +logkit.jar=${logkit.lib}/logkit.jar
  +
   # --------------------------------------------------
   
   #  Settings used to configure compile environment
  @@ -62,4 +123,12 @@
   dist.base = distributions
   
   depchecker.prefix=.
  +
  +# project specific properties
  +lib.dir = lib
  +extension.dir = extensions
  +demo.name = demo
  +demo.jar = ${demo.name}.jar
  +
  +
   
  
  
  
  1.4       +1 -1      jakarta-avalon-excalibur/assembly/kernel.sh
  
  Index: kernel.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/kernel.sh,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- kernel.sh	31 Jul 2002 16:30:43 -0000	1.3
  +++ kernel.sh	20 Aug 2002 23:23:07 -0000	1.4
  @@ -1 +1 @@
  -java -Djava.ext.dirs=./extensions -jar ./extensions/merlin.jar src/etc/kernel.xml
  +java -Djava.ext.dirs=./extensions -jar ./extensions/merlin-2.0a.jar src/etc/kernel.xml
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/assembly/merlin.bat
  
  Index: merlin.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/merlin.bat,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- merlin.bat	4 Aug 2002 06:45:12 -0000	1.1
  +++ merlin.bat	20 Aug 2002 23:23:07 -0000	1.2
  @@ -1 +1 @@
  -java -Djava.ext.dirs=.\extensions -jar .\extensions\merlin.jar %1
  +java -Djava.ext.dirs=.\extensions -jar .\extensions\merlin-2.0a.jar %1
  
  
  
  1.36      +3 -3      jakarta-avalon-excalibur/assembly/src/etc/kernel.xml
  
  Index: kernel.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/kernel.xml,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- kernel.xml	19 Aug 2002 23:05:06 -0000	1.35
  +++ kernel.xml	20 Aug 2002 23:23:07 -0000	1.36
  @@ -38,8 +38,8 @@
      </library>
   
      <classpath>
  -     <fileset dir="dist">
  -       <include name="merlin.jar"/>
  +     <fileset dir="build/lib">
  +       <include name="merlin-2.0a.jar"/>
        </fileset>
      </classpath>
   
  @@ -74,7 +74,7 @@
        -->
   
        <classpath>
  -       <fileset dir="dist">
  +       <fileset dir="build/lib">
            <include name="demo.jar"/>
          </fileset>
        </classpath>
  
  
  
  1.15      +4 -3      jakarta-avalon-excalibur/assembly/src/etc/project.mf
  
  Index: project.mf
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/project.mf,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- project.mf	16 Aug 2002 05:16:32 -0000	1.14
  +++ project.mf	20 Aug 2002 23:23:07 -0000	1.15
  @@ -5,13 +5,14 @@
   Specification-Version: 2.0
   Implementation-Vendor: Apache Software Foundation
   Implementation-Version: 2.1
  -Extension-List: framework meta configuration i18n logger extension collections event concurrent context util
  +Extension-List: framework meta container configuration i18n logger extension collections event concurrent context util
   framework-Extension-Name: avalon-framework
   framework-Specification-Version: 1.0
   framework-Implementation-Version: 4.1.2
  -meta-Extension-Name: avalon-meta
  +meta-Extension-Name: excalibur-meta
   meta-Specification-Version: 1.0
  -meta-Implementation-Version: 0.1
  +container-Extension-Name: excalibur-container
  +container-Specification-Version: 1.0
   configuration-Extension-Name: excalibur-configuration
   configuration-Specification-Version: 1.0
   i18n-Extension-Name: excalibur-i18n
  
  
  
  1.13      +6 -6      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/TypeManager.java
  
  Index: TypeManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/TypeManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TypeManager.java	18 Aug 2002 04:20:09 -0000	1.12
  +++ TypeManager.java	20 Aug 2002 23:23:08 -0000	1.13
  @@ -38,10 +38,10 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.extension.Extension;
  -import org.apache.avalon.excalibur.extension.PackageManager;
  -import org.apache.avalon.excalibur.extension.PackageRepository;
  -import org.apache.avalon.excalibur.extension.OptionalPackage;
  -import org.apache.avalon.excalibur.extension.DefaultPackageRepository;
  +import org.apache.avalon.excalibur.packagemanager.PackageManager;
  +import org.apache.avalon.excalibur.packagemanager.ExtensionManager;
  +import org.apache.avalon.excalibur.packagemanager.OptionalPackage;
  +import org.apache.avalon.excalibur.packagemanager.impl.DefaultExtensionManager;
   import org.apache.excalibur.meta.info.Type;
   import org.apache.excalibur.meta.info.ReferenceDescriptor;
   import org.apache.excalibur.meta.info.PhaseDescriptor;
  @@ -226,7 +226,7 @@
               }
   
               File[] files = (File[]) list.toArray( new File[0] );
  -            PackageRepository repository = new DefaultPackageRepository( files );
  +            ExtensionManager repository = new DefaultExtensionManager( files );
               m_manager = new PackageManager( repository );
           }
   
  
  
  
  1.3       +1 -5      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/ContainerFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContainerFactory.java	13 Aug 2002 03:57:56 -0000	1.2
  +++ ContainerFactory.java	20 Aug 2002 23:23:08 -0000	1.3
  @@ -55,10 +55,6 @@
   import org.apache.avalon.framework.service.DefaultServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.Version;
  -import org.apache.avalon.excalibur.extension.PackageRepository;
  -import org.apache.avalon.excalibur.extension.Extension;
  -import org.apache.avalon.excalibur.extension.OptionalPackage;
  -import org.apache.avalon.excalibur.extension.DefaultPackageRepository;
   import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.excalibur.meta.info.Type;
   import org.apache.excalibur.meta.info.ServiceDescriptor;
  
  
  
  1.33      +1 -6      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java
  
  Index: DefaultContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- DefaultContainer.java	13 Aug 2002 03:57:56 -0000	1.32
  +++ DefaultContainer.java	20 Aug 2002 23:23:08 -0000	1.33
  @@ -55,11 +55,6 @@
   import org.apache.avalon.framework.service.DefaultServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.Version;
  -import org.apache.avalon.excalibur.extension.PackageRepository;
  -import org.apache.avalon.excalibur.extension.Extension;
  -import org.apache.avalon.excalibur.extension.OptionalPackage;
  -import org.apache.avalon.excalibur.extension.DefaultPackageRepository;
  -import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.excalibur.meta.info.Type;
   import org.apache.excalibur.meta.info.ServiceDescriptor;
   import org.apache.excalibur.meta.info.DependencyDescriptor;
  
  
  
  1.42      +1 -6      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/kernel/DefaultKernel.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- DefaultKernel.java	20 Aug 2002 03:30:08 -0000	1.41
  +++ DefaultKernel.java	20 Aug 2002 23:23:08 -0000	1.42
  @@ -55,11 +55,6 @@
   import org.apache.avalon.framework.service.DefaultServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.Version;
  -import org.apache.avalon.excalibur.extension.PackageRepository;
  -import org.apache.avalon.excalibur.extension.Extension;
  -import org.apache.avalon.excalibur.extension.OptionalPackage;
  -import org.apache.avalon.excalibur.extension.DefaultPackageRepository;
  -import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.excalibur.configuration.ConfigurationUtil;
   import org.apache.excalibur.meta.info.Type;
   import org.apache.excalibur.meta.info.ServiceDescriptor;
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/resource/DefaultServiceManager.java
  
  Index: DefaultServiceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/resource/DefaultServiceManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultServiceManager.java	12 Aug 2002 08:11:09 -0000	1.1
  +++ DefaultServiceManager.java	20 Aug 2002 23:23:08 -0000	1.2
  @@ -55,7 +55,7 @@
           catch( ResourceException e )
           {
               final String error = "Service resolution failure for role: " + role;
  -            throw new ServiceException( error, e );
  +            throw new ServiceException( role, error, e );
           }
       }
   
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicComponent.java
  
  Index: BasicComponent.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import java.io.File;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  import org.apache.avalon.framework.activity.Disposable;
  
  /**
   * This is a minimal demonstration component that implements the 
   * <code>BasicService</code> interface and has no dependencies.
   *
   * @avalon.type lifestyle="singleton" version="1.4"
   * @avalon.service interface="org.apache.excalibur.playground.BasicService" shareable="true"
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class BasicComponent extends AbstractLogEnabled 
  implements Contextualizable, Configurable, Initializable, Startable, BasicService, Disposable
  {
  
      private String m_location;
      private String m_message;
      private File m_home;
  
      public void contextualize( Context context )
      {
          BasicContextInterface c = (BasicContextInterface) context;
          m_location = c.getLocation();
          m_home = c.getWorkingDirectory();
      }
  
      //=======================================================================
      // Configurable
      //=======================================================================
  
      public void configure( Configuration config )
      {
          getLogger().debug("configure");
          m_message = config.getChild("message").getValue(null);
      }
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize()
      {
          getLogger().debug("initialize");
          getLogger().debug("location: " + m_location );
          getLogger().debug("home: " + m_home );
          getLogger().debug("message: " + m_message );
      }
  
      //=======================================================================
      // Startable
      //=======================================================================
  
      public void start()
      {
          doPrimeObjective();
      }
  
      public void stop()
      {
          getLogger().info("stopping");
      }
  
      public void dispose()
      {
          getLogger().debug( "dispose" );
      }
  
      //=======================================================================
      // BasicService
      //=======================================================================
  
      public void doPrimeObjective()
      {
          getLogger().info( m_message + " from '" + m_location + "'.");
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicComponent.xconfig
  
  Index: BasicComponent.xconfig
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
  The .xconfig file contains the default configuration for the component.
  -->
  
  <configuration>
     <message>Hello.</message>
  </configuration>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicComponent.xinfo
  
  Index: BasicComponent.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  <type>
  
    <component>
      <name>basic</name>
    </component>
  
    <context>
      <entry key="location"/>
      <entry key="home" type="java.io.File"/>
    </context>
  
    <services>
      <service> 
        <reference type="org.apache.excalibur.playground.BasicService"/>
      </service> 
    </services>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicComponent.xprofile
  
  Index: BasicComponent.xprofile
  ===================================================================
  <?xml version="1.0"?>
  
  <profiles>
     
     <!-- 
     A packaged profile is equivalent to a component declaration inside a container, 
     except that it is provided by a component type.  A PACKAGED profiles take priority
     over an IMPLICIT profile. An EXPLICIT profile declared inside a container definition 
     will take priority over PACKAGED profiles.
     -->
   
     <component name="basic">
       <context class="org.apache.excalibur.playground.BasicContext">
         <import key="home" name="avalon:home"/>
         <entry key="location">Paris</entry>
       </context>
     </component>
  
  </profiles>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicContext.java
  
  Index: BasicContext.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import java.util.Map;
  import java.io.File;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.DefaultContext;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  
  /**
   * This is example of a custom context class.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class BasicContext extends DefaultContext implements BasicContextInterface
  {
  
      public BasicContext( Map map, Context parent )
      {
          super( map, parent );
      }
  
      public String getLocation()
      {
          try
          {
              return (String) super.get( "location" );
          }
          catch( Throwable e )
          {
              return "Unknown";
          }
      }
  
      public File getWorkingDirectory()
      {
          try
          {
              return (File) super.get( "home" );
          }
          catch( Throwable e )
          {
              throw new RuntimeException("context object does not provide required home entry.");
          }
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicContextInterface.java
  
  Index: BasicContextInterface.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import java.io.File;
  
  import org.apache.avalon.framework.context.Context;
  
  /**
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public interface BasicContextInterface extends Context
  {
      public String getLocation();
      public File getWorkingDirectory();
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicService.java
  
  Index: BasicService.java
  ===================================================================
  /*
   */
  package org.apache.excalibur.playground;
  
  /**
   * The <code>BasicService</code> executes a prime objective.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public interface BasicService
  {
  
     static final String KEY = "org.apache.excalibur.playground.BasicService";
  
     /**
      * Execute the prime objective of this services.
      */
      void doPrimeObjective();
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ComplexComponent.java
  
  Index: ComplexComponent.java
  ===================================================================
  /*
   * ComplexComponent.java
   */
  
  package org.apache.excalibur.playground;
  
  import org.apache.avalon.framework.activity.Executable;
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.service.Serviceable;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.avalon.framework.service.ServiceException;
  
  /**
   * This is a minimal demonstration component that declares no interface but
   * has dependecies on two services.  These include SimpleService and 
   * BasicService. 
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  
  public class ComplexComponent extends AbstractLogEnabled
  implements Serviceable, Initializable, Startable, Disposable
  {
  
      private ServiceManager m_manager;
      private SimpleService m_simple;
      private BasicService m_basic;
      private Thread m_thread;
      private boolean CONTINUE = false;
  
      //=================================================================
      // Serviceable
      //=================================================================
      
      /**
       * Pass the <code>ServiceManager</code> to the <code>Serviceable</code>.
       * The <code>Serviceable</code> implementation uses the specified
       * <code>ServiceManager</code> to acquire the services it needs for
       * execution.
       *
       * @param manager The <code>ServiceManager</code> which this
       *                <code>Serviceable</code> uses.
       */
      public void service( ServiceManager manager )
      throws ServiceException
      {
          if( getLogger().isDebugEnabled() )
            getLogger().debug("service");
  	  m_manager = manager;
      }
  
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize()
      throws Exception
      {       
          if( getLogger().isDebugEnabled() )
            getLogger().debug("initialize");
  
          //
          // verify current state
          //
  
          if( getLogger() == null ) throw new IllegalStateException(
            "Logging channel has not been assigned.");
  
          if( m_manager == null ) throw new IllegalStateException(
            "Manager has not been declared.");
  
          //
          // lookup the primary service
          //
  
          m_simple = (SimpleService) m_manager.lookup( "simple" );
          m_basic = (BasicService) m_manager.lookup( "basic" );
  
          getLogger().getChildLogger("init").debug("ready");
          if( getLogger().isInfoEnabled() )
            getLogger().info("ready");
      }
  
      //=======================================================================
      // Startable
      //=======================================================================
  
     /**
      */
      public void start() throws Exception
      {
          getLogger().debug( "starting" );
          CONTINUE = true;
          m_thread = new Thread(
            new Runnable() {
              public void run()
              {
                  while( CONTINUE )
                  {
                      try
                      {
                          Thread.currentThread().sleep( 100 );
                      }
                      catch( Throwable e )
                      {
                      }
                  }
              }
            }
          );
          m_thread.start();
          getLogger().debug( "started" );
      }
  
     /**
      */
      public void stop()
      {
          getLogger().debug( "stopping" );
          CONTINUE = false;
          try
          {
              m_thread.join();
          }
          catch( Throwable e )
          {
          }
      }
  
  
      //=======================================================================
      // Disposable
      //=======================================================================
      
      public void dispose()
      {
          if( getLogger().isDebugEnabled() )
            getLogger().debug("dispose");
  
          
          m_manager.release( m_simple );
          m_manager.release( m_basic );
          m_manager = null;
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ComplexComponent.xinfo
  
  Index: ComplexComponent.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  <type>
  
    <component>
      <name>complex</name>
    </component>
  
    <loggers>
       <logger name="init"/>
    </loggers>
  
    <dependencies>
        <dependency>
            <role>basic</role>
            <reference type="org.apache.excalibur.playground.BasicService"/>
        </dependency>
        <dependency>
            <role>simple</role>
            <reference type="org.apache.excalibur.playground.SimpleService"/>
        </dependency>
    </dependencies>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/CustomContainer.java
  
  Index: CustomContainer.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import org.apache.excalibur.merlin.container.DefaultContainer;
  
  /**
   * This is a minimal validation of the creation of a custom container.  More
   * work is need concernin the DefaultContainer API and validation that it provides
   * the necessary protected methods to make a it useful as a base class.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  
  public class CustomContainer extends DefaultContainer 
  {
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize() throws Exception
      {
          getLogger().info("initialization of a custom container");
          super.initialize();
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/CustomContainer.xinfo
  
  Index: CustomContainer.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  <type>
  
    <component>
      <name>custom</name>
    </component>
  
    <context>
      <entry key="merlin:container.descriptor" 
        type="org.apache.excalibur.merlin.model.ContainerDescriptor" />
      <entry key="merlin:container.manager"
        type="org.apache.excalibur.merlin.assembly.ContainerManager"/>
      <entry key="merlin:container.services" type="java.util.Map"/>
      <entry key="merlin:container.state-listener" 
        type="org.apache.excalibur.merlin.container.StateListener" 
        optional="true"/>
      <entry key="merlin:container.container-listener" 
        type="org.apache.excalibur.merlin.container.ContainerListener" 
        optional="true"/>
      <entry key="merlin:container.logging" 
        type="org.apache.excalibur.merlin.assembly.DefaultLoggerManager"/>
    </context>
  
    <services>
      <service>
        <reference type="org.apache.excalibur.merlin.container.Container" version="1.0"/>
      </service>
    </services>
  
    <stages>
       <stage>
          <reference type="org.apache.excalibur.merlin.container.Structural"/>
       </stage>
    </stages>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/CustomContainer.xprofile
  
  Index: CustomContainer.xprofile
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
  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.
  
  @author  Stephen McConnell
  @version 1.0 12/03/2001
  -->
  
  <profiles>
     
     <component name="default">
  
       <categories priority="INFO">
         <category name="loader" priority="WARN"/>
       </categories>
  
       <context>
         <import key="merlin:container.manager"/>
         <import key="merlin:container.descriptor"/>
         <import key="merlin:container.logging"/>
       </context>
  
     </component>
  
  </profiles>
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/DemoManager.java
  
  Index: DemoManager.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Disposable;
  import org.apache.excalibur.container.lifecycle.Creator;
  import org.apache.excalibur.container.lifecycle.Accessor;
  
  /**
   * Definition of an extension type.
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class DemoManager extends AbstractLogEnabled 
    implements Creator, Accessor, Initializable, Disposable
  {
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize()
      {
          getLogger().debug("initializing extension");
      }
  
      //=======================================================================
      // Creator
      //=======================================================================
  
      public void create( Object target, Context context ) throws Exception
      {
          if( target instanceof Demonstratable )
            ((Demonstratable)target).demo( "create id: " 
               + System.identityHashCode( this ) 
               + ", " + Thread.currentThread() );
      }
  
      public void destroy( Object target, Context context )
      {
          if( target instanceof Demonstratable )
            ((Demonstratable)target).demo( "destroy id: " 
               + System.identityHashCode( this ) 
               + ", " + Thread.currentThread() );
      }
  
      public void access( Object target, Context context ) throws Exception
      {
          if( target instanceof Demonstratable )
            ((Demonstratable)target).demo( "access id: " 
               + System.identityHashCode( this ) 
               + ", " + Thread.currentThread() );
      }
  
      public void release( Object target, Context context )
      {
          if( target instanceof Demonstratable )
            ((Demonstratable)target).demo( "release id: " 
               + System.identityHashCode( this ) 
               + ", " + Thread.currentThread() );
      }
  
      //=======================================================================
      // Disposable
      //=======================================================================
  
      public void dispose()
      {
          if( getLogger().isDebugEnabled() )
          {
              getLogger().debug( "dispose" );  
          }
      }
   }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/DemoManager.xinfo
  
  Index: DemoManager.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  
  <!--
  Definition of the extension type phase support.  This demonstrates the 
  use of a lifestyle policy inside an extension handler.
  -->
  
  <type>
  
    <component>
      <name>demonstratable</name>
      <attributes>
        <attribute key="avalon:lifestyle" value="thread"/>
      </attributes>
    </component>
  
    <!--
    Declaration of the lifecycle support phases that this manager provides. 
    -->
    <extensions>
  
      <!--
      Each extension has a name, a versioned interface reference, and optional 
      attributes.
      -->
      <extension stage="ALL">
        <name>demonstrate</name>
        <reference type="org.apache.excalibur.playground.Demonstratable" version="1.0"/>
        <attributes>
          <attribute key="status" value="experimental"/>
        </attributes>
      </extension>
  
    </extensions>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/Demonstratable.java
  
  Index: Demonstratable.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  /**
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public interface Demonstratable 
  {
      void demo( String stage );
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/EmbeddedDemo.java
  
  Index: EmbeddedDemo.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import java.io.File;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.DefaultContext;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.DefaultConfiguration;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  import org.apache.avalon.framework.activity.Disposable;
  
  import org.apache.excalibur.merlin.kernel.Kernel;
  import org.apache.excalibur.merlin.kernel.DefaultKernel;
  import org.apache.excalibur.merlin.container.Container;
  import org.apache.excalibur.merlin.model.ContainerDescriptor;
  import org.apache.excalibur.merlin.model.ClasspathDescriptor;
  import org.apache.excalibur.merlin.model.Profile;
  import org.apache.excalibur.merlin.assembly.ContainerManager;
  import org.apache.excalibur.merlin.container.ContainerFactory;
  import org.apache.excalibur.meta.info.Type;
  import org.apache.excalibur.meta.info.DependencyDescriptor;
  import org.apache.excalibur.meta.info.ReferenceDescriptor;
  
  /**
   * This is a demonstration of the embedding of a new kernel into the container 
   * container this component.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class EmbeddedDemo extends AbstractLogEnabled 
  implements Contextualizable, Configurable, Initializable, Startable, Disposable
  {
      private DefaultKernel m_kernel;
  
      private File m_home;
      private Context m_context;
      private Configuration m_configuration;
  
      private Container m_container;
  
      //=======================================================================
      // Contextualizable
      //=======================================================================
  
      public void contextualize( Context context ) throws ContextException
      {
          m_context = context;
      }
  
      //=======================================================================
      // Configurable
      //=======================================================================
  
      public void configure( Configuration config )
      {
          m_configuration = config;
      }
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize() throws Exception
      {
          getLogger().info("initialize");
  
          //
          // Grap a reference to the container class loader.
          //
  
          ContainerManager manager;
          if( Thread.currentThread().getContextClassLoader() instanceof ContainerManager )
          {
              manager = (ContainerManager) Thread.currentThread().getContextClassLoader();
          }
          else
          {
              final String error = "Attempting to execute demo outside of a container context.";
              throw new IllegalStateException( error );
          }
  
          //
          // Create the kernel with a root container named "work".
          //
  
          getLogger().info("creating kernel");
          m_kernel = new DefaultKernel( );
          DefaultContext context = new DefaultContext( m_context );
          context.put( DefaultKernel.PATH_KEY, "work" );
          m_kernel.contextualize( context );
          m_kernel.configure( m_configuration.getChild("kernel") );
          m_kernel.initialize();
  
          //
          // Get the root container from the kernel we just created.
          //
     
          getLogger().debug("retriving root");
          Container root = m_kernel.getRootContainer();
  
          //
          // Add a container to our root container programatically.  First, 
          // get a container profile using an versioned interface reference then 
          // add this to the root container to define another new sub-container.
          //
  
          getLogger().debug("adding subcontainer: admin");
          Container container = root.addContainer( "admin" );
  
          //
          // Add a component to the container programatically.
          // We can either locate or create a profile - in the following example we will
          // attempt to locate an existing component profile and add it to the container - 
          // if we wanted to we could dynamically build the profile and add it to the 
          // container.
          //
  
          Profile profile = new Profile("simple2", manager.getProfile( 
            new ReferenceDescriptor( "org.apache.excalibur.playground.SimpleService" ) ) );
  
          //
          // install the profile into the container triggering profile assembly
          //
  
          if( profile != null )
          {
              getLogger().info( "dynamic profile: " + profile );
              container.install( new Profile[]{ profile } );
              getLogger().info("installation sucessfull" );
          }
          else
          {
              getLogger().warn("manager return a null profile - cannot proceed");
          }
      }
  
      //=======================================================================
      // Startable
      //=======================================================================
  
      public void start() throws Exception
      {
          getLogger().info("starting");
          m_kernel.start();
      }
  
      public void stop() throws Exception
      {
          getLogger().info("stopping");
          m_kernel.stop();
      }
  
      public void dispose()
      {
          getLogger().debug( "dispose" );
          //m_kernel.dispose();
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/EmbeddedDemo.xconfig
  
  Index: EmbeddedDemo.xconfig
  ===================================================================
  
  <configuration>
  
    <kernel>
      <container name="working">
        <categories priority="INFO">
          <category priority="WARN"  name="loader" />
          <category priority="WARN"  name="kernel" />
        </categories>
      </container>
    </kernel>
  
  </configuration>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/EmbeddedDemo.xinfo
  
  Index: EmbeddedDemo.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  <type>
  
    <component>
      <name>embeddor</name>
    </component>
  
    <context>
      <entry key="avalon:home" type="java.io.File"/>
    </context>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/Exploitable.java
  
  Index: Exploitable.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  /**
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public interface Exploitable 
  {
      public void incarnate();
      public void etherialize();
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ExploitationManager.java
  
  Index: ExploitationManager.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.excalibur.container.lifecycle.Creator;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Disposable;
  
  /**
   * Definition of an extension type.
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class ExploitationManager extends AbstractLogEnabled implements Creator, Initializable, Disposable
  {
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize()
      {
          getLogger().info("initialize");
      }
  
      //=======================================================================
      // Disposable
      //=======================================================================
  
      public void dispose()
      {
          getLogger().info( "dispose" );
      }
  
      //=======================================================================
      // Extension
      //=======================================================================
  
      public void create( Object object, Context context ) throws Exception
      {
          if( object instanceof Exploitable )
            ((Exploitable)object).incarnate();
      }
  
      public void destroy( Object object, Context context )
      {
          if( object instanceof Exploitable )
            ((Exploitable)object).etherialize();
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ExploitationManager.xinfo
  
  Index: ExploitationManager.xinfo
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
  Definition of the extension type phase support.
  -->
  
  <type>
  
    <component>
      <name>exploit</name>
    </component>
  
    <!--
    Declaration of the lifecycle support phases that this manager provides. 
    -->
    <extensions>
  
      <!--
      Each extension has a name, a versioned interface reference, and optional 
      attributes.
      -->
      <extension stage="ALL">
        <name>exploit</name>
        <reference type="org.apache.excalibur.playground.Exploitable" version="1.0"/>
        <attributes>
          <attribute key="status" value="experimental"/>
        </attributes>
      </extension>
  
    </extensions>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/InvalidComponent.java
  
  Index: InvalidComponent.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  /**
   * This is a minimal demonstration component that is declared with an invalid service dependency.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  
  public class InvalidComponent
  {
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/InvalidComponent.xinfo
  
  Index: InvalidComponent.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  <type>
  
    <component>
      <name>invalid</name>
    </component>
  
    <dependencies>
        <dependency>
            <role>silly</role>
            <reference type="org.apache.excalibur.playground.InvalidService"/>
        </dependency>
    </dependencies>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleComponent.java
  
  Index: SimpleComponent.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.service.Serviceable;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.avalon.framework.service.ServiceException;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  import org.apache.avalon.framework.activity.Disposable;
  
  /**
   * This is a minimal demonstration component that a dependency on 
   * BasicService and provides SimpleService.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  
  public class SimpleComponent extends AbstractLogEnabled 
  implements Configurable, Serviceable, Initializable, Startable, SimpleService, Exploitable, Demonstratable, Disposable
  {
  
      private String m_message;
      private BasicService m_basic;
      private Thread m_thread;
      private boolean CONTINUE = false;
  
      //=======================================================================
      // Configurable
      //=======================================================================
  
      public void configure( Configuration config )
      {
          getLogger().debug("configure");
          m_message = config.getChild("message").getValue(null);
      }
  
      //=======================================================================
      // Serviceable
      //=======================================================================
  
      public void service( ServiceManager manager ) throws ServiceException
      {
          getLogger().debug( "service" );
          m_basic = (BasicService) manager.lookup( "basic" );
          manager.release( m_basic );
      }
  
      //=======================================================================
      // Exploitable
      //=======================================================================
  
      public void incarnate() 
      {
          getLogger().info( "incarnation stage" );
      }
  
      public void etherialize()
      {
          getLogger().info( "etherialize stage" );
      }
  
  
      //=======================================================================
      // Demonstratable
      //=======================================================================
  
      public void demo( String message )
      {
          getLogger().info( message );
      }
  
      //=======================================================================
      // Initializable
      //=======================================================================
  
      public void initialize()
      {
          getLogger().debug("initialize");
          doObjective();
      }
  
      //=======================================================================
      // Startable
      //=======================================================================
  
     /**
      */
      public void start() throws Exception
      {
          getLogger().debug( "starting" );
          CONTINUE = true;
          m_thread = new Thread(
            new Runnable() {
              public void run()
              {
                  while( CONTINUE )
                  {
                      try
                      {
                          Thread.currentThread().sleep( 100 );
                      }
                      catch( Throwable e )
                      {
                      }
                  }
              }
            }
          );
          m_thread.start();
          getLogger().debug( "started" );
      }
  
     /**
      */
      public void stop()
      {
          getLogger().debug( "stopping" );
          CONTINUE = false;
          try
          {
              m_thread.join();
          }
          catch( Throwable e )
          {
          }
      }
  
      //=======================================================================
      // Disposable
      //=======================================================================
  
      public void dispose()
      {
          getLogger().debug( "dispose" );
      }
  
      //=======================================================================
      // PrimaryService
      //=======================================================================
  
      public void doObjective()
      {
          getLogger().info( "message: " + m_message );
      }
  
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleComponent.xconfig
  
  Index: SimpleComponent.xconfig
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
  The .xconfig file contains the default configuration for the component.
  -->
  
  <configuration>
     <message>Hello.</message>
  </configuration>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleComponent.xinfo
  
  Index: SimpleComponent.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  <type>
  
    <component>
      <name>simple</name>
    </component>
  
    <services>
      <service> 
        <reference type="org.apache.excalibur.playground.SimpleService"/>
      </service> 
    </services>
  
    <dependencies>
  
        <!-- 
        Declaration of the services that this component type is 
        dependent on.
        -->
        <dependency>
          <role>basic</role>
          <reference type="org.apache.excalibur.playground.BasicService"/>
        </dependency>
  
    </dependencies>
  
    <!-- 
    Declaration of the extended lifecycle phases that this component type will require.  
    Each phase element contains a reference to a lifecycle phase interface that 
    the container has to manage.
    -->
    <stages>
       <stage>
          <reference type="org.apache.excalibur.playground.Exploitable" version="1.0"/>
       </stage>
       <stage>
          <reference type="org.apache.excalibur.playground.Demonstratable"/>
       </stage>
    </stages>
  
  </type>
  
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleService.java
  
  Index: SimpleService.java
  ===================================================================
  /*
   */
  package org.apache.excalibur.playground;
  
  /**
   * The <code>SimpleService</code> executes an objective.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  
  public interface SimpleService
  {
  
      static final String KEY = "org.apache.excalibur.playground.SimpleService";
  
     /**
      * Execute the prime objective of this services.
      */
      void doObjective();
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/TerminalComponent.java
  
  Index: TerminalComponent.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.activity.Disposable;
  
  /**
   * This is a minimal demonstration component that provides BasicService 
   * and has no dependencies
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  
  public class TerminalComponent extends AbstractLogEnabled
  implements BasicService, Disposable
  {
  
      //=======================================================================
      // BasicService
      //=======================================================================
  
      public void doPrimeObjective()
      {
          getLogger().info("hello from TerminalComponent");
      }
  
      public void dispose()
      {
          getLogger().debug( "dispose" );
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/TerminalComponent.xinfo
  
  Index: TerminalComponent.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Component Type DTD Version 1.0//EN"
               "http://jakarta.apache.org/avalon/type_1_0.dtd" >
  
  <type>
  
    <component>
      <name>terminal-component</name>
    </component>
  
    <services>
        <service> 
            <reference type="org.apache.excalibur.playground.BasicService"/>
        </service> 
    </services>
  
  </type>
  
  
  
  

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