mcconnell 2003/10/04 02:57:34
Modified: merlin/platform/xdocs/starting/advanced index.xml
navigation.xml profiles.xml
Added: merlin/platform/xdocs/starting/advanced selection.xml
Removed: merlin/platform/xdocs/starting/advanced selectors.xml
Log:
Update profile selection tutorial documetation.
Revision Changes Path
1.3 +2 -2 avalon/merlin/platform/xdocs/starting/advanced/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/xdocs/starting/advanced/index.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- index.xml 2 Oct 2003 08:00:22 -0000 1.2
+++ index.xml 4 Oct 2003 09:57:34 -0000 1.3
@@ -72,8 +72,8 @@
<td>Creating and associating a deployment template with a
component.</td>
</tr>
<tr>
- <td><a href="selectors.html">Profile Selectors</a></td>
- <td>Using profile selectors to influence and/or override the assembly
process.</td>
+ <td><a href="selection.html">Profile Selection</a></td>
+ <td>Demonstration of the selection of a packaged profile by name.</td>
</tr>
<tr>
<td><a href="includes.html">Block Includes</a></td>
1.3 +1 -1 avalon/merlin/platform/xdocs/starting/advanced/navigation.xml
Index: navigation.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/xdocs/starting/advanced/navigation.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- navigation.xml 2 Oct 2003 08:01:42 -0000 1.2
+++ navigation.xml 4 Oct 2003 09:57:34 -0000 1.3
@@ -70,7 +70,7 @@
<item name="Lifecycle Extensions"
href="/starting/advanced/lifecycle/index.html"/>
<item name="Contextualization" href="/starting/advanced/context.html"/>
<item name="Deployment Templates"
href="/starting/advanced/profiles.html"/>
- <item name="Profile Selectors" href="/starting/advanced/selectors.html"/>
+ <item name="Profile Selection" href="/starting/advanced/selection.html"/>
<item name="Includes" href="/starting/advanced/includes.html"/>
<item name="Composition" href="/starting/advanced/composite.html"/>
<item name="Containers" href="/starting/advanced/containers.html"/>
1.2 +10 -8 avalon/merlin/platform/xdocs/starting/advanced/profiles.xml
Index: profiles.xml
===================================================================
RCS file: /home/cvs/avalon/merlin/platform/xdocs/starting/advanced/profiles.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- profiles.xml 24 Sep 2003 09:35:19 -0000 1.1
+++ profiles.xml 4 Oct 2003 09:57:34 -0000 1.2
@@ -141,25 +141,27 @@
Build and run the tutorial.
</p>
<source>
-$ ant
-$ merlin build\classes
+$ maven jar
+$ merlin -execute target\classes
</source>
<p>
In the logging output we see that Merlin has automatically locating the
RandomGeneratorProvider using the packaged profile.
</p>
<source>
-[INFO ] (tutorial.hello.random-provider#randomizer): configuration stage
-[INFO ] (tutorial.hello.random-provider#randomizer): seed: 1024
-[INFO ] (tutorial.hello): random: 6608684
-</source>
+[INFO ] (kernel): installing: file:/${user.dir}/target/classes/
+[INFO ] (tutorial.random-provider-randomizer): configuration stage
+[INFO ] (tutorial.random-provider-randomizer): seed: 1024
+[INFO ] (tutorial.hello): resolved random: 26314317
+[INFO ] (kernel): dissassembly phase
+[INFO ] (kernel): disposal phase</source>
<p>
-Note: When constructing an name for the component based on a packaged profile,
Merlin will append the component type name to the profile name, seperated by the #
character resulting in the component name 'random-provider#randomizer'.
+Note: When constructing a name for the component based on a packaged profile,
Merlin will append the component type name to the profile name, seperated by the -
character resulting in the component name 'random-provider-randomizer'.
</p>
</subsection>
<subsection name="Profile selection">
<p>
-The <a href="selectors.html">next tutorial</a> describes the mechanisms used to
influence profile selection within Merlin.
+The <a href="selection.html">next tutorial</a> describes how you can package
multiple profiles with a component and how you can control profile selection.
</p>
</subsection>
1.1 avalon/merlin/platform/xdocs/starting/advanced/selection.xml
Index: selection.xml
===================================================================
<?xml version="1.0"?>
<!--
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
"Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see http://www.apache.org/.
-->
<document>
<header>
<title>Using Merlin</title>
<authors>
<person name="Stephen McConnell" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<section name="Advanced Features">
<subsection name="Profile Selection">
<p>
In the <a href="profiles.html">Profile tutorial</a> we covered the mechanisms used
to establish a pre-configured deployment profile. In this tutorial we update the
<classname>.xprofile to include multiple named profiles and show how you can
select a specific profile when declaring a component in block descriptor.
</p>
<p>
Component deployment profiles are co-located with the component implementation class
under an .xprofile resource.
</p>
</subsection>
<subsection name="Adding multiple profiles">
<p>
The RandomGeneratorProvider.xprofile is updated to include
multiple profiles.
</p>
<p><i>RandomGeneratorProvider.xprofile</i></p>
<source><![CDATA[
<?xml version="1.0"?>
<profiles>
<profile name="primary">
<configuration>
<seed>1024</seed>
</configuration>
</profile>
<profile name="secondary">
<configuration>
<seed>2048</seed>
</configuration>
</profile>
</profiles>
]]></source>
</subsection>
<subsection name="Component declaration using a named profile">
<p>
A <component> element may contain the <strong>profile</strong>
attribute. The value of the profile attribute is the name of a
profile declared under the .xprofile resource. If a component
directive uses the profile attribute content of the element will
be ignored.
</p>
<p><i>block.xml</i></p>
<source><![CDATA[
<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"/>
<!--
addition of a directive to include the RandomGeneratorProvider
component type using the profile key "secondary"
-->
<component name="randomizer"
class="tutorial.RandomGeneratorProvider" profile="secondary"/>
</container>
]]></source>
<subsection name="Executing the tutorial">
<p>
Build and run the tutorial.
</p>
<source>
$ maven jar
$ merlin -execute target\classes
</source>
<p>
In the logging output we see that Merlin has selected the "secondary" profile and as
a consequence the random seed declared in the secondary profile is different to our
earlier examples.
</p>
<source>
[INFO ] (kernel): installing: file:/${user.dir}/target/classes/
[INFO ] (tutorial.random-provider-secondary): configuration stage
[INFO ] (tutorial.random-provider-secondary): seed: 2048
[INFO ] (tutorial.hello): supplied random: 768785105
[INFO ] (kernel): dissassembly phase
[INFO ] (kernel): disposal phase
</source>
</subsection>
</section>
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]