Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2603 - in development/main/test: . components/acme-config components/acme-config/src components/acme-config/src/main components/acme-config/src/main/net components/acme-config/src/main/net/dpml components/acme-config/src/main/net/dpml/test components/acme-config/src/main/net/dpml/test/acme components/acme-config/src/main/net/dpml/test/acme/config

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2603 - in development/main/test: . components/acme-config components/acme-config/src components/acme-config/src/main components/acme-config/src/main/net components/acme-config/src/main/net/dpml components/acme-config/src/main/net/dpml/test components/acme-config/src/main/net/dpml/test/acme components/acme-config/src/main/net/dpml/test/acme/config
  • Date: Thu, 19 May 2005 00:05:50 +0000

Author: mcconnell AT dpml.net
Date: Thu May 19 00:05:40 2005
New Revision: 2603

Added:
development/main/test/build.xml
development/main/test/components/acme-config/ (props changed)
development/main/test/components/acme-config/build.xml
development/main/test/components/acme-config/src/
development/main/test/components/acme-config/src/main/
development/main/test/components/acme-config/src/main/net/
development/main/test/components/acme-config/src/main/net/dpml/
development/main/test/components/acme-config/src/main/net/dpml/test/
development/main/test/components/acme-config/src/main/net/dpml/test/acme/

development/main/test/components/acme-config/src/main/net/dpml/test/acme/config/

development/main/test/components/acme-config/src/main/net/dpml/test/acme/config/ConfigurableComponent.java

development/main/test/components/acme-config/src/main/net/dpml/test/acme/config/ConfigurableContainer.java
development/main/test/index.xml
Log:
Add the acme-config components.

Added: development/main/test/build.xml
==============================================================================
--- (empty file)
+++ development/main/test/build.xml Thu May 19 00:05:40 2005
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 2005 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.
+-->
+
+<project name="dpml-depot" default="default" basedir="."
+ xmlns:transit="antlib:net.dpml.transit">
+
+ <transit:import uri="artifact:template:dpml/magic/reactor"/>
+
+</project>

Added: development/main/test/components/acme-config/build.xml
==============================================================================
--- (empty file)
+++ development/main/test/components/acme-config/build.xml Thu May 19
00:05:40 2005
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="dpml-test-acme-config" default="install" basedir="."
+ xmlns:transit="antlib:net.dpml.transit"
+ xmlns:x="plugin:dpml/magic/dpml-magic-core">
+
+ <transit:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="build" depends="standard.build">
+
+ </target>
+
+</project>

Added:
development/main/test/components/acme-config/src/main/net/dpml/test/acme/config/ConfigurableComponent.java
==============================================================================
--- (empty file)
+++
development/main/test/components/acme-config/src/main/net/dpml/test/acme/config/ConfigurableComponent.java
Thu May 19 00:05:40 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2005 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 net.dpml.test.acme.config;
+
+import java.util.logging.Logger;
+
+import net.dpml.configuration.Configuration;
+
+import net.dpml.activity.Executable;
+
+/**
+ * Experimental component dealing with state management.
+ *
+ * @author <a href="mailto:info AT dpml.net";>The Digital Product Meta
Library</a>
+ */
+public class ConfigurableComponent implements Executable
+{
+ // ------------------------------------------------------------------
+ // state
+ // ------------------------------------------------------------------
+
+ private final Logger m_logger;
+ private final Configuration m_configuration;
+
+ // ------------------------------------------------------------------
+ // constructor
+ // ------------------------------------------------------------------
+
+ /**
+ * Creation of a component that uses a supplied configuration.
+ *
+ * @param logger the logging channel assigned by the container
+ * @param configuration the supplied component configuration
+ */
+ public ConfigurableComponent( final Logger logger, final Configuration
configuration )
+ {
+ m_logger = logger;
+ m_configuration = configuration;
+ }
+
+ // ------------------------------------------------------------------
+ // activity
+ // ------------------------------------------------------------------
+
+ public void execute() throws Exception
+ {
+ Configuration color = m_configuration.getChild( "color" );
+ String value = color.getValue( "undefined" );
+ getLogger().info( "color: " + value );
+ }
+
+ // ------------------------------------------------------------------
+ // implementation
+ // ------------------------------------------------------------------
+
+ private Logger getLogger()
+ {
+ return m_logger;
+ }
+}

Added:
development/main/test/components/acme-config/src/main/net/dpml/test/acme/config/ConfigurableContainer.java
==============================================================================
--- (empty file)
+++
development/main/test/components/acme-config/src/main/net/dpml/test/acme/config/ConfigurableContainer.java
Thu May 19 00:05:40 2005
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2005 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 net.dpml.test.acme.config;
+
+import java.util.logging.Logger;
+
+import net.dpml.configuration.Configuration;
+import net.dpml.configuration.Configurable;
+import net.dpml.configuration.ConfigurationException;
+
+import net.dpml.activity.Executable;
+
+import net.dpml.parts.control.Controller;
+import net.dpml.parts.model.Model;
+
+import net.dpml.parts.control.Manager;
+
+/**
+ * Demonstration of a component that uses a supplied configuration to
+ * configure its children.
+ *
+ * @author <a href="mailto:dev-dpml AT lists.ibiblio.org";>The Digital Product
Meta Library</a>
+ */
+public class ConfigurableContainer implements Executable
+{
+ //------------------------------------------------------------------
+ // state
+ //------------------------------------------------------------------
+
+ private final Logger m_logger;
+ private final Parts m_parts;
+ private final Configuration m_configuration;
+
+ //------------------------------------------------------------------
+ // constructor
+ //------------------------------------------------------------------
+
+ /**
+ * This container demonstrates how a supplied configuration can be
+ * used as the source for configuration of the model of a contained
+ * part.
+ *
+ * @param logger the logging channel asign by the container
+ * @param parts the parts managed by this container
+ * @param configuration the container configuration
+ */
+ public ConfigurableContainer( final Logger logger, Parts parts,
Configuration configuration )
+ {
+ m_logger = logger;
+ m_parts = parts;
+ m_configuration = configuration;
+ }
+
+ //------------------------------------------------------------------
+ // implementation
+ //------------------------------------------------------------------
+
+ public void execute() throws Exception
+ {
+ Parts parts = getParts();
+ Model model = parts.getTestModel();
+ if( model instanceof Configurable )
+ {
+ Configuration conf = m_configuration.getChild( "test", false );
+ if( null != conf )
+ {
+ getLogger().info( "applying configuration to " + model );
+ ((Configurable)model).configure( conf );
+ }
+ }
+ model.getProvider().resolve();
+ }
+
+ private Logger getLogger()
+ {
+ return m_logger;
+ }
+
+ private Parts getParts()
+ {
+ return m_parts;
+ }
+
+ //------------------------------------------------------------------
+ // concerns
+ //------------------------------------------------------------------
+
+ public interface Parts
+ {
+ Model getTestModel();
+ }
+}

Added: development/main/test/index.xml
==============================================================================
--- (empty file)
+++ development/main/test/index.xml Thu May 19 00:05:40 2005
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<index key="dpml-test">
+
+ <import uri="${dpml.transit.uri}"/>
+ <import uri="${dpml.depot.uri}"/>
+ <import uri="${dpml.magic.uri}"/>
+ <import uri="${dpml.metro.uri}"/>
+
+ <!-- Components -->
+
+ <project basedir="components/acme">
+ <info>
+ <group>dpml/test</group>
+ <name>dpml-test-acme</name>
+ <types>
+ <type>jar</type>
+ <type>part</type>
+ </types>
+ </info>
+ <plugins>
+ <include key="dpml-composition-builder" runtime="false"/>
+ </plugins>
+ </project>
+
+ <project basedir="components/acme-config">
+ <info>
+ <group>dpml/test</group>
+ <name>dpml-test-acme-config</name>
+ <types>
+ <type>jar</type>
+ <type>part</type>
+ </types>
+ </info>
+ <dependencies>
+ <include key="dpml-parts-api"/>
+ <include key="dpml-configuration-api"/>
+ <include key="dpml-activity-api"/>
+ </dependencies>
+ <plugins>
+ <include key="dpml-composition-builder" runtime="false"/>
+ </plugins>
+ </project>
+
+</index>



  • svn commit: r2603 - in development/main/test: . components/acme-config components/acme-config/src components/acme-config/src/main components/acme-config/src/main/net components/acme-config/src/main/net/dpml components/acme-config/src/main/net/dpml/test components/acme-config/src/main/net/dpml/test/acme components/acme-config/src/main/net/dpml/test/acme/config, mcconnell, 05/18/2005

Archive powered by MHonArc 2.6.24.

Top of Page