remm01/07/22 20:12:45
Modified:catalina/src/share/org/apache/catalina/startup
CatalinaService.java
Log:
- Separate start into load + start.
Revision ChangesPath
1.3 +43 -6
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java
Index: CatalinaService.java
===
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CatalinaService.java 2001/07/22 20:25:13 1.2
+++ CatalinaService.java 2001/07/23 03:12:45 1.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
1.2 2001/07/22 20:25:13 pier Exp $
- * $Revision: 1.2 $
- * $Date: 2001/07/22 20:25:13 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
1.3 2001/07/23 03:12:45 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/07/23 03:12:45 $
*
*
*
@@ -104,7 +104,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.2 $ $Date: 2001/07/22 20:25:13 $
+ * @version $Revision: 1.3 $ $Date: 2001/07/23 03:12:45 $
*/
public class CatalinaService extends Catalina {
@@ -163,9 +163,24 @@
/**
+ * Execute the processing that has been configured from the command line.
+ */
+protected void execute() throws Exception {
+
+if (starting) {
+load();
+start();
+} else if (stopping) {
+stop();
+}
+
+}
+
+
+/**
* Start a new server instance.
*/
-protected void start() {
+public void load() {
// Create and execute our mapper
XmlMapper mapper = createStartMapper();
@@ -221,6 +236,28 @@
// Start the new server
if (server instanceof Lifecycle) {
try {
+server.initialize();
+} catch (LifecycleException e) {
+System.out.println(Catalina.start: + e);
+e.printStackTrace(System.out);
+if (e.getThrowable() != null) {
+System.out.println(- Root Cause -);
+e.getThrowable().printStackTrace(System.out);
+}
+}
+}
+
+}
+
+
+/**
+ * Start a new server instance.
+ */
+public void start() {
+
+// Start the new server
+if (server instanceof Lifecycle) {
+try {
((Lifecycle) server).start();
} catch (LifecycleException e) {
System.out.println(Catalina.start: + e);
@@ -238,7 +275,7 @@
/**
* Stop an existing server instance.
*/
-protected void stop() {
+public void stop() {
// Shut down the server
if (server instanceof Lifecycle) {