Package org.apache.catalina.startup
Class Catalina
java.lang.Object
org.apache.catalina.startup.Catalina
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 ClassesModifier and TypeClassDescriptionprotected classShutdown hook which will perform a clean shutdown of Catalina if needed.static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanUse await.protected StringPathname to the server configuration file.protected booleanGenerate Tomcat embedded code from configuration files.protected FileLocation of generated sources.protected StringValue of the argument.protected StringTop package name for generated source.protected booleanPrevent duplicate loads.protected ClassLoaderThe shared extensions class loader for this server.protected ServerThe server component we are starting or stopping.static final Stringprotected ThreadShutdown hook.protected static final StringManagerThe string manager for this package.protected booleanRethrow exceptions on init failure.protected booleanUse generated code as a replacement for configuration files.protected booleanIs naming enabled ?protected booleanUse shutdown hook flag. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanProcess the specified command line arguments.voidawait()Await and shutdown.protected FileReturn a File object representing our configuration file.protected DigesterCreate and configure the Digester we will be using for startup.protected DigesterCreate and configure the Digester we will be using for shutdown.protected voidgenerateClassFooter(Digester digester) protected voidgenerateClassHeader(Digester digester, boolean start) protected voidbooleanbooleanbooleanbooleanprotected voidprotected voidbooleanisAwait()booleanvoidload()Start a new server instance.voidprotected voidparseServerXml(boolean start) voidsetAwait(boolean b) voidsetConfigFile(String file) voidsetGenerateCode(boolean generateCode) voidsetGeneratedCodeLocation(File generatedCodeLocation) voidsetGeneratedCodePackage(String generatedCodePackage) voidsetParentClassLoader(ClassLoader parentClassLoader) Set the shared extensions class loader.protected voidSet the security package access/protection.voidvoidsetThrowOnInitFailure(boolean throwOnInitFailure) Set the behavior regarding errors that could occur during server init.voidsetUseGeneratedCode(boolean useGeneratedCode) voidsetUseNaming(boolean useNaming) Enables or disables naming support.voidsetUseShutdownHook(boolean useShutdownHook) voidstart()Start a new server instance.voidstop()Stop an existing server instance.voidvoidstopServer(String[] arguments) protected voidusage()Print usage information for this application.
-
Field Details
-
sm
The string manager for this package. -
SERVER_XML
- See Also:
-
await
protected boolean awaitUse await. -
configFile
Pathname to the server configuration file. -
parentClassLoader
The shared extensions class loader for this server. -
server
The server component we are starting or stopping. -
useShutdownHook
protected boolean useShutdownHookUse shutdown hook flag. -
shutdownHook
Shutdown hook. -
useNaming
protected boolean useNamingIs naming enabled ? -
loaded
protected boolean loadedPrevent duplicate loads. -
throwOnInitFailure
protected boolean throwOnInitFailureRethrow exceptions on init failure. -
generateCode
protected boolean generateCodeGenerate Tomcat embedded code from configuration files. -
generatedCodeLocation
Location of generated sources. -
generatedCodeLocationParameter
Value of the argument. -
generatedCodePackage
Top package name for generated source. -
useGeneratedCode
protected boolean useGeneratedCodeUse generated code as a replacement for configuration files.
-
-
Constructor Details
-
Catalina
public Catalina()
-
-
Method Details
-
setConfigFile
-
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
-
setGeneratedCodeLocation
-
getGeneratedCodePackage
-
setGeneratedCodePackage
-
getThrowOnInitFailure
public boolean getThrowOnInitFailure()- Returns:
trueif 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
Set the shared extensions class loader.- Parameters:
parentClassLoader- The shared extensions class loader.
-
getParentClassLoader
-
setServer
-
getServer
-
isUseNaming
public boolean isUseNaming()- Returns:
trueif 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
Process the specified command line arguments.- Parameters:
args- Command line arguments to process- Returns:
trueif we should continue processing
-
configFile
Return a File object representing our configuration file.- Returns:
- the main configuration file
-
createStartDigester
Create and configure the Digester we will be using for startup.- Returns:
- the main digester to parse server.xml
-
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
-
load
public void load()Start a new server instance. -
load
-
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
-