tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r940304 - in /tomcat/trunk/java/org/apache/catalina/util: LifecycleBase.java LocalStrings.properties
Date Sun, 02 May 2010 19:05:08 GMT
Author: markt
Date: Sun May  2 19:05:07 2010
New Revision: 940304

URL: http://svn.apache.org/viewvc?rev=940304&view=rev
Log:
Just log multiple calls to destroy rather than throwing an Exception.

Modified:
    tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
    tomcat/trunk/java/org/apache/catalina/util/LocalStrings.properties

Modified: tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java?rev=940304&r1=940303&r2=940304&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java Sun May  2 19:05:07 2010
@@ -258,6 +258,20 @@ public abstract class LifecycleBase impl
 
 
     public synchronized final void destroy() throws LifecycleException {
+        if (LifecycleState.DESTROYED.equals(state)) {
+
+            if (log.isDebugEnabled()) {
+                Exception e = new LifecycleException();
+                log.debug(sm.getString("lifecycleBase.alreadyDestroyed",
+                        toString()), e);
+            } else if (log.isInfoEnabled()) {
+                log.info(sm.getString("lifecycleBase.alreadyDestroyed",
+                        toString()));
+            }
+            
+            return;
+        }
+        
         if (!state.equals(LifecycleState.STOPPED) &&
                 !state.equals(LifecycleState.FAILED)) {
             invalidTransition(Lifecycle.DESTROY_EVENT);

Modified: tomcat/trunk/java/org/apache/catalina/util/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/LocalStrings.properties?rev=940304&r1=940303&r2=940304&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/util/LocalStrings.properties Sun May  2 19:05:07
2010
@@ -25,6 +25,7 @@ extensionValidator.failload=Failure load
 lifecycleBase.initMBeanFail=Failed to register component [{0}] with MBean name [{1}]
 lifecycleBase.alreadyStarted=The start() method was called on component [{0}] after start()
had already been called. The second call will be ignored.
 lifecycleBase.alreadyStopped=The stop() method was called on component [{0}] after stop()
had already been called. The second call will be ignored.
+lifecycleBase.alreadyDestroyed=The destroy() method was called on component [{0}] after destroy()
had already been called. The second call will be ignored.
 lifecycleBase.invalidTransition=An invalid Lifecycle transition was attempted ([{0}]) for
component [{1}] in state [{2}]
 requestUtil.convertHexDigit.notHex=[{0}] is not a hexadecimal digit
 requestUtil.parseParameters.uee=Unable to parse the parameters since the encoding [{0}] is
not supported.



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


Mime
View raw message