tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r812146 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/jk/server/JkMain.java
Date Mon, 07 Sep 2009 14:07:03 GMT
Author: markt
Date: Mon Sep  7 14:07:02 2009
New Revision: 812146

URL: http://svn.apache.org/viewvc?rev=812146&view=rev
Log:
Additional patch required for https://issues.apache.org/bugzilla/show_bug.cgi?id=47046
Clean up Jk components that only exist in the 6.0.x and were hence missed

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/jk/server/JkMain.java

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=812146&r1=812145&r2=812146&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep  7 14:07:02 2009
@@ -190,13 +190,6 @@
   +1: markt
   -1: 
 
-* Additional patch required for 
-  https://issues.apache.org/bugzilla/show_bug.cgi?id=47046
-  Clean up Jk components that only exist in the 6.0.x and were hence missed
-  https://issues.apache.org/bugzilla/attachment.cgi?id=24125
-  +1: markt, funkman, rjung
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45403
   Add a check when enumerating jar files, and
   do not suppress IO errors when starting a web application.

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jk/server/JkMain.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jk/server/JkMain.java?rev=812146&r1=812145&r2=812146&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jk/server/JkMain.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jk/server/JkMain.java Mon Sep  7 14:07:02 2009
@@ -278,17 +278,59 @@
     
     public void stop() 
     {
+        // Clean up the handlers
+        MBeanServer s = Registry.getRegistry(null,null).getMBeanServer();
         for( int i=0; i<wEnv.getHandlerCount(); i++ ) {
-            if( wEnv.getHandler(i) != null ) {
+            JkHandler handler = wEnv.getHandler(i);
+            if(handler != null) {
+                String handlerName = handler.getName();
                 try {
-                    wEnv.getHandler(i).destroy();
+                    handler.destroy();
                 } catch( IOException ex) {
-                    log.error("Error stopping " + wEnv.getHandler(i).getName(), ex);
+                    log.error("Error stopping " + handlerName, ex);
+                }
+                if(domain != null) {
+                    try {
+                        ObjectName handlerOname = new ObjectName(
+                                this.domain + ":" + "type=JkHandler,name=" +
+                                handlerName);
+                        if (s.isRegistered(handlerOname)) {
+                            s.unregisterMBean(handlerOname);
+                        }
+                    } catch (Exception e) {
+                        log.error( "Error unregistering " + handlerName, e );
+                    }
+
                 }
             }
         }
 
         started=false;
+        
+        // De-register JMX for Env
+        if (domain != null) {
+            try {
+                ObjectName wEnvName =
+                    new ObjectName(domain + ":type=JkWorkerEnv");
+                if (s.isRegistered(wEnvName)) {
+                    s.unregisterMBean(wEnvName);
+                }
+            } catch (Exception e) {
+                log.error( "Error unregistering JkWorkerEnv", e );
+            }
+        }
+
+        // De-register JMX for JkMain
+        if(oname != null) {
+            if (s.isRegistered(oname)) {
+                try {
+                    Registry.getRegistry(null, null)
+                        .unregisterComponent(oname);
+                } catch (Exception e) {
+                    log.error( "Error unregistering jkmain " + e );
+                }
+            }
+        }
     }
     
     public void start() throws IOException



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


Mime
View raw message