dirkv 2004/07/25 08:48:33
Modified: launcher/xdocs navigation.xml
Added: launcher/xdocs example.xml
Log:
add example + wiki
Revision Changes Path
1.5 +2 -8 jakarta-commons/launcher/xdocs/navigation.xml
Index: navigation.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/launcher/xdocs/navigation.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- navigation.xml 7 Mar 2004 11:05:22 -0000 1.4
+++ navigation.xml 25 Jul 2004 15:48:33 -0000 1.5
@@ -21,16 +21,10 @@
<menu name="Commons Launcher">
<item name="Overview" href="/index.html" />
-<!-- <item name="Configuration"
href="/configuration.html" /> -->
<item name="API Documentation" href="/apidocs/index.html"/>
-<!--
- <item name="Developers Guide" href="/guide/index.html"
collapse="true">
- <item name="Class Diagrams"
href="/guide/classdiagrams.html"/>
- <item name="Sequence Diagrams"
href="/guide/sequencediagrams.html"/>
- </item>
- <item name="Examples"
href="http://cvs.apache.org/viewcvs/jakarta-commons/launcher/doc/"/>
--->
+ <item name="Example" href="/example.html"/>
<item name="Downloads" href="/downloads.html"/>
+ <item name="Wiki"
href="http://wiki.apache.org/jakarta-commons/Launcher"/>
</menu>
&common-menus;
</body>
1.1 jakarta-commons/launcher/xdocs/example.xml
Index: example.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2002-2004 The Apache Software Foundation
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.
-->
<document>
<properties>
<title>Example</title>
<author email="[EMAIL PROTECTED]">Commons Documentation Team</author>
</properties>
<body>
<section name="Introduction">
<p>
The Commons-launcher project provides a smart way to start a Java application.
In the facts, the CommonsLauncher provides a bootstrap class which starts a ant
process.
</p>
<p>
This ant process :
<ul>
<li>makes the needed pre execution tasks : create the needed classpath, check
resources, download resources ..</li>
<li>invoke a launcher task which allows to start a java application</li>
</ul>
</p>
</section>
<section name="Example">
<p>
We want to start a small Main class :
<source>
package org.apache.launcher.example;
import org.apache.commons.logging.LogFactory;
public class Main {
public static void main(String[] args) {
LogFactory.getLog(Main.class).info("start");
}
}
</source>
We will name it "our application".
</p>
</section>
<section name="Global distribution">
<p>This runtime distribution includes:
<ul>
<li>bin/demo.sh : the unix user script to start our small Main class</li>
<li>bin/demo.bat : the windows user script to start our small Main class</li>
<li>bin/ : contains the other files used by the script</li>
<li>etc/ : contains the configuration file (log4j configuration, ..)</li>
<li>lib/launcher-demo.jar : contains the small Main class</li>
<li>lib/ : contains the needed jar files to the application</li>
<li>lib/launcher/ : contains the needed jar files to the commons launcher</li>
</ul>
</p>
</section>
<section name="Bin Directory">
<p><b>User script</b></p>
<p>The demo.(sh/bat) is the bootstrap script used by the user to start the
application:
<source>
java -cp . LauncherBootstrap -executablename launcher-demo demo
</source>
</p>
<p><b>Launcher ant configuration</b></p>
<p>Our launcher.xml is as simple as possible :
<source><![CDATA[
<project name="Demo Launcher" default="demo" basedir=".">
<property name="base.dir" value="${basedir}/.."/>
<property name="etc.dir" value="${base.dir}/etc"/>
<property name="lib.dir" value="${base.dir}/lib"/>
<property name="log.dir" value="${base.dir}/log"/>
<path id="base.class.path">
<pathelement path="${etc.dir}"/>
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<target name="demo">
<mkdir dir="${log.dir}" />
<launch classname="org.apache.launcher.example.Main">
<classpath refid="base.class.path"/>
<syspropertyset>
<sysproperty key="log.dir" file="${log.dir}"/>
</syspropertyset>
</launch>
</target>
</project>]]>
</source>
It creates the needed classpath, the log directory, sets the log.dir system
property for log4j and executes our Main class.
</p>
<p><b>Other files</b></p>
<p>
<ul>
<li>LauncherBootstrap.class, commons-launcher.jar : the neede classes the
CommonsLauncher</li>
<li>launcher.properties : the bootstrap configuration (used to find the
lib/launcher files)</li>
</ul>
</p>
</section>
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]