📄 org_apache_catalina_startup_catalina--rosonsandy.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0055)http://rosonsandy.blogdriver.com/rosonsandy/879651.html -->
<HTML><HEAD><TITLE>org.apache.catalina.startup.Catalina--rosonsandy</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GBK">
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>
<META
content="RequestPathorg.apache.catalina.startup.Catalinaorg.apache.catalina.startup.ContextRuleSet 博客 博客动力 blog blogdriver blogger 中国"
name=description>
<META
content="rosonsandy RequestPathorg.apache.catalina.startup.Catalinaorg.apache.catalina.startup.ContextRuleSet 博客 博客动力 blog blogdriver blogger 中国"
name=keywords><LINK
href="org_apache_catalina_startup_Catalina--rosonsandy.files/diary.css"
type=text/css rel=stylesheet>
<SCRIPT language=JavaScript
src="org_apache_catalina_startup_Catalina--rosonsandy.files/UBB.js"></SCRIPT>
<SCRIPT src="org_apache_catalina_startup_Catalina--rosonsandy.files/blog.js"
type=text/javascript></SCRIPT>
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV id=container>
<DIV id=header>
<H1 class=title><A
href="http://rosonsandy.blogdriver.com/rosonsandy/index.html">rosonsandy</A></H1></DIV>
<DIV id=category><A title=上一篇
href="http://rosonsandy.blogdriver.com/rosonsandy/876166.html">RequestPath</A>-
-| <A href="http://rosonsandy.blogdriver.com/rosonsandy/index.html">回首页</A> | <A
href="http://rosonsandy.blogdriver.com/rosonsandy/catalog_2005.html">2005年索引</A>
| - -<A title=下一篇
href="http://rosonsandy.blogdriver.com/rosonsandy/879859.html">org.apache.catalina.startup.ContextRuleSet</A></DIV>
<DIV class=entity>
<H2 class=diaryTitle>org.apache.catalina.startup.Catalina- -</H2>
<P>
<P>
<P>Catalina.java主要看的函数为start()和createStartDigester()</P>
<P>package org.apache.catalina.startup;</P>
<P><BR>import java.io.File;<BR>import java.io.FileInputStream;<BR>import
java.io.IOException;<BR>import java.io.OutputStream;<BR>import
java.lang.reflect.InvocationTargetException;<BR>import
java.lang.reflect.Constructor;<BR>import java.net.Socket;<BR>import
java.security.Security;<BR>import java.util.Stack;<BR>import
org.apache.catalina.Container;<BR>import
org.apache.catalina.Lifecycle;<BR>import
org.apache.catalina.LifecycleException;<BR>import
org.apache.catalina.LifecycleListener;<BR>import
org.apache.catalina.Server;<BR>import org.apache.catalina.Loader;<BR>import
org.apache.commons.digester.Digester;<BR>import
org.apache.commons.digester.Rule;<BR>import
org.apache.tomcat.util.log.SystemLogHandler;<BR>import
org.xml.sax.Attributes;<BR>import org.xml.sax.InputSource;</P>
<P><BR>/**<BR> * Startup/Shutdown shell program for Catalina. The
following command line<BR> * options are
recognized:<BR> * <BR> * <B> -config {pathname}</B> -
Set the pathname of the configuration file<BR> * to
be processed. If a relative path is specified, it will
be<BR> * interpreted as relative to the directory
pathname specified by the<BR> * "catalina.base"
system property. [conf/server.xml]<BR> * <B>-help</B> - Display
usage information.<BR> * <B>-stop</B> - Stop the currently running instance
of Catalina.<BR> * </U /><BR> *<BR> * @author Craig R.
McClanahan<BR> * @version $Revision: 1.51 $ $Date: 2002/10/24 02:42:03
$<BR> */</P>
<P>
<P>public class Catalina {</P>
<P><BR> //
----------------------------------------------------- Instance Variables</P>
<P><BR> /**<BR> * Pathname to the
server configuration file.<BR> */<BR>
protected String configFile = "conf/server.xml";</P>
<P><BR> /**<BR> * Set the debugging
detail level on our Digester.<BR>
*/<BR> protected boolean debug = false;</P>
<P><BR> /**<BR> * The shared
extensions class loader for this server.<BR>
*/<BR> protected ClassLoader parentClassLoader
=<BR>
ClassLoader.getSystemClassLoader();</P>
<P><BR> /**<BR> * The server component
we are starting or stopping<BR> */<BR>
protected Server server = null;</P>
<P><BR> /**<BR> * Are we starting a
new server?<BR> */<BR> protected
boolean starting = false;</P>
<P><BR> /**<BR> * Are we stopping an
existing server?<BR> */<BR> protected
boolean stopping = false;</P>
<P><BR> /**<BR> * Are we using naming
?<BR> */<BR> protected boolean
useNaming = true;</P>
<P><BR> //
----------------------------------------------------------- Main Program</P>
<P><BR> /**<BR> * The application main
program.<BR> *<BR> * @param args
Command line arguments<BR> */<BR>
public static void main(String args[]) {</P>
<P> (new
Catalina()).process(args);<BR> }</P>
<P><BR> /**<BR> * The instance main
program.<BR> *<BR> * @param args
Command line arguments<BR> */<BR>
public void process(String args[]) {</P>
<P>
setCatalinaHome();<BR>
setCatalinaBase();<BR> try
{<BR> if
(arguments(args))
<BR>
execute();<BR> } catch (Exception e)
{<BR>
e.printStackTrace(System.out);<BR>
}<BR> }</P>
<P><BR> //
--------------------------------------------------------- Public Methods</P>
<P><BR> /**<BR> * Set the shared
extensions class loader.<BR>
*<BR> * @param parentClassLoader The shared extensions
class loader.<BR> */<BR> public void
setParentClassLoader(ClassLoader parentClassLoader)
{<BR> this.parentClassLoader =
parentClassLoader;<BR> }</P>
<P><BR> /**<BR> * Set the server
instance we are configuring.<BR>
*<BR> * @param server The new
server<BR> */<BR> public void
setServer(Server server) <BR>
{<BR> this.server =
server;<BR> }</P>
<P><BR> //
------------------------------------------------------ Protected Methods</P>
<P><BR> /**<BR> * Process the
specified command line arguments, and return<BR> *
<CODE>true</CODE> if we should continue processing;
otherwise<BR> * return
<CODE>false</CODE>.<BR> *<BR> *
@param args Command line arguments to process<BR>
*/<BR> protected boolean arguments(String args[]) {</P>
<P> boolean isConfig = false;</P>
<P> if (args.length < 1)
{<BR>
usage();<BR>
return (false);<BR> }</P>
<P> for (int i = 0; i <
args.length; i++)
{<BR> if
(isConfig)
{<BR>
configFile =
args[i];<BR>
isConfig =
false;<BR> }
else if (args[i].equals("-config"))
{<BR>
isConfig =
true;<BR> }
else if (args[i].equals("-debug"))
{<BR>
debug =
true;<BR> }
else if (args[i].equals("-nonaming"))
{<BR>
useNaming =
false;<BR> }
else if (args[i].equals("-help"))
{<BR>
usage();<BR>
return
(false);<BR> }
else if (args[i].equals("start"))
{<BR>
starting =
true;<BR> }
else if (args[i].equals("stop"))
{<BR>
stopping =
true;<BR> }
else
{<BR>
usage();<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -