avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-apps/simpleserver/src/manifest simpleserver.mf
Date Fri, 01 Nov 2002 23:23:59 GMT
donaldp     2002/11/01 15:23:59

  Modified:    simpleserver build.xml
               simpleserver/src/conf simpleserver-environment.xml
               simpleserver/src/java/org/apache/avalon/simpleserver
                        SimpleServer.java
  Added:       simpleserver/src/java/org/apache/avalon/simpleserver/cltest
                        CLTest.java
               simpleserver/src/manifest simpleserver.mf
  Log:
  Update test so that the application explicitly declares a classloader tree.
  
  Revision  Changes    Path
  1.18      +32 -25    jakarta-avalon-apps/simpleserver/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/simpleserver/build.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- build.xml	2 Oct 2002 20:24:02 -0000	1.17
  +++ build.xml	1 Nov 2002 23:23:59 -0000	1.18
  @@ -23,7 +23,7 @@
     <!-- Set the properties for intermediate directory -->
     <property name="build.dir" value="build"/>
     <property name="build.lib" value="${build.dir}/lib"/>
  -  <property name="build.xdoclet" value="${build.dir}/xdoclet"/>
  +  <property name="gen.dir" value="${build.dir}/gen"/>
     <property name="build.src" value="${build.dir}/src"/>
     <property name="build.classes" value="${build.dir}/classes"/>
     <property name="build.javadocs" value="${build.dir}/javadocs"/>
  @@ -123,40 +123,37 @@
   
   
     <!-- Make .xinfo and manifest automatically for blocks -->
  -  <target name="phoenix-xdoclet" depends="compile">
  +  <target name="phoenix-meta" depends="compile">
   
  -    <mkdir dir="${build.xdoclet}"/>
  +    <mkdir dir="${gen.dir}"/>
   
  -    <taskdef name="phoenix-blocks"
  -             classname="org.apache.avalon.phoenix.tools.xdoclet.PhoenixXDoclet"
  -             classpathref="project.class.path"/>
  -
  -    <phoenix-blocks
  -        destdir="${build.xdoclet}"
  -        classpathref="project.class.path">
  -      <fileset dir="${java.dir}">
  -        <include name="**/*.java" />
  -      </fileset>
  -      <blockinfo/>
  -      <manifest manifestFile="manifest.mf" />
  -    </phoenix-blocks>
  +          <taskdef name="generatemeta" classname="org.apache.avalon.phoenix.tools.metagenerate.MetaGenerateQdoxTask">
  +              <classpath refid="project.class.path"/>
  +          </taskdef>
  +
  +          <generatemeta dest="${gen.dir}">
  +              <fileset dir="${java.dir}">
  +                  <include name="**/*.java"/>
  +              </fileset>
  +          </generatemeta>
   
     </target>
   
     <!-- Jars up project -->
  -  <target name="jars" depends="phoenix-xdoclet">
  +  <target name="jars" depends="phoenix-meta">
   
       <mkdir dir="${build.lib}"/>
   
       <jar jarfile="${build.lib}/simpleserver.jar"
  -         manifest="${build.xdoclet}/manifest.mf">
  +        manifest="${manifest.dir}/simpleserver.mf">
         <fileset dir="${build.classes}">
           <include name="org/apache/avalon/simpleserver/**"/>
  -        <exclude name="org/apache/avalon/cornerstone/demos/simpleserver/extension1/*"/>
  -        <exclude name="org/apache/avalon/cornerstone/demos/simpleserver/extension2/*"/>
  -        <exclude name="org/apache/avalon/cornerstone/demos/simpleserver/classes/*"/>
  +        <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/*"/>
         </fileset>
  -      <fileset dir="${build.xdoclet}">
  +      <fileset dir="${gen.dir}">
           <include name="**/*.xinfo"/>
         </fileset>
       </jar>
  @@ -164,15 +161,20 @@
       <jar jarfile="${build.lib}/demo-test-extension1.jar"
            basedir="${build.classes}"
            manifest="${manifest.dir}/test-extension1.mf">
  -      <include name="org/apache/avalon/cornerstone/demos/simpleserver/extension1/*"/>
  +      <include name="org/apache/avalon/simpleserver/extension1/*"/>
       </jar>
   
       <jar jarfile="${build.lib}/demo-test-extension2.jar"
            basedir="${build.classes}"
            manifest="${manifest.dir}/test-extension2.mf">
  -      <include name="org/apache/avalon/cornerstone/demos/simpleserver/extension2/*"/>
  +      <include name="org/apache/avalon/simpleserver/extension2/*"/>
       </jar>
   
  +      <jar jarfile="${build.lib}/cltest.jar"
  +          basedir="${build.classes}">
  +          <include name="org/apache/avalon/simpleserver/cltest/*"/>
  +      </jar>
  +
     </target>
   
     <target name="main" depends="sars" description="Default target to generate build products
minus docs"/>
  @@ -186,8 +188,13 @@
            assembly="${conf.dir}/simpleserver-assembly.xml" >
   
         <zipfileset dir="${build.classes}" prefix="SAR-INF/classes">
  -        <include name="org/apache/avalon/cornerstone/demos/simpleserver/classes/*"/>
  +        <include name="org/apache/avalon/simpleserver/classes/*"/>
         </zipfileset>
  +
  +      <zipfileset dir="${build.lib}/" prefix="lib">
  +        <include name="cltest.jar"/>
  +      </zipfileset>
  +
         <fileset dir=".">
             <include name="README.txt"/>
         </fileset>
  
  
  
  1.3       +16 -0     jakarta-avalon-apps/simpleserver/src/conf/simpleserver-environment.xml
  
  Index: simpleserver-environment.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/simpleserver/src/conf/simpleserver-environment.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- simpleserver-environment.xml	11 May 2002 07:04:19 -0000	1.2
  +++ simpleserver-environment.xml	1 Nov 2002 23:23:59 -0000	1.3
  @@ -23,4 +23,20 @@
         </grant>
       </policy>
   
  +    <classloader 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>
  +
  +    </classloader>
  +
   </environment>
  
  
  
  1.11      +16 -2     jakarta-avalon-apps/simpleserver/src/java/org/apache/avalon/simpleserver/SimpleServer.java
  
  Index: SimpleServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/simpleserver/src/java/org/apache/avalon/simpleserver/SimpleServer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SimpleServer.java	6 Sep 2002 09:45:07 -0000	1.10
  +++ SimpleServer.java	1 Nov 2002 23:23:59 -0000	1.11
  @@ -60,7 +60,7 @@
    * <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>
  @@ -93,7 +93,7 @@
       }
   
       /**
  -     * 
  +     *
        * @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"
  @@ -174,6 +174,20 @@
           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.simpleserver.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" );
       }
  
  
  
  1.1                  jakarta-avalon-apps/simpleserver/src/java/org/apache/avalon/simpleserver/cltest/CLTest.java
  
  Index: CLTest.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.simpleserver.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: 2002/11/01 23:23:59 $
   */
  public class CLTest
  {
  }
  
  
  
  1.3       +3 -18     jakarta-avalon-apps/simpleserver/src/manifest/simpleserver.mf
  
  
  
  

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


Mime
View raw message