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 2020/12/08 09:25:47 UTC

[camel-examples] branch master updated: CAMEL-15926: updated route template example

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-examples.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a9b5ca  CAMEL-15926: updated route template example
4a9b5ca is described below

commit 4a9b5cacceb21293fc6411b2c6963a5b9808331e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Dec 8 10:25:34 2020 +0100

    CAMEL-15926: updated route template example
---
 .../src/main/java/org/apache/camel/example/MyApplication.java        | 4 ++--
 .../camel/example/{MyConfiguration.java => MyTemplateBuilder.java}   | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyApplication.java b/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyApplication.java
index 6b9e4f4..2d46da6 100644
--- a/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyApplication.java
+++ b/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyApplication.java
@@ -33,14 +33,14 @@ public final class MyApplication {
         main.configure().addRoutesBuilder(MyRouteTemplates.class);
         // add configuration class which setup the routes from the route templates
 
-        // to configure route templates we can use java code as below from a configuration class,
+        // to configure route templates we can use java code as below from a template builder class,
         // gives more power as its java code.
         // or we can configure as well from application.properties,
         // less power as its key value pair properties
         // and you can also use both java and properties together
 
         // in this example we use properties by default and have disabled java
-        // main.configure().addConfigurationClass(MyConfiguration.class);
+        // main.bind("myTemplateBuilder", new MyTemplateBuilder());
 
         // now keep the application running until the JVM is terminated (ctrl + c or sigterm)
         main.run(args);
diff --git a/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyConfiguration.java b/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyTemplateBuilder.java
similarity index 90%
rename from examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyConfiguration.java
rename to examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyTemplateBuilder.java
index ac23bc0..a9fbceb 100644
--- a/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyConfiguration.java
+++ b/examples/camel-example-routetemplate/src/main/java/org/apache/camel/example/MyTemplateBuilder.java
@@ -18,8 +18,9 @@ package org.apache.camel.example;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.TemplatedRouteBuilder;
+import org.apache.camel.main.ConfigureRouteTemplates;
 
-public class MyConfiguration {
+public class MyTemplateBuilder implements ConfigureRouteTemplates {
 
     /**
      * Configure and adds routes from route templates.
@@ -28,7 +29,7 @@ public class MyConfiguration {
      * and invoked after routes and route templates has been loaded which allows
      * to create and add routes from the route templates during bootstrap
      */
-    public void configureRouteTemplates(CamelContext context) {
+    public void configure(CamelContext context) {
 
         // create two routes from the template