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/10/03 16:42:34 UTC
cvs commit: avalon/merlin/platform/tutorials/profiles/src/java/tutorial HelloComponent.java RandomGeneratorProvider.java HelloComponent.xinfo RandomGeneratorProvider.xinfo
mcconnell 2003/10/03 07:42:34
Modified: merlin/platform/tutorials/profiles/src/java/tutorial
HelloComponent.java RandomGeneratorProvider.java
Added: merlin/platform/tutorials/profiles .cvsignore project.xml
merlin/platform/tutorials/profiles/conf block.xml
Removed: merlin/platform/tutorials/profiles/src/config block.xml
merlin/platform/tutorials/profiles/src/java/tutorial
HelloComponent.xinfo RandomGeneratorProvider.xinfo
Log:
Bring propfile tutorial up-to-date (added meta tags and maven build).
Revision Changes Path
1.1 avalon/merlin/platform/tutorials/profiles/.cvsignore
Index: .cvsignore
===================================================================
maven.log
velocity.log
build
target
tutorial.jar
1.1 avalon/merlin/platform/tutorials/profiles/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>${basedir}/../project.xml</extend>
<id>merlin-tutorial-profile</id>
<name>Merlin Profiles Tutorial</name>
<package>tutorial</package>
<currentVersion>1.0</currentVersion>
<inceptionYear>2003</inceptionYear>
<shortDescription>Test for the Merlin Profile Management.</shortDescription>
<dependencies>
<dependency>
<groupId>avalon-framework</groupId>
<artifactId>avalon-framework-api</artifactId>
<version>4.1.5</version>
</dependency>
<dependency>
<groupId>avalon-framework</groupId>
<artifactId>avalon-framework-impl</artifactId>
<version>4.1.5</version>
</dependency>
</dependencies>
</project>
1.1 avalon/merlin/platform/tutorials/profiles/conf/block.xml
Index: block.xml
===================================================================
<container name="tutorial">
<classloader>
<classpath>
<repository>
<resource id="avalon-framework:avalon-framework-impl" version="4.1.5"/>
</repository>
</classpath>
</classloader>
<component name="hello" class="tutorial.HelloComponent" activation="startup"/>
</container>
1.2 +9 -1 avalon/merlin/platform/tutorials/profiles/src/java/tutorial/HelloComponent.java
Index: HelloComponent.java
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/tutorials/profiles/src/java/tutorial/HelloComponent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HelloComponent.java 24 Sep 2003 09:34:07 -0000 1.1
+++ HelloComponent.java 3 Oct 2003 14:42:34 -0000 1.2
@@ -5,6 +5,12 @@
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.ServiceException;
+/**
+ * A demonstration component that is dependent on a random number
+ * service that will be located and constructed using a packaged profile.
+ *
+ * @avalon.component name="hello" lifestyle="singleton"
+ */
public class HelloComponent extends AbstractLogEnabled
implements Serviceable
{
@@ -13,11 +19,13 @@
* Servicing of the component by the container during
* which service dependencies declared under the component
* can be resolved using the supplied service manager.
+ *
+ * @avalon.dependency type="tutorial.RandomGenerator" key="random"
*/
public void service( ServiceManager manager )
throws ServiceException
{
RandomGenerator random = (RandomGenerator) manager.lookup( "random" );
- getLogger().info( "random: " + random.getRandom() );
+ getLogger().info( "resolved random: " + random.getRandom() );
}
}
1.2 +3 -0 avalon/merlin/platform/tutorials/profiles/src/java/tutorial/RandomGeneratorProvider.java
Index: RandomGeneratorProvider.java
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/tutorials/profiles/src/java/tutorial/RandomGeneratorProvider.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RandomGeneratorProvider.java 24 Sep 2003 09:34:07 -0000 1.1
+++ RandomGeneratorProvider.java 3 Oct 2003 14:42:34 -0000 1.2
@@ -10,6 +10,9 @@
/**
* An implementation of a random number generator.
+ *
+ * @avalon.component name="random-provider" lifestyle="singleton"
+ * @avalon.service type="tutorial.RandomGenerator"
*/
public class RandomGeneratorProvider extends AbstractLogEnabled
implements Configurable, RandomGenerator
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org