tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r940036 - /tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
Date Sat, 01 May 2010 14:18:05 GMT
Author: markt
Date: Sat May  1 14:18:05 2010
New Revision: 940036

URL: http://svn.apache.org/viewvc?rev=940036&view=rev
Log:
Get the shutdown hook working again.
Now LifecycleBase uses synchronized methods, Catalina can't extend it else the shutdown hook
can't function.

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/Catalina.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Catalina.java?rev=940036&r1=940035&r2=940036&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Catalina.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Catalina.java Sat May  1 14:18:05 2010
@@ -32,10 +32,8 @@ import java.util.logging.LogManager;
 
 import org.apache.catalina.Container;
 import org.apache.catalina.LifecycleException;
-import org.apache.catalina.LifecycleState;
 import org.apache.catalina.Server;
 import org.apache.catalina.core.StandardServer;
-import org.apache.catalina.util.LifecycleBase;
 import org.apache.juli.ClassLoaderLogManager;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.digester.Digester;
@@ -67,7 +65,7 @@ import org.xml.sax.InputSource;
  * @version $Id$
  */
 
-public class Catalina extends LifecycleBase {
+public class Catalina {
 
 
     /**
@@ -557,16 +555,10 @@ public class Catalina extends LifecycleB
     }
 
 
-    @Override
-    protected void initInternal() {
-        // NOOP
-    }
-
     /**
      * Start a new server instance.
      */
-    @Override
-    protected void startInternal() {
+    public void start() {
 
         if (getServer() == null) {
             load();
@@ -579,8 +571,6 @@ public class Catalina extends LifecycleB
 
         long t1 = System.nanoTime();
 
-        setState(LifecycleState.STARTING);
-
         // Start the new server
         try {
             getServer().start();
@@ -615,10 +605,8 @@ public class Catalina extends LifecycleB
         }
 
         if (await) {
-            setState(LifecycleState.STARTED);
-            fireLifecycleEvent(AFTER_START_EVENT, null);
             await();
-            setState(LifecycleState.MUST_STOP);
+            stop();
         }
 
     }
@@ -627,11 +615,7 @@ public class Catalina extends LifecycleB
     /**
      * Stop an existing server instance.
      */
-    @Override
-    protected void stopInternal() {
-
-        fireLifecycleEvent(STOP_EVENT, null);
-        setState(LifecycleState.STOPPING);
+    public void stop() {
 
         try {
             // Remove the ShutdownHook first so that server.stop() 
@@ -662,11 +646,6 @@ public class Catalina extends LifecycleB
     }
 
 
-    @Override
-    protected void destroyInternal() {
-        // NOOP
-    }
-
     /**
      * Await and shutdown.
      */
@@ -803,7 +782,7 @@ public class Catalina extends LifecycleB
             if (getServer() != null) {
                 try {
                     Catalina.this.stop();
-                } catch (LifecycleException e) {
+                } catch (Exception e) {
                     log.error(sm.getString("catalina.shutdownHookFail"), e);
                 }
             }
@@ -814,9 +793,7 @@ public class Catalina extends LifecycleB
             if (logManager instanceof ClassLoaderLogManager) {
                 ((ClassLoaderLogManager) logManager).shutdown();
             }
-
         }
-
     }
     
     



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message