Package org.apache.catalina.startup
Class Catalina
- java.lang.Object
-
- org.apache.catalina.startup.Catalina
-
public class Catalina extends java.lang.Object
Startup/Shutdown shell program for Catalina. The following command line options are recognized:- -config {pathname} - Set the pathname of the configuration file to be processed. If a relative path is specified, it will be interpreted as relative to the directory pathname specified by the "catalina.base" system property. [conf/server.xml]
- -help - Display usage information.
- -nonaming - Disable naming support.
- configtest - Try to test the config
- start - Start an instance of Catalina.
- stop - Stop the currently running instance of Catalina.
- Author:
- Craig R. McClanahan, Remy Maucherat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
Catalina.CatalinaShutdownHook
Shutdown hook which will perform a clean shutdown of Catalina if needed.static interface
Catalina.ServerXml
-
Field Summary
Fields Modifier and Type Field Description protected boolean
await
Use await.protected java.lang.String
configFile
Pathname to the server configuration file.protected boolean
generateCode
Generate Tomcat embedded code from configuration files.protected java.io.File
generatedCodeLocation
Location of generated sources.protected java.lang.String
generatedCodeLocationParameter
Value of the argument.protected java.lang.String
generatedCodePackage
Top package name for generated source.protected boolean
loaded
Prevent duplicate loads.protected java.lang.ClassLoader
parentClassLoader
The shared extensions class loader for this server.protected Server
server
The server component we are starting or stopping.static java.lang.String
SERVER_XML
protected java.lang.Thread
shutdownHook
Shutdown hook.protected static StringManager
sm
The string manager for this package.protected boolean
throwOnInitFailure
Rethrow exceptions on init failure.protected boolean
useGeneratedCode
Use generated code as a replacement for configuration files.protected boolean
useNaming
Is naming enabled ?protected boolean
useShutdownHook
Use shutdown hook flag.
-
Constructor Summary
Constructors Constructor Description Catalina()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
arguments(java.lang.String[] args)
Process the specified command line arguments.void
await()
Await and shutdown.protected java.io.File
configFile()
Return a File object representing our configuration file.protected Digester
createStartDigester()
Create and configure the Digester we will be using for startup.protected Digester
createStopDigester()
Create and configure the Digester we will be using for shutdown.protected void
generateClassFooter(Digester digester)
protected void
generateClassHeader(Digester digester, boolean start)
protected void
generateLoader()
java.lang.String
getConfigFile()
boolean
getGenerateCode()
java.io.File
getGeneratedCodeLocation()
java.lang.String
getGeneratedCodePackage()
java.lang.ClassLoader
getParentClassLoader()
Server
getServer()
boolean
getThrowOnInitFailure()
boolean
getUseGeneratedCode()
boolean
getUseShutdownHook()
protected void
initNaming()
protected void
initStreams()
boolean
isAwait()
boolean
isUseNaming()
void
load()
Start a new server instance.void
load(java.lang.String[] args)
protected void
parseServerXml(boolean start)
void
setAwait(boolean b)
void
setConfigFile(java.lang.String file)
void
setGenerateCode(boolean generateCode)
void
setGeneratedCodeLocation(java.io.File generatedCodeLocation)
void
setGeneratedCodePackage(java.lang.String generatedCodePackage)
void
setParentClassLoader(java.lang.ClassLoader parentClassLoader)
Set the shared extensions class loader.protected void
setSecurityProtection()
Set the security package access/protection.void
setServer(Server server)
void
setThrowOnInitFailure(boolean throwOnInitFailure)
Set the behavior regarding errors that could occur during server init.void
setUseGeneratedCode(boolean useGeneratedCode)
void
setUseNaming(boolean useNaming)
Enables or disables naming support.void
setUseShutdownHook(boolean useShutdownHook)
void
start()
Start a new server instance.void
stop()
Stop an existing server instance.void
stopServer()
void
stopServer(java.lang.String[] arguments)
protected void
usage()
Print usage information for this application.
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The string manager for this package.
-
SERVER_XML
public static final java.lang.String SERVER_XML
- See Also:
- Constant Field Values
-
await
protected boolean await
Use await.
-
configFile
protected java.lang.String configFile
Pathname to the server configuration file.
-
parentClassLoader
protected java.lang.ClassLoader parentClassLoader
The shared extensions class loader for this server.
-
server
protected Server server
The server component we are starting or stopping.
-
useShutdownHook
protected boolean useShutdownHook
Use shutdown hook flag.
-
shutdownHook
protected java.lang.Thread shutdownHook
Shutdown hook.
-
useNaming
protected boolean useNaming
Is naming enabled ?
-
loaded
protected boolean loaded
Prevent duplicate loads.
-
throwOnInitFailure
protected boolean throwOnInitFailure
Rethrow exceptions on init failure.
-
generateCode
protected boolean generateCode
Generate Tomcat embedded code from configuration files.
-
generatedCodeLocation
protected java.io.File generatedCodeLocation
Location of generated sources.
-
generatedCodeLocationParameter
protected java.lang.String generatedCodeLocationParameter
Value of the argument.
-
generatedCodePackage
protected java.lang.String generatedCodePackage
Top package name for generated source.
-
useGeneratedCode
protected boolean useGeneratedCode
Use generated code as a replacement for configuration files.
-
-
Method Detail
-
setConfigFile
public void setConfigFile(java.lang.String file)
-
getConfigFile
public java.lang.String getConfigFile()
-
setUseShutdownHook
public void setUseShutdownHook(boolean useShutdownHook)
-
getUseShutdownHook
public boolean getUseShutdownHook()
-
getGenerateCode
public boolean getGenerateCode()
-
setGenerateCode
public void setGenerateCode(boolean generateCode)
-
getUseGeneratedCode
public boolean getUseGeneratedCode()
-
setUseGeneratedCode
public void setUseGeneratedCode(boolean useGeneratedCode)
-
getGeneratedCodeLocation
public java.io.File getGeneratedCodeLocation()
-
setGeneratedCodeLocation
public void setGeneratedCodeLocation(java.io.File generatedCodeLocation)
-
getGeneratedCodePackage
public java.lang.String getGeneratedCodePackage()
-
setGeneratedCodePackage
public void setGeneratedCodePackage(java.lang.String generatedCodePackage)
-
getThrowOnInitFailure
public boolean getThrowOnInitFailure()
- Returns:
true
if an exception should be thrown if an error occurs during server init
-
setThrowOnInitFailure
public void setThrowOnInitFailure(boolean throwOnInitFailure)
Set the behavior regarding errors that could occur during server init.- Parameters:
throwOnInitFailure
- the new flag value
-
setParentClassLoader
public void setParentClassLoader(java.lang.ClassLoader parentClassLoader)
Set the shared extensions class loader.- Parameters:
parentClassLoader
- The shared extensions class loader.
-
getParentClassLoader
public java.lang.ClassLoader getParentClassLoader()
-
setServer
public void setServer(Server server)
-
getServer
public Server getServer()
-
isUseNaming
public boolean isUseNaming()
- Returns:
true
if naming is enabled.
-
setUseNaming
public void setUseNaming(boolean useNaming)
Enables or disables naming support.- Parameters:
useNaming
- The new use naming value
-
setAwait
public void setAwait(boolean b)
-
isAwait
public boolean isAwait()
-
arguments
protected boolean arguments(java.lang.String[] args)
Process the specified command line arguments.- Parameters:
args
- Command line arguments to process- Returns:
true
if we should continue processing
-
configFile
protected java.io.File configFile()
Return a File object representing our configuration file.- Returns:
- the main configuration file
-
createStartDigester
protected Digester createStartDigester()
Create and configure the Digester we will be using for startup.- Returns:
- the main digester to parse server.xml
-
createStopDigester
protected Digester createStopDigester()
Create and configure the Digester we will be using for shutdown.- Returns:
- the digester to process the stop operation
-
parseServerXml
protected void parseServerXml(boolean start)
-
stopServer
public void stopServer()
-
stopServer
public void stopServer(java.lang.String[] arguments)
-
load
public void load()
Start a new server instance.
-
load
public void load(java.lang.String[] args)
-
start
public void start()
Start a new server instance.
-
stop
public void stop()
Stop an existing server instance.
-
await
public void await()
Await and shutdown.
-
usage
protected void usage()
Print usage information for this application.
-
initStreams
protected void initStreams()
-
initNaming
protected void initNaming()
-
setSecurityProtection
protected void setSecurityProtection()
Set the security package access/protection.
-
generateLoader
protected void generateLoader()
-
generateClassHeader
protected void generateClassHeader(Digester digester, boolean start)
-
generateClassFooter
protected void generateClassFooter(Digester digester)
-
-