Top Description Fields Constructors Methods
org.apache.catalina.startup

public final Class Bootstrap

extends Object
Class Inheritance
Imports
java.io.File, .IOException, java.lang.reflect.InvocationTargetException, .Method, java.net.MalformedURLException, .URI, .URISyntaxException, .URL, java.util.ArrayList, .List, java.util.regex.Matcher, .Pattern, org.apache.catalina.security.SecurityClassLoad, org.apache.catalina.startup.ClassLoaderFactory.Repository, .ClassLoaderFactory.RepositoryType, org.apache.juli.logging.Log, .LogFactory

Bootstrap loader for Catalina. This application constructs a class loader for use in loading the Catalina internal classes (by accumulating all of the JAR files found in the "server" directory under "catalina.home"), and starts the regular execution of the container. The purpose of this roundabout approach is to keep the Catalina internal classes (and any other classes they depend on, such as an XML parser) out of the system class path and therefore not visible to application level classes.
Authors
Craig R. McClanahan, Remy Maucherat

Field Summary

Modifier and TypeField and Description
private static final File
private Object
catalinaDaemon

Daemon reference.

private static final File
pack-priv ClassLoader
pack-priv ClassLoader
private static volatile Bootstrap
private static final Object
daemonLock

Daemon object used by main.

private static final Log
private static final Pattern
pack-priv ClassLoader

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private ClassLoader
public void
destroy()

Destroy the Catalina Daemon.

public boolean
public static String

Returns:

the catalina base
getCatalinaBase
()

Obtain the name of the configured base (instance) directory.

public static File

Returns:

the catalina base as a file
getCatalinaBaseFile
()

Obtain the configured base (instance) directory.

public static String

Returns:

the catalina home
getCatalinaHome
()

Obtain the name of configured home (binary) directory.

public static File

Returns:

the catalina home as a file
getCatalinaHomeFile
()

Obtain the configured home (binary) directory.

protected static String[]
private Object
getServer()

getServer() for configtest

pack-priv static void
public void
init()

Initialize daemon.

public void
init(String[]
Initialization arguments
arguments
)

Load the Catalina daemon.

private void
private void
load(String[] arguments)

Load daemon.

public static void
main(String[]
Command line arguments to be processed
args
)

Main method and entry point when starting Tomcat via the provided scripts.

protected String

Returns:

the modified string
replace
(String
The original string
str
)

System property replacement in the given string.

public void
setAwait(boolean
true if the daemon should block
await
)

Set flag.

public void
start()

Start the Catalina daemon.

public void
stop()

Stop the Catalina Daemon.

public void
stopServer()

Stop the standalone server.

public void
stopServer(String[]
Command line arguments
arguments
)

Stop the standalone server.

pack-priv static Throwable
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

catalinaBaseFileback to summary
private static final File catalinaBaseFile
catalinaDaemonback to summary
private Object catalinaDaemon

Daemon reference.

catalinaHomeFileback to summary
private static final File catalinaHomeFile
catalinaLoaderback to summary
pack-priv ClassLoader catalinaLoader
commonLoaderback to summary
pack-priv ClassLoader commonLoader
daemonback to summary
private static volatile Bootstrap daemon
daemonLockback to summary
private static final Object daemonLock

Daemon object used by main.

logback to summary
private static final Log log
PATH_PATTERNback to summary
private static final Pattern PATH_PATTERN
sharedLoaderback to summary
pack-priv ClassLoader sharedLoader

Constructor Detail

Bootstrapback to summary
public Bootstrap()

Method Detail

createClassLoaderback to summary
private ClassLoader createClassLoader(String name, ClassLoader parent) throws Exception
destroyback to summary
public void destroy()

Destroy the Catalina Daemon.

getAwaitback to summary
public boolean getAwait() throws Exception
getCatalinaBaseback to summary
public static String getCatalinaBase()

Obtain the name of the configured base (instance) directory. Note that home and base may be the same (and are by default). If this is not set the value returned by getCatalinaHome() will be used.

Returns:String

the catalina base

getCatalinaBaseFileback to summary
public static File getCatalinaBaseFile()

Obtain the configured base (instance) directory. Note that home and base may be the same (and are by default). If this is not set the value returned by getCatalinaHomeFile() will be used.

Returns:File

the catalina base as a file

getCatalinaHomeback to summary
public static String getCatalinaHome()

Obtain the name of configured home (binary) directory. Note that home and base may be the same (and are by default).

Returns:String

the catalina home

getCatalinaHomeFileback to summary
public static File getCatalinaHomeFile()

Obtain the configured home (binary) directory. Note that home and base may be the same (and are by default).

Returns:File

the catalina home as a file

getPathsback to summary
protected static String[] getPaths(String value)
getServerback to summary
private Object getServer() throws Exception

getServer() for configtest

handleThrowableback to summary
pack-priv static void handleThrowable(Throwable t)
initback to summary
public void init() throws Exception

Initialize daemon.

Exceptions
Exception:
Fatal initialization error
initback to summary
public void init(String[] arguments) throws Exception

Load the Catalina daemon.

Parameters
arguments:String[]

Initialization arguments

Exceptions
Exception:
Fatal initialization error
initClassLoadersback to summary
private void initClassLoaders()
loadback to summary
private void load(String[] arguments) throws Exception

Load daemon.

mainback to summary
public static void main(String[] args)

Main method and entry point when starting Tomcat via the provided scripts.

Parameters
args:String[]

Command line arguments to be processed

replaceback to summary
protected String replace(String str)

System property replacement in the given string.

Parameters
str:String

The original string

Returns:String

the modified string

setAwaitback to summary
public void setAwait(boolean await) throws Exception

Set flag.

Parameters
await:boolean

true if the daemon should block

Exceptions
Exception:
Reflection error
startback to summary
public void start() throws Exception

Start the Catalina daemon.

Exceptions
Exception:
Fatal start error
stopback to summary
public void stop() throws Exception

Stop the Catalina Daemon.

Exceptions
Exception:
Fatal stop error
stopServerback to summary
public void stopServer() throws Exception

Stop the standalone server.

Exceptions
Exception:
Fatal stop error
stopServerback to summary
public void stopServer(String[] arguments) throws Exception

Stop the standalone server.

Parameters
arguments:String[]

Command line arguments

Exceptions
Exception:
Fatal stop error
unwrapInvocationTargetExceptionback to summary
pack-priv static Throwable unwrapInvocationTargetException(Throwable t)