Author: markt
Date: Thu Jan 12 20:34:24 2012
New Revision: 1230765
URL: http://svn.apache.org/viewvc?rev=1230765&view=rev
Log:
Move destruction of ContainerBase objects to ContainerBase to ensure
that they are destroyed.
Modified:
tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1230765&r1=1230764&r2=1230765&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Thu Jan 12
20:34:24 2012
@@ -1195,6 +1195,20 @@ public abstract class ContainerBase exte
@Override
protected void destroyInternal() throws LifecycleException {
+ if ((manager != null) && (manager instanceof Lifecycle)) {
+ ((Lifecycle) manager).destroy();
+ }
+ Realm realm = getRealmInternal();
+ if ((realm != null) && (realm instanceof Lifecycle)) {
+ ((Lifecycle) realm).destroy();
+ }
+ if ((cluster != null) && (cluster instanceof Lifecycle)) {
+ ((Lifecycle) cluster).destroy();
+ }
+ if ((loader != null) && (loader instanceof Lifecycle)) {
+ ((Lifecycle) loader).destroy();
+ }
+
// Stop the Valves in our pipeline (including the basic), if any
if (pipeline instanceof Lifecycle) {
((Lifecycle) pipeline).destroy();
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1230765&r1=1230764&r2=1230765&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Thu Jan 12
20:34:24 2012
@@ -5450,20 +5450,6 @@ public class StandardContext extends Con
@Override
protected void destroyInternal() throws LifecycleException {
- if ((manager != null) && (manager instanceof Lifecycle)) {
- ((Lifecycle) manager).destroy();
- }
- Realm realm = getRealmInternal();
- if ((realm != null) && (realm instanceof Lifecycle)) {
- ((Lifecycle) realm).destroy();
- }
- if ((cluster != null) && (cluster instanceof Lifecycle)) {
- ((Lifecycle) cluster).destroy();
- }
- if ((loader != null) && (loader instanceof Lifecycle)) {
- ((Lifecycle) loader).destroy();
- }
-
// If in state NEW when destroy is called, the object name will never
// have been set so the notification can't be created
if (getObjectName() != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]