Package org.apache.catalina.startup
Class Catalina
- java.lang.Object
-
- org.apache.catalina.startup.Catalina
-
public class Catalina extends 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 classCatalina.CatalinaShutdownHookShutdown hook which will perform a clean shutdown of Catalina if needed.
-
Field Summary
Fields Modifier and Type Field Description protected booleanawaitUse await.protected StringconfigFilePathname to the server configuration file.protected booleanloadedPrevent duplicate loads.protected ClassLoaderparentClassLoaderThe shared extensions class loader for this server.protected ServerserverThe server component we are starting or stopping.protected ThreadshutdownHookShutdown hook.protected static StringManagersmThe string manager for this package.protected booleanuseNamingIs naming enabled ?protected booleanuseShutdownHookUse shutdown hook flag.
-
Constructor Summary
Constructors Constructor Description Catalina()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleanarguments(String[] args)Process the specified command line arguments.voidawait()Await and shutdown.protected FileconfigFile()Return a File object representing our configuration file.protected DigestercreateStartDigester()Create and configure the Digester we will be using for startup.protected DigestercreateStopDigester()Create and configure the Digester we will be using for shutdown.StringgetConfigFile()ClassLoadergetParentClassLoader()ServergetServer()booleangetUseShutdownHook()protected voidinitDirs()Deprecated.unused.protected voidinitNaming()protected voidinitStreams()booleanisAwait()booleanisUseNaming()voidload()Start a new server instance.voidload(String[] args)voidsetAwait(boolean b)voidsetConfigFile(String file)voidsetParentClassLoader(ClassLoader parentClassLoader)Set the shared extensions class loader.protected voidsetSecurityProtection()Set the security package access/protection.voidsetServer(Server server)voidsetUseNaming(boolean useNaming)Enables or disables naming support.voidsetUseShutdownHook(boolean useShutdownHook)voidstart()Start a new server instance.voidstop()Stop an existing server instance.voidstopServer()voidstopServer(String[] arguments)protected voidusage()Print usage information for this application.
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The string manager for this package.
-
await
protected boolean await
Use await.
-
configFile
protected String configFile
Pathname to the server configuration file.
-
parentClassLoader
protected 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 Thread shutdownHook
Shutdown hook.
-
useNaming
protected boolean useNaming
Is naming enabled ?
-
loaded
protected boolean loaded
Prevent duplicate loads.
-
-
Method Detail
-
setConfigFile
public void setConfigFile(String file)
-
getConfigFile
public String getConfigFile()
-
setUseShutdownHook
public void setUseShutdownHook(boolean useShutdownHook)
-
getUseShutdownHook
public boolean getUseShutdownHook()
-
setParentClassLoader
public void setParentClassLoader(ClassLoader parentClassLoader)
Set the shared extensions class loader.- Parameters:
parentClassLoader- The shared extensions class loader.
-
getParentClassLoader
public ClassLoader getParentClassLoader()
-
setServer
public void setServer(Server server)
-
getServer
public Server 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
protected boolean arguments(String[] args)
Process the specified command line arguments.- Parameters:
args- Command line arguments to process- Returns:
trueif we should continue processing
-
configFile
protected 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
-
stopServer
public void stopServer()
-
stopServer
public void stopServer(String[] arguments)
-
load
public void load()
Start a new server instance.
-
load
public void load(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.
-
initDirs
@Deprecated protected void initDirs()
Deprecated.unused. Will be removed in Tomcat 10 onwards.
-
initStreams
protected void initStreams()
-
initNaming
protected void initNaming()
-
setSecurityProtection
protected void setSecurityProtection()
Set the security package access/protection.
-
-