avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: avalon-apps/simpleserver/src/manifest testserver.mf simpleserver.mf
Date Fri, 04 Apr 2003 22:11:09 GMT
donaldp     2003/04/04 14:11:09

  Modified:    simpleserver build.xml default.properties
  Added:       simpleserver/src/conf testserver-assembly.xml
                        testserver-config.xml testserver-environment.xml
               simpleserver/src/java/org/apache/avalon/testserver
                        DummyClass.java PacketPokingTest.java
                        SimpleListener.java SimpleServer.java WARNING.txt
               simpleserver/src/java/org/apache/avalon/testserver/classes
                        ClassesTest.java
               simpleserver/src/java/org/apache/avalon/testserver/cltest
                        CLTest.java
               simpleserver/src/java/org/apache/avalon/testserver/extension1
                        ExtensionTestClass1.java
               simpleserver/src/java/org/apache/avalon/testserver/extension2
                        ExtensionTestClass2.java
               simpleserver/src/manifest testserver.mf
  Removed:     simpleserver/src/conf simpleserver-assembly.xml
                        simpleserver-config.xml
                        simpleserver-environment.xml
               simpleserver/src/java/org/apache/avalon/simpleserver
                        DummyClass.java PacketPokingTest.java
                        SimpleListener.java SimpleServer.java WARNING.txt
               simpleserver/src/java/org/apache/avalon/simpleserver/classes
                        ClassesTest.java
               simpleserver/src/java/org/apache/avalon/simpleserver/cltest
                        CLTest.java
               simpleserver/src/java/org/apache/avalon/simpleserver/extension1
                        ExtensionTestClass1.java
               simpleserver/src/java/org/apache/avalon/simpleserver/extension2
                        ExtensionTestClass2.java
               simpleserver/src/manifest simpleserver.mf
  Log:
  Rename to testserver
  
  Revision  Changes    Path
  1.27      +19 -22    avalon-apps/simpleserver/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/avalon-apps/simpleserver/build.xml,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- build.xml	4 Apr 2003 22:00:01 -0000	1.26
  +++ build.xml	4 Apr 2003 22:11:08 -0000	1.27
  @@ -32,11 +32,8 @@
     <property name="java.dir" value="${src.dir}/java"/>
     <property name="manifest.dir" value="${src.dir}/manifest"/>
     <property name="conf.dir" value="${src.dir}/conf"/>
  -  <property name="context.dir" value="../../avalon/src/documentation"/>
     <property name="tools.dir" location="../../avalon/tools"/>
   
  -  <property name="www.dir" value="../../avalon-site/site"/>
  -
     <property name="dist.base" value="distributions"/>
   
     <path id="project.class.path">
  @@ -97,14 +94,14 @@
   
       <mkdir dir="${build.lib}"/>
   
  -    <jar jarfile="${build.lib}/simpleserver.jar"
  -        manifest="${manifest.dir}/simpleserver.mf">
  +    <jar jarfile="${build.lib}/testserver.jar"
  +        manifest="${manifest.dir}/testserver.mf">
         <fileset dir="${build.classes}">
  -        <include name="org/apache/avalon/simpleserver/**"/>
  -        <exclude name="org/apache/avalon/simpleserver/extension1/*"/>
  -        <exclude name="org/apache/avalon/simpleserver/cltest/*"/>
  -        <exclude name="org/apache/avalon/simpleserver/extension2/*"/>
  -        <exclude name="org/apache/avalon/simpleserver/classes/*"/>
  +        <include name="org/apache/avalon/testserver/**"/>
  +        <exclude name="org/apache/avalon/testserver/extension1/*"/>
  +        <exclude name="org/apache/avalon/testserver/cltest/*"/>
  +        <exclude name="org/apache/avalon/testserver/extension2/*"/>
  +        <exclude name="org/apache/avalon/testserver/classes/*"/>
         </fileset>
         <fileset dir="${gen.dir}">
           <include name="**/*.xinfo"/>
  @@ -114,18 +111,18 @@
       <jar jarfile="${build.lib}/demo-test-extension1.jar"
            basedir="${build.classes}"
            manifest="${manifest.dir}/test-extension1.mf">
  -      <include name="org/apache/avalon/simpleserver/extension1/*"/>
  +      <include name="org/apache/avalon/testserver/extension1/*"/>
       </jar>
   
       <jar jarfile="${build.lib}/demo-test-extension2.jar"
            basedir="${build.classes}"
            manifest="${manifest.dir}/test-extension2.mf">
  -      <include name="org/apache/avalon/simpleserver/extension2/*"/>
  +      <include name="org/apache/avalon/testserver/extension2/*"/>
       </jar>
   
         <jar jarfile="${build.lib}/cltest.jar"
             basedir="${build.classes}">
  -          <include name="org/apache/avalon/simpleserver/cltest/*"/>
  +          <include name="org/apache/avalon/testserver/cltest/*"/>
         </jar>
   
     </target>
  @@ -135,12 +132,12 @@
     <target name="sars" depends="jars">
   
       <sar sarfile="${build.lib}/avalon-${name}.sar"
  -         config="${conf.dir}/simpleserver-config.xml"
  -         environment="${conf.dir}/simpleserver-environment.xml"
  -         assembly="${conf.dir}/simpleserver-assembly.xml" >
  +         config="${conf.dir}/testserver-config.xml"
  +         environment="${conf.dir}/testserver-environment.xml"
  +         assembly="${conf.dir}/testserver-assembly.xml" >
   
         <zipfileset dir="${build.classes}" prefix="SAR-INF/classes">
  -        <include name="org/apache/avalon/simpleserver/classes/*"/>
  +        <include name="org/apache/avalon/testserver/classes/*"/>
         </zipfileset>
   
         <zipfileset dir="${build.lib}/" prefix="lib">
  @@ -250,7 +247,7 @@
       <property name="bin.dist.dir" value="dist"/>
       <property name="bin.dist.lib" value="${bin.dist.dir}/lib"/>
   
  -    <copy file="${build.lib}/avalon-simpleserver.sar" tofile="${bin.dist.dir}/avalon-simpleserver-${version}.sar"/>
  +    <copy file="${build.lib}/avalon-testserver.sar" tofile="${bin.dist.dir}/avalon-testserver-${version}.sar"/>
   
       <chmod dir="${bin.dist.dir}" perm="go-rwx" />
     </target>
  @@ -259,8 +256,8 @@
     <target name="install" depends="main" description="Installs into Phoenix">
       <!-- <fail message="install.dir not specified." unless="install.dir"/> -->
       <echo message="Installing to ${install.dir}" />
  -    <delete dir="${install.dir}/avalon-simpleserver" />
  -    <copy file="${build.lib}/avalon-simpleserver.sar" todir="${install.dir}" />
  +    <delete dir="${install.dir}/avalon-testserver" />
  +    <copy file="${build.lib}/avalon-testserver.sar" todir="${install.dir}" />
       <copy file="${build.lib}/demo-test-extension2.jar"
             tofile="${phoenix.home}/ext/demo-test-extension2.jar"
             overwrite="true" />
  @@ -269,8 +266,8 @@
     <target name="uninstall" description="Uninstalls from Phoenix">
   
       <!-- <fail message="install.dir not specified." unless="install.dir"/> -->
  -    <delete dir="${install.dir}/avalon-simpleserver/" />
  -    <delete file="avalon-simpleserver.sar" dir="${install.dir}"/>
  +    <delete dir="${install.dir}/avalon-testserver/" />
  +    <delete file="avalon-testserver.sar" dir="${install.dir}"/>
     </target>
   
     <target name="clean" description="Cleans up artifacts from build process">
  
  
  
  1.2       +4 -4      avalon-apps/simpleserver/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/avalon-apps/simpleserver/default.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- default.properties	26 Jul 2002 14:21:58 -0000	1.1
  +++ default.properties	4 Apr 2003 22:11:08 -0000	1.2
  @@ -7,10 +7,10 @@
   #           DOC GENERATION CONFIGURATION
   # ----------------------------------------------------------------------------
   
  -name				= simpleserver
  -Name				= Avalon Apps SimpleServer
  -dir-name			= simpleserver
  +name				= testserver
  +Name				= Avalon Apps TestServer
  +dir-name			= testserver
   version				= 0.7
  -package-version			= 1.0
  +package-version		= 1.0
   year				= 2000-2002
   
  
  
  
  1.1                  avalon-apps/simpleserver/src/conf/testserver-assembly.xml
  
  Index: testserver-assembly.xml
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE assembly PUBLIC "-//PHOENIX/Assembly DTD Version 1.0//EN"
                    "http://jakarta.apache.org/avalon/dtds/phoenix/assembly_1_0.dtd">
  
  <assembly>
  
    <listener class="org.apache.avalon.testserver.SimpleListener"
                    name="simple-listener" />
  
    <!-- The Storage block -->
    <block class="org.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager"
           name="objectstorage" />
  
    <!-- The Packet Manager block -->
    <block class="org.apache.avalon.cornerstone.blocks.packet.DefaultPacketManager"
           name="packet-manager">
      <provide name="thread-manager"
               role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
    </block>
  
    <!-- The ThreadManager block -->
    <block class="org.apache.avalon.cornerstone.blocks.threads.DefaultThreadManager"
           name="thread-manager" />
  
    <!-- The Connection Manager block -->
    <block class="org.apache.avalon.cornerstone.blocks.connection.DefaultConnectionManager"
           name="connections">
      <provide name="thread-manager"
               role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
    </block>
  
    <!-- The Socket Manager block -->
    <block class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager" name="sockets" />
  
    <!-- The TimeScheduler block -->
    <block class="org.apache.avalon.cornerstone.blocks.scheduler.DefaultTimeScheduler" name="scheduler">
      <provide name="thread-manager"
               role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
    </block>
  
    <!--                                          -->
    <!-- Below this section are the simple server -->
    <!--                                          -->
  
    <block class="org.apache.avalon.testserver.SimpleServer"
           name="simple-server" >
  
      <!-- The names here must match the names specified for a Block in some conf.xml file.
      The role should be the interface mentioned in the BlockInfo (.xinfo) files  -->
  
  
      <provide name="packet-manager"
               role="org.apache.avalon.cornerstone.services.packet.PacketManager"/>
      <provide name="sockets" role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
      <provide name="connections"
               role="org.apache.avalon.cornerstone.services.connection.ConnectionManager" />
      <provide name="objectstorage" role="org.apache.avalon.cornerstone.services.store.Store"/>
      <provide name="scheduler"
               role="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"/>
    </block>
  
  </assembly>
  
  
  
  1.1                  avalon-apps/simpleserver/src/conf/testserver-config.xml
  
  Index: testserver-config.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <config>
  
    <thread-manager>
        <thread-group>
          <name>default</name>
  
          <!-- normal priority == 5, max-priority = 10 -->
          <priority>5</priority>
  
          <!-- are threads deamon threads ? -->
          <is-daemon>false</is-daemon>
  
          <max-threads>40</max-threads>
          <!-- these are ignored at the moment but will be fixed in later revisions -->
          <min-threads>20</min-threads>
          <min-spare-threads>20</min-spare-threads>
        </thread-group>
    </thread-manager>
  
    <!-- The Storage block -->
    <objectstorage>
        <repositories>
          <repository class="org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Object_Repository">
            <protocols>
              <protocol>file</protocol>
            </protocols>
            <types>
              <type>OBJECT</type>
            </types>
            <models>
              <model>SYNCHRONOUS</model>
              <model>ASYNCHRONOUS</model>
              <model>CACHE</model>
            </models>
          </repository>
          <repository class="org.apache.avalon.cornerstone.blocks.masterstore.File_Persistent_Stream_Repository">
            <protocols>
              <protocol>file</protocol>
            </protocols>
            <types>
              <type>STREAM</type>
            </types>
            <models>
              <model>SYNCHRONOUS</model>
              <model>ASYNCHRONOUS</model>
              <model>CACHE</model>
            </models>
          </repository>
        </repositories>
    </objectstorage>
  
    <sockets>
        <server-sockets>
          <factory name="plain"
                   class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory" />
        </server-sockets>
  
        <client-sockets>
          <factory name="plain"
                   class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory" />
        </client-sockets>
    </sockets>
  
    <simple-listener>
     <!-- dummy configuration to make sure  listener configure is called-->
    </simple-listener>
  
    <simple-server>
      <!-- Note trailing file searator in destinationURL -->
        <repository destinationURL="file://var/demo/" type="OBJECT" model="SYNCHRONOUS"/>
        <port>4556</port>
    </simple-server>
  
  </config>
  
  
  
  1.1                  avalon-apps/simpleserver/src/conf/testserver-environment.xml
  
  Index: testserver-environment.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
                                  README!
  
      Basic config file that sets up context for server application.
  
  -->
  <environment>
  
      <logs>
  
        <category name="" target="default" priority="DEBUG" />
        <category name="objectstorage" target="objectstorage-target" priority="DEBUG" />
        <category name="simple-server" target="simple-server" priority="DEBUG" />
        <log-target name="default" location="/logs/avalon-demo.log" />
        <log-target name="objectstorage-target" location="/logs/objectstorage.log" />
        <log-target name="simple-server" location="/logs/simple-server.log" />
      </logs>
  
      <classloaders default="default" version="1.0">
          <predefined name="*system*"/>
  
          <classloader name="default" parent="*system*">
              <entry location="SAR-INF/classes/"/>
              <fileset dir="SAR-INF/lib">
                  <include name="*.jar"/>
              </fileset>
          </classloader>
  
          <classloader name="cltest" parent="*system*">
              <entry location="lib/cltest.jar"/>
          </classloader>
  
      </classloaders>
  
  </environment>
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/DummyClass.java
  
  Index: DummyClass.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver;
  
  import java.io.Serializable;
  
  /**
   * This is a dummy class to test Store. If this is in a seperate bar
   * from the masterstore classes, reading it from disc will throw a
   * ClassNotFoundException.
   *
   * @author Charles Benett <charles@benett1.demon.co.uk>
   */
  public class DummyClass
      implements Serializable
  {
      private String m_name;
  
      public void setName( final String name )
      {
          m_name = name;
      }
  
      public String getName()
      {
          return m_name;
      }
  }
  
  
  
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/PacketPokingTest.java
  
  Index: PacketPokingTest.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver;
  
  import java.net.DatagramPacket;
  import java.net.DatagramSocket;
  import java.net.InetAddress;
  
  /**
   * Test Simpleervers packet-manager
   */
  public class PacketPokingTest
  {
      public static final void main( String[] argv )
          throws Exception
      {
          final DatagramSocket socket = new DatagramSocket();
          socket.connect( InetAddress.getLocalHost(), 5053 );
          final DatagramPacket packet = new DatagramPacket( new byte[ 1 ], 0 );
          socket.send( packet );
      }
  }
  
  
  
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/SimpleListener.java
  
  Index: SimpleListener.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver;
  
  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.phoenix.ApplicationEvent;
  import org.apache.avalon.phoenix.ApplicationListener;
  import org.apache.avalon.phoenix.BlockEvent;
  
  /**
   * This is a simple block listener to demonstrate deployment.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class SimpleListener
      implements ApplicationListener, Configurable
  {
      public void configure( final Configuration configuration )
          throws ConfigurationException
      {
          System.out.println( "SimpleBlockListener.configure() called!" );
      }
  
      /**
       * Notification that a block has just been added
       * to Server Application.
       *
       * @param event the BlockEvent
       */
      public void blockAdded( final BlockEvent event )
      {
          System.out.println( "Added block '" + event.getName() + "'" );
      }
  
      /**
       * Notification that a block is just about to be
       * removed from Server Application.
       *
       * @param event the BlockEvent
       */
      public void blockRemoved( final BlockEvent event )
      {
      }
  
      public void applicationStarting( ApplicationEvent applicationEvent ) throws Exception
      {
      }
  
      public void applicationStarted()
      {
      }
  
      public void applicationStopping()
      {
      }
  
      public void applicationStopped()
      {
      }
  
      public void applicationFailure( Exception causeOfFailure )
      {
      }
  }
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/SimpleServer.java
  
  Index: SimpleServer.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver;
  
  import java.io.BufferedOutputStream;
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.InterruptedIOException;
  import java.io.PrintWriter;
  import java.io.InputStream;
  import java.net.DatagramPacket;
  import java.net.DatagramSocket;
  import java.net.ProtocolException;
  import java.net.ServerSocket;
  import java.net.Socket;
  import java.net.SocketException;
  import java.util.Iterator;
  import java.util.StringTokenizer;
  import org.apache.avalon.cornerstone.services.connection.ConnectionHandler;
  import org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory;
  import org.apache.avalon.cornerstone.services.connection.ConnectionManager;
  import org.apache.avalon.cornerstone.services.packet.PacketHandler;
  import org.apache.avalon.cornerstone.services.packet.PacketHandlerFactory;
  import org.apache.avalon.cornerstone.services.packet.PacketManager;
  import org.apache.avalon.cornerstone.services.scheduler.PeriodicTimeTrigger;
  import org.apache.avalon.cornerstone.services.scheduler.Target;
  import org.apache.avalon.cornerstone.services.scheduler.TimeScheduler;
  import org.apache.avalon.cornerstone.services.scheduler.TimeTrigger;
  import org.apache.avalon.cornerstone.services.sockets.ServerSocketFactory;
  import org.apache.avalon.cornerstone.services.sockets.SocketManager;
  import org.apache.avalon.cornerstone.services.store.ObjectRepository;
  import org.apache.avalon.cornerstone.services.store.Store;
  import org.apache.avalon.framework.activity.Initializable;
  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.context.Context;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.service.ServiceException;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.avalon.framework.service.Serviceable;
  import org.apache.avalon.phoenix.BlockContext;
  import org.apache.avalon.testserver.classes.ClassesTest;
  import org.apache.avalon.testserver.extension1.ExtensionTestClass1;
  import org.apache.avalon.testserver.extension2.ExtensionTestClass2;
  
  /**
   * This is a demo block used to demonstrate a simple server using Avalon. The
   * server listens on a port specified in .confs. All commands are one line
   * commands. It understands three commands: PUT, COUNT, LIST.
   * <br>PUT <string> stores the given string on the file system
   * <br>COUNT counts the number of strings stored
   * <br>LIST responds with all the strings, one per line.
   *
   * @phoenix:block
   *
   * @author Charles Benett <charles@benett1.demon.co.uk>
   * @author Federico Barbieri <fede@apache.org>
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class SimpleServer
      extends AbstractLogEnabled
      implements Contextualizable, Serviceable, Configurable, Initializable,
      ConnectionHandlerFactory, ConnectionHandler, Target, PacketHandler, PacketHandlerFactory
  {
      private TimeScheduler m_timeScheduler;
      private Configuration m_configuration;
      private SocketManager m_socketManager;
      private ConnectionManager m_connectionManager;
      private Store m_testStore;
      private ObjectRepository m_repository;
      private PacketManager m_packetManager;
  
      private PrintWriter m_out;
      private int m_count;
      private BlockContext m_context;
  
      public void contextualize( final Context context )
      {
          m_context = (BlockContext)context;
      }
  
      protected final BlockContext getBlockContext()
      {
          return m_context;
      }
  
      /**
       *
       * @phoenix:dependency name="org.apache.avalon.cornerstone.services.store.Store"
       * @phoenix:dependency name="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
       * @phoenix:dependency name="org.apache.avalon.cornerstone.services.sockets.SocketManager"
       * @phoenix:dependency name="org.apache.avalon.cornerstone.services.packet.PacketManager"
       * @phoenix:dependency name="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler"
       *
       */
      public void service( final ServiceManager serviceManager )
          throws ServiceException
      {
          m_testStore = (Store)serviceManager.lookup( Store.ROLE );
          m_socketManager = (SocketManager)serviceManager.lookup( SocketManager.ROLE );
          m_connectionManager = (ConnectionManager)serviceManager.lookup( ConnectionManager.ROLE );
          m_timeScheduler = (TimeScheduler)serviceManager.lookup( TimeScheduler.ROLE );
          m_packetManager = (PacketManager)serviceManager.lookup( PacketManager.ROLE );
      }
  
      public void configure( final Configuration configuration )
          throws ConfigurationException
      {
          m_configuration = configuration;
      }
  
      public void initialize()
          throws Exception
      {
          getLogger().info( "init Demo ..." );
  
          final Configuration repConf = m_configuration.getChild( "repository" );
          getLogger().info( "Want to use repository in:" +
                            repConf.getAttribute( "destinationURL" ) );
          m_repository = (ObjectRepository)m_testStore.select( repConf );
          getLogger().info( "Got repository" );
  
          TimeTrigger trigger = null;
  
          trigger = new PeriodicTimeTrigger( -1, 2 * 1000 );
          m_timeScheduler.addTrigger( "try", trigger, this );
  
          trigger = new PeriodicTimeTrigger( 9 * 1000, -1 );
          m_timeScheduler.addTrigger( "do", trigger, this );
  
          //trigger = new CronTimeTrigger( -1, -1, -1, -1, -1, false );
          //m_timeScheduler.addTrigger( "cron-trigger", trigger, this );
  
          final int port = m_configuration.getChild( "port" ).getValueAsInteger();
          getLogger().info( "Want to open port on:" + port );
  
          final ServerSocketFactory factory =
              m_socketManager.getServerSocketFactory( "plain" );
          final ServerSocket serverSocket = factory.createServerSocket( port );
  
          m_connectionManager.connect( "DemoListener", serverSocket, this );
  
          getLogger().info( "Got socket" );
  
          getLogger().info( "Testing access to Extension in same .sar ..." );
          ExtensionTestClass1.doSomeThing();
          getLogger().info( "...successful test" );
  
          getLogger().info( "Testing access to Extension from central extension repository..." );
          ExtensionTestClass2.doSomeThing();
          getLogger().info( "...successful test" );
  
          getLogger().info( "Creating datagram socket..." );
          final DatagramSocket datagramSocket = new DatagramSocket( 5053 );
          getLogger().info( "...successful" );
  
          getLogger().info( "Connecting datagram socket..." );
          m_packetManager.connect( "udp/5053", datagramSocket, this );
          getLogger().info( "...successful" );
  
          getLogger().info( "Testing a class loaded from SAR-INF/classes..." );
          ClassesTest.doClassesTest();
          getLogger().info( "...successful" );
  
          testResource( "/README.txt" );
          testResource( "README.txt" );
          testResource( "SAR-INF/config.xml" );
          testResource( "SAR-INF/lib/cornerstone.jar" );
  
          getLogger().info( "Testing loading a class from a non-standard ClassLoader tree" );
          final ClassLoader classLoader =
              getBlockContext().getClassLoader( "cltest" );
          try
          {
              classLoader.loadClass( "org.apache.avalon.testserver.cltest.CLTest" );
          }
          catch( final ClassNotFoundException cnfe )
          {
              final String message =
                  "Failed to load class CLTest from cltest classloader";
              throw new Exception( message );
          }
  
          getLogger().info( "...Demo init" );
      }
  
      private void testResource( String resourceName ) throws Exception
      {
          final InputStream resourceAsStream =
              m_context.getResourceAsStream( resourceName );
          if( null == resourceAsStream )
          {
              final String message = "Unable to load resource named: " + resourceName;
              throw new Exception( message );
          }
          else
          {
              final String message =
                  "Loaded resource named " + resourceName +
                  " as " + resourceAsStream;
              System.out.println( message );
          }
      }
  
      /**
       * Construct an appropriate PacketHandler.
       *
       * @return the new PacketHandler
       * @exception Exception if an error occurs
       */
      public PacketHandler createPacketHandler()
          throws Exception
      {
          return this;
      }
  
      /**
       * Handle a datgram packet.
       * This handler is responsible for processing packets as they occur.
       *
       * @param packet the packet
       * @exception IOException if an error reading from socket occurs
       * @exception ProtocolException if an error handling connection occurs
       */
      public void handlePacket( final DatagramPacket packet )
          throws IOException, ProtocolException
      {
          System.out.println( "Pickety pickety pop - got a packet!" );
      }
  
      /**
       * Construct an appropriate ConnectionHandler.
       *
       * @return the new ConnectionHandler
       * @exception Exception if an error occurs
       */
      public ConnectionHandler createConnectionHandler()
          throws Exception
      {
          //Can return this because the ConnectionHandler is thread safe
          return this;
      }
  
      /**
       * Release a previously created ConnectionHandler e.g. for spooling.
       */
      public void releaseConnectionHandler( ConnectionHandler connectionHandler )
      {
      }
  
      /**
       * Handle a connection.
       * This handler is responsible for processing connections as they occur.
       *
       * @param socket the connection
       * @exception IOException if an error reading from socket occurs
       * @exception ProtocolException if an error handling connection occurs
       */
      public void handleConnection( final Socket socket )
          throws IOException, ProtocolException
      {
          String remoteHost = null;
          String remoteIP = null;
  
          try
          {
              final BufferedReader in =
                  new BufferedReader( new InputStreamReader( socket.getInputStream() ), 1024 );
              m_out =
                  new PrintWriter( new BufferedOutputStream( socket.getOutputStream() ), true );
  
              remoteHost = socket.getInetAddress().getHostName();
              remoteIP = socket.getInetAddress().getHostAddress();
  
              getLogger().info( "Connection from " + remoteHost + " ( " + remoteIP + " )" );
  
              //Greet connection
              m_out.println( "Welcome to the Avalon Demo Server!" );
  
              // Handle connection
              while( parseCommand( in.readLine() ) )
              {
                  // timeServer.resetAlarm(this.toString());
              }
  
              //Finish
              m_out.flush();
              socket.close();
          }
          catch( final SocketException se )
          {
              getLogger().info( "Socket to " + remoteHost + " closed remotely." );
          }
          catch( final InterruptedIOException iioe )
          {
              getLogger().info( "Socket to " + remoteHost + " timeout." );
          }
          catch( IOException ioe )
          {
              getLogger().info( "Exception handling socket to " + remoteHost + ":" +
                                ioe.getMessage() );
          }
          catch( final Exception e )
          {
              getLogger().info( "Exception on socket: " + e.getMessage() );
          }
          finally
          {
              try
              {
                  socket.close();
              }
              catch( final IOException ioe )
              {
                  getLogger().error( "Exception closing socket: " + ioe.getMessage() );
              }
          }
      }
  
      public void targetTriggered( final String triggerName )
      {
          if( triggerName.equals( "do" ) )
          {
              try
              {
                  m_timeScheduler.removeTrigger( "try" );
              }
              catch( final Exception e )
              {
                  e.printStackTrace();
              }
          }
  
          System.out.println( "[" + getBlockContext().getName() + "] Target triggered: " + triggerName );
      }
  
      private boolean parseCommand( String command )
          throws Exception
      {
          if( null == command )
          {
              return false;
          }
  
          getLogger().info( "Command received: " + command );
  
          StringTokenizer commandLine = new StringTokenizer( command.trim() );
          int arguments = commandLine.countTokens();
          String argument = null;
          if( 0 == arguments )
          {
              return true;
          }
  
          String fullcommand = command;
          command = commandLine.nextToken();
          if( arguments > 1 )
          {
              argument = fullcommand.substring( command.length() + 1 );
          }
  
          if( command.equalsIgnoreCase( "TEST" ) )
          {
              m_out.println( "You said 'TEST'" );
  
              final DummyClass write = new DummyClass();
              write.setName( argument );
  
              try
              {
                  m_repository.put( argument, write );
              }
              catch( final Exception e )
              {
                  getLogger().warn( "Exception putting into repository: " + e );
              }
  
              m_out.println( "Dummy written, trying for read" );
              try
              {
                  m_repository.list();
              }
              catch( Exception e )
              {
                  getLogger().warn( "Exception reading from repository: " + e, e );
              }
  
              DummyClass read = null;
              try
              {
                  read = (DummyClass)m_repository.get( argument );
              }
              catch( final Exception e )
              {
                  getLogger().warn( "Exception reading from repository: " + e, e );
              }
  
              m_out.println( "Recovered: " + read.getName() );
              return true;
          }
          else if( command.equalsIgnoreCase( "PUT" ) )
          {
              m_out.println( "You said 'PUT'" );
              final String key = "AMsg" + ++m_count;
              m_repository.put( key, argument );
              return true;
          }
          else if( command.equalsIgnoreCase( "LIST" ) )
          {
              m_out.println( "You said 'LIST'" );
  
              final Iterator it = m_repository.list();
  
              while( it.hasNext() )
              {
                  String k = (String)it.next();
                  String txt = (String)m_repository.get( k );
                  m_out.println( "Msg " + k + " was " + txt );
              }
              m_out.println( "That's All folks!" );
              return true;
          }
          else if( command.equalsIgnoreCase( "COUNT" ) )
          {
              m_out.println( "You said 'COUNT'" );
              Iterator it = m_repository.list();
              int c = 0;
  
              while( it.hasNext() )
              {
                  it.next();
                  c = c + 1;
              }
  
              m_out.println( "Number of messages in repository is: " + c );
              return true;
          }
          else
          {
              m_out.println( "Only valid commands are: PUT, LIST or COUNT." );
              return true;
          }
      }
  }
  
  
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/WARNING.txt
  
  Index: WARNING.txt
  ===================================================================
  Unlike the package name would suggest. This is *not* a simple example. In fact
  it serves as a basic application which features have been added to over time to 
  test various features of phoenix. It is recomended you don't look at this demo 
  unless you are familiar with Avalon/Phoenix.
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/classes/ClassesTest.java
  
  Index: ClassesTest.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver.classes;
  
  /**
   * This is a class that resides in SAR-INF/classes and used to test
   * classloading from that location.
   */
  public class ClassesTest
  {
      public static void doClassesTest()
      {
          System.out.println( "ClassesTest.doClassesTest()" );
      }
  }
  
  
  
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/cltest/CLTest.java
  
  Index: CLTest.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver.cltest;
  
  /**
   * This is a s simple class to test declaration of classloaders
   * in environment.xml
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2003/04/04 22:11:09 $
   */
  public class CLTest
  {
  }
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/extension1/ExtensionTestClass1.java
  
  Index: ExtensionTestClass1.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver.extension1;
  
  import java.io.Serializable;
  
  /**
   * A simple class to test loading an extension that
   * is contained within the .sar.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class ExtensionTestClass1
      implements Serializable
  {
      public static void doSomeThing()
      {
          System.out.println( "ExtensionTestClass1.doSomeThing()" );
      }
  }
  
  
  
  
  
  
  1.1                  avalon-apps/simpleserver/src/java/org/apache/avalon/testserver/extension2/ExtensionTestClass2.java
  
  Index: ExtensionTestClass2.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002,2003 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.avalon.testserver.extension2;
  
  import java.io.Serializable;
  
  /**
   * A simple class to test loading an extension that
   * is contained within the central extension repository.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   */
  public class ExtensionTestClass2
      implements Serializable
  {
      public static void doSomeThing()
      {
          System.out.println( "ExtensionTestClass2.doSomeThing()" );
      }
  }
  
  
  
  
  
  
  1.1                  avalon-apps/simpleserver/src/manifest/testserver.mf
  
  Index: testserver.mf
  ===================================================================
  Extension-List: ext1 ext2
  ext1-Extension-Name: cornerstone.test.extension
  ext2-Extension-Name: cornerstone.test.extension2
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message