avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/src/java/tutorial HelloComponent.java
Date Mon, 18 Aug 2003 18:05:17 GMT
mcconnell    2003/08/18 11:05:17

  Modified:    merlin/merlin-platform/tutorials/context_custom/src/java/tutorial
                        HelloComponent.java
  Added:       merlin/merlin-platform/tutorials/context_custom .cvsignore
                        README.TXT maven.xml project.xml
               merlin/merlin-platform/tutorials/context_custom/conf
                        block.xml
  Removed:     merlin/merlin-platform/tutorials/context_custom build.xml
               merlin/merlin-platform/tutorials/context_custom/src/config
                        block.xml
  Log:
  Migrate from ant to maven.
  
  Revision  Changes    Path
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  maven.log
  velocity.log
  build
  target
  tutorial.jar
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/README.TXT
  
  Index: README.TXT
  ===================================================================
  
  Typesafe context casting
  ------------------------
  
  This tutorial covers the declaration of custom constructed context entry.
  
  $ maven
  $ merlin -execute target\classes
  
  [INFO   ] (tutorial.hello): result: 10.5
  
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/maven.xml
  
  Index: maven.xml
  ===================================================================
  <project default="jar:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util">
  
    <preGoal name="java:compile">
      <attainGoal name="avalon:meta"/>
    </preGoal>
  
  </project>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
  
    <groupId>merlin</groupId>
    <id>merlin-tutorial-context-constructed</id>
    <name>Merlin Context Constuctor Tutorial</name>
    <package>tutorial</package>
  
    <currentVersion>1.0</currentVersion>
    <inceptionYear>2003</inceptionYear>
    <shortDescription>Merlin Context Constuctor Tutorial.</shortDescription>
  
    <dependencies>
      <dependency>
        <groupId>avalon-framework</groupId>
        <artifactId>avalon-framework-api</artifactId>
        <version>SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>avalon-framework</groupId>
        <artifactId>avalon-framework-impl</artifactId>
        <version>SNAPSHOT</version>
      </dependency>
    </dependencies>
    
    <build>
  
      <sourceDirectory>${basedir}/src/java</sourceDirectory>
  
      <resources>
        <resource>
          <directory>${basedir}/conf</directory>
          <targetPath>BLOCK-INF</targetPath>
          <includes>
            <include>block.xml</include>
          </includes>
        </resource>
      </resources>
  
      <jars></jars>
  
    </build>
  
  </project>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/conf/block.xml
  
  Index: block.xml
  ===================================================================
  
  <container name="tutorial">
  
       <component name="hello" class="tutorial.HelloComponent">
         <context>
           <entry key="cruncher">
             <constructor class="tutorial.NumberCruncher">
               <param class="java.lang.Integer">7</param>
               <param class="java.lang.Double">1.5</param>
             </constructor>
           </entry>
         </context>
       </component>
  
  </container>
  
  
  
  1.2       +8 -0      avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/src/java/tutorial/HelloComponent.java
  
  Index: HelloComponent.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/tutorials/context_custom/src/java/tutorial/HelloComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HelloComponent.java	10 Jun 2003 02:12:23 -0000	1.1
  +++ HelloComponent.java	18 Aug 2003 18:05:17 -0000	1.2
  @@ -5,6 +5,11 @@
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   
  +/**
  + * Demonstration of a component that uses a constructed context entry.
  + * 
  + * @avalon.component name="demo"
  + */
   public class HelloComponent extends AbstractLogEnabled 
     implements Contextualizable
   {
  @@ -13,6 +18,9 @@
       * Contextualization of the component by the container.
       * The context supplied by the container shall contain
       * a NumberCruncher instance as declared in the xinfo resource.
  +    *
  +    * @avalon.context
  +    * @avalon.entry key="cruncher" type="tutorial.NumberCruncher"
       */
       public void contextualize( Context context )
         throws ContextException
  
  
  

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


Mime
View raw message