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

public Class Catalina

extends Object
Class Inheritance
Imports
java.io.File, .FileWriter, .IOException, .InputStream, .OutputStream, java.lang.reflect.Constructor, java.net.ConnectException, .Socket, java.util.ArrayList, .HashMap, .List, .Map, java.util.concurrent.TimeUnit, java.util.logging.LogManager, org.apache.catalina.Container, .LifecycleException, .LifecycleState, .Server, org.apache.catalina.connector.Connector, org.apache.catalina.core.StandardContext, org.apache.catalina.security.SecurityConfig, org.apache.juli.ClassLoaderLogManager, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.digester.Digester, .Rule, .RuleSet, org.apache.tomcat.util.file.ConfigFileLoader, .ConfigurationSource, org.apache.tomcat.util.log.SystemLogHandler, org.apache.tomcat.util.res.StringManager, org.xml.sax.Attributes, .InputSource

Startup/Shutdown shell program for Catalina. The following command line options are recognized:
Authors
Craig R. McClanahan, Remy Maucherat

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
Catalina.CatalinaShutdownHook

Shutdown hook which will perform a clean shutdown of Catalina if needed.

public static interface
pack-priv class
Catalina.SetParentClassLoaderRule

Rule that sets the parent class loader for the top object on the stack, which must be a Container.

Field Summary

Modifier and TypeField and Description
protected boolean
await

Use await.

protected String
configFile

Pathname to the server configuration file.

protected boolean
generateCode

Generate Tomcat embedded code from configuration files.

protected File
generatedCodeLocation

Location of generated sources.

protected String
generatedCodeLocationParameter

Value of the argument.

protected String
generatedCodePackage

Top package name for generated source.

protected boolean
loaded

Prevent duplicate loads.

private static final Log
protected ClassLoader
parentClassLoader

The shared extensions class loader for this server.

protected Server
server

The server component we are starting or stopping.

public static final String
protected Thread
shutdownHook

Shutdown hook.

protected static final 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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addClusterRuleSet(Digester digester, String prefix)

Cluster support is optional.

protected boolean

Returns:

true if we should continue processing
arguments
(String[]
Command line arguments to process
args
)

Process the specified command line arguments.

public void
await()

Await and shutdown.

protected File

Returns:

the main configuration file
configFile
()

Return a File object representing our configuration file.

protected Digester

Returns:

the main digester to parse server.xml
createStartDigester
()

Create and configure the Digester we will be using for startup.

protected Digester

Returns:

the digester to process the stop operation
createStopDigester
()

Create and configure the Digester we will be using for shutdown.

protected void
protected void
generateClassHeader(Digester digester, boolean start)

protected void
public String
public boolean
public File
public String
public ClassLoader
public Server
public boolean

Returns:

true if an exception should be thrown if an error occurs during server init
getThrowOnInitFailure
()

public boolean
public boolean
protected void
protected void
public boolean
public boolean

Returns:

true if naming is enabled.
isUseNaming
()

public void
load()

Start a new server instance.

public void
load(String[] args)

protected void
parseServerXml(boolean start)

public void
setAwait(boolean b)

public void
public void
setGenerateCode(boolean generateCode)

public void
setGeneratedCodeLocation(File generatedCodeLocation)

public void
setGeneratedCodePackage(String generatedCodePackage)

public void
setParentClassLoader(ClassLoader
The shared extensions class loader.
parentClassLoader
)

Set the shared extensions class loader.

protected void
setSecurityProtection()

Set the security package access/protection.

public void
setServer(Server server)

public void
setThrowOnInitFailure(boolean
the new flag value
throwOnInitFailure
)

Set the behavior regarding errors that could occur during server init.

public void
setUseGeneratedCode(boolean useGeneratedCode)

public void
setUseNaming(boolean
The new use naming value
useNaming
)

Enables or disables naming support.

public void
setUseShutdownHook(boolean useShutdownHook)

public void
start()

Start a new server instance.

public void
stop()

Stop an existing server instance.

public void
public void
stopServer(String[] arguments)

protected void
usage()

Print usage information for this application.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

awaitback to summary
protected boolean await

Use await.

configFileback to summary
protected String configFile

Pathname to the server configuration file.

generateCodeback to summary
protected boolean generateCode

Generate Tomcat embedded code from configuration files.

generatedCodeLocationback to summary
protected File generatedCodeLocation

Location of generated sources.

generatedCodeLocationParameterback to summary
protected String generatedCodeLocationParameter

Value of the argument.

generatedCodePackageback to summary
protected String generatedCodePackage

Top package name for generated source.

loadedback to summary
protected boolean loaded

Prevent duplicate loads.

logback to summary
private static final Log log
parentClassLoaderback to summary
protected ClassLoader parentClassLoader

The shared extensions class loader for this server.

serverback to summary
protected Server server

The server component we are starting or stopping.

SERVER_XMLback to summary
public static final String SERVER_XML
shutdownHookback to summary
protected Thread shutdownHook

Shutdown hook.

smback to summary
protected static final StringManager sm

The string manager for this package.

throwOnInitFailureback to summary
protected boolean throwOnInitFailure

Rethrow exceptions on init failure.

useGeneratedCodeback to summary
protected boolean useGeneratedCode

Use generated code as a replacement for configuration files.

useNamingback to summary
protected boolean useNaming

Is naming enabled ?

useShutdownHookback to summary
protected boolean useShutdownHook

Use shutdown hook flag.

Constructor Detail

Catalinaback to summary
public Catalina()

Method Detail

addClusterRuleSetback to summary
private void addClusterRuleSet(Digester digester, String prefix)

Cluster support is optional. The JARs may have been removed.

argumentsback to summary
protected boolean arguments(String[] args)

Process the specified command line arguments.

Parameters
args:String[]

Command line arguments to process

Returns:boolean

true if we should continue processing

awaitback to summary
public void await()

Await and shutdown.

configFileback to summary
protected File configFile()

Return a File object representing our configuration file.

Returns:File

the main configuration file

createStartDigesterback to summary
protected Digester createStartDigester()

Create and configure the Digester we will be using for startup.

Returns:Digester

the main digester to parse server.xml

createStopDigesterback to summary
protected Digester createStopDigester()

Create and configure the Digester we will be using for shutdown.

Returns:Digester

the digester to process the stop operation

generateClassFooterback to summary
protected void generateClassFooter(Digester digester)
generateClassHeaderback to summary
protected void generateClassHeader(Digester digester, boolean start)
generateLoaderback to summary
protected void generateLoader()
getConfigFileback to summary
public String getConfigFile()
getGenerateCodeback to summary
public boolean getGenerateCode()
getGeneratedCodeLocationback to summary
public File getGeneratedCodeLocation()
getGeneratedCodePackageback to summary
public String getGeneratedCodePackage()
getParentClassLoaderback to summary
public ClassLoader getParentClassLoader()
getServerback to summary
public Server getServer()
getThrowOnInitFailureback to summary
public boolean getThrowOnInitFailure()
Returns:boolean

true if an exception should be thrown if an error occurs during server init

getUseGeneratedCodeback to summary
public boolean getUseGeneratedCode()
getUseShutdownHookback to summary
public boolean getUseShutdownHook()
initNamingback to summary
protected void initNaming()
initStreamsback to summary
protected void initStreams()
isAwaitback to summary
public boolean isAwait()
isUseNamingback to summary
public boolean isUseNaming()
Returns:boolean

true if naming is enabled.

loadback to summary
public void load()

Start a new server instance.

loadback to summary
public void load(String[] args)
parseServerXmlback to summary
protected void parseServerXml(boolean start)
setAwaitback to summary
public void setAwait(boolean b)
setConfigFileback to summary
public void setConfigFile(String file)
setGenerateCodeback to summary
public void setGenerateCode(boolean generateCode)
setGeneratedCodeLocationback to summary
public void setGeneratedCodeLocation(File generatedCodeLocation)
setGeneratedCodePackageback to summary
public void setGeneratedCodePackage(String generatedCodePackage)
setParentClassLoaderback to summary
public void setParentClassLoader(ClassLoader parentClassLoader)

Set the shared extensions class loader.

Parameters
parentClassLoader:ClassLoader

The shared extensions class loader.

setSecurityProtectionback to summary
protected void setSecurityProtection()

Set the security package access/protection.

setServerback to summary
public void setServer(Server server)
setThrowOnInitFailureback to summary
public void setThrowOnInitFailure(boolean throwOnInitFailure)

Set the behavior regarding errors that could occur during server init.

Parameters
throwOnInitFailure:boolean

the new flag value

setUseGeneratedCodeback to summary
public void setUseGeneratedCode(boolean useGeneratedCode)
setUseNamingback to summary
public void setUseNaming(boolean useNaming)

Enables or disables naming support.

Parameters
useNaming:boolean

The new use naming value

setUseShutdownHookback to summary
public void setUseShutdownHook(boolean useShutdownHook)
startback to summary
public void start()

Start a new server instance.

stopback to summary
public void stop()

Stop an existing server instance.

stopServerback to summary
public void stopServer()
stopServerback to summary
public void stopServer(String[] arguments)
usageback to summary
protected void usage()

Print usage information for this application.

org.apache.catalina.startup back to summary

protected Class Catalina.CatalinaShutdownHook

extends Thread
Class Inheritance

Shutdown hook which will perform a clean shutdown of Catalina if needed.

Field Summary

Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Constructor Detail

CatalinaShutdownHookback to summary
protected CatalinaShutdownHook()

Method Detail

runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override
org.apache.catalina.startup back to summary

public Interface Catalina.ServerXml


Method Summary

Modifier and TypeMethod and Description
public void
load(Catalina catalina)

Method Detail

loadback to summary
public void load(Catalina catalina)
org.apache.catalina.startup back to summary

pack-priv final Class Catalina.SetParentClassLoaderRule

extends Rule
Class Inheritance

Rule that sets the parent class loader for the top object on the stack, which must be a Container.

Field Summary

Modifier and TypeField and Description
pack-priv ClassLoader
Inherited from org.apache.tomcat.util.digester.Rule:
digesternamespaceURIsm

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
begin(String
the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
namespace
,
String
the local name if the parser is namespace aware, or just the element name otherwise
name
,
Attributes
The attribute list of this element
attributes
)

Overrides org.apache.tomcat.util.digester.Rule.begin.

This method is called when the beginning of a matching XML element is encountered.

Inherited from org.apache.tomcat.util.digester.Rule:
bodyendfinishgetDigestergetNamespaceURIsetDigestersetNamespaceURI

Field Detail

parentClassLoaderback to summary
pack-priv ClassLoader parentClassLoader

Constructor Detail

SetParentClassLoaderRuleback to summary
pack-priv SetParentClassLoaderRule(ClassLoader parentClassLoader)

Method Detail

beginback to summary
public void begin(String namespace, String name, Attributes attributes) throws Exception

Overrides org.apache.tomcat.util.digester.Rule.begin.

Doc from org.apache.tomcat.util.digester.Rule.begin.

This method is called when the beginning of a matching XML element is encountered. The default implementation is a NO-OP.

Parameters
namespace:String

the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace

name:String

the local name if the parser is namespace aware, or just the element name otherwise

attributes:Attributes

The attribute list of this element

Annotations
@Override
Exceptions
Exception:
if an error occurs while processing the event