Skip to Content.
Sympa Menu

notify-dpml - r1582 - in trunk/central/tutorials: . components components/context components/context/src components/context/src/main components/context/src/main/org components/context/src/main/org/acme components/context/src/test components/context/src/test/org components/context/src/test/org/acme components/context/src/test/org/acme/test components/customize components/customize/clock components/customize/clock/src components/customize/clock/src/main components/customize/clock/src/main/org components/customize/clock/src/main/org/acme components/customize/clock/src/main/org/acme/clock components/customize/clock/src/test components/customize/clock/src/test/org components/customize/clock/src/test/org/acme components/customize/clock/src/test/org/acme/test components/customize/custom components/customize/custom/src components/customize/custom/src/test components/customize/custom/src/test/org components/customize/custom/src/test/org/acme components/customize/custom/src/test/org/acme/t! est components/examples components/examples/src components/examples/src/main components/examples/src/main/org components/examples/src/main/org/acme components/examples/src/test components/examples/src/test/org components/examples/src/test/org/acme components/examples/src/test/org/acme/test components/hello components/hello/src components/hello/src/main components/hello/src/main/org components/hello/src/main/org/acme components/hello/src/test components/hello/src/test/org components/hello/src/test/org/acme components/hello/src/test/org/acme/test components/import components/import/api components/import/api/src components/import/api/src/main components/import/api/src/main/org components/import/api/src/main/org/acme components/import/clock components/import/clock/src components/import/clock/src/main components/import/clock/src/main/org components/import/clock/src/main/org/acme components/import/clock/src/main/org/acme/scheduler components/import/demo components/import/demo/etc! components/import/demo/etc/data components/import/demo/src co! mponents

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: r1582 - in trunk/central/tutorials: . components components/context components/context/src components/context/src/main components/context/src/main/org components/context/src/main/org/acme components/context/src/test components/context/src/test/org components/context/src/test/org/acme components/context/src/test/org/acme/test components/customize components/customize/clock components/customize/clock/src components/customize/clock/src/main components/customize/clock/src/main/org components/customize/clock/src/main/org/acme components/customize/clock/src/main/org/acme/clock components/customize/clock/src/test components/customize/clock/src/test/org components/customize/clock/src/test/org/acme components/customize/clock/src/test/org/acme/test components/customize/custom components/customize/custom/src components/customize/custom/src/test components/customize/custom/src/test/org components/customize/custom/src/test/org/acme components/customize/custom/src/test/org/acme/t! est components/examples components/examples/src components/examples/src/main components/examples/src/main/org components/examples/src/main/org/acme components/examples/src/test components/examples/src/test/org components/examples/src/test/org/acme components/examples/src/test/org/acme/test components/hello components/hello/src components/hello/src/main components/hello/src/main/org components/hello/src/main/org/acme components/hello/src/test components/hello/src/test/org components/hello/src/test/org/acme components/hello/src/test/org/acme/test components/import components/import/api components/import/api/src components/import/api/src/main components/import/api/src/main/org components/import/api/src/main/org/acme components/import/clock components/import/clock/src components/import/clock/src/main components/import/clock/src/main/org components/import/clock/src/main/org/acme components/import/clock/src/main/org/acme/scheduler components/import/demo components/import/demo/etc! components/import/demo/etc/data components/import/demo/src co! mponents
  • Date: Mon, 17 Jul 2006 16:15:47 +0200

Author: mcconnell
Date: 2006-07-17 16:15:40 +0200 (Mon, 17 Jul 2006)
New Revision: 1582

Added:
trunk/central/tutorials/components/
trunk/central/tutorials/components/context/
trunk/central/tutorials/components/context/build.xml
trunk/central/tutorials/components/context/src/
trunk/central/tutorials/components/context/src/main/
trunk/central/tutorials/components/context/src/main/org/
trunk/central/tutorials/components/context/src/main/org/acme/
trunk/central/tutorials/components/context/src/main/org/acme/Demo.java
trunk/central/tutorials/components/context/src/test/
trunk/central/tutorials/components/context/src/test/org/
trunk/central/tutorials/components/context/src/test/org/acme/
trunk/central/tutorials/components/context/src/test/org/acme/test/

trunk/central/tutorials/components/context/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/customize/
trunk/central/tutorials/components/customize/clock/
trunk/central/tutorials/components/customize/clock/build.xml
trunk/central/tutorials/components/customize/clock/src/
trunk/central/tutorials/components/customize/clock/src/main/
trunk/central/tutorials/components/customize/clock/src/main/org/
trunk/central/tutorials/components/customize/clock/src/main/org/acme/
trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/

trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/Clock.java

trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/SimpleClock.java
trunk/central/tutorials/components/customize/clock/src/test/
trunk/central/tutorials/components/customize/clock/src/test/org/
trunk/central/tutorials/components/customize/clock/src/test/org/acme/
trunk/central/tutorials/components/customize/clock/src/test/org/acme/test/

trunk/central/tutorials/components/customize/clock/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/customize/custom/
trunk/central/tutorials/components/customize/custom/src/
trunk/central/tutorials/components/customize/custom/src/test/
trunk/central/tutorials/components/customize/custom/src/test/org/
trunk/central/tutorials/components/customize/custom/src/test/org/acme/
trunk/central/tutorials/components/customize/custom/src/test/org/acme/test/

trunk/central/tutorials/components/customize/custom/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/customize/module.xml
trunk/central/tutorials/components/examples/
trunk/central/tutorials/components/examples/build.xml
trunk/central/tutorials/components/examples/src/
trunk/central/tutorials/components/examples/src/main/
trunk/central/tutorials/components/examples/src/main/org/
trunk/central/tutorials/components/examples/src/main/org/acme/
trunk/central/tutorials/components/examples/src/main/org/acme/Demo.java
trunk/central/tutorials/components/examples/src/test/
trunk/central/tutorials/components/examples/src/test/org/
trunk/central/tutorials/components/examples/src/test/org/acme/
trunk/central/tutorials/components/examples/src/test/org/acme/test/

trunk/central/tutorials/components/examples/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/hello/
trunk/central/tutorials/components/hello/build.xml
trunk/central/tutorials/components/hello/src/
trunk/central/tutorials/components/hello/src/main/
trunk/central/tutorials/components/hello/src/main/org/
trunk/central/tutorials/components/hello/src/main/org/acme/
trunk/central/tutorials/components/hello/src/main/org/acme/Demo.java
trunk/central/tutorials/components/hello/src/test/
trunk/central/tutorials/components/hello/src/test/org/
trunk/central/tutorials/components/hello/src/test/org/acme/
trunk/central/tutorials/components/hello/src/test/org/acme/test/

trunk/central/tutorials/components/hello/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/import/
trunk/central/tutorials/components/import/api/
trunk/central/tutorials/components/import/api/build.xml
trunk/central/tutorials/components/import/api/src/
trunk/central/tutorials/components/import/api/src/main/
trunk/central/tutorials/components/import/api/src/main/org/
trunk/central/tutorials/components/import/api/src/main/org/acme/
trunk/central/tutorials/components/import/api/src/main/org/acme/Clock.java
trunk/central/tutorials/components/import/clock/
trunk/central/tutorials/components/import/clock/build.xml
trunk/central/tutorials/components/import/clock/src/
trunk/central/tutorials/components/import/clock/src/main/
trunk/central/tutorials/components/import/clock/src/main/org/
trunk/central/tutorials/components/import/clock/src/main/org/acme/

trunk/central/tutorials/components/import/clock/src/main/org/acme/scheduler/

trunk/central/tutorials/components/import/clock/src/main/org/acme/scheduler/SimpleClock.java
trunk/central/tutorials/components/import/demo/
trunk/central/tutorials/components/import/demo/build.xml
trunk/central/tutorials/components/import/demo/etc/
trunk/central/tutorials/components/import/demo/etc/data/
trunk/central/tutorials/components/import/demo/etc/data/logging.properties
trunk/central/tutorials/components/import/demo/src/
trunk/central/tutorials/components/import/demo/src/main/
trunk/central/tutorials/components/import/demo/src/main/org/
trunk/central/tutorials/components/import/demo/src/main/org/acme/
trunk/central/tutorials/components/import/demo/src/main/org/acme/demo/

trunk/central/tutorials/components/import/demo/src/main/org/acme/demo/Demo.java
trunk/central/tutorials/components/import/demo/src/test/
trunk/central/tutorials/components/import/demo/src/test/org/
trunk/central/tutorials/components/import/demo/src/test/org/acme/
trunk/central/tutorials/components/import/demo/src/test/org/acme/test/

trunk/central/tutorials/components/import/demo/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/import/module.xml
trunk/central/tutorials/components/index.xml
trunk/central/tutorials/components/lifestyle/
trunk/central/tutorials/components/lifestyle/ABOUT.TXT
trunk/central/tutorials/components/lifestyle/build.xml
trunk/central/tutorials/components/lifestyle/etc/
trunk/central/tutorials/components/lifestyle/etc/data/
trunk/central/tutorials/components/lifestyle/etc/data/logging.properties
trunk/central/tutorials/components/lifestyle/src/
trunk/central/tutorials/components/lifestyle/src/main/
trunk/central/tutorials/components/lifestyle/src/main/org/
trunk/central/tutorials/components/lifestyle/src/main/org/acme/
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Demo.java
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Gizmo.java
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Widget.java
trunk/central/tutorials/components/lifestyle/src/test/
trunk/central/tutorials/components/lifestyle/src/test/org/
trunk/central/tutorials/components/lifestyle/src/test/org/acme/
trunk/central/tutorials/components/lifestyle/src/test/org/acme/test/

trunk/central/tutorials/components/lifestyle/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/logging/
trunk/central/tutorials/components/logging/build.xml
trunk/central/tutorials/components/logging/etc/
trunk/central/tutorials/components/logging/etc/data/
trunk/central/tutorials/components/logging/etc/data/logging.properties
trunk/central/tutorials/components/logging/src/
trunk/central/tutorials/components/logging/src/main/
trunk/central/tutorials/components/logging/src/main/org/
trunk/central/tutorials/components/logging/src/main/org/acme/
trunk/central/tutorials/components/logging/src/main/org/acme/Demo.java
trunk/central/tutorials/components/logging/src/main/org/acme/logging/
trunk/central/tutorials/components/logging/src/test/
trunk/central/tutorials/components/logging/src/test/org/
trunk/central/tutorials/components/logging/src/test/org/acme/
trunk/central/tutorials/components/logging/src/test/org/acme/test/

trunk/central/tutorials/components/logging/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/lookup/
trunk/central/tutorials/components/lookup/ABOUT.TXT
trunk/central/tutorials/components/lookup/build.xml
trunk/central/tutorials/components/lookup/etc/
trunk/central/tutorials/components/lookup/etc/data/
trunk/central/tutorials/components/lookup/etc/data/logging.properties
trunk/central/tutorials/components/lookup/src/
trunk/central/tutorials/components/lookup/src/main/
trunk/central/tutorials/components/lookup/src/main/org/
trunk/central/tutorials/components/lookup/src/main/org/acme/
trunk/central/tutorials/components/lookup/src/main/org/acme/Demo.java
trunk/central/tutorials/components/lookup/src/main/org/acme/Gizmo.java
trunk/central/tutorials/components/lookup/src/main/org/acme/Widget.java
trunk/central/tutorials/components/lookup/src/test/
trunk/central/tutorials/components/lookup/src/test/org/
trunk/central/tutorials/components/lookup/src/test/org/acme/
trunk/central/tutorials/components/lookup/src/test/org/acme/test/

trunk/central/tutorials/components/lookup/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/parts/
trunk/central/tutorials/components/parts/build.xml
trunk/central/tutorials/components/parts/src/
trunk/central/tutorials/components/parts/src/main/
trunk/central/tutorials/components/parts/src/main/org/
trunk/central/tutorials/components/parts/src/main/org/acme/
trunk/central/tutorials/components/parts/src/main/org/acme/Demo.java
trunk/central/tutorials/components/parts/src/main/org/acme/Widget.java
trunk/central/tutorials/components/parts/src/test/
trunk/central/tutorials/components/parts/src/test/org/
trunk/central/tutorials/components/parts/src/test/org/acme/
trunk/central/tutorials/components/parts/src/test/org/acme/test/

trunk/central/tutorials/components/parts/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/singleton/
trunk/central/tutorials/components/singleton/ABOUT.TXT
trunk/central/tutorials/components/singleton/build.xml
trunk/central/tutorials/components/singleton/etc/
trunk/central/tutorials/components/singleton/etc/data/
trunk/central/tutorials/components/singleton/etc/data/logging.properties
trunk/central/tutorials/components/singleton/src/
trunk/central/tutorials/components/singleton/src/main/
trunk/central/tutorials/components/singleton/src/main/org/
trunk/central/tutorials/components/singleton/src/main/org/acme/
trunk/central/tutorials/components/singleton/src/main/org/acme/Demo.java
trunk/central/tutorials/components/singleton/src/main/org/acme/Gizmo.java
trunk/central/tutorials/components/singleton/src/test/
trunk/central/tutorials/components/singleton/src/test/org/
trunk/central/tutorials/components/singleton/src/test/org/acme/
trunk/central/tutorials/components/singleton/src/test/org/acme/test/

trunk/central/tutorials/components/singleton/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/state/
trunk/central/tutorials/components/state/ABOUT.TXT
trunk/central/tutorials/components/state/build.xml
trunk/central/tutorials/components/state/etc/
trunk/central/tutorials/components/state/etc/data/
trunk/central/tutorials/components/state/etc/data/logging.properties
trunk/central/tutorials/components/state/src/
trunk/central/tutorials/components/state/src/main/
trunk/central/tutorials/components/state/src/main/org/
trunk/central/tutorials/components/state/src/main/org/acme/
trunk/central/tutorials/components/state/src/main/org/acme/Demo.java
trunk/central/tutorials/components/state/src/test/
trunk/central/tutorials/components/state/src/test/org/
trunk/central/tutorials/components/state/src/test/org/acme/
trunk/central/tutorials/components/state/src/test/org/acme/test/

trunk/central/tutorials/components/state/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/thread/
trunk/central/tutorials/components/thread/ABOUT.TXT
trunk/central/tutorials/components/thread/build.xml
trunk/central/tutorials/components/thread/etc/
trunk/central/tutorials/components/thread/etc/data/
trunk/central/tutorials/components/thread/etc/data/logging.properties
trunk/central/tutorials/components/thread/src/
trunk/central/tutorials/components/thread/src/main/
trunk/central/tutorials/components/thread/src/main/org/
trunk/central/tutorials/components/thread/src/main/org/acme/
trunk/central/tutorials/components/thread/src/main/org/acme/Demo.java
trunk/central/tutorials/components/thread/src/main/org/acme/Gizmo.java
trunk/central/tutorials/components/thread/src/test/
trunk/central/tutorials/components/thread/src/test/org/
trunk/central/tutorials/components/thread/src/test/org/acme/
trunk/central/tutorials/components/thread/src/test/org/acme/test/

trunk/central/tutorials/components/thread/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/transient/
trunk/central/tutorials/components/transient/ABOUT.TXT
trunk/central/tutorials/components/transient/build.xml
trunk/central/tutorials/components/transient/etc/
trunk/central/tutorials/components/transient/etc/data/
trunk/central/tutorials/components/transient/etc/data/logging.properties
trunk/central/tutorials/components/transient/src/
trunk/central/tutorials/components/transient/src/main/
trunk/central/tutorials/components/transient/src/main/org/
trunk/central/tutorials/components/transient/src/main/org/acme/
trunk/central/tutorials/components/transient/src/main/org/acme/Demo.java
trunk/central/tutorials/components/transient/src/main/org/acme/Gizmo.java
trunk/central/tutorials/components/transient/src/test/
trunk/central/tutorials/components/transient/src/test/org/
trunk/central/tutorials/components/transient/src/test/org/acme/
trunk/central/tutorials/components/transient/src/test/org/acme/test/

trunk/central/tutorials/components/transient/src/test/org/acme/test/DemoTestCase.java
trunk/central/tutorials/components/type/
trunk/central/tutorials/components/type/ABOUT.TXT
trunk/central/tutorials/components/type/build.xml
trunk/central/tutorials/components/type/etc/
trunk/central/tutorials/components/type/etc/data/
trunk/central/tutorials/components/type/etc/data/logging.properties
trunk/central/tutorials/components/type/src/
trunk/central/tutorials/components/type/src/main/
trunk/central/tutorials/components/type/src/main/org/
trunk/central/tutorials/components/type/src/main/org/acme/
trunk/central/tutorials/components/type/src/main/org/acme/Demo.java
trunk/central/tutorials/components/type/src/main/org/acme/Widget.java
trunk/central/tutorials/components/type/src/test/
trunk/central/tutorials/components/type/src/test/org/
trunk/central/tutorials/components/type/src/test/org/acme/
trunk/central/tutorials/components/type/src/test/org/acme/test/

trunk/central/tutorials/components/type/src/test/org/acme/test/DemoTestCase.java
Log:
add component tutorials

Added: trunk/central/tutorials/components/context/build.xml
===================================================================
--- trunk/central/tutorials/components/context/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/context/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/context/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/context/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/context/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ //------------------------------------------------------------------
+ // context
+ //------------------------------------------------------------------
+
+ /**
+ * The internal context interface through which the component declares
+ * its operational prerequisited.
+ */
+ public interface Context
+ {
+ /**
+ * Return a string describing an activity that our object should
+ * perform. An activity is a word such as "painting" or "coloring"
+ * or any other color related activity you can think of. The
component
+ * implementation will construct a phrase using this word as the
operative
+ * activity.
+ *
+ * @return the activity verb
+ */
+ String getActivity();
+
+ /**
+ * When constructing a phrase the implementation uses a owner to
+ * distringuish the ownership of the subject to which it is applying
+ * an activity. The value returned by this method could be a user's
name
+ * or an alias such as "batman".
+ *
+ * @return the owner's name
+ */
+ String getOwner();
+
+ /**
+ * The object implementation applies an activity to an owners object.
The
+ * name of the object is provided in the form of a target. A target
could
+ * be a house, a bike, a car, or whatever object appeals to the
manager of
+ * the object.
+ *
+ * @return the name of the owner's target to which the activity will
+ * be applied
+ */
+ String getTarget();
+
+ /**
+ * Returns the color to be used during construction of the activity
statement.
+ *
+ * @return the color value
+ */
+ String getColor();
+ }
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ * @param context the deployment context
+ */
+ public Demo( final Logger logger, final Context context )
+ {
+ if( logger.isLoggable( Level.INFO ) )
+ {
+ final String owner = context.getOwner();
+ final String activity = context.getActivity();
+ final String target = context.getTarget();
+ final String color = context.getColor();
+ final String message =
+ activity
+ + " "
+ + owner
+ + "'s "
+ + target
+ + " "
+ + color
+ + ".";
+ logger.info( message );
+ }
+ }
+}

Added:
trunk/central/tutorials/components/context/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/context/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/context/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/customize/clock/build.xml
===================================================================
--- trunk/central/tutorials/components/customize/clock/build.xml
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/customize/clock/build.xml
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added:
trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/Clock.java
===================================================================
---
trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/Clock.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/Clock.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.clock;
+
+import java.util.Date;
+
+/**
+ * Clock interface.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface Clock
+{
+ String getTimestamp();
+}

Added:
trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/SimpleClock.java
===================================================================
---
trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/SimpleClock.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/customize/clock/src/main/org/acme/clock/SimpleClock.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.clock;
+
+import java.util.Date;
+import java.util.Locale;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * A minimal implementation of a clock.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class SimpleClock implements Clock
+{
+ //------------------------------------------------------------------
+ // static
+ //------------------------------------------------------------------
+
+ private static final String DEFAULT_PATTERN = "K:mm a, z";
+ private static final Locale DEFAULT_LOCALE = Locale.getDefault();
+
+ //------------------------------------------------------------------
+ // criteria
+ //------------------------------------------------------------------
+
+ /**
+ * Declaration of the context information required by the implementation.
+ */
+ public interface Context
+ {
+ /**
+ * Return the optional date format as a string.
+ * @param format the default value
+ * @return the date format value
+ */
+ public String getFormat( final String format );
+
+ /**
+ * Return the operational locale.
+ * @param locale the default value
+ * @return the locale
+ */
+ public Locale getLocale( final Locale locale );
+ }
+
+ //------------------------------------------------------------------
+ // state
+ //------------------------------------------------------------------
+
+ private final Context m_context;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new instance.
+ * @param context the initial configuration
+ */
+ public SimpleClock( final Context context )
+ {
+ m_context = context;
+ }
+
+ //------------------------------------------------------------------
+ // Clock
+ //------------------------------------------------------------------
+
+ /**
+ * Return the current time as a formatted string.
+ * @return the current time as a string
+ */
+ public String getTimestamp()
+ {
+ Date date = new Date();
+ DateFormat formatter = getDateFormatter();
+ return formatter.format( date );
+ }
+
+ private DateFormat getDateFormatter()
+ {
+ String format = m_context.getFormat( DEFAULT_PATTERN );
+ Locale locale = m_context.getLocale( DEFAULT_LOCALE );
+ return new SimpleDateFormat( format, locale );
+ }
+}

Added:
trunk/central/tutorials/components/customize/clock/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/customize/clock/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/customize/clock/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.clock.Clock;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Clock clock = (Clock) part.getContent();
+ System.out.println( clock.getTimestamp() );
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added:
trunk/central/tutorials/components/customize/custom/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/customize/custom/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/customize/custom/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.clock.Clock;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Clock clock = (Clock) part.getContent();
+ System.out.println( clock.getTimestamp() );
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/customize/module.xml
===================================================================
--- trunk/central/tutorials/components/customize/module.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/customize/module.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<module name="customize" xmlns="link:xsd:dpml/lang/dpml-module#1.0" >
+
+ <project name="acme-simple-clock" basedir="clock">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.clock.SimpleClock">
+ <context>
+ <entry key="format" value="K:mm a, z"/>
+ </context>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include ref="org/acme/acme-type-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-custom-clock" basedir="custom">
+ <types>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ uri="resource:part:org/acme/customize/acme-simple-clock">
+ <context>
+ <entry key="format" value="h:mm a"/>
+ </context>
+ </component>
+ </types>
+ <dependencies>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ <include key="acme-simple-clock"/>
+ </test>
+ </dependencies>
+ </project>
+
+</module>

Added: trunk/central/tutorials/components/examples/build.xml
===================================================================
--- trunk/central/tutorials/components/examples/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/examples/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/examples/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/examples/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/examples/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,273 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+import java.io.File;
+import java.net.URI;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A component with a context
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ //------------------------------------------------------------------
+ // context
+ //------------------------------------------------------------------
+
+ /**
+ * Component driven context criteria.
+ */
+ public interface Context
+ {
+ /**
+ * Return the assigned color.
+ * @return the required color value
+ */
+ Color getColor();
+
+ /**
+ * Return the optional color.
+ * @param color the default color value
+ * @return the resolved color value
+ */
+ Color getOptionalColor( Color color );
+
+ /**
+ * Return a constructed color.
+ * @param color another color value
+ * @return the color value
+ */
+ Color getAnotherColor();
+
+ /**
+ * Return as assigned non-optional integer value.
+ * @return the integer value
+ */
+ int getInteger();
+
+ /**
+ * Return as resolved optional integer value.
+ * @param value the default value
+ * @return the integer value
+ */
+ int getOptionalInteger( int value );
+
+ /**
+ * Return as assigned non-optional short value.
+ * @return the short value
+ */
+ short getShort();
+
+ /**
+ * Return as resolved optional short value.
+ * @param value the default value
+ * @return the short value
+ */
+ short getOptionalShort( short value );
+
+ /**
+ * Return as assigned non-optional long value.
+ * @return the long value
+ */
+ long getLong();
+
+ /**
+ * Return as resolved optional long value.
+ * @param value the default value
+ * @return the long value
+ */
+ long getOptionalLong( long value );
+
+ /**
+ * Return as assigned non-optional byte value.
+ * @return the byte value
+ */
+ byte getByte();
+
+ /**
+ * Return as resolved optional byte value.
+ * @param value the default value
+ * @return the byte value
+ */
+ byte getOptionalByte( byte value );
+
+ /**
+ * Return as assigned non-optional double value.
+ * @return the double value
+ */
+ double getDouble();
+
+ /**
+ * Return as resolved optional double value.
+ * @param value the default value
+ * @return the double value
+ */
+ double getOptionalDouble( double value );
+
+ /**
+ * Return as assigned non-optional float value.
+ * @return the float value
+ */
+ float getFloat();
+
+ /**
+ * Return as resolved optional float value.
+ * @param value the default value
+ * @return the float value
+ */
+ float getOptionalFloat( float value );
+
+ /**
+ * Return as assigned non-optional char value.
+ * @return the char value
+ */
+ char getChar();
+
+ /**
+ * Return as resolved optional char value.
+ * @param value the default value
+ * @return the char value
+ */
+ char getOptionalChar( char value );
+
+ /**
+ * Return as assigned non-optional boolean value.
+ * @return the boolean value
+ */
+ boolean getBoolean();
+
+ /**
+ * Return as resolved optional boolean value.
+ * @param flag the default value
+ * @return the boolean value
+ */
+ boolean getOptionalBoolean( boolean flag );
+
+ /**
+ * Return as assigned non-optional file value.
+ * @return the file value
+ */
+ File getFile();
+
+ /**
+ * Return as resolved optional file value.
+ * @param value the default value
+ * @return the file value
+ */
+ File getOptionalFile( File value );
+
+ /**
+ * Return a non-optional temporary file value.
+ * @return the temp file value
+ */
+ File getTempFile();
+
+ /**
+ * Return as assigned non-optional uri value.
+ * @return the uri value
+ */
+ URI getURI();
+
+ /**
+ * Return a optional uri value.
+ * @param value the default value
+ * @return the uri value
+ */
+ URI getOptionalURI( URI value );
+
+ /**
+ * Return as assigned non-optional name.
+ * @return the name
+ */
+ String getName();
+
+ /**
+ * Return as assigned non-optional path.
+ * @return the path
+ */
+ String getPath();
+
+ /**
+ * Return as assigned non-optional array of names.
+ * @return the name array
+ */
+ String[] getNames();
+
+ }
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ * @param context the deployment context
+ */
+ public Demo( final Logger logger, final Context context ) throws
Exception
+ {
+ short s = 9;
+ long l = 21;
+ byte b = 3;
+ double d = 0.001;
+ float f = 3.142f;
+ char c = '#';
+ File file = new File( System.getProperty( "user.dir" ) );
+ File tmp = new File( System.getProperty( "java.io.tmpdir" ) );
+ URI uri = file.toURI();
+
+ if( logger.isLoggable( Level.INFO ) )
+ {
+ logger.info( "color: " + context.getColor() );
+ logger.info( "anotherColor: " + context.getAnotherColor() );
+ logger.info( "integer: " + context.getInteger() );
+ logger.info( "short: " + context.getShort() );
+ logger.info( "long: " + context.getLong() );
+ logger.info( "byte: " + context.getByte() );
+ logger.info( "double: " + context.getDouble() );
+ logger.info( "float: " + context.getFloat() );
+ logger.info( "char: " + context.getChar() );
+ logger.info( "boolean: " + context.getBoolean() );
+ logger.info( "file: " + context.getFile() );
+ logger.info( "temp: " + context.getTempFile() );
+ logger.info( "uri: " + context.getURI() );
+ logger.info( "name: " + context.getName() );
+ logger.info( "path: " + context.getPath() );
+ logger.info( "names: " + context.getNames().length );
+ logger.info( "optionalColor: " + context.getOptionalColor(
Color.BLUE ) );
+ logger.info( "optionalInteger: " + context.getOptionalInteger(
42 ) );
+ logger.info( "optionalShort: " + context.getOptionalLong( s ) );
+ logger.info( "optionalLong: " + context.getOptionalLong( l ) );
+ logger.info( "optionalByte: " + context.getOptionalByte( b ) );
+ logger.info( "optionalDouble: " + context.getOptionalDouble( d )
);
+ logger.info( "optionalFloat: " + context.getOptionalFloat( f ) );
+ logger.info( "optionalChar: " + context.getOptionalChar( c ) );
+ logger.info( "optionalBoolean: " + context.getOptionalBoolean(
false ) );
+ logger.info( "optionalFile: " + context.getOptionalFile( file )
);
+ logger.info( "optionalURI: " + context.getOptionalURI( uri ) );
+ }
+ }
+}

Added:
trunk/central/tutorials/components/examples/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/examples/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/examples/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/hello/build.xml
===================================================================
--- trunk/central/tutorials/components/hello/build.xml 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/hello/build.xml 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/hello/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/hello/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/hello/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the supplied logging channel
+ */
+ public Demo( Logger logger )
+ {
+ if( logger.isLoggable( Level.INFO ) )
+ {
+ logger.info( "Hello!" );
+ }
+ }
+}

Added:
trunk/central/tutorials/components/hello/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/hello/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/hello/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/import/api/build.xml
===================================================================
--- trunk/central/tutorials/components/import/api/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/import/api/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added:
trunk/central/tutorials/components/import/api/src/main/org/acme/Clock.java
===================================================================
---
trunk/central/tutorials/components/import/api/src/main/org/acme/Clock.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/import/api/src/main/org/acme/Clock.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.Date;
+
+/**
+ * Clock interface.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface Clock
+{
+ String getTimestamp();
+}

Added: trunk/central/tutorials/components/import/clock/build.xml
===================================================================
--- trunk/central/tutorials/components/import/clock/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/import/clock/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added:
trunk/central/tutorials/components/import/clock/src/main/org/acme/scheduler/SimpleClock.java
===================================================================
---
trunk/central/tutorials/components/import/clock/src/main/org/acme/scheduler/SimpleClock.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/import/clock/src/main/org/acme/scheduler/SimpleClock.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.scheduler;
+
+import java.util.Date;
+import java.util.Locale;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import org.acme.Clock;
+
+/**
+ * A minimal implementation of a clock.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class SimpleClock implements Clock
+{
+ //------------------------------------------------------------------
+ // static
+ //------------------------------------------------------------------
+
+ private static final String DEFAULT_PATTERN = "K:mm a, z";
+ private static final Locale DEFAULT_LOCALE = Locale.getDefault();
+
+ //------------------------------------------------------------------
+ // criteria
+ //------------------------------------------------------------------
+
+ /**
+ * Declaration of the context information required by the implementation.
+ */
+ public interface Context
+ {
+ /**
+ * Return the optional date format as a string.
+ * @param format the default value
+ * @return the date format value
+ */
+ public String getFormat( final String format );
+
+ /**
+ * Return the operational locale.
+ * @param locale the default value
+ * @return the locale
+ */
+ public Locale getLocale( final Locale locale );
+ }
+
+ //------------------------------------------------------------------
+ // state
+ //------------------------------------------------------------------
+
+ private final Context m_context;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new instance.
+ * @param context the initial configuration
+ */
+ public SimpleClock( final Context context )
+ {
+ m_context = context;
+ }
+
+ //------------------------------------------------------------------
+ // Clock
+ //------------------------------------------------------------------
+
+ /**
+ * Return the current time as a formatted string.
+ * @return the current time as a string
+ */
+ public String getTimestamp()
+ {
+ Date date = new Date();
+ DateFormat formatter = getDateFormatter();
+ return formatter.format( date );
+ }
+
+ private DateFormat getDateFormatter()
+ {
+ String format = m_context.getFormat( DEFAULT_PATTERN );
+ Locale locale = m_context.getLocale( DEFAULT_LOCALE );
+ return new SimpleDateFormat( format, locale );
+ }
+}

Added: trunk/central/tutorials/components/import/demo/build.xml
===================================================================
--- trunk/central/tutorials/components/import/demo/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/import/demo/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added:
trunk/central/tutorials/components/import/demo/etc/data/logging.properties
===================================================================
---
trunk/central/tutorials/components/import/demo/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/import/demo/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,7 @@
+.level=FINEST
+sun.rmi.level=INFO
+dpml.metro.level=INFO
+dpml.transit.level=INFO
+dpml.lang.level=INFO
+demo.level=FINE
+

Added:
trunk/central/tutorials/components/import/demo/src/main/org/acme/demo/Demo.java
===================================================================
---
trunk/central/tutorials/components/import/demo/src/main/org/acme/demo/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/import/demo/src/main/org/acme/demo/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.demo;
+
+import org.acme.Clock;
+
+import net.dpml.logging.Logger;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ //------------------------------------------------------------------
+ // criteria
+ //------------------------------------------------------------------
+
+ public interface Parts
+ {
+ Clock getClock();
+ }
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ public Demo( final Logger logger, final Parts parts )
+ {
+ Clock clock = parts.getClock();
+ logger.info(
+ clock.getTimestamp()
+ + " (from " + clock.getClass().getName()
+ + ")"
+ );
+ }
+}

Added:
trunk/central/tutorials/components/import/demo/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/import/demo/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/import/demo/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.demo.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/import/module.xml
===================================================================
--- trunk/central/tutorials/components/import/module.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/import/module.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<module name="import" xmlns="link:xsd:dpml/lang/dpml-module#1.0" >
+
+ <project name="acme-clock-api" basedir="api">
+ <types>
+ <type id="jar"/>
+ </types>
+ <dependencies>
+ <build>
+ <include ref="org/acme/customize"/>
+ </build>
+ </dependencies>
+ </project>
+
+ <project name="acme-clock-impl" basedir="clock">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.scheduler.SimpleClock"/>
+ </types>
+ <dependencies>
+ <runtime>
+ <include key="acme-clock-api"/>
+ </runtime>
+ </dependencies>
+ </project>
+
+ <project name="acme-clock-demo" basedir="demo">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.demo.Demo">
+ <parts>
+ <component key="clock"
uri="resource:part:org/acme/import/acme-clock-impl">
+ <context>
+ <entry key="format" value="h:mm a"/>
+ </context>
+ </component>
+ </parts>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-clock-impl"/>
+ </build>
+ <runtime>
+ <include key="acme-clock-api"/>
+ <include ref="dpml/util/dpml-logging-api"/>
+ </runtime>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+</module>

Added: trunk/central/tutorials/components/index.xml
===================================================================
--- trunk/central/tutorials/components/index.xml 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/index.xml 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<index xmlns="link:xsd:dpml/lang/dpml-module#1.0">
+
+ <imports>
+ <import uri="link:module:ant"/>
+ <import uri="link:module:dpml"/>
+ </imports>
+
+ <modules>
+
+ <module name="org/acme">
+
+ <properties>
+ <property name="project.publisher.name" value="OSM"/>
+ <property name="project.publisher.url" value="http://www.osm.net"/>
+ </properties>
+
+ <filters>
+ <filter token="PUBLISHER-NAME" value="${project.publisher.name}"/>
+ <filter token="PUBLISHER-URL" value="${project.publisher.url}"/>
+ <feature token="PROJECT-VERSION" id="version"/>
+ </filters>
+
+ <!-- a minimal component -->
+
+ <project name="acme-demo-hello" basedir="hello">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo"/>
+ </types>
+ <dependencies>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <!-- adding context inner interface -->
+
+ <project name="acme-demo-context" basedir="context">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <context>
+ <entry key="owner" value="${user.name}"/>
+ <entry key="activity" value="Painting"/>
+ <entry key="target" value="bike"/>
+ <entry key="color" value="silver"/>
+ </context>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-demo-hello"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <!-- demonstrating context primitives, arrays, and constructed values
-->
+
+ <project name="acme-demo-examples" basedir="examples">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <context>
+ <entry key="color" method="RED"/>
+ <entry key="anotherColor">
+ <param class="int" value="100"/>
+ <param class="int" value="200"/>
+ <param class="int" value="0"/>
+ </entry>
+ <entry key="integer" value="42"/>
+ <entry key="short" value="19"/>
+ <entry key="long" value="1042"/>
+ <entry key="byte" value="9"/>
+ <entry key="double" value="32"/>
+ <entry key="float" value="9.813"/>
+ <entry key="char" value="x"/>
+ <entry key="boolean" value="true"/>
+ <entry key="file" value="${work}"/>
+ <entry key="tempFile" value="${temp}"/>
+ <entry key="URI" value="${uri}"/>
+ <entry key="name" value="${name}"/>
+ <entry key="path" value="${path}"/>
+ <entry key="names">
+ <param value="fred"/>
+ <param value="george"/>
+ <param value="mary"/>
+ </entry>
+ </context>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-demo-context"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-parts-demo" basedir="parts">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <parts>
+ <component key="widget" type="org.acme.Widget" name="widget">
+ <context>
+ <entry key="color" method="BLUE"/>
+ </context>
+ </component>
+ </parts>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-demo-examples"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-lookup-demo" basedir="lookup">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <parts>
+ <component key="widget" type="org.acme.Widget" name="widget">
+ <context>
+ <entry key="color" method="BLUE"/>
+ </context>
+ </component>
+ <component key="gizmo" type="org.acme.Gizmo" name="gizmo">
+ <context>
+ <entry key="widget" lookup="org.acme.Widget"/>
+ </context>
+ </component>
+ </parts>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-parts-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-lifestyle-demo" basedir="lifestyle">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <parts>
+ <component key="widget" type="org.acme.Widget" name="widget"
lifestyle="transient">
+ <context>
+ <entry key="color" method="BLUE"/>
+ </context>
+ </component>
+ <component key="gizmo" type="org.acme.Gizmo" name="gizmo">
+ <context>
+ <entry key="widget" lookup="org.acme.Widget"/>
+ </context>
+ </component>
+ </parts>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-lookup-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-transient-demo" basedir="transient">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <context>
+ <entry key="count" value="5"/>
+ </context>
+ <parts>
+ <component key="gizmo" type="org.acme.Gizmo"
lifestyle="transient"/>
+ </parts>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-lifestyle-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-thread-demo" basedir="thread">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <context>
+ <entry key="threadCount" value="3"/>
+ <entry key="accessCount" value="2"/>
+ </context>
+ <parts>
+ <component key="gizmo" type="org.acme.Gizmo"
lifestyle="thread"/>
+ </parts>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-transient-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-singleton-demo" basedir="singleton">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo">
+ <context>
+ <entry key="threadCount" value="3"/>
+ <entry key="accessCount" value="2"/>
+ </context>
+ <parts>
+ <component key="gizmo" type="org.acme.Gizmo"
lifestyle="singleton"/>
+ </parts>
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-thread-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-state-demo" basedir="state">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo"
+ lifestyle="transient">
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-singleton-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-logging-demo" basedir="logging">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"
+ name="demo"
+ lifestyle="transient">
+ </component>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-state-demo"/>
+ </build>
+ <runtime>
+ <include ref="dpml/util/dpml-logging-api"/>
+ </runtime>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <project name="acme-type-demo" basedir="type">
+ <types>
+ <type id="jar"/>
+ <component xmlns="link:xsd:dpml/lang/dpml-component#1.0"
+ type="org.acme.Demo"/>
+ </types>
+ <dependencies>
+ <build>
+ <include key="acme-logging-demo"/>
+ </build>
+ <test>
+ <include ref="ant/ant-junit"/>
+ <include ref="dpml/transit/dpml-transit-main"/>
+ </test>
+ </dependencies>
+ </project>
+
+ <module file="customize/module.xml"/>
+
+ <module file="import/module.xml"/>
+
+ </module>
+
+ </modules>
+
+</index>

Added: trunk/central/tutorials/components/lifestyle/ABOUT.TXT
===================================================================
--- trunk/central/tutorials/components/lifestyle/ABOUT.TXT 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lifestyle/ABOUT.TXT 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1 @@
+Demonstrating the impact of changing a componet lifestyle to TRANSIENT.
\ No newline at end of file

Added: trunk/central/tutorials/components/lifestyle/build.xml
===================================================================
--- trunk/central/tutorials/components/lifestyle/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lifestyle/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added:
trunk/central/tutorials/components/lifestyle/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/lifestyle/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lifestyle/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,3 @@
+.level=INFO
+demo.level=FINE
+

Added:
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/lifestyle/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lifestyle/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Parts
+ {
+ /**
+ * Return the gizmo.
+ * @return the gizmo
+ */
+ Gizmo getGizmo();
+ }
+
+ private Logger m_logger;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ * @param parts the internal parts
+ */
+ public Demo( final Logger logger, final Parts parts )
+ {
+ m_logger = logger;
+ if( logger.isLoggable( Level.INFO ) )
+ {
+ Gizmo gizmo = parts.getGizmo();
+ Widget widget = gizmo.getWidget();
+ Color color = widget.getColor();
+ logger.info( "located the color " + color );
+ }
+ }
+}

Added:
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Gizmo.java
===================================================================
--- trunk/central/tutorials/components/lifestyle/src/main/org/acme/Gizmo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lifestyle/src/main/org/acme/Gizmo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Gizmo
+{
+ /**
+ * Gizmo dependencies.
+ */
+ public interface Context
+ {
+ /**
+ * Return the reference to a Widget service.
+ * @return the widget
+ */
+ Widget getWidget();
+ }
+
+ private final Context m_context;
+
+ /**
+ * Creation of a new gizmo.
+ * @param context the deployment context
+ */
+ public Gizmo( Context context )
+ {
+ m_context = context;
+ }
+
+ /**
+ * Return the wdget resolved via the dployment context.
+ * @return the widget
+ */
+ public Widget getWidget()
+ {
+ return m_context.getWidget();
+ }
+}

Added:
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Widget.java
===================================================================
---
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Widget.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/lifestyle/src/main/org/acme/Widget.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Widget
+{
+ //------------------------------------------------------------------
+ // context
+ //------------------------------------------------------------------
+
+ /**
+ * The internal context interface through which the component declares
+ * its operational prerequisited.
+ */
+ public interface Context
+ {
+ /**
+ * Return the color.
+ *
+ * @return the color
+ */
+ Color getColor();
+ }
+
+ //------------------------------------------------------------------
+ // immutable state
+ //------------------------------------------------------------------
+
+ private final Context m_context;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new widget.
+ * @param context the deployment context
+ */
+ public Widget( final Context context )
+ {
+ m_context = context;
+ }
+
+ //------------------------------------------------------------------
+ // services
+ //------------------------------------------------------------------
+
+ /**
+ * Return the color value assigned via the component context.
+ * @return the color
+ */
+ public Color getColor()
+ {
+ return m_context.getColor();
+ }
+}

Added:
trunk/central/tutorials/components/lifestyle/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/lifestyle/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/lifestyle/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri, false );
+ Demo demo = (Demo) part.getContent();
+ demo = null;
+ System.gc();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/logging/build.xml
===================================================================
--- trunk/central/tutorials/components/logging/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/logging/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/logging/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/logging/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/logging/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,3 @@
+.level=INFO
+demo.level=FINE
+

Added: trunk/central/tutorials/components/logging/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/logging/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/logging/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import net.dpml.logging.Logger;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the supplied logging channel
+ */
+ public Demo( Logger logger )
+ {
+ if( logger.isTraceEnabled() )
+ {
+ logger.trace( "commencing instantiation cycle" );
+ }
+ if( logger.isInfoEnabled() )
+ {
+ logger.info( "Hello!" );
+ }
+ if( logger.isDebugEnabled() )
+ {
+ logger.debug( "instantiation complete" );
+ }
+ }
+}

Added:
trunk/central/tutorials/components/logging/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/logging/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/logging/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/lookup/ABOUT.TXT
===================================================================
--- trunk/central/tutorials/components/lookup/ABOUT.TXT 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/lookup/ABOUT.TXT 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1 @@
+Demonstrating the lookup argument in a context directive.
\ No newline at end of file

Added: trunk/central/tutorials/components/lookup/build.xml
===================================================================
--- trunk/central/tutorials/components/lookup/build.xml 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/lookup/build.xml 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/lookup/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/lookup/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lookup/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,3 @@
+.level=INFO
+demo.level=FINE
+

Added: trunk/central/tutorials/components/lookup/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/lookup/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lookup/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Parts
+ {
+ /**
+ * Return the gizmo.
+ * @return the gizmo
+ */
+ Gizmo getGizmo();
+ }
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ * @param parts the internal parts
+ */
+ public Demo( final Logger logger, final Parts parts )
+ {
+ if( logger.isLoggable( Level.INFO ) )
+ {
+ Gizmo gizmo = parts.getGizmo();
+ Widget widget = gizmo.getWidget();
+ Color color = widget.getColor();
+ logger.info( "located the color " + color );
+ }
+ }
+}

Added: trunk/central/tutorials/components/lookup/src/main/org/acme/Gizmo.java
===================================================================
--- trunk/central/tutorials/components/lookup/src/main/org/acme/Gizmo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lookup/src/main/org/acme/Gizmo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Gizmo
+{
+ /**
+ * Gizmo dependencies.
+ */
+ public interface Context
+ {
+ /**
+ * Return the reference to a Widget service.
+ * @return the widget
+ */
+ Widget getWidget();
+ }
+
+ private final Context m_context;
+
+ /**
+ * Creation of a new gizmo.
+ * @param context the deployment context
+ */
+ public Gizmo( Context context )
+ {
+ m_context = context;
+ }
+
+ /**
+ * Return the wdget resolved via the dployment context.
+ * @return the widget
+ */
+ public Widget getWidget()
+ {
+ return m_context.getWidget();
+ }
+}

Added: trunk/central/tutorials/components/lookup/src/main/org/acme/Widget.java
===================================================================
--- trunk/central/tutorials/components/lookup/src/main/org/acme/Widget.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/lookup/src/main/org/acme/Widget.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Widget
+{
+ //------------------------------------------------------------------
+ // context
+ //------------------------------------------------------------------
+
+ /**
+ * The internal context interface through which the component declares
+ * its operational prerequisited.
+ */
+ public interface Context
+ {
+ /**
+ * Return the color.
+ *
+ * @return the color
+ */
+ Color getColor();
+ }
+
+ //------------------------------------------------------------------
+ // immutable state
+ //------------------------------------------------------------------
+
+ private final Context m_context;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new widget.
+ * @param context the deployment context
+ */
+ public Widget( final Context context )
+ {
+ m_context = context;
+ }
+
+ //------------------------------------------------------------------
+ // services
+ //------------------------------------------------------------------
+
+ /**
+ * Return the color value assigned via the component context.
+ * @return the color
+ */
+ public Color getColor()
+ {
+ return m_context.getColor();
+ }
+}

Added:
trunk/central/tutorials/components/lookup/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/lookup/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/lookup/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Demo demo = (Demo) part.getContent();
+ //part = null;
+ //demo = null;
+ System.gc();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/parts/build.xml
===================================================================
--- trunk/central/tutorials/components/parts/build.xml 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/parts/build.xml 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/parts/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/parts/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/parts/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ //------------------------------------------------------------------
+ // context
+ //------------------------------------------------------------------
+
+ /**
+ * The internal parts interface through which this component may
+ * manage a collection of internal (strongly aggregated) components
+ * that make up the definition of this component.
+ */
+ public interface Parts
+ {
+ /**
+ * Return a internal widget.
+ *
+ * @return the widget
+ */
+ Widget getWidget();
+ }
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ * @param context the deployment context
+ */
+ public Demo( final Logger logger, final Parts parts )
+ {
+ if( logger.isLoggable( Level.INFO ) )
+ {
+ Widget widget = parts.getWidget();
+ Color color = widget.getColor();
+ logger.info( "located the color " + color );
+ }
+ }
+}

Added: trunk/central/tutorials/components/parts/src/main/org/acme/Widget.java
===================================================================
--- trunk/central/tutorials/components/parts/src/main/org/acme/Widget.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/parts/src/main/org/acme/Widget.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.awt.Color;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Widget
+{
+ //------------------------------------------------------------------
+ // context
+ //------------------------------------------------------------------
+
+ /**
+ * The internal context interface through which the component declares
+ * its operational prerequisited.
+ */
+ public interface Context
+ {
+ /**
+ * Return the color.
+ *
+ * @return the color
+ */
+ Color getColor();
+ }
+
+ //------------------------------------------------------------------
+ // immutable state
+ //------------------------------------------------------------------
+
+ private final Context m_context;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ * @param context the deployment context
+ */
+ public Widget( final Context context )
+ {
+ m_context = context;
+ }
+
+ //------------------------------------------------------------------
+ // services
+ //------------------------------------------------------------------
+
+ /**
+ * Return the color value assigned via the component context.
+ * @return the color
+ */
+ public Color getColor()
+ {
+ return m_context.getColor();
+ }
+}

Added:
trunk/central/tutorials/components/parts/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/parts/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/parts/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/singleton/ABOUT.TXT
===================================================================
--- trunk/central/tutorials/components/singleton/ABOUT.TXT 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/singleton/ABOUT.TXT 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1 @@
+Demonstrating the SINGLETON lifestyle.
\ No newline at end of file

Added: trunk/central/tutorials/components/singleton/build.xml
===================================================================
--- trunk/central/tutorials/components/singleton/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/singleton/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added:
trunk/central/tutorials/components/singleton/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/singleton/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/singleton/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,4 @@
+.level=INFO
+#sun.rmi.level=INFO
+#dpml.metro.level=FINEST
+#demo.level=FINE

Added:
trunk/central/tutorials/components/singleton/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/singleton/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/singleton/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Context
+ {
+ /**
+ * Return the loop count
+ * @return the count
+ */
+ int getAccessCount();
+
+ /**
+ * Return the loop count
+ * @return the count
+ */
+ int getThreadCount();
+
+ }
+
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Parts
+ {
+ /**
+ * Return the gizmo.
+ * @return the gizmo
+ */
+ Gizmo getGizmo();
+ }
+
+ private final Parts m_parts;
+ private final Logger m_logger;
+ private final Context m_context;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel, context and
+ * internal parts.
+ * @param logger the logging channel
+ * @param context the deployment context
+ */
+ public Demo( final Logger logger, final Context context, Parts parts )
throws Exception
+ {
+ m_logger = logger;
+ m_parts = parts;
+ m_context = context;
+
+ int n = context.getThreadCount();
+ for( int i=0; i<n; i++ )
+ {
+ Thread thread = new Accessor();
+ thread.setName( "" + i );
+ thread.start();
+ }
+ }
+
+ private class Accessor extends Thread
+ {
+ public void run()
+ {
+ int n = m_context.getAccessCount();
+ Gizmo gizmo = m_parts.getGizmo();
+ for( int i=0; i<n; i++ )
+ {
+ int id = System.identityHashCode( gizmo );
+ m_logger.info( " gizmo (" + this + ") [" + id + "]" );
+ }
+ }
+ }
+}

Added:
trunk/central/tutorials/components/singleton/src/main/org/acme/Gizmo.java
===================================================================
--- trunk/central/tutorials/components/singleton/src/main/org/acme/Gizmo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/singleton/src/main/org/acme/Gizmo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Gizmo
+{
+}

Added:
trunk/central/tutorials/components/singleton/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/singleton/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/singleton/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri, false );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/state/ABOUT.TXT
===================================================================
--- trunk/central/tutorials/components/state/ABOUT.TXT 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/state/ABOUT.TXT 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1 @@
+Lifecycle state graph demo.
\ No newline at end of file

Added: trunk/central/tutorials/components/state/build.xml
===================================================================
--- trunk/central/tutorials/components/state/build.xml 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/state/build.xml 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+ <target name="init" depends="standard.init">
+ <x:plugin uri="link:part:dpml/metro/dpml-metro-tools">
+ <task name="state" class="net.dpml.metro.tools.StateTask"/>
+ </x:plugin>
+ </target>
+
+ <target name="build" depends="standard.build">
+ <state class="org.acme.Demo">
+ <trigger event="initialization">
+ <transition name="start" target="started">
+ <operation name="startup" method="start"/>
+ </transition>
+ </trigger>
+ <state name="started">
+ <transition name="stop" target="../stopped">
+ <operation name="stop" method="stop"/>
+ </transition>
+ <trigger event="termination">
+ <apply id="stop"/>
+ </trigger>
+ </state>
+ <state name="stopped">
+ <transition name="start" target="../started">
+ <operation name="start" method="start"/>
+ </transition>
+ </state>
+ </state>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/state/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/state/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/state/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,4 @@
+.level=INFO
+#sun.rmi.level=INFO
+#dpml.metro.level=FINEST
+demo.level=FINEST

Added: trunk/central/tutorials/components/state/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/state/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/state/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ private final Logger m_logger;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ */
+ public Demo( final Logger logger )
+ {
+ m_logger = logger;
+ }
+
+ public void start()
+ {
+ m_logger.info( "startup" );
+ }
+
+ public void stop()
+ {
+ m_logger.info( "shutdown" );
+ }
+}

Added:
trunk/central/tutorials/components/state/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/state/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/state/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri, false );
+ Demo demo = (Demo) part.getContent();
+ demo = null;
+ System.gc();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/thread/ABOUT.TXT
===================================================================
--- trunk/central/tutorials/components/thread/ABOUT.TXT 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/thread/ABOUT.TXT 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1 @@
+Demonstrating uniquness of values when access the parts interface with
differnet threads when the assigned component is associated with a per-THREAD
lifestyle.
\ No newline at end of file

Added: trunk/central/tutorials/components/thread/build.xml
===================================================================
--- trunk/central/tutorials/components/thread/build.xml 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/thread/build.xml 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/thread/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/thread/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/thread/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,4 @@
+.level=INFO
+#sun.rmi.level=INFO
+#dpml.metro.level=FINEST
+#demo.level=FINE

Added: trunk/central/tutorials/components/thread/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/thread/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/thread/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Context
+ {
+ /**
+ * Return the loop count
+ * @return the count
+ */
+ int getAccessCount();
+
+ /**
+ * Return the loop count
+ * @return the count
+ */
+ int getThreadCount();
+
+ }
+
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Parts
+ {
+ /**
+ * Return the gizmo.
+ * @return the gizmo
+ */
+ Gizmo getGizmo();
+ }
+
+ private final Parts m_parts;
+ private final Logger m_logger;
+ private final Context m_context;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel, context and
+ * internal parts.
+ * @param logger the logging channel
+ * @param context the deployment context
+ */
+ public Demo( final Logger logger, final Context context, Parts parts )
throws Exception
+ {
+ m_logger = logger;
+ m_parts = parts;
+ m_context = context;
+
+ int n = context.getThreadCount();
+ for( int i=0; i<n; i++ )
+ {
+ Thread thread = new Accessor();
+ thread.setName( "" + i );
+ thread.start();
+ }
+ }
+
+ private class Accessor extends Thread
+ {
+ public void run()
+ {
+ int n = m_context.getAccessCount();
+ Gizmo gizmo = m_parts.getGizmo();
+ for( int i=0; i<n; i++ )
+ {
+ int id = System.identityHashCode( gizmo );
+ m_logger.info( " gizmo (" + this + ") [" + id + "]" );
+ }
+ }
+ }
+}

Added: trunk/central/tutorials/components/thread/src/main/org/acme/Gizmo.java
===================================================================
--- trunk/central/tutorials/components/thread/src/main/org/acme/Gizmo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/thread/src/main/org/acme/Gizmo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Gizmo
+{
+}

Added:
trunk/central/tutorials/components/thread/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/thread/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/thread/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri, false );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/transient/ABOUT.TXT
===================================================================
--- trunk/central/tutorials/components/transient/ABOUT.TXT 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/transient/ABOUT.TXT 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1 @@
+Demonstrating uniquness of values when access the parts interface when the
assigned component is associated with a TRANSIENT lifestyle.
\ No newline at end of file

Added: trunk/central/tutorials/components/transient/build.xml
===================================================================
--- trunk/central/tutorials/components/transient/build.xml 2006-07-17
14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/transient/build.xml 2006-07-17
14:15:40 UTC (rev 1582)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project default="install"
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+</project>

Added:
trunk/central/tutorials/components/transient/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/transient/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/transient/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,4 @@
+.level=INFO
+#sun.rmi.level=INFO
+#dpml.metro.level=FINEST
+#demo.level=FINE

Added:
trunk/central/tutorials/components/transient/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/transient/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/transient/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo
+{
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Context
+ {
+ /**
+ * Return the loop count
+ * @return the count
+ */
+ int getCount();
+
+ }
+
+ /**
+ * Utility interface used to resolve internal parts.
+ */
+ public interface Parts
+ {
+ /**
+ * Return the gizmo.
+ * @return the gizmo
+ */
+ Gizmo getGizmo();
+ }
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel, context and
+ * internal parts.
+ * @param logger the logging channel
+ * @param context the deployment context
+ */
+ public Demo( final Logger logger, final Context context, Parts parts )
+ {
+ int n = context.getCount();
+ for( int i=0; i<n; i++ )
+ {
+ Gizmo gizmo = parts.getGizmo();
+ if( logger.isLoggable( Level.INFO ) )
+ {
+ int id = System.identityHashCode( gizmo );
+ logger.info( " gizmo [" + (i+1) + "] " + id );
+ }
+ }
+ }
+}

Added:
trunk/central/tutorials/components/transient/src/main/org/acme/Gizmo.java
===================================================================
--- trunk/central/tutorials/components/transient/src/main/org/acme/Gizmo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/transient/src/main/org/acme/Gizmo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+/**
+ * A test component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Gizmo
+{
+}

Added:
trunk/central/tutorials/components/transient/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/transient/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/transient/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri, false );
+ Demo demo = (Demo) part.getContent();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}

Added: trunk/central/tutorials/components/type/ABOUT.TXT
===================================================================
--- trunk/central/tutorials/components/type/ABOUT.TXT 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/type/ABOUT.TXT 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1 @@
+Lifecycle state graph demo.
\ No newline at end of file

Added: trunk/central/tutorials/components/type/build.xml
===================================================================
--- trunk/central/tutorials/components/type/build.xml 2006-07-17 14:08:06
UTC (rev 1581)
+++ trunk/central/tutorials/components/type/build.xml 2006-07-17 14:15:40
UTC (rev 1582)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="dpml:depot">
+
+ <transit:import uri="local:template:dpml/tools/standard"/>
+
+ <target name="prepare" depends="standard.prepare">
+ <x:plugin uri="link:part:dpml/depot/dpml-depot-convert">
+ <task name="convert" class="de.java2html.anttasks.Java2HtmlTask"/>
+ </x:plugin>
+ <convert srcdir="target/build/main" destdir="target/reports/src"/>
+ <convert srcdir="target/build/test" destdir="target/reports/src"/>
+ </target>
+
+ <target name="init" depends="standard.init">
+ <x:plugin uri="link:part:dpml/metro/dpml-metro-tools" urn="metro"/>
+ </target>
+
+ <target name="build" depends="standard.build">
+ <type xmlns="metro" class="org.acme.Demo" name="demo" threadsafe="true"
collection="soft">
+ <services>
+ <service class="org.acme.Widget"/>
+ </services>
+ <state>
+ <trigger event="initialization">
+ <transition name="start" target="started">
+ <operation name="startup" method="start"/>
+ </transition>
+ </trigger>
+ <state name="started">
+ <transition name="stop" target="../stopped">
+ <operation name="stop" method="stop"/>
+ </transition>
+ <trigger event="termination">
+ <apply id="stop"/>
+ </trigger>
+ </state>
+ <state name="stopped">
+ <transition name="start" target="../started">
+ <operation name="start" method="start"/>
+ </transition>
+ </state>
+ </state>
+ </type>
+ </target>
+
+</project>

Added: trunk/central/tutorials/components/type/etc/data/logging.properties
===================================================================
--- trunk/central/tutorials/components/type/etc/data/logging.properties
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/type/etc/data/logging.properties
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,2 @@
+.level=INFO
+#demo.level=FINE

Added: trunk/central/tutorials/components/type/src/main/org/acme/Demo.java
===================================================================
--- trunk/central/tutorials/components/type/src/main/org/acme/Demo.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/type/src/main/org/acme/Demo.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+/**
+ * A minimal component implementing a minimal service interface.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class Demo implements Widget
+{
+ private final Logger m_logger;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * Creation of a new object using a supplied logging channel.
+ * @param logger the logging channel
+ */
+ public Demo( final Logger logger )
+ {
+ m_logger = logger;
+ }
+
+ public void start()
+ {
+ m_logger.info( "startup" );
+ }
+
+ public void stop()
+ {
+ m_logger.info( "shutdown" );
+ }
+
+ public void doSomething()
+ {
+ m_logger.info( "doing stuff" );
+ }
+}

Added: trunk/central/tutorials/components/type/src/main/org/acme/Widget.java
===================================================================
--- trunk/central/tutorials/components/type/src/main/org/acme/Widget.java
2006-07-17 14:08:06 UTC (rev 1581)
+++ trunk/central/tutorials/components/type/src/main/org/acme/Widget.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme;
+
+/**
+ * A minimal service interface.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public interface Widget
+{
+ void doSomething();
+}

Added:
trunk/central/tutorials/components/type/src/test/org/acme/test/DemoTestCase.java
===================================================================
---
trunk/central/tutorials/components/type/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:08:06 UTC (rev 1581)
+++
trunk/central/tutorials/components/type/src/test/org/acme/test/DemoTestCase.java
2006-07-17 14:15:40 UTC (rev 1582)
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2006 Stephen J. McConnell.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.acme.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import net.dpml.lang.Part;
+
+import org.acme.Demo;
+
+/**
+ * Deployment of the demo component.
+ *
+ * @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
+ * @version @PROJECT-VERSION@
+ */
+public class DemoTestCase extends TestCase
+{
+ /**
+ * Test component deployment.
+ * @exception Exception if an error occurs
+ */
+ public void testComponent() throws Exception
+ {
+ URI uri = getPartURI();
+ Part part = Part.load( uri, false );
+ Demo demo = (Demo) part.getContent();
+ demo.doSomething();
+ demo = null;
+ System.gc();
+ }
+
+ private URI getPartURI() throws Exception
+ {
+ String path = System.getProperty(
"project.deliverable.part.filename" );
+ File file = new File( path );
+ return file.toURI();
+ }
+}




  • r1582 - in trunk/central/tutorials: . components components/context components/context/src components/context/src/main components/context/src/main/org components/context/src/main/org/acme components/context/src/test components/context/src/test/org components/context/src/test/org/acme components/context/src/test/org/acme/test components/customize components/customize/clock components/customize/clock/src components/customize/clock/src/main components/customize/clock/src/main/org components/customize/clock/src/main/org/acme components/customize/clock/src/main/org/acme/clock components/customize/clock/src/test components/customize/clock/src/test/org components/customize/clock/src/test/org/acme components/customize/clock/src/test/org/acme/test components/customize/custom components/customize/custom/src components/customize/custom/src/test components/customize/custom/src/test/org components/customize/custom/src/test/org/acme components/customize/custom/src/test/org/acme/t! est components/examples components/examples/src components/examples/src/main components/examples/src/main/org components/examples/src/main/org/acme components/examples/src/test components/examples/src/test/org components/examples/src/test/org/acme components/examples/src/test/org/acme/test components/hello components/hello/src components/hello/src/main components/hello/src/main/org components/hello/src/main/org/acme components/hello/src/test components/hello/src/test/org components/hello/src/test/org/acme components/hello/src/test/org/acme/test components/import components/import/api components/import/api/src components/import/api/src/main components/import/api/src/main/org components/import/api/src/main/org/acme components/import/clock components/import/clock/src components/import/clock/src/main components/import/clock/src/main/org components/import/clock/src/main/org/acme components/import/clock/src/main/org/acme/scheduler components/import/demo components/import/demo/etc! components/import/demo/etc/data components/import/demo/src co! mponents, mcconnell at BerliOS, 07/17/2006

Archive powered by MHonArc 2.6.24.

Top of Page