remm 00/11/12 22:42:31
Modified: catalina build.xml
catalina/src/bin catalina.bat
Added: catalina/src/conf catalina.conf.xml
catalina/src/share/org/apache/catalina/startup
CatalinaBlock.java CatalinaBlock.xinfo
Log:
- Add a wrapper to enable management of Tomcat 4 by Avalon.
- Use the new "dist-opt-avalon" target in the Catalina build file to build the
Avalon block. This is NOT part of the "dist" target because of limitations
in the current Ant (the problem seems to be that this build file is actually
used from the main Tomcat build file; any help to resolve this would be
appreciated).
This target assumes that Avalon is in ../../dist/avalon. There is an
avalon.dist property which can be used to point to another location.
- The Avalon block (catalina.bar) contains a configuration file which has
a path element which must point to the Tomcat 4 distribution. If Avalon is
in the directory mentioned above, then the defaults are fine.
- The wrapper has been successfully tested with Avalon 3.0a3.
Revision Changes Path
1.25 +35 -5 jakarta-tomcat-4.0/catalina/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- build.xml 2000/11/12 01:10:42 1.24
+++ build.xml 2000/11/13 06:42:29 1.25
@@ -2,11 +2,14 @@
<!-- ===================== Initialize Property Values =================== -->
- <property name="build.compiler" value="classic"/>
- <property name="catalina.build" value="../../build/catalina"/>
- <property name="catalina.deploy" value="../../build/tomcat-4.0"/>
- <property name="catalina.dist" value="../../dist/catalina"/>
+ <property name="build.compiler" value="classic"/>
+ <property name="catalina.build" value="../../build/catalina"/>
+ <property name="catalina.deploy" value="../../build/tomcat-4.0"/>
+ <property name="catalina.dist" value="../../dist/catalina"/>
+ <property name="servletapi.build" value="../../build/servletapi"/>
+ <property name="avalon.dist" value="../../dist/avalon"/>
+
<!-- ================== Derived Property Values ========================= -->
<property name="jaxp.jar" value="${catalina.jaxp.home}/jaxp.jar"/>
<property name="parser.jar"
value="${catalina.jaxp.home}/${catalina.jaxp.parser.jar}"/>
@@ -20,6 +23,8 @@
<!-- =================== BUILD: Create Directories ====================== -->
<target name="build-prepare">
<available file="${jaxp.jar}" property="jaxp.jar.present" />
+ <available property="avalon.present"
+ classname="org.apache.avalon.blocks.Block" />
<mkdir dir="${catalina.build}"/>
<mkdir dir="${catalina.build}/bin"/>
<mkdir dir="${catalina.build}/classes"/>
@@ -44,7 +49,9 @@
<!-- Configuration Files -->
<copy todir="${catalina.build}/conf">
- <fileset dir="src/conf" />
+ <fileset dir="src/conf">
+ <exclude name="catalina.conf.xml" />
+ </fileset>
</copy>
<!-- Shared Extensions -->
@@ -82,6 +89,8 @@
classname="javax.sql.DataSource" />
<available property="jta.present"
classname="javax.transaction.UserTransaction" />
+ <available property="avalon.present"
+ classname="org.apache.avalon.blocks.Block" />
<!-- Compile internal server components -->
<javac srcdir="src/share" destdir="${catalina.build}/classes"
@@ -94,6 +103,8 @@
unless="jdbcse.present" />
<exclude name="**/factory/TransactionFactory.java"
unless="jta.present" />
+ <exclude name="**/startup/CatalinaBlock.java"
+ unless="avalon.present" />
</javac>
<!-- Copy static resource files -->
@@ -120,6 +131,7 @@
</target>
+
<!-- ================ BUILD: Create Catalina Javadocs =================== -->
<target name="javadoc" depends="build-main">
<delete dir="${catalina.build}/javadoc"/>
@@ -240,6 +252,24 @@
</target>
+ <!-- ============= DIST: Create Avalon Block Distribution =============== -->
+ <!--FIXME : Can't get that to work ... Ant bug ?-->
+ <!--target name="dist-opt-avalon" depends="build-main" if="avalon-present"-->
+ <target name="dist-opt-avalon">
+ <jar jarfile="${avalon.dist}/bin/blocks/catalina.bar">
+ <fileset dir="${catalina.build}/classes">
+ <include name="org/apache/catalina/startup/Bootstrap.class" />
+ <include name="org/apache/catalina/startup/CatalinaBlock.class" />
+ <include name="org/apache/catalina/loader/**" />
+ </fileset>
+ <fileset dir="src">
+ <include name="**/conf/catalina.conf.xml"/>
+ </fileset>
+ <fileset dir="src/share">
+ <include name="**/startup/*.xinfo"/>
+ </fileset>
+ </jar>
+ </target>
<!-- ======================== DIST: Clean Directory ===================== -->
<target name="dist-clean">
1.13 +2 -3 jakarta-tomcat-4.0/catalina/src/bin/catalina.bat
Index: catalina.bat
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/catalina.bat,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- catalina.bat 2000/11/02 06:14:08 1.12
+++ catalina.bat 2000/11/13 06:42:29 1.13
@@ -12,7 +12,7 @@
rem
rem JAVA_HOME Must point at your Java Development Kit installation.
rem
-rem $Id: catalina.bat,v 1.12 2000/11/02 06:14:08 remm Exp $
+rem $Id: catalina.bat,v 1.13 2000/11/13 06:42:29 remm Exp $
rem ---------------------------------------------------------------------------
@@ -54,8 +54,7 @@
rem ----- Set Up The Runtime Classpath ----------------------------------------
-set CP=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_HOME%\bin\servlet.jar
-set CP=%CP%;%CATALINA_HOME%\bin\naming.jar;%JAVA_HOME%\lib\tools.jar
+set CP=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CP%
echo Using CLASSPATH: %CLASSPATH%
1.1 jakarta-tomcat-4.0/catalina/src/conf/catalina.conf.xml
Index: catalina.conf.xml
===================================================================
<?xml version="1.0"?>
<avalon>
<block class="org.apache.catalina.startup.CatalinaBlock"
name="catalina" >
<logger name="Servlet container" destinationURL="../logs/catalina.log"
priority="DEBUG"/>
<configuration>
<path>../../tomcat-4.0</path>
</configuration>
</block>
</avalon>
1.1
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaBlock.java
Index: CatalinaBlock.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaBlock.java,v
1.1 2000/11/13 06:42:30 remm Exp $
* $Revision: 1.1 $
* $Date: 2000/11/13 06:42:30 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", 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 [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* 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/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.catalina.startup;
import org.apache.avalon.ConfigurationException;
import org.apache.avalon.Configuration;
import org.apache.avalon.blocks.AbstractBlock;
/**
* Catalina wrapper for Avalon.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
* @version $Revision: 1.1 $
*/
public final class CatalinaBlock
extends AbstractBlock {
// ----------------------------------------------------- Instance Variables
/**
* Catalina path (as read in the configuration file).
*/
private String path = null;
// ---------------------------------------------------------- Block Methods
public void configure(final Configuration configuration)
throws ConfigurationException {
super.configure(configuration);
try {
Configuration pathElement = configuration.getChild("path");
path = pathElement.getValue();
} catch (ConfigurationException e) {
e.printStackTrace();
}
if (path != null) {
System.setProperty("catalina.home", path);
}
}
public void init()
throws Exception {
try {
String[] args = { "start" };
Bootstrap.main(args);
} catch (Throwable t) {
t.printStackTrace();
}
}
public void dispose()
throws Exception {
try {
String[] args = { "stop" };
Bootstrap.main(args);
} catch (Throwable t) {
t.printStackTrace();
}
}
}
1.1
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaBlock.xinfo
Index: CatalinaBlock.xinfo
===================================================================
<?xml version="1.0"?>
<blockinfo>
<meta>
<contributors>
<author name="Remy Maucherat" email="[EMAIL PROTECTED]"/>
</contributors>
</meta>
<!-- services that are offered by this block -->
<services>
<service name="org.apache.avalon.blocks.Block" version="1.0" />
</services>
</blockinfo>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]