svn commit: rev 23562 - avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl

[email protected]
Newsgroups gmane.comp.jakarta.avalon.cvs
Message-ID <[email protected]>
Author: niclas
Date: Sun Jul 25 12:31:16 2004
New Revision: 23562

Modified:
   avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/ModelHandler.java
Log:
Fixed a StackOverflow on shutdown and some more logging statements.

Modified: avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/ModelHandler.java
==============================================================================
--- avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/ModelHandler.java	(original)
+++ avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/ModelHandler.java	Sun Jul 25 12:31:16 2004
@@ -23,6 +23,8 @@
 import org.apache.avalon.composition.model.ComponentModel;
 import org.apache.avalon.composition.model.DeploymentModel;
 
+import org.apache.avalon.framework.activity.Startable;
+
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -53,7 +55,7 @@
  */
 public class ModelHandler
     implements Serviceable, Configurable, Contextualizable, LogEnabled,
-               HttpHandler, CompositionListener
+               HttpHandler, CompositionListener, Startable
 {
     private Logger              m_Logger;
     private ContainmentModel    m_Model;
@@ -150,14 +152,18 @@
     
     public void start()
     {
+        if( m_Logger.isDebugEnabled() )
+            m_Logger.debug( "Starting ModelHandler: " + this );
         m_Context.addHandler( this );
         m_Started = true;
     }
     
     public void stop()
     {
-        m_Context.removeHandler( this );
         m_Started = false;
+        if( m_Logger.isDebugEnabled() )
+            m_Logger.debug( "Stopping ModelHandler: " + this );
+        m_Context.removeHandler( this );
     }
    
    /* CompositionListener interface  */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.