Skip to Content.
Sympa Menu

notify-dpml - r1927 - in trunk/central/site/src/docs: metro metro/component/lifecycle metro/tutorials metro/tutorials/lifecycles metro/tutorials/lifestyles util/depot/tutorials

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1927 - in trunk/central/site/src/docs: metro metro/component/lifecycle metro/tutorials metro/tutorials/lifecycles metro/tutorials/lifestyles util/depot/tutorials
  • Date: Tue, 20 Mar 2007 18:35:34 +0100

Author: mcconnell
Date: 2007-03-20 18:35:28 +0100 (Tue, 20 Mar 2007)
New Revision: 1927

Removed:
trunk/central/site/src/docs/metro/runtime/
trunk/central/site/src/docs/metro/tutorials/types/
Modified:
trunk/central/site/src/docs/metro/component/lifecycle/index.xml
trunk/central/site/src/docs/metro/tutorials/composition-by-parts.xml
trunk/central/site/src/docs/metro/tutorials/context-examples.xml
trunk/central/site/src/docs/metro/tutorials/context.xml
trunk/central/site/src/docs/metro/tutorials/intro.xml
trunk/central/site/src/docs/metro/tutorials/lifecycles/index.xml
trunk/central/site/src/docs/metro/tutorials/lifestyles/index.xml
trunk/central/site/src/docs/metro/tutorials/lifestyles/per-thread.xml
trunk/central/site/src/docs/metro/tutorials/lifestyles/singleton.xml
trunk/central/site/src/docs/metro/tutorials/lifestyles/transients.xml
trunk/central/site/src/docs/metro/tutorials/lookup.xml
trunk/central/site/src/docs/metro/tutorials/navigation.xml
trunk/central/site/src/docs/util/depot/tutorials/plugins.xml
Log:
bringing metro tutorials into line with 2.0

Modified: trunk/central/site/src/docs/metro/component/lifecycle/index.xml
===================================================================
--- trunk/central/site/src/docs/metro/component/lifecycle/index.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/component/lifecycle/index.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -47,9 +47,9 @@
the current state's parent state, the parent's paranet state, etc.).
Any
transition declared on any of the states within the state chain are
considered as
available transitions. Transitions may be tagged as implict
initialization transitions
- or implicit termination terminsitions. On component deployment
initialization transitions
+ or implicit termination transitions. On component deployment
initialization transitions
are fired (possibly resulting in a state change and the emergence of
new implicit
- initialization transitions (which are automatically invoked). On
deommissioning on
+ initialization transitions (which are automatically invoked). On
decommissioning on
a component the runtime will automatically invoke termination
transitions, iuncluding
new termination transitions comming into scope as a result of a
termination state change.
</p>
@@ -79,8 +79,7 @@
component via execution of the start transition).
</p>

-<pre>&lt;state xmlns="dpml:state"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
+<pre>&lt;state xmlns="dpml:state"&gt;

&lt;trigger event="initialization"&gt;
&lt;transition name="start" target="started"&gt;

Modified: trunk/central/site/src/docs/metro/tutorials/composition-by-parts.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/composition-by-parts.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/composition-by-parts.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -52,35 +52,16 @@
of a <tt>&lt;context&gt;</tt> element.
</p>

-<pre>&lt;index ..... &gt;
+<pre>&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ <font color="darkred">&lt;parts&gt;
+ &lt;component key="widget" type="org.acme.Widget"&gt;
+ &lt;context&gt;
+ &lt;entry key="color" method="BLUE"/&gt;
+ &lt;/context&gt;
+ &lt;/component&gt;
+ &lt;/parts&gt;</font>
+&lt;/component&gt;</pre>

- &lt;project name="acme-demo-parts" basedir="parts"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- <font color="darkred">&lt;parts&gt;
- &lt;component key="widget" type="org.acme.Widget"&gt;
- &lt;context&gt;
- &lt;entry key="color" method="BLUE"/&gt;
- &lt;/context&gt;
- &lt;/component&gt;
- &lt;/parts&gt;</font>
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
-
</subsection>

<subsection name="Testing the component">

Modified: trunk/central/site/src/docs/metro/tutorials/context-examples.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/context-examples.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/context-examples.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -37,58 +37,40 @@

<p>
The deployment solution for the above component is defined in the
- following part definition (additional context entry directives are
+ following component definition (additional context entry directives
are
presented in red).
</p>

-<pre>&lt;index ..... &gt;
+<pre>
+&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ <font color="darkred">&lt;context&gt;
+ &lt;entry key="color" method="RED"/&gt;
+ &lt;entry key="anotherColor"&gt;
+ &lt;param class="int" value="100"/&gt;
+ &lt;param class="int" value="200"/&gt;
+ &lt;param class="int" value="0"/&gt;
+ &lt;/entry&gt;
+ &lt;entry key="integer" value="42"/&gt;
+ &lt;entry key="short" value="19"/&gt;
+ &lt;entry key="long" value="1042"/&gt;
+ &lt;entry key="byte" value="9"/&gt;
+ &lt;entry key="double" value="32"/&gt;
+ &lt;entry key="float" value="9.813"/&gt;
+ &lt;entry key="char" value="x"/&gt;
+ &lt;entry key="boolean" value="true"/&gt;
+ &lt;entry key="file" value="${work}"/&gt;
+ &lt;entry key="tempFile" value="${temp}"/&gt;
+ &lt;entry key="URI" value="${uri}"/&gt;
+ &lt;entry key="name" value="${name}"/&gt;
+ &lt;entry key="path" value="${path}"/&gt;
+ &lt;entry key="names"&gt;
+ &lt;param value="fred"/&gt;
+ &lt;param value="george"/&gt;
+ &lt;param value="mary"/&gt;
+ &lt;/entry&gt;
+ &lt;/context&gt;</font>
+&lt;/component&gt;</pre>

- &lt;project name="acme-demo-examples" basedir="examples"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- <font color="darkred">&lt;context&gt;
- &lt;entry key="color" method="RED"/&gt;
- &lt;entry key="anotherColor"&gt;
- &lt;param class="int" value="100"/&gt;
- &lt;param class="int" value="200"/&gt;
- &lt;param class="int" value="0"/&gt;
- &lt;/entry&gt;
- &lt;entry key="integer" value="42"/&gt;
- &lt;entry key="short" value="19"/&gt;
- &lt;entry key="long" value="1042"/&gt;
- &lt;entry key="byte" value="9"/&gt;
- &lt;entry key="double" value="32"/&gt;
- &lt;entry key="float" value="9.813"/&gt;
- &lt;entry key="char" value="x"/&gt;
- &lt;entry key="boolean" value="true"/&gt;
- &lt;entry key="file" value="${work}"/&gt;
- &lt;entry key="tempFile" value="${temp}"/&gt;
- &lt;entry key="URI" value="${uri}"/&gt;
- &lt;entry key="name" value="${name}"/&gt;
- &lt;entry key="path" value="${path}"/&gt;
- &lt;entry key="names"&gt;
- &lt;param value="fred"/&gt;
- &lt;param value="george"/&gt;
- &lt;param value="mary"/&gt;
- &lt;/entry&gt;
- &lt;/context&gt;</font>
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
-
</subsection>

<subsection name="Testing the component">

Modified: trunk/central/site/src/docs/metro/tutorials/context.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/context.xml 2007-03-20
15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/context.xml 2007-03-20
17:35:28 UTC (rev 1927)
@@ -180,34 +180,16 @@
component definition.
</i></p>

-<pre>&lt;index ..... &gt;
+<pre>
+&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ <font color="darkred">&lt;context&gt;
+ &lt;entry key="owner" value="${user.name}"/&gt;
+ &lt;entry key="activity" value="Painting"/&gt;
+ &lt;entry key="target" value="bike"/&gt;
+ &lt;entry key="color" value="silver"/&gt;
+ &lt;/context&gt;</font>
+&lt;/component&gt;</pre>

- &lt;project name="acme-demo-context" basedir="context"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- <font color="darkred">&lt;context&gt;
- &lt;entry key="owner" value="${user.name}"/&gt;
- &lt;entry key="activity" value="Painting"/&gt;
- &lt;entry key="target" value="bike"/&gt;
- &lt;entry key="color" value="silver"/&gt;
- &lt;/context&gt;</font>
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
-
</subsection>

<subsection name="Testing the component using a Part handler">

Modified: trunk/central/site/src/docs/metro/tutorials/intro.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/intro.xml 2007-03-20
15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/intro.xml 2007-03-20
17:35:28 UTC (rev 1927)
@@ -12,14 +12,13 @@
<section name="Overview">

<p>
- In the earlier tutorials dealing with Transit Plugins we covered the
general
- subject of a deployment unit descriptor that associated an object
instantiation
- <tt>strategy</tt> with a <tt>classloader</tt> chain definition. The
Metro platform
- provides an alternative deployment strategy and runtime handler that
delivers
- a complete context driven IOC object instantiation model.
- </p>
-
- <p>
+ In the earlier tutorials dealing with
+ <a href="../../util/depot/tutorials/plugins.html">Depot plugin
datatypes</a>
+ we covered the general subject of a deployment unit descriptor that
associated
+ an object instantiation <tt>strategy</tt> with a <tt>classloader</tt>
chain
+ definition. The Metro platform provides the prefered deployment
strategy and
+ runtime handler that delivers a complete context driven IOC object
+ instantiation model.
In addition to instantiation there are several aspects of a class that
effect its deployment. These aspects include thread-safety, a
depoyment and
decommissioning lifecycle, garbage collection policy, etc. Each of
these concerns
@@ -55,46 +54,64 @@
<subsection name="Component Creation">

<p>
- The creation of a new component defintion is basically the same as
the procedure
- used to create a plugin. In the following Depot project definition
we are declaring
- a new project with publication of a jar and a part artifact. The
significant difference
- from a regular plugin is the usage of a custom part strategy.
+ In the following Depot project definition we are declaring
+ a new project with publication of a jar and a part artifact.
+ The significant difference from a regular plugin is the usage
+ of a custom part strategy.
</p>

-<source>
+ <p><i>From the global index.xml we establish the reference to out
target project:</i></p>
+<pre>
&lt;index ..... &gt;

- &lt;project name="acme-demo-hello" basedir="hello"&gt;
- &lt;types&gt;
+ ...
+
+ &lt;project xmlns="dpml:library" name="hello"&gt;
+
+ &lt;info title="DPML Metro Hello Tutorial"&gt;
+ &lt;description&gt;Introductory Hello World demo.&lt;/description&gt;
+ &lt;/info&gt;
+
+ &lt;types>
&lt;type id="jar"/&gt;
- <font color="darkred">&lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"/&gt;</font>
+ &lt;type id="part" source="target/component.xml"/&gt;
&lt;/types&gt;
+
&lt;dependencies&gt;
&lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
+ &lt;include ref="dpml/metro/dpml-metro-part"/&gt;
+ &lt;include ref="org/apache/ant/ant-junit"/&gt;
&lt;/test&gt;
&lt;/dependencies&gt;
+
&lt;/project&gt;

...

&lt;/index&gt;
-</source>
+</pre>

+ <p><i>The component.xml file referenced in the part type production
+ statement contains the information about the component deployment
+ strategy.</i></p>
+
+<pre>
+&lt;component xmlns="dpml:metro" name="demo" class="org.acme.Demo"/&gt;
+</pre>
+
<p>
The custom part definition introduced under the <tt>dpml:metro</tt>
namespace is declaring the production of a new <tt>part</tt>
datastructure under which
the class <tt>org.acme.Demo</tt> is to handled by the Metro runtime
platform. The above
- definition also includes the declaration of test phase dependencies
that we will need in
+ project definition also includes the declaration of test phase
dependencies that we will need in
order to launch the component.
</p>

<p>
The generated part datastructure is show below (the custom Metro
deployment
- strategy is hilighted in red).
+ strategy is hilighted in red). The datastructure include dependency
information
+ extracted from the prject defintion, together with component
deployment infromation
+ resolved from the referenced component.xml deployment directive.
</p>

<source>
@@ -104,11 +121,8 @@
&lt;info/&gt;

<font color="darkred">&lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"
- collection="system"
- activation="system"&gt;
- &lt;/component&gt;</font>
+ class="org.acme.Demo"
+ name="demo"/&gt;</font>

&lt;classpath&gt;
&lt;private&gt;

Modified: trunk/central/site/src/docs/metro/tutorials/lifecycles/index.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/lifecycles/index.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/lifecycles/index.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -38,55 +38,42 @@
<subsection name="The Start/Stop Example">

<p>
- The following Ant build file contains a task that constructs a
- formal state-transition graph for a component that is initialized
- via a start method invocation, resulting in the exposure of a stop
- management operation, and the assertion of a termination criteria
- involving the invocation of a stop method.
+ The following lifecycle defintion constructs a formal
state-transition
+ graph for a component that is initialized via a start method
invocation,
+ resulting in the exposure of a stop management operation, and the
assertion
+ of a termination criteria involving the invocation of a stop method.
</p>
-<source>
-&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+
+ <p><i>org/acme/Demo.xgraph</i></p>
+
+<pre>&lt;state xmlns="dpml:state"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;

-&lt;project xmlns:transit="antlib:dpml.tools.transit"
- xmlns:x="dpml:depot"&gt;
+ &lt;trigger event="initialization"&gt;
+ &lt;transition name="start" target="started"&gt;
+ &lt;operation name="startup" method="start"/&gt;
+ &lt;/transition&gt;
+ &lt;/trigger&gt;

- &lt;transit:import uri="local:template:dpml/tools/standard"/&gt;
-
- &lt;target name="init" depends="standard.init"&gt;
- &lt;x:plugin uri="link:part:dpml/metro/dpml-metro-tools"&gt;
- &lt;task name="state" class="net.dpml.metro.tools.StateTask"/&gt;
- &lt;/x:plugin&gt;
- &lt;/target&gt;
-
- &lt;target name="build" depends="standard.build"&gt;
- <font color="darkred">&lt;state class="org.acme.Demo"&gt;
- &lt;trigger event="initialization"&gt;
- &lt;transition name="start" target="started"&gt;
- &lt;operation name="startup" method="start"/&gt;
- &lt;/transition&gt;
- &lt;/trigger&gt;
- &lt;state name="started"&gt;
- &lt;transition name="stop" target="../stopped"&gt;
- &lt;operation name="stop" method="stop"/&gt;
- &lt;/transition&gt;
- &lt;trigger event="termination"&gt;
- &lt;apply id="stop"/&gt;
- &lt;/trigger&gt;
- &lt;/state&gt;
- &lt;state name="stopped"&gt;
- &lt;transition name="start" target="../started"&gt;
- &lt;operation name="start" method="start"/&gt;
- &lt;/transition&gt;
- &lt;/state&gt;
- &lt;/state&gt;</font>
- &lt;/target&gt;
+ &lt;state name="started"&gt;
+ &lt;trigger event="termination"&gt;
+ &lt;apply id="stop"/&gt;
+ &lt;/trigger&gt;
+ &lt;transition name="stop" target="../stopped"&gt;
+ &lt;operation name="stop" method="stop"/&gt;
+ &lt;/transition&gt;
+ &lt;/state&gt;

-&lt;/project&gt;</source>
+ &lt;state name="stopped"&gt;
+ &lt;transition name="start" target="../started"&gt;
+ &lt;operation name="start" method="start"/&gt;
+ &lt;/transition&gt;
+ &lt;/state&gt;
+
+&lt;/state&gt;</pre>

<p>
- The above state task creates a file named
<tt>org/acme/Demo.xgraph</tt> which
- is basically equivalent to the XML content show in red. This graph
declares a
- root state containing:
+ This above lifecycle graph declares a root state containing:
</p>

<ul>

Modified: trunk/central/site/src/docs/metro/tutorials/lifestyles/index.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/lifestyles/index.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/lifestyles/index.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -59,42 +59,25 @@
</p>

<p>
- <i>project definition:</i>:
+ <i>component definition:</i>:
</p>

-<pre>&lt;index ..... &gt;
-
- &lt;project name="acme-lifestyle-demo" basedir="lifestyle"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- &lt;parts&gt;
- <font color="darkred">&lt;component key="widget"
type="org.acme.Widget" name="widget" lifestyle="transient"&gt;
- &lt;context&gt;
- &lt;entry key="color" method="BLUE"/&gt;
- &lt;/context&gt;
- &lt;/component&gt;</font>
- &lt;component key="gizmo" type="org.acme.Gizmo" name="gizmo"&gt;
- &lt;context&gt;
- &lt;entry lookup="org.acme.Widget"/&gt;
- &lt;/context&gt;
- &lt;/component&gt;
- &lt;/parts&gt;
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
+<pre>
+&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ &lt;parts&gt;
+ <font color="darkred">&lt;component key="widget" type="org.acme.Widget"
name="widget" lifestyle="transient"&gt;
+ &lt;context&gt;
+ &lt;entry key="color" method="BLUE"/&gt;
+ &lt;/context&gt;
+ &lt;/component&gt;</font>
+ &lt;component key="gizmo" type="org.acme.Gizmo" name="gizmo"&gt;
+ &lt;context&gt;
+ &lt;entry lookup="org.acme.Widget"/&gt;
+ &lt;/context&gt;
+ &lt;/component&gt;
+ &lt;/parts&gt;
+&lt;/component&gt;
+</pre>

</subsection>


Modified:
trunk/central/site/src/docs/metro/tutorials/lifestyles/per-thread.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/lifestyles/per-thread.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/lifestyles/per-thread.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -55,37 +55,19 @@
</p>

<p>
- <i>project definition:</i>:
+ <i>component definition:</i>:
</p>

-<pre>&lt;index ..... &gt;
-
- &lt;project name="acme-thread-demo" basedir="thread"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- &lt;context&gt;
- &lt;entry key="threadCount" value="3"/&gt;
- &lt;entry key="accessCount" value="2"/&gt;
- &lt;/context&gt;
- &lt;parts&gt;
- <font color="darkred">&lt;component key="gizmo"
type="org.acme.Gizmo" lifestyle="thread"/&gt;</font>
- &lt;/parts&gt;
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
+<pre>&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ &lt;context&gt;
+ &lt;entry key="threadCount" value="3"/&gt;
+ &lt;entry key="accessCount" value="2"/&gt;
+ &lt;/context&gt;
+ &lt;parts&gt;
+ <font color="darkred">&lt;component key="gizmo" type="org.acme.Gizmo"
lifestyle="thread"/&gt;</font>
+ &lt;/parts&gt;
+&lt;/component&gt;
+</pre>

</subsection>


Modified: trunk/central/site/src/docs/metro/tutorials/lifestyles/singleton.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/lifestyles/singleton.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/lifestyles/singleton.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -3,15 +3,15 @@
<document>
<properties>
<author email="mcconnell AT osm.net">Stephen McConnell</author>
- <title>Component Lifestyle</title>
+ <title>Component Singleton Lifestyle</title>
</properties>

<body>

- <section name="Transient Lifestyles">
+ <section name="Singleton Lifestyles">

<p>
- This example demonstrates the uniquenes of a singletone instances
+ This example demonstrates the uniquenes of a singleton instances
across multiple threads. Unlike earlier examples of TRANSIENT and
THREAD lifestyle policy - the instances returned within any given
thread
and any given part access invocation is the same instance.
@@ -45,34 +45,15 @@

<subsection name="Deployment Solution">

-<pre>&lt;index ..... &gt;
-
- &lt;project name="acme-singleton-demo" basedir="singleton"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- &lt;context&gt;
- &lt;entry key="threadCount" value="3"/&gt;
- &lt;entry key="accessCount" value="2"/&gt;
- &lt;/context&gt;
- &lt;parts&gt;
- <font color="darkred">&lt;component key="gizmo"
type="org.acme.Gizmo" lifestyle="singleton"/&gt;</font>
- &lt;/parts&gt;
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
+<pre>&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ &lt;context&gt;
+ &lt;entry key="threadCount" value="3"/&gt;
+ &lt;entry key="accessCount" value="2"/&gt;
+ &lt;/context&gt;
+ &lt;parts&gt;
+ <font color="darkred">&lt;component key="gizmo" type="org.acme.Gizmo"
lifestyle="singleton"/&gt;</font>
+ &lt;/parts&gt;
+&lt;/component&gt;</pre>

</subsection>


Modified:
trunk/central/site/src/docs/metro/tutorials/lifestyles/transients.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/lifestyles/transients.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/lifestyles/transients.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -54,36 +54,17 @@
</p>

<p>
- <i>project definition:</i>:
+ <i>component definition:</i>:
</p>

-<pre>&lt;index ..... &gt;
-
- &lt;project name="acme-transient-demo" basedir="transient"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- &lt;context&gt;
- &lt;entry key="count" value="5"/&gt;
- &lt;/context&gt;
- &lt;parts&gt;
- <font color="darkred">&lt;component key="gizmo"
type="org.acme.Gizmo" lifestyle="transient"/&gt;</font>
- &lt;/parts&gt;
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
+<pre>&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ &lt;context&gt;
+ &lt;entry key="count" value="5"/&gt;
+ &lt;/context&gt;
+ &lt;parts&gt;
+ <font color="darkred">&lt;component key="gizmo" type="org.acme.Gizmo"
lifestyle="transient"/&gt;</font>
+ &lt;/parts&gt;
+&lt;/component&gt;</pre>

</subsection>


Modified: trunk/central/site/src/docs/metro/tutorials/lookup.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/lookup.xml 2007-03-20
15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/lookup.xml 2007-03-20
17:35:28 UTC (rev 1927)
@@ -52,42 +52,23 @@
</p>

<p>
- <i>project definition:</i>:
+ <i>component definition:</i>:
</p>

-<pre>&lt;index ..... &gt;
-
- &lt;project name="acme-lookup-demo" basedir="lookup"&gt;
- &lt;types&gt;
- &lt;type id="jar"/&gt;
- &lt;component xmlns="dpml:metro"
- type="org.acme.Demo"
- name="demo"&gt;
- &lt;parts&gt;
- &lt;component key="widget" type="org.acme.Widget" name="widget"&gt;
- &lt;context&gt;
- &lt;entry key="color" method="BLUE"/&gt;
- &lt;/context&gt;
- &lt;/component&gt;
- &lt;component key="gizmo" type="org.acme.Gizmo" name="gizmo"&gt;
- &lt;context&gt;
- <font color="darkred">&lt;entry key="widget"
lookup="org.acme.Widget"/&gt;</font>
- &lt;/context&gt;
- &lt;/component&gt;
- &lt;/parts&gt;
- &lt;/component&gt;
- &lt;/types&gt;
- &lt;dependencies&gt;
- &lt;test&gt;
- &lt;include ref="ant/ant-junit"/&gt;
- &lt;include ref="dpml/transit/dpml-transit-main"/&gt;
- &lt;/test&gt;
- &lt;/dependencies&gt;
- &lt;/project&gt;
-
- ...
-
-&lt;/index&gt;</pre>
+<pre>&lt;component xmlns="dpml:metro" class="org.acme.Demo" name="demo"&gt;
+ &lt;parts&gt;
+ &lt;component key="widget" type="org.acme.Widget" name="widget"&gt;
+ &lt;context&gt;
+ &lt;entry key="color" method="BLUE"/&gt;
+ &lt;/context&gt;
+ &lt;/component&gt;
+ &lt;component key="gizmo" type="org.acme.Gizmo" name="gizmo"&gt;
+ &lt;context&gt;
+ <font color="darkred">&lt;entry key="widget"
lookup="org.acme.Widget"/&gt;</font>
+ &lt;/context&gt;
+ &lt;/component&gt;
+ &lt;/parts&gt;
+&lt;/component&gt;</pre>

</subsection>


Modified: trunk/central/site/src/docs/metro/tutorials/navigation.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/navigation.xml 2007-03-20
15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/metro/tutorials/navigation.xml 2007-03-20
17:35:28 UTC (rev 1927)
@@ -33,8 +33,7 @@
<item name="Lifestyles" href="lifestyles/index.html"/>
<item name="Lifecycles" href="lifecycles/index.html"/>
<item name="Logging" href="logging/index.html"/>
- <item name="Component Types" href="types/index.html"/>
- <item name="Building On Sholders" href="customize/index.html"/>
+ <!--<item name="Building On Sholders" href="customize/index.html"/>-->
<item name="Unit Testing" href="unit/index.html"/>
</menu>


Modified: trunk/central/site/src/docs/util/depot/tutorials/plugins.xml
===================================================================
--- trunk/central/site/src/docs/util/depot/tutorials/plugins.xml
2007-03-20 15:27:34 UTC (rev 1926)
+++ trunk/central/site/src/docs/util/depot/tutorials/plugins.xml
2007-03-20 17:35:28 UTC (rev 1927)
@@ -62,7 +62,7 @@
&lt;project name="clock-impl" basedir="impl"&gt;
&lt;types&gt;
&lt;type id="jar"/&gt;
- <font color="darkred">&lt;type id="part"
source="etc/part.xml"/&gt;</font>
+ <font color="darkred">&lt;type id="part"
source="etc/component.xml"/&gt;</font>
&lt;/types&gt;
&lt;dependencies&gt;
&lt;runtime&gt;




  • r1927 - in trunk/central/site/src/docs: metro metro/component/lifecycle metro/tutorials metro/tutorials/lifecycles metro/tutorials/lifestyles util/depot/tutorials, mcconnell at BerliOS, 03/20/2007

Archive powered by MHonArc 2.6.24.

Top of Page