Skip to Content.
Sympa Menu

notify-dpml - r1993 - in trunk: central/site/src/docs/about/news central/site/src/docs/metro/tutorials tutorials/components/examples/etc tutorials/components/examples/src/main/org/acme

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: r1993 - in trunk: central/site/src/docs/about/news central/site/src/docs/metro/tutorials tutorials/components/examples/etc tutorials/components/examples/src/main/org/acme
  • Date: Fri, 27 Apr 2007 18:49:13 +0200

Author: mcconnell
Date: 2007-04-27 18:49:11 +0200 (Fri, 27 Apr 2007)
New Revision: 1993

Modified:
trunk/central/site/src/docs/about/news/index.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/index.xml
trunk/tutorials/components/examples/etc/component.xml
trunk/tutorials/components/examples/src/main/org/acme/Demo.java
Log:
Documentation housekeeping and updates to context examples to include a map
entry.

Modified: trunk/central/site/src/docs/about/news/index.xml
===================================================================
--- trunk/central/site/src/docs/about/news/index.xml 2007-04-25 07:11:15
UTC (rev 1992)
+++ trunk/central/site/src/docs/about/news/index.xml 2007-04-27 16:49:11
UTC (rev 1993)
@@ -30,7 +30,7 @@

<ul>
<li>JSR 277 readiness.</li>
- <li>Integral support for <tt>java.util.ServiceLoader</tt> as an
basic extension mechansims.</li>
+ <li>Integral support for <tt>java.util.ServiceLoader</tt> as a
basic extension mechansims.</li>
<li>Support for plugable content type handlers via
<tt>java.util.ServiceLoader</tt>.</li>
<li>JMX management of the Transit resource management layer.</li>
<li>Metro component model moved to a dedicated content type
handler.</li>

Modified: trunk/central/site/src/docs/metro/tutorials/context-examples.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/context-examples.xml
2007-04-25 07:11:15 UTC (rev 1992)
+++ trunk/central/site/src/docs/metro/tutorials/context-examples.xml
2007-04-27 16:49:11 UTC (rev 1993)
@@ -13,8 +13,8 @@
<p>
The DPML Metro platform provides support for primitive (e.g.
<tt>int</tt>,
<tt>long</tt>, <tt>short</tt>, <tt>float</tt>, <tt>boolean</tt>,
etc.),
- and complex object return types. arrays, and default arguments within a
- <tt>#Context</tt> inner interface definition.
+ and complex object return types, arrays, maps, and usage of default
+ arguments within a <tt>Context</tt> interface.
</p>

<subsection name="Component Example">
@@ -111,6 +111,9 @@
[junit] [25598] [INFO ] (demo): optionalBoolean: false
[junit] [25598] [INFO ] (demo): optionalFile:
C:\dev\osm\trunk\tutorial\components\examples
[junit] [25598] [INFO ] (demo): optionalURI:
file:/C:/dev/osm/trunk/tutorial/components/examples/
+ [junit] [18231] [INFO ] (demo): color (blue):
java.awt.Color[r=0,g=0,b=255]
+ [junit] [18231] [INFO ] (demo): color (white):
java.awt.Color[r=255,g=255,b=255]
+ [junit] [18231] [INFO ] (demo): color (red):
java.awt.Color[r=255,g=0,b=0]
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.937
sec</pre>

</subsection>

Modified: trunk/central/site/src/docs/metro/tutorials/context.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/context.xml 2007-04-25
07:11:15 UTC (rev 1992)
+++ trunk/central/site/src/docs/metro/tutorials/context.xml 2007-04-27
16:49:11 UTC (rev 1993)
@@ -15,7 +15,7 @@

<p>
The purpose of this tutorial is to introduce the Metro Context model
and the
- contract this represents between a container and a component.
+ contract this represents between a component and its container.
</p>

<p>
@@ -37,10 +37,10 @@
Components are typically established and deployed dynamically
by a controlling system. To do this the controlling system
needs to know about the operational requirements of the
- component and delivery mechanism assumed by a component. Within
- the Metro component model both the declaration of requirement and
- the delivery mechanism are described using a <tt>Context</tt> inner
- interface within a component implementation class.
+ component and delivery mechanism. Within the Metro component model
+ both the declaration of requirement and delivery mechanism are
+ described using a <tt>Context</tt> interface referenced as a
+ parameter within the component constructor.
</p>

<p>
@@ -158,7 +158,7 @@
<li>the dependency key is based on the method name applying the
bean
pattern get[key]
</li>
- <li>defalt values may be declared as a single method argument</li>
+ <li>default values may be declared as a single method argument</li>
<li>if a default value is declared it must be assignable to the
method
return type
</li>
@@ -176,8 +176,8 @@

<p><i>
The following lines are example of the creation of a component
- deployment solution. Modifications markup shows changes from our
initial
- component definition.
+ deployment solution. Markup up of the XML is used to show changes
from our
+ initial component definition.
</i></p>

<pre>
@@ -192,14 +192,15 @@

</subsection>

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

<p>
During execution of the testcases we see the result of logging the
a message reflecting configuration and runtime information. In
the <a href="context/DemoTestCase.java.html">DemoTestCase</a>
the output is shows the result of concatination of values resolved
- fro the context implementation supplied by the container to the
component instance.
+ from the context implementation supplied by the container to the
+ component instance.
</p>

<pre>
@@ -247,10 +248,10 @@
The container will make best efforts to assemble a viable deployment
scenario. If that scenario cannot be established then your
component will
not be deployed. During deployment the container will evaluate all
runtime
- requirements declaring with a #Context innner interface, build an
context
+ requirements declaring within the context interface, build an context
implementation fullfilling the contract (and any other recognized
contructor
- arguments) and deploy the component taking into account lifecyle and
lifestyle
- (but more of these subject later in the tutorial).
+ arguments) and deploy the component taking into account lifecyle,
lifestyle
+ and collection policies (but more of these subject later in the
tutorial).
</p>

<p>

Modified: trunk/central/site/src/docs/metro/tutorials/index.xml
===================================================================
--- trunk/central/site/src/docs/metro/tutorials/index.xml 2007-04-25
07:11:15 UTC (rev 1992)
+++ trunk/central/site/src/docs/metro/tutorials/index.xml 2007-04-27
16:49:11 UTC (rev 1993)
@@ -60,7 +60,7 @@
of a custom part strategy.
</p>

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

@@ -126,7 +126,7 @@

&lt;classpath&gt;
&lt;private&gt;
-
&lt;uri&gt;artifact:jar:dpmlx/tutorials/components/acme-demo-hello#SNAPSHOT&lt;/uri&gt;
+
&lt;uri&gt;artifact:jar:artifact:jar:org/acme/hello#SNAPSHOT&lt;/uri&gt;
&lt;/private&gt;
&lt;/classpath&gt;

@@ -140,10 +140,23 @@
<p>
In this example the Demo implementation class contains nothing
significant -
however, the important point of this tutorial is the association of
- a different runtime handler for the class within our part definition.
+ a different runtime handler for the class within our part
definition. In
+ particular:
+ </p>
+
+ <ul>
+ <li>the &lt;component&gt; element is defined under a schema
definition
+ which assert a default value of
"link:part:dpml/lang/dpml-lang-component"
+ for the handler attibute which in turn is used to establish the
runtime
+ handler for the class</li>
+ <li>the runtime handler is supplied with a classloader composed of
jar
+ files resolved from the &lt;classpath&gt; defintion</li>
+ </ul>
+
+ <p>
Our next tutorial extends this project with the introduction of
<a href="context.html">context management</a> and in particular, the
way in
- which a component class declares context assumptions, and the
mechanisms
+ which a component class declares deployment context assumptions, and
the mechanisms
used by the Metro runtime to fullfill those requirements.
</p>


Modified: trunk/tutorials/components/examples/etc/component.xml
===================================================================
--- trunk/tutorials/components/examples/etc/component.xml 2007-04-25
07:11:15 UTC (rev 1992)
+++ trunk/tutorials/components/examples/etc/component.xml 2007-04-27
16:49:11 UTC (rev 1993)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<component xmlns="dpml:metro"
class="org.acme.Demo"
- name="demo">
+ name="demo" lifestyle="singleton">
<context>
<entry key="color" method="RED"/>
<entry key="anotherColor">
@@ -27,5 +27,10 @@
<param value="george"/>
<param value="mary"/>
</entry>
+ <map key="colors">
+ <entry key="red" class="java.awt.Color" method="RED"/>
+ <entry key="white" class="java.awt.Color" method="WHITE"/>
+ <entry key="blue" class="java.awt.Color" method="BLUE"/>
+ </map>
</context>
</component>

Modified: trunk/tutorials/components/examples/src/main/org/acme/Demo.java
===================================================================
--- trunk/tutorials/components/examples/src/main/org/acme/Demo.java
2007-04-25 07:11:15 UTC (rev 1992)
+++ trunk/tutorials/components/examples/src/main/org/acme/Demo.java
2007-04-27 16:49:11 UTC (rev 1993)
@@ -21,6 +21,7 @@
import java.awt.Color;
import java.io.File;
import java.net.URI;
+import java.util.Map;

import java.util.logging.Logger;
import java.util.logging.Level;
@@ -215,6 +216,11 @@
*/
String[] getNames();

+ /**
+ * Return a map with string keys and instances of Color as values.
+ * @return a color map
+ */
+ Map<String,Color> getColors();
}

//------------------------------------------------------------------
@@ -268,6 +274,11 @@
logger.info( "optionalBoolean: " + context.getOptionalBoolean(
false ) );
logger.info( "optionalFile: " + context.getOptionalFile( file )
);
logger.info( "optionalURI: " + context.getOptionalURI( uri ) );
+ for( String key : context.getColors().keySet() )
+ {
+ Color color = context.getColors().get( key );
+ logger.info( "color (" + key + "): " + color );
+ }
}
}
}




  • r1993 - in trunk: central/site/src/docs/about/news central/site/src/docs/metro/tutorials tutorials/components/examples/etc tutorials/components/examples/src/main/org/acme, mcconnell at BerliOS, 04/27/2007

Archive powered by MHonArc 2.6.24.

Top of Page