camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hekon...@apache.org
Subject [1/2] git commit: [CAMEL-7963] Added JMX disable option.
Date Mon, 27 Oct 2014 14:44:32 GMT
Repository: camel
Updated Branches:
  refs/heads/master 183bbb958 -> a5032cb9d


[CAMEL-7963] Added JMX disable option.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ac7371a9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ac7371a9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ac7371a9

Branch: refs/heads/master
Commit: ac7371a99ca92ac34b616be04cbbb7c268085514
Parents: ef039d5
Author: Henryk Konsek <hekonsek@gmail.com>
Authored: Mon Oct 27 15:40:56 2014 +0100
Committer: Henryk Konsek <hekonsek@gmail.com>
Committed: Mon Oct 27 15:40:56 2014 +0100

----------------------------------------------------------------------
 .../apache/camel/spring/boot/CamelAutoConfiguration.java  |  6 ++++++
 .../camel/spring/boot/CamelConfigurationProperties.java   | 10 ++++++++++
 .../spring/boot/CamelAutoConfigurationPropertiesTest.java |  2 ++
 .../camel/spring/boot/CamelAutoConfigurationTest.java     |  4 +++-
 4 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ac7371a9/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
index 068dcc7..38ab141 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
@@ -121,11 +121,17 @@ public class CamelAutoConfiguration {
     @Bean
     CamelContext camelContext() throws Exception {
         CamelContext camelContext = new SpringCamelContext(applicationContext);
+
+        if (!configurationProperties.isJmxEnabled()) {
+            camelContext.disableJMX();
+        }
+
         if (routesBuilders != null) {
             for (RoutesBuilder routesBuilder : routesBuilders) {
                 camelContext.addRoutes(routesBuilder);
             }
         }
+
         return camelContext;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/ac7371a9/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
index e8f904e..b17199f 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
@@ -21,10 +21,20 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
 @ConfigurationProperties(prefix = "camel.springboot")
 public class CamelConfigurationProperties {
 
+    private boolean jmxEnabled = true;
+
     private int producerTemplateCacheSize = 1000;
 
     private int consumerTemplateCacheSize = 1000;
 
+    public boolean isJmxEnabled() {
+        return jmxEnabled;
+    }
+
+    public void setJmxEnabled(boolean jmxEnabled) {
+        this.jmxEnabled = jmxEnabled;
+    }
+
     public int getProducerTemplateCacheSize() {
         return producerTemplateCacheSize;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/ac7371a9/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
index 481d295..7b39821 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationPropertiesTest.java
@@ -27,6 +27,7 @@ import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.IntegrationTest;
 import org.springframework.boot.test.SpringApplicationConfiguration;
 import org.springframework.context.annotation.Bean;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -34,6 +35,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 @RunWith(SpringJUnit4ClassRunner.class)
 @EnableAutoConfiguration
 @SpringApplicationConfiguration(classes = CamelAutoConfigurationPropertiesTest.class)
+@IntegrationTest("camel.springboot.jmxEnabled=false")
 public class CamelAutoConfigurationPropertiesTest extends Assert {
 
     // Route fixtures

http://git-wip-us.apache.org/repos/asf/camel/blob/ac7371a9/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationTest.java
b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationTest.java
index 5d0b9f5..b363b00 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/CamelAutoConfigurationTest.java
@@ -35,7 +35,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 @RunWith(SpringJUnit4ClassRunner.class)
 @EnableAutoConfiguration
 @SpringApplicationConfiguration(classes = CamelAutoConfigurationTest.class)
-@IntegrationTest("camel.springboot.consumerTemplateCacheSize:100")
+@IntegrationTest({
+        "camel.springboot.consumerTemplateCacheSize:100",
+        "camel.springboot.jmxEnabled=false"})
 public class CamelAutoConfigurationTest extends Assert {
 
     // Collaborators fixtures


Mime
View raw message