svn commit: r935160 - /camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r935160 - /camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java

ningjiang
Author: ningjiang
Date: Sat Apr 17 10:00:47 2010
New Revision: 935160

URL: http://svn.apache.org/viewvc?rev=935160&view=rev
Log:
CAMEL-2652 Did some enhancement with suggestion of Claus

Modified:
    camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java

Modified: camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java?rev=935160&r1=935159&r2=935160&view=diff
==============================================================================
--- camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java (original)
+++ camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java Sat Apr 17 10:00:47 2010
@@ -81,6 +81,7 @@ public class JettyHttpComponent extends
     protected Integer httpClientMinThreads;
     protected Integer httpClientMaxThreads;
     protected MBeanContainer mbContainer;
+    protected boolean enableJmx;
 
     class ConnectorRef {
         Server server;
@@ -104,6 +105,14 @@ public class JettyHttpComponent extends
         }
     }
     
+    public void setEnableJmx(boolean enableJmx) {
+        this.enableJmx = enableJmx;
+    }
+    
+    public boolean isEnableJmx() {
+        return enableJmx;
+    }
+    
     
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
@@ -164,6 +173,9 @@ public class JettyHttpComponent extends
         
         if (enableJmx != null) {
             endpoint.setEnableJmx(enableJmx);
+        } else {
+            // set this option based on setting of JettyHttpComponent
+            endpoint.setEnableJmx(isEnableJmx());
         }
 
         setProperties(endpoint, parameters);
@@ -494,7 +506,7 @@ public class JettyHttpComponent extends
                 // traditional embedded Jetty configurations.
                 mbContainer.addBean(mbContainer);
             } catch (Exception e) {
-                LOG.fatal("Could not start Jetty MBeanContainer.  Jetty JMX extensions will remain disabled.", e);
+                LOG.warn("Could not start Jetty MBeanContainer.  Jetty JMX extensions will remain disabled.", e);
             }
         }
     }