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/meta/src/java/org/apache/avalon/playground Primary.java PrimaryService.java Secondary.java SecondaryService.java
Date Thu, 12 Jun 2003 07:44:41 GMT
mcconnell    2003/06/12 00:44:41

  Added:       merlin/merlin-platform/tutorials/meta .cvsignore README.TXT
                        maven.xml project.xml
               merlin/merlin-platform/tutorials/meta/src/java/org/apache/avalon/playground
                        Primary.java PrimaryService.java Secondary.java
                        SecondaryService.java
  Log:
  Addition of a meta tags demonstration.
  
  Revision  Changes    Path
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/meta/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  target
  maven.log
  velocity.log
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/meta/README.TXT
  
  Index: README.TXT
  ===================================================================
  
  Meta Generation
  ---------------
  
  This tutorial demonstrates the creation of meta-info tags and subsequent deployment of a
container using the component types declared with the meta.
  
  $ maven clean
  $ maven
  
  The maven run will build and deploy the resulting component model.
  During deployment you should see the following log messages.
  
  [INFO   ] (primary): ready
  [INFO   ] (secondary): logging established
  [INFO   ] (secondary.system): primary service resolved
  
  Steve.
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/meta/maven.xml
  
  Index: maven.xml
  ===================================================================
  <project default="java:jar" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util">
  
    <preGoal name="java:compile">
      <attainGoal name="merlin:meta"/>
    </preGoal>
  
    <postGoal name="jar:jar">
      <attainGoal name="merlin:deploy"/>
    </postGoal>
  
  </project>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/meta/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
  
    <groupId>test</groupId>
    <id>plugin-test</id>
    <name>Merlin Plugin Test</name>
    <package>org.apache.avalon.playground</package>
  
    <currentVersion>1.0</currentVersion>
    <inceptionYear>2003</inceptionYear>
    <shortDescription>Test for the Merlin Plugin.</shortDescription>
  
    <developers>
      <developer>
        <name>Stephen McConnell</name>
        <id>mcconnell</id>
        <email>mcconnell@apache.org</email>
        <organization>OSM</organization>
        <roles>
          <role>Architecture and development.</role>
        </roles>
      </developer>
    </developers>
  
    <dependencies>
      <dependency>
        <groupId>avalon</groupId>
        <artifactId>avalon-framework</artifactId>
        <version>4.1.4</version>
      </dependency>
    </dependencies>
    
    <build>
  
      <sourceDirectory>${basedir}/src/java</sourceDirectory>
      <unitTestSourceDirectory></unitTestSourceDirectory>
      <unitTest></unitTest>
      <testResources></testResources>
      <integrationUnitTestPatterns></integrationUnitTestPatterns>
  
      <resources>
        <resource>
          <directory>${basedir}/src/java</directory> 
          <includes>
            <include>**/*.properties</include>
          </includes>
        </resource>
        <resource>
          <directory>${maven.build.src}</directory> 
          <includes>
            <include>**/*.x*</include>
          </includes>
        </resource>
        <resource>
          <directory>${maven.conf.dir}</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/meta/src/java/org/apache/avalon/playground/Primary.java
  
  Index: Primary.java
  ===================================================================
  
  package org.apache.avalon.playground;
  
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  /**
   * @avalon.meta.version 1.3
   * @avalon.meta.name primary-component
   * @avalon.meta.lifestyle singleton
   * @avalon.meta.service type="org.apache.avalon.playground.PrimaryService:9.8"
   * @todo Verify class level todo.
   */
  public class Primary extends AbstractLogEnabled 
    implements PrimaryService, Contextualizable
  {
     /**
      * @avalon.meta.entry key="urn:avalon:home" 
      *    type="java.io.File"
      */
      public void contextualize( Context context ) throws ContextException
      {
          getLogger().info( "ready" );
      }
  }
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/meta/src/java/org/apache/avalon/playground/PrimaryService.java
  
  Index: PrimaryService.java
  ===================================================================
  
  package org.apache.avalon.playground;
  
  /**
   * An interface representing a service.
   *
   * @avalon.meta.version 9.8
   * @avalon.meta.attribute key="status" value="test"
   */
  public interface PrimaryService
  {
  }
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/meta/src/java/org/apache/avalon/playground/Secondary.java
  
  Index: Secondary.java
  ===================================================================
  
  package org.apache.avalon.playground;
  
  import org.apache.avalon.framework.logger.Logger;
  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;
  
  /**
   * @avalon.meta.name secondary-component
   * @avalon.meta.version 2.4
   * @avalon.meta.service type="org.apache.avalon.playground.SecondaryService:0.1"
   */
  public class Secondary extends AbstractLogEnabled 
  implements Serviceable, SecondaryService
  {
      private Logger m_system = null;
  
      private PrimaryService m_primary = null;
  
     /**
      * Supply of a logging channel to the component.
      * @param logger the logging channel
      * @avalon.meta.logger name="system"
      */
      public void enableLogging( Logger logger )
      {
          super.enableLogging( logger );
          m_system = logger.getChildLogger( "system" );
          logger.info( "logging established" );
      }
  
     /**
      * Supply of dependent services to this component by the container.
      * @param manager the service manager
      * @avalon.meta.dependency type="org.apache.avalon.playground.PrimaryService:9.8" key="primary"
      */
      public void service( ServiceManager manager ) throws ServiceException
      {
          m_primary = (PrimaryService) manager.lookup( "primary" );
          m_system.info( "primary service resolved" );
      }
  }
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-platform/tutorials/meta/src/java/org/apache/avalon/playground/SecondaryService.java
  
  Index: SecondaryService.java
  ===================================================================
  
  package org.apache.avalon.playground;
  
  /**
   * An interface representing a service.
   * @avalon.meta.version 0.1
   */
  public interface SecondaryService
  {
  }
  
  

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


Mime
View raw message