org.apache.tomcat.startup
Class Main

java.lang.Object
  extended byorg.apache.tomcat.startup.Main

public class Main
extends java.lang.Object

Launcher capable of setting class loader and guessing locations.

This is a replacement/enhancement for the .sh and .bat files - you can use JDK1.2 "java -jar [PROGRAM].jar", or ( for jdk 1.1 ) you just need to include a single jar file in the classpath.

The class will first guess it's own location by looking in each classpath location. It'll then process the command line parameters and based on a properties file, locate the actual class that will be started.

It'll then construct a class loader ( common ) from the content of a specified directory and/or additionl system property. Based on the first argument, it'll instantiate a class ( in the created class loader ), set the parameters, and call it's execute() method.

Author:
Costin Manolache, Ignacio J. Ortega, Mel Martinez mmartinez@g1440.com

Field Summary
static java.lang.String PROPERTY_COMMON_LOADER
          System property that can be used to pass additional classpath to the 'common' loader, used to load EmbededTomcat and the core.
 
Constructor Summary
Main()
           
 
Method Summary
 void execute()
           
 void initClassLoader()
           
 void initSecurityFile()
          If "-sandbox" parameter is found ( the first after the action ), we'll load a sandbox with the policy in install/conf/tomcat.policy.
static void main(java.lang.String[] args)
           
 void printUsage()
           
 void processArgs(java.lang.String[] args)
           
 void setInstallDir(java.lang.String dir)
           
 void setLibDir(java.lang.String dir)
           
 void setLoaderProperty(java.lang.String prop)
           
 void setParentLoader(java.lang.ClassLoader p)
           
 void setTask(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_COMMON_LOADER

public static final java.lang.String PROPERTY_COMMON_LOADER
System property that can be used to pass additional classpath to the 'common' loader, used to load EmbededTomcat and the core. EmbededTomcat will load the container int a separate loader, and each applications will be set up int its own loader. The loader configurator module may use additional properties

See Also:
Constant Field Values
Constructor Detail

Main

public Main()
Method Detail

setLibDir

public void setLibDir(java.lang.String dir)

setLoaderProperty

public void setLoaderProperty(java.lang.String prop)

setInstallDir

public void setInstallDir(java.lang.String dir)

setParentLoader

public void setParentLoader(java.lang.ClassLoader p)

main

public static void main(java.lang.String[] args)

processArgs

public void processArgs(java.lang.String[] args)

initClassLoader

public void initClassLoader()

initSecurityFile

public void initSecurityFile()
If "-sandbox" parameter is found ( the first after the action ), we'll load a sandbox with the policy in install/conf/tomcat.policy. This has to happen before loading any class or constructing the loader, or some VMs will have wrong permissions. We do that here, instead of the shell script, in order to support java -jar and to minimize the ammount of platform-dependent code. Note that we are not setting a security manager - just adding permissions so that all "system" classes have permissions.


setTask

public void setTask(java.lang.String s)

printUsage

public void printUsage()

execute

public void execute()
             throws java.lang.Exception
Throws:
java.lang.Exception


Copyright ? 2001 Apache Software Foundation. All Rights Reserved.