You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/06/22 17:05:56 UTC
[4/4] camel git commit: Optimise - The runtime endpoint register may
not be enabled by default. The commands needed a little fix for that.
Optimise - The runtime endpoint register may not be enabled by default. The commands needed a little fix for that.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6062e8d3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6062e8d3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6062e8d3
Branch: refs/heads/master
Commit: 6062e8d31f60e22b7eb9ffcba406f1d2c6f30374
Parents: 22ffa47
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Jun 22 17:35:40 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Jun 22 19:05:44 2017 +0200
----------------------------------------------------------------------
.../org/apache/camel/commands/AbstractLocalCamelController.java | 2 +-
.../java/org/apache/camel/commands/ContextListCommandTest.java | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/6062e8d3/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
index e1e6e3d..554471d 100644
--- a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
+++ b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
@@ -457,7 +457,7 @@ public abstract class AbstractLocalCamelController extends AbstractCamelControll
if (camelContextName != null) {
CamelContext context = this.getLocalCamelContext(camelContextName);
- if (context != null) {
+ if (context != null && context.getRuntimeEndpointRegistry() != null) {
EndpointRegistry staticRegistry = context.getEndpointRegistry();
for (RuntimeEndpointRegistry.Statistic stat : context.getRuntimeEndpointRegistry().getEndpointStatistics()) {
http://git-wip-us.apache.org/repos/asf/camel/blob/6062e8d3/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java b/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
index 24f2042..05e5f1b 100644
--- a/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
+++ b/platforms/commands/commands-core/src/test/java/org/apache/camel/commands/ContextListCommandTest.java
@@ -23,6 +23,7 @@ import java.io.PrintStream;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.impl.DefaultRuntimeEndpointRegistry;
import org.apache.camel.impl.ExplicitCamelContextNameStrategy;
import org.junit.Test;
import org.slf4j.Logger;
@@ -63,6 +64,7 @@ public class ContextListCommandTest {
@Test
public void testEndpointStats() throws Exception {
CamelContext context = new DefaultCamelContext();
+ context.setRuntimeEndpointRegistry(new DefaultRuntimeEndpointRegistry());
context.setNameStrategy(new ExplicitCamelContextNameStrategy("foobar"));
context.addRoutes(new RouteBuilder() {
@Override