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 2015/03/31 10:53:25 UTC

[1/7] camel git commit: Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x 0977cef04 -> 522025114
  refs/heads/master 97320fa18 -> 5f59322fb


Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

This reverts commit 9445f4c7656a90a212bb32c29e81795af25b0824.


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

Branch: refs/heads/master
Commit: 772d53783c0bd8b6ae1bc2aec6fc9339c0840f42
Parents: 97320fa
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 31 09:59:29 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 31 09:59:29 2015 +0200

----------------------------------------------------------------------
 .../apache/camel/impl/DefaultCamelContext.java  |   3 +-
 .../org/apache/camel/impl/RouteService.java     |   5 +-
 ...ointRegistryKeepRouteInputEndpointsTest.java | 132 -------------------
 3 files changed, 4 insertions(+), 136 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/772d5378/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 221abac..1152600 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -1089,8 +1089,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                     }
                 }
                 for (Endpoint endpoint : toRemove) {
-                    log.debug("Stopping and removing: {} which was only in use by route: {}", endpoint, routeId);
-                    ServiceHelper.stopAndShutdownService(endpoint);
+                    log.debug("Removing: {} which was only in use by route: {}", endpoint, routeId);
                     removeEndpoint(endpoint);
                 }
                 return true;

http://git-wip-us.apache.org/repos/asf/camel/blob/772d5378/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
index 462fb5e..32bb3f5 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
@@ -105,8 +105,6 @@ public class RouteService extends ChildServiceSupport {
     public Set<Endpoint> gatherEndpoints() {
         Set<Endpoint> answer = new LinkedHashSet<Endpoint>();
         for (Route route : routes) {
-            // the input endpoint itself
-            answer.add(route.getEndpoint());
             Set<Service> services = gatherChildServices(route, true);
             for (Service service : services) {
                 if (service instanceof EndpointAware) {
@@ -280,6 +278,9 @@ public class RouteService extends ChildServiceSupport {
             // shutdown the route itself
             ServiceHelper.stopAndShutdownServices(route);
 
+            // endpoints should only be stopped when Camel is shutting down
+            // see more details in the warmUp method
+            ServiceHelper.stopAndShutdownServices(route.getEndpoint());
             // invoke callbacks on route policy
             if (route.getRouteContext().getRoutePolicyList() != null) {
                 for (RoutePolicy routePolicy : route.getRouteContext().getRoutePolicyList()) {

http://git-wip-us.apache.org/repos/asf/camel/blob/772d5378/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java b/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java
deleted file mode 100644
index 1a1434b..0000000
--- a/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.impl;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Endpoint;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.support.ServiceSupport;
-
-public class EndpointRegistryKeepRouteInputEndpointsTest extends ContextTestSupport {
-
-    public void testEndpointRegistryKeepRouteEndpoints() throws Exception {
-        Endpoint seda = context.hasEndpoint("seda://start?multipleConsumers=true");
-        assertNotNull(seda);
-        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertTrue(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove bar route
-        context.stopRoute("bar");
-        context.removeRoute("bar");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove baz route
-        context.stopRoute("baz");
-        context.removeRoute("baz");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertFalse(context.hasEndpoint("seda://stop") != null);
-        assertFalse(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove foo route
-        context.stopRoute("foo");
-        context.removeRoute("foo");
-
-        assertFalse(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertFalse(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertFalse(context.hasEndpoint("mock://result") != null);
-        assertFalse(context.hasEndpoint("seda://stop") != null);
-        assertFalse(context.hasEndpoint("mock://stop") != null);
-
-        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
-    }
-
-    public void testEndpointRegistryKeepRouteEndpointsContextStop() throws Exception {
-        Endpoint seda = context.hasEndpoint("seda://start?multipleConsumers=true");
-        assertNotNull(seda);
-        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertTrue(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove bar route
-        context.stopRoute("bar");
-        context.removeRoute("bar");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove baz route
-        context.stopRoute("baz");
-        context.removeRoute("baz");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertFalse(context.hasEndpoint("seda://stop") != null);
-        assertFalse(context.hasEndpoint("mock://stop") != null);
-
-        // stop camel which should stop the endpoint
-
-        context.stop();
-
-        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("seda:start?multipleConsumers=true").routeId("foo")
-                    .to("log:foo").to("mock:result");
-
-                from("seda:start?multipleConsumers=true").routeId("bar")
-                    .to("log:bar").to("log:bar").to("mock:result");
-
-                from("seda:stop").routeId("baz")
-                    .to("mock:stop");
-            }
-        };
-    }
-
-}


[3/7] camel git commit: Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

Posted by da...@apache.org.
Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

This reverts commit 166c0be906aec697b6c5e6ef9c756510f64a94a2.


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

Branch: refs/heads/master
Commit: b8f4702350bcfda53ced5de09770912eef06d958
Parents: 60ef47d
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 31 10:38:21 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 31 10:38:21 2015 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/impl/RouteService.java       | 5 -----
 .../Endpoint2MustBeStartedBeforeSendProcessorTest.java          | 2 --
 .../processor/EndpointMustBeStartedBeforeSendProcessorTest.java | 2 --
 3 files changed, 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b8f47023/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
index 32bb3f5..2139d5c 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
@@ -140,11 +140,6 @@ public class RouteService extends ChildServiceSupport {
             // endpoints should only be started once as they can be reused on other routes
             // and whatnot, thus their lifecycle is to start once, and only to stop when Camel shutdown
             for (Route route : routes) {
-                // ensure endpoints is registered in the registry
-                String uri = route.getEndpoint().getEndpointUri();
-                if (camelContext.hasEndpoint(uri) == null) {
-                    camelContext.addEndpoint(uri, route.getEndpoint());
-                }
                 // ensure endpoint is started first (before the route services, such as the consumer)
                 ServiceHelper.startService(route.getEndpoint());
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/b8f47023/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
index 637c80a..29cfb68 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
@@ -95,8 +95,6 @@ public class Endpoint2MustBeStartedBeforeSendProcessorTest extends ContextTestSu
         });
         context.start();
 
-        assertTrue("Should be static endpoint", context.getEndpointRegistry().isStatic(myendpoint.getEndpointKey()));
-
         assertEquals("EndpointProducerConsumer", order);
         order = "";
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b8f47023/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
index 0e3a347..19cd537 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
@@ -95,8 +95,6 @@ public class EndpointMustBeStartedBeforeSendProcessorTest extends ContextTestSup
         });
         context.start();
 
-        assertTrue("Should be static endpoint", context.getEndpointRegistry().isStatic(myendpoint.getEndpointKey()));
-
         assertEquals("EndpointProducerConsumer", order);
         order = "";
 


[7/7] camel git commit: CAMEL-8562: Added unit test to verify route endpoints is stopped when a route is remove.

Posted by da...@apache.org.
CAMEL-8562: Added unit test to verify route endpoints is stopped when a route is remove.


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

Branch: refs/heads/camel-2.15.x
Commit: 5220251143f312a592a6ed5c0eff0b83280e2b3b
Parents: 2ec52d9
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 31 10:52:41 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 31 10:55:41 2015 +0200

----------------------------------------------------------------------
 .../camel/impl/RemoveRouteStopEndpointTest.java | 152 +++++++++++++++++++
 1 file changed, 152 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/52202511/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java b/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java
new file mode 100644
index 0000000..0f80f8c
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java
@@ -0,0 +1,152 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.impl;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Endpoint;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.support.ServiceSupport;
+
+public class RemoveRouteStopEndpointTest extends ContextTestSupport {
+
+    public void testEndpointRegistryStopRouteEndpoints() throws Exception {
+        Endpoint seda = context.hasEndpoint("seda://foo");
+        assertNotNull(seda);
+        Endpoint log = context.hasEndpoint("log://bar");
+        assertNotNull(log);
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be started", ((ServiceSupport) log).isStarted());
+
+        assertTrue(context.hasEndpoint("seda:foo") != null);
+        assertTrue(context.hasEndpoint("seda:bar") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertTrue(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        // stop and remove bar route
+        context.stopRoute("bar");
+        context.removeRoute("bar");
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be stopped", ((ServiceSupport) log).isStopped());
+
+        // stop and remove baz route
+        context.stopRoute("baz");
+        context.removeRoute("baz");
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertFalse(context.hasEndpoint("seda://stop") != null);
+        assertFalse(context.hasEndpoint("mock://stop") != null);
+        // stop and remove foo route
+        context.stopRoute("foo");
+        context.removeRoute("foo");
+
+        assertFalse(context.hasEndpoint("seda://foo") != null);
+        assertFalse(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertFalse(context.hasEndpoint("mock://result") != null);
+        assertFalse(context.hasEndpoint("seda://stop") != null);
+        assertFalse(context.hasEndpoint("mock://stop") != null);
+
+        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
+        assertFalse("Should not be started", ((ServiceSupport) log).isStarted());
+    }
+
+    public void testEndpointRegistryStopRouteEndpointsContextStop() throws Exception {
+        Endpoint seda = context.hasEndpoint("seda://foo");
+        assertNotNull(seda);
+        Endpoint log = context.hasEndpoint("log://bar");
+        assertNotNull(log);
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be started", ((ServiceSupport) log).isStarted());
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertTrue(context.hasEndpoint("seda://bar") != null);
+        assertTrue(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        // stop and remove bar route
+        context.stopRoute("bar");
+        context.removeRoute("bar");
+
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be stopped", ((ServiceSupport) log).isStopped());
+
+        assertTrue(context.hasEndpoint("seda:foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        // stop and remove baz route
+        context.stopRoute("baz");
+        context.removeRoute("baz");
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertFalse(context.hasEndpoint("seda://stop") != null);
+        assertFalse(context.hasEndpoint("mock://stop") != null);
+
+        // stop camel which should stop the endpoint
+
+        context.stop();
+
+        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
+        assertFalse("Should not be started", ((ServiceSupport) log).isStarted());
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("seda:foo").routeId("foo")
+                        .to("log:foo").to("mock:result");
+
+                from("seda:bar").routeId("bar")
+                        .to("log:bar").to("log:bar").to("mock:result");
+
+                from("seda:stop").routeId("baz")
+                        .to("mock:stop");
+            }
+        };
+    }
+
+}


[4/7] camel git commit: CAMEL-8562: Added unit test to verify route endpoints is stopped when a route is remove.

Posted by da...@apache.org.
CAMEL-8562: Added unit test to verify route endpoints is stopped when a route is remove.


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

Branch: refs/heads/master
Commit: 5f59322fbe0898bc1fdc0dc47fa5b221736232a4
Parents: b8f4702
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 31 10:52:41 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 31 10:52:41 2015 +0200

----------------------------------------------------------------------
 .../camel/impl/RemoveRouteStopEndpointTest.java | 152 +++++++++++++++++++
 1 file changed, 152 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5f59322f/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java b/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java
new file mode 100644
index 0000000..0f80f8c
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/impl/RemoveRouteStopEndpointTest.java
@@ -0,0 +1,152 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.impl;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Endpoint;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.support.ServiceSupport;
+
+public class RemoveRouteStopEndpointTest extends ContextTestSupport {
+
+    public void testEndpointRegistryStopRouteEndpoints() throws Exception {
+        Endpoint seda = context.hasEndpoint("seda://foo");
+        assertNotNull(seda);
+        Endpoint log = context.hasEndpoint("log://bar");
+        assertNotNull(log);
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be started", ((ServiceSupport) log).isStarted());
+
+        assertTrue(context.hasEndpoint("seda:foo") != null);
+        assertTrue(context.hasEndpoint("seda:bar") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertTrue(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        // stop and remove bar route
+        context.stopRoute("bar");
+        context.removeRoute("bar");
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be stopped", ((ServiceSupport) log).isStopped());
+
+        // stop and remove baz route
+        context.stopRoute("baz");
+        context.removeRoute("baz");
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertFalse(context.hasEndpoint("seda://stop") != null);
+        assertFalse(context.hasEndpoint("mock://stop") != null);
+        // stop and remove foo route
+        context.stopRoute("foo");
+        context.removeRoute("foo");
+
+        assertFalse(context.hasEndpoint("seda://foo") != null);
+        assertFalse(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertFalse(context.hasEndpoint("mock://result") != null);
+        assertFalse(context.hasEndpoint("seda://stop") != null);
+        assertFalse(context.hasEndpoint("mock://stop") != null);
+
+        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
+        assertFalse("Should not be started", ((ServiceSupport) log).isStarted());
+    }
+
+    public void testEndpointRegistryStopRouteEndpointsContextStop() throws Exception {
+        Endpoint seda = context.hasEndpoint("seda://foo");
+        assertNotNull(seda);
+        Endpoint log = context.hasEndpoint("log://bar");
+        assertNotNull(log);
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be started", ((ServiceSupport) log).isStarted());
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertTrue(context.hasEndpoint("seda://bar") != null);
+        assertTrue(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        // stop and remove bar route
+        context.stopRoute("bar");
+        context.removeRoute("bar");
+
+        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
+        assertTrue("Should be stopped", ((ServiceSupport) log).isStopped());
+
+        assertTrue(context.hasEndpoint("seda:foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertTrue(context.hasEndpoint("seda://stop") != null);
+        assertTrue(context.hasEndpoint("mock://stop") != null);
+
+        // stop and remove baz route
+        context.stopRoute("baz");
+        context.removeRoute("baz");
+
+        assertTrue(context.hasEndpoint("seda://foo") != null);
+        assertTrue(context.hasEndpoint("log://foo") != null);
+        assertFalse(context.hasEndpoint("seda://bar") != null);
+        assertFalse(context.hasEndpoint("log://bar") != null);
+        assertTrue(context.hasEndpoint("mock://result") != null);
+        assertFalse(context.hasEndpoint("seda://stop") != null);
+        assertFalse(context.hasEndpoint("mock://stop") != null);
+
+        // stop camel which should stop the endpoint
+
+        context.stop();
+
+        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
+        assertFalse("Should not be started", ((ServiceSupport) log).isStarted());
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("seda:foo").routeId("foo")
+                        .to("log:foo").to("mock:result");
+
+                from("seda:bar").routeId("bar")
+                        .to("log:bar").to("log:bar").to("mock:result");
+
+                from("seda:stop").routeId("baz")
+                        .to("mock:stop");
+            }
+        };
+    }
+
+}


[5/7] camel git commit: Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

Posted by da...@apache.org.
Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

This reverts commit 9445f4c7656a90a212bb32c29e81795af25b0824.


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

Branch: refs/heads/camel-2.15.x
Commit: 360499fad1e8878dcacd81da5a0adbf7cf98ec6a
Parents: 0977cef
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 31 09:59:29 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 31 10:55:28 2015 +0200

----------------------------------------------------------------------
 .../apache/camel/impl/DefaultCamelContext.java  |   3 +-
 .../org/apache/camel/impl/RouteService.java     |   5 +-
 ...ointRegistryKeepRouteInputEndpointsTest.java | 132 -------------------
 3 files changed, 4 insertions(+), 136 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/360499fa/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 0622af6..9ac71b6 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -1002,8 +1002,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                     }
                 }
                 for (Endpoint endpoint : toRemove) {
-                    log.debug("Stopping and removing: {} which was only in use by route: {}", endpoint, routeId);
-                    ServiceHelper.stopAndShutdownService(endpoint);
+                    log.debug("Removing: {} which was only in use by route: {}", endpoint, routeId);
                     removeEndpoint(endpoint);
                 }
                 return true;

http://git-wip-us.apache.org/repos/asf/camel/blob/360499fa/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
index 462fb5e..32bb3f5 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
@@ -105,8 +105,6 @@ public class RouteService extends ChildServiceSupport {
     public Set<Endpoint> gatherEndpoints() {
         Set<Endpoint> answer = new LinkedHashSet<Endpoint>();
         for (Route route : routes) {
-            // the input endpoint itself
-            answer.add(route.getEndpoint());
             Set<Service> services = gatherChildServices(route, true);
             for (Service service : services) {
                 if (service instanceof EndpointAware) {
@@ -280,6 +278,9 @@ public class RouteService extends ChildServiceSupport {
             // shutdown the route itself
             ServiceHelper.stopAndShutdownServices(route);
 
+            // endpoints should only be stopped when Camel is shutting down
+            // see more details in the warmUp method
+            ServiceHelper.stopAndShutdownServices(route.getEndpoint());
             // invoke callbacks on route policy
             if (route.getRouteContext().getRoutePolicyList() != null) {
                 for (RoutePolicy routePolicy : route.getRouteContext().getRoutePolicyList()) {

http://git-wip-us.apache.org/repos/asf/camel/blob/360499fa/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java b/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java
deleted file mode 100644
index 1a1434b..0000000
--- a/camel-core/src/test/java/org/apache/camel/impl/EndpointRegistryKeepRouteInputEndpointsTest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.impl;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Endpoint;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.support.ServiceSupport;
-
-public class EndpointRegistryKeepRouteInputEndpointsTest extends ContextTestSupport {
-
-    public void testEndpointRegistryKeepRouteEndpoints() throws Exception {
-        Endpoint seda = context.hasEndpoint("seda://start?multipleConsumers=true");
-        assertNotNull(seda);
-        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertTrue(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove bar route
-        context.stopRoute("bar");
-        context.removeRoute("bar");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove baz route
-        context.stopRoute("baz");
-        context.removeRoute("baz");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertFalse(context.hasEndpoint("seda://stop") != null);
-        assertFalse(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove foo route
-        context.stopRoute("foo");
-        context.removeRoute("foo");
-
-        assertFalse(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertFalse(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertFalse(context.hasEndpoint("mock://result") != null);
-        assertFalse(context.hasEndpoint("seda://stop") != null);
-        assertFalse(context.hasEndpoint("mock://stop") != null);
-
-        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
-    }
-
-    public void testEndpointRegistryKeepRouteEndpointsContextStop() throws Exception {
-        Endpoint seda = context.hasEndpoint("seda://start?multipleConsumers=true");
-        assertNotNull(seda);
-        assertTrue("Should be started", ((ServiceSupport) seda).isStarted());
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertTrue(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove bar route
-        context.stopRoute("bar");
-        context.removeRoute("bar");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertTrue(context.hasEndpoint("seda://stop") != null);
-        assertTrue(context.hasEndpoint("mock://stop") != null);
-
-        // stop and remove baz route
-        context.stopRoute("baz");
-        context.removeRoute("baz");
-
-        assertTrue(context.hasEndpoint("seda://start?multipleConsumers=true") != null);
-        assertTrue(context.hasEndpoint("log://foo") != null);
-        assertFalse(context.hasEndpoint("log://bar") != null);
-        assertTrue(context.hasEndpoint("mock://result") != null);
-        assertFalse(context.hasEndpoint("seda://stop") != null);
-        assertFalse(context.hasEndpoint("mock://stop") != null);
-
-        // stop camel which should stop the endpoint
-
-        context.stop();
-
-        assertFalse("Should not be started", ((ServiceSupport) seda).isStarted());
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("seda:start?multipleConsumers=true").routeId("foo")
-                    .to("log:foo").to("mock:result");
-
-                from("seda:start?multipleConsumers=true").routeId("bar")
-                    .to("log:bar").to("log:bar").to("mock:result");
-
-                from("seda:stop").routeId("baz")
-                    .to("mock:stop");
-            }
-        };
-    }
-
-}


[6/7] camel git commit: Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

Posted by da...@apache.org.
Revert "CAMEL-8562: Removing a route - Should check if the route input endpoint is static and used by other routes"

This reverts commit 166c0be906aec697b6c5e6ef9c756510f64a94a2.


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

Branch: refs/heads/camel-2.15.x
Commit: 2ec52d900621b89ca4bc350db3c02d524857d1dd
Parents: 360499f
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 31 10:38:21 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 31 10:55:35 2015 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/impl/RouteService.java       | 5 -----
 .../Endpoint2MustBeStartedBeforeSendProcessorTest.java          | 2 --
 .../processor/EndpointMustBeStartedBeforeSendProcessorTest.java | 2 --
 3 files changed, 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2ec52d90/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
index 32bb3f5..2139d5c 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/RouteService.java
@@ -140,11 +140,6 @@ public class RouteService extends ChildServiceSupport {
             // endpoints should only be started once as they can be reused on other routes
             // and whatnot, thus their lifecycle is to start once, and only to stop when Camel shutdown
             for (Route route : routes) {
-                // ensure endpoints is registered in the registry
-                String uri = route.getEndpoint().getEndpointUri();
-                if (camelContext.hasEndpoint(uri) == null) {
-                    camelContext.addEndpoint(uri, route.getEndpoint());
-                }
                 // ensure endpoint is started first (before the route services, such as the consumer)
                 ServiceHelper.startService(route.getEndpoint());
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ec52d90/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
index 637c80a..29cfb68 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/Endpoint2MustBeStartedBeforeSendProcessorTest.java
@@ -95,8 +95,6 @@ public class Endpoint2MustBeStartedBeforeSendProcessorTest extends ContextTestSu
         });
         context.start();
 
-        assertTrue("Should be static endpoint", context.getEndpointRegistry().isStatic(myendpoint.getEndpointKey()));
-
         assertEquals("EndpointProducerConsumer", order);
         order = "";
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ec52d90/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
index 0e3a347..19cd537 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/EndpointMustBeStartedBeforeSendProcessorTest.java
@@ -95,8 +95,6 @@ public class EndpointMustBeStartedBeforeSendProcessorTest extends ContextTestSup
         });
         context.start();
 
-        assertTrue("Should be static endpoint", context.getEndpointRegistry().isStatic(myendpoint.getEndpointKey()));
-
         assertEquals("EndpointProducerConsumer", order);
         order = "";
 


[2/7] camel git commit: Revert "[CAMEL-8554] Jackons component now provides map => pojo fallback converter."

Posted by da...@apache.org.
Revert "[CAMEL-8554] Jackons component now provides map => pojo fallback converter."

This reverts commit 2fa60111add917affc161570892efda4a763f56a.

Conflicts:
	components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java


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

Branch: refs/heads/master
Commit: 60ef47d6e8086f3d0b1edc03ceb29b2c5fb24d15
Parents: 772d537
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 31 10:04:11 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 31 10:04:11 2015 +0200

----------------------------------------------------------------------
 .../converter/JacksonTypeConverters.java        | 45 -----------------
 .../services/org/apache/camel/TypeConverter     | 17 -------
 .../jackson/JacksonConversionsTest.java         | 51 --------------------
 3 files changed, 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/60ef47d6/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java b/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java
deleted file mode 100644
index 6db03a1..0000000
--- a/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.jackson.converter;
-
-import java.util.Map;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.camel.Exchange;
-import org.apache.camel.FallbackConverter;
-import org.apache.camel.spi.TypeConverterRegistry;
-
-public final class JacksonTypeConverters {
-
-    private JacksonTypeConverters() {
-    }
-
-    @FallbackConverter
-    public static <T> T convertTo(Class<T> type, Exchange exchange, Object value, TypeConverterRegistry registry) {
-        if (value instanceof Map) {
-            try {
-                return new ObjectMapper().convertValue(value, type);
-            } catch (Exception ex) {
-                // Just catch the exception and return null when the ObjectMapper cannot convert the value
-                return null;
-            }
-        }
-        // Just return null to let other fallback converter to do the job
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/60ef47d6/components/camel-jackson/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/main/resources/META-INF/services/org/apache/camel/TypeConverter b/components/camel-jackson/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
deleted file mode 100644
index 6ad0528..0000000
--- a/components/camel-jackson/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-org.apache.camel.component.jackson.converter.JacksonTypeConverters
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/60ef47d6/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonConversionsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonConversionsTest.java b/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonConversionsTest.java
deleted file mode 100644
index 20427b5..0000000
--- a/components/camel-jackson/src/test/java/org/apache/camel/component/jackson/JacksonConversionsTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.jackson;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
-
-public class JacksonConversionsTest extends CamelTestSupport {
-    protected MockEndpoint results;
-
-    @Test
-    public void shouldConvertMapToPojo() {
-        String name = "someName";
-        Map<String, String> pojoAsMap = new HashMap<String, String>();
-        pojoAsMap.put("name", name);
-
-        TestPojo testPojo = (TestPojo) template.requestBody("direct:test", pojoAsMap);
-
-        assertEquals(name, testPojo.getName());
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("direct:test").convertBodyTo(TestPojo.class);
-            }
-        };
-    }
-
-}