Skip to content

Commit 94400a2

Browse files
committed
- Add the set of scripts.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@421604 13f79535-47bb-0310-9956-ffa450edef68
1 parent db8f5f3 commit 94400a2

17 files changed

Lines changed: 1312 additions & 0 deletions

bin/catalina-tasks.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!--
2+
XML file for importing Catalina ant tasks.
3+
<import file="${catalina.home}/bin/catalina-tasks.xml"/>
4+
-->
5+
6+
<project name="catalina-tasks">
7+
<description>Catalina Ant Manager, JMX and JSPC Tasks</description>
8+
<!-- set catalina.home if it's not already set -->
9+
<dirname property="catalina.home.bin.dir" file="${ant.file.catalina-tasks}"/>
10+
<property name="catalina.home" value="${catalina.home.bin.dir}/.."/>
11+
<taskdef resource="org/apache/catalina/ant/catalina.tasks">
12+
<classpath>
13+
<fileset file="${catalina.home}/bin/commons-logging-api.jar"/>
14+
<fileset file="${catalina.home}/lib/jasper.jar"/>
15+
<fileset file="${catalina.home}/lib/jasper-el.jar"/>
16+
<fileset file="${catalina.home}/lib/el-api.jar"/>
17+
<fileset file="${catalina.home}/lib/jsp-api.jar"/>
18+
<fileset file="${catalina.home}/lib/servlet-api.jar"/>
19+
<fileset file="${catalina.home}/lib/catalina-ant.jar"/>
20+
</classpath>
21+
</taskdef>
22+
<taskdef resource="org/apache/catalina/ant/jmx/jmxaccessor.tasks">
23+
<classpath>
24+
<fileset file="${catalina.home}/lib/catalina-ant.jar"/>
25+
</classpath>
26+
</taskdef>
27+
<typedef
28+
name="jmxEquals"
29+
classname="org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition">
30+
<classpath>
31+
<fileset file="${catalina.home}/lib/catalina-ant.jar"/>
32+
</classpath>
33+
</typedef>
34+
<typedef
35+
name="jmxCondition"
36+
classname="org.apache.catalina.ant.jmx.JMXAccessorCondition">
37+
<classpath>
38+
<fileset file="${catalina.home}/lib/catalina-ant.jar"/>
39+
</classpath>
40+
</typedef>
41+
</project>

bin/catalina.bat

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
@echo off
2+
if "%OS%" == "Windows_NT" setlocal
3+
rem ---------------------------------------------------------------------------
4+
rem Start/Stop Script for the CATALINA Server
5+
rem
6+
rem Environment Variable Prequisites
7+
rem
8+
rem CATALINA_HOME May point at your Catalina "build" directory.
9+
rem
10+
rem CATALINA_BASE (Optional) Base directory for resolving dynamic portions
11+
rem of a Catalina installation. If not present, resolves to
12+
rem the same directory that CATALINA_HOME points to.
13+
rem
14+
rem CATALINA_OPTS (Optional) Java runtime options used when the "start",
15+
rem "stop", or "run" command is executed.
16+
rem
17+
rem CATALINA_TMPDIR (Optional) Directory path location of temporary directory
18+
rem the JVM should use (java.io.tmpdir). Defaults to
19+
rem %CATALINA_BASE%\temp.
20+
rem
21+
rem JAVA_HOME Must point at your Java Development Kit installation.
22+
rem Required to run the with the "debug" argument.
23+
rem
24+
rem JRE_HOME Must point at your Java Development Kit installation.
25+
rem Defaults to JAVA_HOME if empty.
26+
rem
27+
rem JAVA_OPTS (Optional) Java runtime options used when the "start",
28+
rem "stop", or "run" command is executed.
29+
rem
30+
rem JSSE_HOME (Optional) May point at your Java Secure Sockets Extension
31+
rem (JSSE) installation, whose JAR files will be added to the
32+
rem system class path used to start Tomcat.
33+
rem
34+
rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
35+
rem command is executed. The default is "dt_shmem".
36+
rem
37+
rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
38+
rem command is executed. The default is "jdbconn".
39+
rem
40+
rem $Id: catalina.bat 355227 2005-12-08 21:44:16Z keith $
41+
rem ---------------------------------------------------------------------------
42+
43+
rem Guess CATALINA_HOME if not defined
44+
set CURRENT_DIR=%cd%
45+
if not "%CATALINA_HOME%" == "" goto gotHome
46+
set CATALINA_HOME=%CURRENT_DIR%
47+
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
48+
cd ..
49+
set CATALINA_HOME=%cd%
50+
cd %CURRENT_DIR%
51+
:gotHome
52+
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
53+
echo The CATALINA_HOME environment variable is not defined correctly
54+
echo This environment variable is needed to run this program
55+
goto end
56+
:okHome
57+
58+
rem Get standard environment variables
59+
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
60+
61+
rem Get standard Java environment variables
62+
if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
63+
echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
64+
echo This file is needed to run this program
65+
goto end
66+
:okSetclasspath
67+
set BASEDIR=%CATALINA_HOME%
68+
call "%CATALINA_HOME%\bin\setclasspath.bat" %1
69+
if errorlevel 1 goto end
70+
71+
rem Add on extra jar files to CLASSPATH
72+
if "%JSSE_HOME%" == "" goto noJsse
73+
set CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar
74+
:noJsse
75+
set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
76+
77+
if not "%CATALINA_BASE%" == "" goto gotBase
78+
set CATALINA_BASE=%CATALINA_HOME%
79+
:gotBase
80+
81+
if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
82+
set CATALINA_TMPDIR=%CATALINA_BASE%\temp
83+
:gotTmpdir
84+
85+
if not exist "%CATALINA_HOME%\conf\logging.properties" goto noJuli
86+
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
87+
:noJuli
88+
89+
rem ----- Execute The Requested Command ---------------------------------------
90+
91+
echo Using CATALINA_BASE: %CATALINA_BASE%
92+
echo Using CATALINA_HOME: %CATALINA_HOME%
93+
echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%
94+
if ""%1"" == ""debug"" goto use_jdk
95+
echo Using JRE_HOME: %JRE_HOME%
96+
goto java_dir_displayed
97+
:use_jdk
98+
echo Using JAVA_HOME: %JAVA_HOME%
99+
:java_dir_displayed
100+
101+
set _EXECJAVA=%_RUNJAVA%
102+
set MAINCLASS=org.apache.catalina.startup.Bootstrap
103+
set ACTION=start
104+
set SECURITY_POLICY_FILE=
105+
set DEBUG_OPTS=
106+
set JPDA=
107+
108+
if not ""%1"" == ""jpda"" goto noJpda
109+
set JPDA=jpda
110+
if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
111+
set JPDA_TRANSPORT=dt_shmem
112+
:gotJpdaTransport
113+
if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
114+
set JPDA_ADDRESS=jdbconn
115+
:gotJpdaAddress
116+
shift
117+
:noJpda
118+
119+
if ""%1"" == ""debug"" goto doDebug
120+
if ""%1"" == ""run"" goto doRun
121+
if ""%1"" == ""start"" goto doStart
122+
if ""%1"" == ""stop"" goto doStop
123+
if ""%1"" == ""version"" goto doVersion
124+
125+
echo Usage: catalina ( commands ... )
126+
echo commands:
127+
echo debug Start Catalina in a debugger
128+
echo debug -security Debug Catalina with a security manager
129+
echo jpda start Start Catalina under JPDA debugger
130+
echo run Start Catalina in the current window
131+
echo run -security Start in the current window with security manager
132+
echo start Start Catalina in a separate window
133+
echo start -security Start in a separate window with security manager
134+
echo stop Stop Catalina
135+
echo version What version of tomcat are you running?
136+
goto end
137+
138+
:doDebug
139+
shift
140+
set _EXECJAVA=%_RUNJDB%
141+
set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\java"
142+
if not ""%1"" == ""-security"" goto execCmd
143+
shift
144+
echo Using Security Manager
145+
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
146+
goto execCmd
147+
148+
:doRun
149+
shift
150+
if not ""%1"" == ""-security"" goto execCmd
151+
shift
152+
echo Using Security Manager
153+
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
154+
goto execCmd
155+
156+
:doStart
157+
shift
158+
if not "%OS%" == "Windows_NT" goto noTitle
159+
set _EXECJAVA=start "Tomcat" %_RUNJAVA%
160+
goto gotTitle
161+
:noTitle
162+
set _EXECJAVA=start %_RUNJAVA%
163+
:gotTitle
164+
if not ""%1"" == ""-security"" goto execCmd
165+
shift
166+
echo Using Security Manager
167+
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
168+
goto execCmd
169+
170+
:doStop
171+
shift
172+
set ACTION=stop
173+
goto execCmd
174+
175+
:doVersion
176+
%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" org.apache.catalina.util.ServerInfo
177+
goto end
178+
179+
180+
:execCmd
181+
rem Get remaining unshifted command line arguments and save them in the
182+
set CMD_LINE_ARGS=
183+
:setArgs
184+
if ""%1""=="""" goto doneSetArgs
185+
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
186+
shift
187+
goto setArgs
188+
:doneSetArgs
189+
190+
rem Execute Java with the applicable properties
191+
if not "%JPDA%" == "" goto doJpda
192+
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
193+
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
194+
goto end
195+
:doSecurity
196+
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
197+
goto end
198+
:doJpda
199+
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
200+
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
201+
goto end
202+
:doSecurityJpda
203+
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
204+
goto end
205+
206+
:end

0 commit comments

Comments
 (0)