Repository: camel Updated Branches: refs/heads/master 69abfd77a -> 7d36d5260
Include hostname in the Camel Tomcat examples so if you try this on different hosts its easier to see the example actually runs where Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d36d526 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d36d526 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d36d526 Branch: refs/heads/master Commit: 7d36d52606df8bf37dca22756f4aa274a04134db Parents: 69abfd7 Author: Claus Ibsen <davscl...@apache.org> Authored: Tue May 19 17:32:08 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Tue May 19 17:32:08 2015 +0200 ---------------------------------------------------------------------- .../src/main/resources/META-INF/blueprint.xml | 2 +- .../camel/example/servletlistener/HelloBean.java | 5 +++-- .../camel/example/servletlistener/MyLifecycle.java | 16 +++++----------- .../src/main/resources/camel-config.xml | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/7d36d526/examples/camel-example-servlet-tomcat-blueprintweb/src/main/resources/META-INF/blueprint.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-servlet-tomcat-blueprintweb/src/main/resources/META-INF/blueprint.xml b/examples/camel-example-servlet-tomcat-blueprintweb/src/main/resources/META-INF/blueprint.xml index 6de33d2..d897687 100755 --- a/examples/camel-example-servlet-tomcat-blueprintweb/src/main/resources/META-INF/blueprint.xml +++ b/examples/camel-example-servlet-tomcat-blueprintweb/src/main/resources/META-INF/blueprint.xml @@ -33,7 +33,7 @@ <header>name</header> <!-- yes so return back a message to the user --> <transform> - <simple>Hello ${header.name} how are you?</simple> + <simple>Hello ${header.name} how are you? You are from host: ${sysenv.HOSTNAME}</simple> </transform> </when> <otherwise> http://git-wip-us.apache.org/repos/asf/camel/blob/7d36d526/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/HelloBean.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/HelloBean.java b/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/HelloBean.java index 3912711..828e5e3 100644 --- a/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/HelloBean.java +++ b/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/HelloBean.java @@ -17,11 +17,12 @@ package org.apache.camel.example.servletlistener; import org.apache.camel.Header; +import org.apache.camel.language.Simple; public class HelloBean { - public String sayHello(@Header("name")String name) { - return "Hello " + name + ", how are you?"; + public String sayHello(@Header("name") String name, @Simple("${sysenv.HOSTNAME}") String host) { + return "Hello " + name + ", how are you? You are from host: " + host; } } http://git-wip-us.apache.org/repos/asf/camel/blob/7d36d526/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/MyLifecycle.java ---------------------------------------------------------------------- diff --git a/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/MyLifecycle.java b/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/MyLifecycle.java index 3a23c2a..23eb920 100644 --- a/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/MyLifecycle.java +++ b/examples/camel-example-servlet-tomcat-no-spring/src/main/java/org/apache/camel/example/servletlistener/MyLifecycle.java @@ -26,36 +26,30 @@ public class MyLifecycle implements CamelContextLifecycle<JndiRegistry> { public void beforeStart(ServletCamelContext camelContext, JndiRegistry registry) throws Exception { // enlist our bean(s) in the registry registry.bind("myBean", new HelloBean()); - } @Override public void beforeStop(ServletCamelContext camelContext, JndiRegistry registry) throws Exception { - // TODO Auto-generated method stub - + // noop } @Override public void afterStop(ServletCamelContext camelContext, JndiRegistry registry) throws Exception { - // TODO Auto-generated method stub - + // noop } @Override public void beforeAddRoutes(ServletCamelContext camelContext, JndiRegistry registry) throws Exception { - // TODO Auto-generated method stub - + // noop } @Override public void afterAddRoutes(ServletCamelContext camelContext, JndiRegistry registry) throws Exception { - // TODO Auto-generated method stub - + // noop } @Override public void afterStart(ServletCamelContext camelContext, JndiRegistry registry) throws Exception { - // TODO Auto-generated method stub - + // noop } } http://git-wip-us.apache.org/repos/asf/camel/blob/7d36d526/examples/camel-example-servlet-tomcat/src/main/resources/camel-config.xml ---------------------------------------------------------------------- diff --git a/examples/camel-example-servlet-tomcat/src/main/resources/camel-config.xml b/examples/camel-example-servlet-tomcat/src/main/resources/camel-config.xml index b11ee83..e3ce6c2 100755 --- a/examples/camel-example-servlet-tomcat/src/main/resources/camel-config.xml +++ b/examples/camel-example-servlet-tomcat/src/main/resources/camel-config.xml @@ -35,7 +35,7 @@ <header>name</header> <!-- yes so return back a message to the user --> <transform> - <simple>Hello ${header.name} how are you?</simple> + <simple>Hello ${header.name} how are you? You are from host: ${sysenv.HOSTNAME}</simple> </transform> </when> <otherwise>