cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r835580 - in /cxf/branches/2.2.x-fixes: ./ rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Date Thu, 12 Nov 2009 22:03:04 GMT
Author: dkulp
Date: Thu Nov 12 22:03:03 2009
New Revision: 835580

URL: http://svn.apache.org/viewvc?rev=835580&view=rev
Log:
Merged revisions 835576 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r835576 | dkulp | 2009-11-12 16:59:59 -0500 (Thu, 12 Nov 2009) | 1 line
  
  Possibly wire in the jetty management if mgmt is enabled
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=835580&r1=835579&r2=835580&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Thu Nov 12 22:03:03 2009
@@ -29,15 +29,19 @@
 
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
+import javax.management.MBeanServer;
 import javax.servlet.ServletContext;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.management.InstrumentationManager;
 import org.apache.cxf.transport.HttpUriMapper;
 import org.apache.cxf.transport.https_jetty.JettySslConnectorFactory;
+import org.mortbay.component.Container;
 import org.mortbay.jetty.AbstractConnector;
 import org.mortbay.jetty.Connector;
 import org.mortbay.jetty.Handler;
@@ -297,6 +301,21 @@
             DefaultHandler defaultHandler = null;
             // create a new jetty server instance if there is no server there           

             server = new Server();
+            if (bus != null && bus.getExtension(InstrumentationManager.class) !=
null) {
+                MBeanServer mbs =  bus.getExtension(InstrumentationManager.class).getMBeanServer();
+                if (mbs != null) {
+                    try {
+                        Class<?> cls = ClassLoaderUtils.loadClass("org.mortbay.management.MBeanContainer",

+                                                              getClass());
+                        Container.Listener listener 
+                            = (Container.Listener)cls.getConstructor(MBeanServer.class).newInstance(mbs);
+                        server.getContainer().addEventListener(listener);
+                    } catch (Throwable ex) {
+                        //ignore - just won't instrument jetty.  Probably don't have the
+                        //jetty-management jar available
+                    }
+                }
+            }
             if (connector == null) {
                 connector = connectorFactory.createConnector(getHost(), getPort());
                 if (LOG.isLoggable(Level.FINER)) {



Mime
View raw message