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 2003/04/04 13:58:44 UTC

cvs commit: avalon-sandbox/merlin/merlin-smp/src/tutorial/001/src/java/tutorial HelloComponent.java HelloComponent.xinfo

mcconnell    2003/04/04 03:58:44

  Added:       merlin/merlin-smp/src/tutorial/001 .cvsignore build.xml
               merlin/merlin-smp/src/tutorial/001/src/config block.xml
               merlin/merlin-smp/src/tutorial/001/src/java/tutorial
                        HelloComponent.java HelloComponent.xinfo
  Log:
  Tutorial content for lesson 001.
  
  Revision  Changes    Path
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/001/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  build
  logs
  tutorial.jar
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/001/build.xml
  
  Index: build.xml
  ===================================================================
  
  <!-- 
  Test application
  -->
  
  <project name="tutorial" default="jar" basedir=".">
  
    <property name="src.dir"  value="${basedir}/src" />
    <property name="java.dir"  value="${src.dir}/java" />
    <property name="config.dir"  value="${src.dir}/config" />
    <property name="build.dir"  value="${basedir}/build" />
    <property name="classes.dir"  value="${build.dir}/classes" />
  
    <property environment="env"/>
    <property name="merlin.home"  value="${env.MERLIN_HOME}"/>
  
    <property name="framework.jar"
      value="${merlin.home}/lib/shared/avalon-framework-4.1.4.jar" />
  
    <path id="project.class.path">
      <pathelement path="${java.class.path}" />
      <pathelement location="${framework.jar}"/>
      <fileset dir="${classes.dir}"/>
    </path>
  
    <target name="compile" >
      <mkdir dir="${classes.dir}" />
      <copy toDir="${classes.dir}">
        <fileset dir="${java.dir}">
          <include name="**/*.xinfo"/>
        </fileset>
      </copy>
      <mkdir dir="${classes.dir}/BLOCK-INF" />
      <copy toDir="${classes.dir}/BLOCK-INF">
        <fileset dir="${config.dir}">
          <include name="block.xml"/>
        </fileset>
      </copy>
      <javac debug="on" destdir="${classes.dir}" >
          <classpath>
            <path refid="project.class.path"/>
  	  </classpath>
          <src path="${src.dir}" />
      </javac>
    </target>
  
    <target name="jar" depends="compile">
      <jar jarfile="tutorial.jar" basedir="${classes.dir}"/>
    </target>
  
    <target name="clean">
      <delete dir="${build.dir}"/>
      <delete file="tutorial.jar"/>
    </target>
  
   </project>
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/001/src/config/block.xml
  
  Index: block.xml
  ===================================================================
  
  <block name="tutorial">
     <container>
       <component name="hello" class="tutorial.HelloComponent" activation="startup"/>
    </container>
  </block>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/001/src/java/tutorial/HelloComponent.java
  
  Index: HelloComponent.java
  ===================================================================
  
  package tutorial;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.activity.Initializable;
  
  public class HelloComponent extends AbstractLogEnabled implements Initializable
  {
     /**
      * Initialization of the component by the container.
      * @exception Exception if an initialization error occurs
      */
      public void initialize() throws Exception
      {
          getLogger().info( "I've been initialized!" );
      }
  }
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-smp/src/tutorial/001/src/java/tutorial/HelloComponent.xinfo
  
  Index: HelloComponent.xinfo
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE type
        PUBLIC "-//AVALON/Type DTD Version 1.0//EN"
               "http://avalon.apache.org/dtds/meta/type_1_1.dtd" >
  <type>
    <info>
      <name>hello</name>
      <version>1.0</version>
    </info>
  </type>
  
  
  

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