mcconnell    2004/04/18 03:51:56

  Modified:    tutorials .cvsignore README.TXT maven.xml
               tutorials/context/strategy index.ent
               tutorials/dynamics index.ent
               tutorials/dynamics/src/java/tutorial HelloFacility.java
               tutorials/jmx index.ent
               tutorials/lifecycle/activation index.ent
               tutorials/parameterization index.ent
  Added:       tutorials project.xml
  Log:
  Bring tutorial package into buildable state.
  
  Revision  Changes    Path
  1.2       +2 -0      avalon/tutorials/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore        24 Sep 2003 09:33:40 -0000      1.1
  +++ .cvsignore        18 Apr 2004 10:51:55 -0000      1.2
  @@ -3,3 +3,5 @@
   build
   target
   tutorial.jar
  +build.properties
  +build.xml
  \ No newline at end of file
  
  
  
  1.4       +38 -21    avalon/tutorials/README.TXT
  
  Index: README.TXT
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/README.TXT,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- README.TXT        15 Apr 2004 11:53:28 -0000      1.3
  +++ README.TXT        18 Apr 2004 10:51:55 -0000      1.4
  @@ -5,27 +5,37 @@
   A set of buildable and executable projects that demonstrate
   different features of the Merlin platform.
   
  - * hello         - a very simple single component
  -                   demloyment example
  + * hello             - a very simple single component
  +                       demloyment example
   
  - * configuration - using default configurations, 
  -                   explicit deployment configuations,
  -                   and overriding configurations
  -
  - * context       - using standard context entries, 
  -                   constructed context values, 
  -                   volatile context entries, type-safe
  -                   context casting, and plugin context
  -                   strategy handlers.
  -
  - * dependencies  - demonstration of service dependecy 
  -                   and service provision declaration using
  -                   javadoc tags, auto assembly features, 
  -                   and orderly deployment and decommissioning
  -                   behaviour.
  + * configuration     - using default configurations, 
  +                       explicit deployment configuations,
  +                       and overriding configurations
  + 
  + * context           - using standard context entries, 
  +                       constructed context values, 
  +                       volatile context entries, type-safe
  +                       context casting, and plugin context
  +                       strategy handlers.
  +
  + * dependencies      - demonstration of service dependecy 
  +                       and service provision declaration using
  +                       javadoc tags, auto assembly features, 
  +                       and orderly deployment and decommissioning
  +                       behaviour.
  +
  + * dynamics          - demonstrating dynamic component model 
  +                       resolution and instance activation
  +
  + * lifecycle         - lifecycle extension examples
  +
  + * main              - merlin embedded in a main method
   
  - * composition   - creation of virtual components by 
  -                   composition
  + * parameterization  - demonstration of the parameterizable 
  +                       lifecycle stage
  +
  + * composition       - creation of virtual components by 
  +                       composition
   
   Unless noted in a project readme, demonstrations can be built
   using the following command (assuming you have installed 
  @@ -40,7 +50,13 @@
   readme.txt for additional details).
    
     $ cd [a-tutorial-containing-a-project.xml]
  +
  +then:
  +
     $ merlin -execute target\classes
  +
  +or:
  +
     $ merlin -execute target\<jar-name>.jar
   
   Alternatively, demonstrations can be built and deployed 
  @@ -49,6 +65,7 @@
     $ cd [a-tutorial-containing-a-project.xml]
     $ maven demo
   
  -Additional tutorials are in preparation. Questions and comments
  -should be directed to [EMAIL PROTECTED]
  +Additional tutorials are in constant preparation. 
  +Questions and comments should be directed to 
  [EMAIL PROTECTED]
   
  
  
  
  1.4       +111 -12   avalon/tutorials/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/maven.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- maven.xml 14 Apr 2004 23:52:23 -0000      1.3
  +++ maven.xml 18 Apr 2004 10:51:55 -0000      1.4
  @@ -1,9 +1,119 @@
   <project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" 
xmlns:util="jelly:util" xmlns:ant="jelly:ant">
   
  +  <!--
  +  ==============================================================================
  +  build the tutorials and generate a clean copy for publication 
  +  ==============================================================================
  +  -->
  +
  +  <goal name="avalon:clean" 
  +       description="Clean." >
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="**/project.xml"
  +      excludes="project.xml,**/target/**"
  +      goals="clean:clean" 
  +      banner="Clean:"
  +      ignoreFailures="false" 
  +      postProcessing="false" />
  +  </goal>
  +
  +  <goal name="avalon:build" 
  +       description="Build and generate a clean tutorial package." >
  +
  +    <maven:reactor
  +      basedir="${basedir}"
  +      includes="**/project.xml"
  +      excludes="project.xml,**/target/**,**/mixed/**,**/jmx/**,**/security/**"
  +      goals="xgen" 
  +      banner="Generation:"
  +      ignoreFailures="false" 
  +      postProcessing="true" />
  +
  +    <!-- 
  +    copy the generated target/package directory to the 
  +    local target/tutorials directory 
  +    -->
  +
  +    <j:set var="tutorialsDir" value="${basedir}"/>
  +    <j:set var="tutorialsLen" value="${tutorialsDir.length()}"/>
  +    <j:forEach var="child" items="${reactorProjects}">
  +      <j:set var="pkgPath" value="${child.file.parentFile.path}"/>
  +      <j:set var="pkgLen" value="${pkgPath.length()}"/>
  +      <j:set var="packageName" value="${pkgPath.substring( tutorialsLen )}"/>
  +      <ant:copy toDir="${basedir}/target/tutorials${packageName}">
  +        <fileset dir="${child.file.parentFile}/target/package"/>
  +      </ant:copy>
  +    </j:forEach>
  +
  +    <!-- 
  +    copy the generated target/package directory to the 
  +    local target/tutorials directory 
  +    -->
  +
  +    <ant:copy toFile="${maven.build.dir}/tutorials/maven.xml"
  +       file="${basedir}/maven-template.xml"/>
  +    <ant:copy toFile="${maven.build.dir}/tutorials/master.xml"
  +       file="${basedir}/master.xml"/>
  +    <ant:copy todir="${maven.build.dir}/tutorials">
  +      <fileset dir="${basedir}">
  +        <include name="**/README.TXT"/>
  +        <exclude name="target/**"/>
  +      </fileset>
  +    </ant:copy>
  +
  +  </goal>
  +
  +  <goal name="avalon:dist" prereqs="avalon:build">
  +
  +    <j:set var="tutorial.name" value="${maven.final.name}"/>
  +    <ant:echo>Building tutorial kit: ${tutorial.name}</ant:echo>
  +    <ant:zip zipfile="${maven.build.dir}/${tutorial.name}.zip">
  +      <zipfileset dir="${basedir}/target/tutorials" prefix="tutorial"/>
  +    </ant:zip>
  +    <checksum file="${maven.build.dir}/${tutorial.name}.zip" fileext=".md5" />
  +    <j:if test="${maven_gpg_exe != null}">
  +      <ant:exec executable="${maven_gpg_exe}">
  +        <ant:arg value="-a"/>
  +        <ant:arg value="-b"/>
  +        <ant:arg value="${maven.build.dir}/${tutorial.name}.zip"/>
  +      </ant:exec>
  +    </j:if>
  +
  +    <ant:tar longfile="gnu" tarfile="${maven.build.dir}/${tutorial.name}.tar">
  +      <tarfileset dir="${basedir}/target/tutorials" prefix="tutorial"/>
  +    </ant:tar>
  +    <ant:gzip 
  +      zipfile="${maven.build.dir}/${tutorial.name}.tar.gz"
  +      src="${maven.build.dir}/${tutorial.name}.tar"/>
  +    <ant:delete file="${maven.build.dir}/${tutorial.name}.tar"/>
  +    <checksum file="${maven.build.dir}/${tutorial.name}.tar.gz" fileext=".md5" />
  +    <j:if test="${maven_gpg_exe != null}">
  +      <ant:exec executable="${maven_gpg_exe}">
  +        <ant:arg value="-a"/>
  +        <ant:arg value="-b"/>
  +        <ant:arg value="${maven.build.dir}/${tutorial.name}.tar.gz"/>
  +      </ant:exec>
  +    </j:if>
  +
  +  </goal>
  +
  +  <!--
  +  ==============================================================================
  +  common pre and post goals
  +  ==============================================================================
  +  -->
  +
     <preGoal name="java:compile">
       <attainGoal name="avalon:meta"/>
     </preGoal>
   
  +  <!--
  +  ==============================================================================
  +  utilities
  +  ==============================================================================
  +  -->
  +
     <goal name="demo" prereqs="jar:install">
       <j:set var="demo.target" 
value="${maven.build.dir}/classes/BLOCK-INF/block.xml"/>
       <util:file var="target" name="${demo.target}"/>
  @@ -12,18 +122,6 @@
       </j:if>
     </goal>
   
  -  <goal name="avalon:demo" 
  -       description="Build and execute." >
  -    <maven:reactor
  -      basedir="${basedir}"
  -      includes="platform/tutorials/**/project.xml"
  -      
excludes="platform/tutorials/project.xml,**/target/**,platform/tutorials/mixed/**,platform/tutorials/jmx/**,platform/tutorials/security/**"
  -      goals="demo" 
  -      banner="Build and execute:"
  -      ignoreFailures="false" 
  -      postProcessing="false" />
  -  </goal>
  -
     <goal name="xgen" prereqs="jar:install">
       <ant:mkdir dir="${maven.build.dir}/package"/>
       <ant:copy toDir="${maven.build.dir}/package">
  @@ -47,4 +145,5 @@
         </ant:xslt>
       </j:if>
     </goal>
  +
   </project>
  
  
  
  1.3       +5 -61     avalon/tutorials/project.xml
  
  
  
  
  1.3       +1 -1      avalon/tutorials/context/strategy/index.ent
  
  Index: index.ent
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/context/strategy/index.ent,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.ent 8 Apr 2004 11:58:32 -0000       1.2
  +++ index.ent 18 Apr 2004 10:51:56 -0000      1.3
  @@ -1 +1 @@
  -<!ENTITY % merlin-entities SYSTEM 
"file:../../../../../versioning/avalon-merlin.ent"> %merlin-entities;
  +<!ENTITY % merlin-entities SYSTEM "file:../../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  
  
  
  1.4       +2 -2      avalon/tutorials/dynamics/index.ent
  
  Index: index.ent
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/dynamics/index.ent,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- index.ent 14 Apr 2004 22:18:55 -0000      1.3
  +++ index.ent 18 Apr 2004 10:51:56 -0000      1.4
  @@ -1,2 +1,2 @@
  -<!ENTITY % merlin-entities SYSTEM "file:../../../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  -<!ENTITY % meta-entities SYSTEM "file:../../../../versioning/avalon-meta.ent"> 
%meta-entities;
  +<!ENTITY % merlin-entities SYSTEM "file:../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  +<!ENTITY % meta-entities SYSTEM "file:../../versioning/avalon-meta.ent"> 
%meta-entities;
  
  
  
  1.8       +5 -16     avalon/tutorials/dynamics/src/java/tutorial/HelloFacility.java
  
  Index: HelloFacility.java
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/dynamics/src/java/tutorial/HelloFacility.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HelloFacility.java        24 Feb 2004 23:57:38 -0000      1.7
  +++ HelloFacility.java        18 Apr 2004 10:51:56 -0000      1.8
  @@ -38,7 +38,7 @@
    * @avalon.component name="hello" lifestyle="singleton"
    */
   public class HelloFacility 
  -  implements Contextualizable, Executable
  +  implements Executable
   {
   
      //---------------------------------------------------------
  @@ -65,28 +65,17 @@
   
     /**
      * Creation of a new hello facility.
  -   * @param logger a logging channel
  -   */
  -   public HelloFacility( Logger logger )
  -   {
  -       m_logger = logger;
  -   }
  -
  -   //---------------------------------------------------------
  -   // Contextualizable
  -   //---------------------------------------------------------
  -
  -  /**
  -   * Contextulaization of the facility by the container during 
  -   * which we are supplied with the root containment model.
      *
  +   * @param logger a logging channel
      * @param context the supplied context
      * @avalon.entry key="urn:composition:containment.model" 
      *    type="org.apache.avalon.composition.model.ContainmentModel" 
      * @exception ContextException if a contextualization error occurs
      */
  -   public void contextualize( Context context ) throws ContextException
  +   public HelloFacility( Logger logger, Context context ) 
  +     throws ContextException
      {
  +       m_logger = logger;
          m_model = 
            (ContainmentModel) context.get( 
              "urn:composition:containment.model" );
  
  
  
  1.3       +1 -1      avalon/tutorials/jmx/index.ent
  
  Index: index.ent
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/jmx/index.ent,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.ent 8 Apr 2004 11:58:32 -0000       1.2
  +++ index.ent 18 Apr 2004 10:51:56 -0000      1.3
  @@ -1 +1 @@
  -<!ENTITY % merlin-entities SYSTEM "file:../../../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  +<!ENTITY % merlin-entities SYSTEM "file:../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  
  
  
  1.3       +1 -1      avalon/tutorials/lifecycle/activation/index.ent
  
  Index: index.ent
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/lifecycle/activation/index.ent,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.ent 8 Apr 2004 11:58:32 -0000       1.2
  +++ index.ent 18 Apr 2004 10:51:56 -0000      1.3
  @@ -1 +1 @@
  -<!ENTITY % merlin-entities SYSTEM 
"file:../../../../../versioning/avalon-merlin.ent"> %merlin-entities;
  +<!ENTITY % merlin-entities SYSTEM "file:../../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  
  
  
  1.3       +1 -1      avalon/tutorials/parameterization/index.ent
  
  Index: index.ent
  ===================================================================
  RCS file: /home/cvs/avalon/tutorials/parameterization/index.ent,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.ent 8 Apr 2004 11:58:33 -0000       1.2
  +++ index.ent 18 Apr 2004 10:51:56 -0000      1.3
  @@ -1 +1 @@
  -<!ENTITY % merlin-entities SYSTEM "file:../../../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  +<!ENTITY % merlin-entities SYSTEM "file:../../versioning/avalon-merlin.ent"> 
%merlin-entities;
  
  
  

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

Reply via email to