Return-Path: Delivered-To: apmail-avalon-cvs-archive@www.apache.org Received: (qmail 1869 invoked from network); 2 Jul 2004 14:31:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Jul 2004 14:31:20 -0000 Received: (qmail 30596 invoked by uid 500); 2 Jul 2004 14:31:22 -0000 Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 30514 invoked by uid 500); 2 Jul 2004 14:31:21 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 30449 invoked by uid 99); 2 Jul 2004 14:31:20 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 02 Jul 2004 07:31:20 -0700 Received: (qmail 1743 invoked by uid 65534); 2 Jul 2004 14:31:13 -0000 Date: 2 Jul 2004 14:31:13 -0000 Message-ID: <20040702143113.1736.qmail@minotaur.apache.org> From: mcconnell@apache.org To: cvs@avalon.apache.org Subject: svn commit: rev 22477 - in avalon/trunk/planet: cornerstone tutorials tutorials/parameterization tutorials/profiles tutorials/simple-web tutorials/simple-web/conf tutorials/simple-web/src/java tutorials/simple-web/src/main tutorials/simple-web/src/main/tutorial X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: mcconnell Date: Fri Jul 2 07:31:12 2004 New Revision: 22477 Added: avalon/trunk/planet/tutorials/simple-web/build.xml avalon/trunk/planet/tutorials/simple-web/src/main/ - copied from rev 22276, avalon/trunk/planet/tutorials/simple-web/src/java/ Removed: avalon/trunk/planet/tutorials/parameterization/copy-all.xsl avalon/trunk/planet/tutorials/parameterization/index.ent avalon/trunk/planet/tutorials/parameterization/merlin.properties avalon/trunk/planet/tutorials/parameterization/project.xml avalon/trunk/planet/tutorials/profiles/project.xml avalon/trunk/planet/tutorials/simple-web/conf/ avalon/trunk/planet/tutorials/simple-web/maven.xml avalon/trunk/planet/tutorials/simple-web/project.properties avalon/trunk/planet/tutorials/simple-web/project.xml avalon/trunk/planet/tutorials/simple-web/src/java/ Modified: avalon/trunk/planet/cornerstone/index.xml avalon/trunk/planet/tutorials/index.xml avalon/trunk/planet/tutorials/parameterization/README.txt avalon/trunk/planet/tutorials/simple-web/src/main/tutorial/SimpleWebServerComponent.java Log: Add the simple-web tutorial and the parameterization tutorial. Also made some updates to the web-server to make it parameterizable instead of configurable (we only need a port number). Converted the block to be automatically generated and got rid of related fluff. Modified: avalon/trunk/planet/cornerstone/index.xml ============================================================================== --- avalon/trunk/planet/cornerstone/index.xml (original) +++ avalon/trunk/planet/cornerstone/index.xml Fri Jul 2 07:31:12 2004 @@ -172,6 +172,7 @@ + @@ -227,7 +228,7 @@ - + Modified: avalon/trunk/planet/tutorials/index.xml ============================================================================== --- avalon/trunk/planet/tutorials/index.xml (original) +++ avalon/trunk/planet/tutorials/index.xml Fri Jul 2 07:31:12 2004 @@ -5,6 +5,9 @@ + + @@ -340,6 +343,46 @@ + + + + + + + + + avalon/tutorial + avalon-tutorial-profiles + + + + + + + + + + + + avalon/tutorial + avalon-tutorial-selection + + + + + + + + + + + + avalon/tutorial + avalon-tutorial-webserver + + + + Modified: avalon/trunk/planet/tutorials/parameterization/README.txt ============================================================================== --- avalon/trunk/planet/tutorials/parameterization/README.txt (original) +++ avalon/trunk/planet/tutorials/parameterization/README.txt Fri Jul 2 07:31:12 2004 @@ -10,25 +10,11 @@ Build the project using the following command: -$ maven - -The above command triggers the default goal jar:jar which will -create a jar file under the target directory named -parameters-1.0.jar. The jar file contains a single -component, generated .xinfo descriptor, and a bundled block.xml -deployment descriptor. +$ ant Runtime ------- -To see Merlin in action, execute Merlin and give it either the -jar file of the target/classes directory as the deployment -argument. - $ merlin target\classes -execute - -Or: - -$ merlin target\parameters-1.0.jar -execute Added: avalon/trunk/planet/tutorials/simple-web/build.xml ============================================================================== --- (empty file) +++ avalon/trunk/planet/tutorials/simple-web/build.xml Fri Jul 2 07:31:12 2004 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + Modified: avalon/trunk/planet/tutorials/simple-web/src/main/tutorial/SimpleWebServerComponent.java ============================================================================== --- avalon/trunk/planet/tutorials/simple-web/src/java/tutorial/SimpleWebServerComponent.java (original) +++ avalon/trunk/planet/tutorials/simple-web/src/main/tutorial/SimpleWebServerComponent.java Fri Jul 2 07:31:12 2004 @@ -19,16 +19,15 @@ import java.net.ServerSocket; -import org.apache.avalon.cornerstone.services.connection. - ConnectionHandlerFactory; +import org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory; import org.apache.avalon.cornerstone.services.connection.ConnectionManager; import org.apache.avalon.cornerstone.services.sockets.ServerSocketFactory; import org.apache.avalon.cornerstone.services.sockets.SocketManager; import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.activity.Executable; -import org.apache.avalon.framework.configuration.Configurable; -import org.apache.avalon.framework.configuration.Configuration; -import org.apache.avalon.framework.configuration.ConfigurationException; +import org.apache.avalon.framework.parameters.Parameterizable; +import org.apache.avalon.framework.parameters.Parameters; +import org.apache.avalon.framework.parameters.ParameterException; import org.apache.avalon.framework.logger.LogEnabled; import org.apache.avalon.framework.logger.Logger; import org.apache.avalon.framework.service.ServiceException; @@ -42,10 +41,10 @@ * * @author Avalon Development Team * - * @avalon.component version="1.0" name="simple-web-server" + * @avalon.component version="1.0" name="simple-web-server" lifestyle="singleton" */ public class SimpleWebServerComponent - implements LogEnabled, Serviceable, Configurable, Executable, Disposable { + implements LogEnabled, Serviceable, Parameterizable, Executable, Disposable { /** * Internal reference to the logging channel supplied by the container. */ @@ -76,8 +75,6 @@ * Supply of a logging channel by the container. * * @param logger the logging channel for this component - * - * @see org.apache.avalon.framework.logger.LogEnabled#enableLogging(org.apache.avalon.framework.logger.Logger) */ public void enableLogging(Logger logger) { m_logger = logger; @@ -106,26 +103,14 @@ } /** - * Configuration of the component by the container. - * - * TODO: Describe the configuration of the component. - * - * @param config the component configuration + * Parameterization of the component by the container. + * @param parameters the component parameters * @throws ConfigurationException if a configuration error occurs - * - * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ - public void configure(Configuration config) throws ConfigurationException { - getLogger().info("Configuring..."); - - // Add an HTTP socket listener? - Configuration httpConfig = config.getChild("http-listener", true); - if (httpConfig == null) { - throw new ConfigurationException("port attribute not found!"); - } - else { - m_port = httpConfig.getAttributeAsInteger("port", 80); - } + public void parameterize( Parameters params ) throws ParameterException + { + getLogger().info("Parameterizing..."); + m_port = params.getParameterAsInteger( "port", 80 ); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org