svn commit: r666530 - in /activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example: client/CamelClient.java client/CamelClientRemoting.java server/Multiplier.java server/ServerRoutes.java server/Treble.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r666530 - in /activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example: client/CamelClient.java client/CamelClientRemoting.java server/Multiplier.java server/ServerRoutes.java server/Treble.java

davsclaus-2
Author: davsclaus
Date: Tue Jun 10 22:19:46 2008
New Revision: 666530

URL: http://svn.apache.org/viewvc?rev=666530&view=rev
Log:
CAMEL-590: Camel tutorial polished

Modified:
    activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
    activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
    activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java
    activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java
    activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java

Modified: activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java?rev=666530&r1=666529&r2=666530&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java (original)
+++ activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java Tue Jun 10 22:19:46 2008
@@ -23,9 +23,9 @@
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
+ * Client that uses the {@link ProducerTemplate} to easily exchange messages with the Server.
+ * <p/>
  * Requires that the JMS broker is running, as well as CamelServer
- *
- * @author martin.gilday
  */
 public final class CamelClient {
 

Modified: activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java?rev=666530&r1=666529&r2=666530&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java (original)
+++ activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java Tue Jun 10 22:19:46 2008
@@ -21,9 +21,9 @@
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
+ * Client that uses Camel Spring Remoting for very easy integration with the server.
+ * <p/>
  * Requires that the JMS broker is running, as well as CamelServer
- *
- * @author martin.gilday
  */
 public final class CamelClientRemoting {
 

Modified: activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java?rev=666530&r1=666529&r2=666530&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java (original)
+++ activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Multiplier.java Tue Jun 10 22:19:46 2008
@@ -17,7 +17,7 @@
 package org.apache.camel.example.server;
 
 /**
- * @author martin.gilday
+ * Our business service.
  */
 // START SNIPPET: e1
 public interface Multiplier {

Modified: activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java?rev=666530&r1=666529&r2=666530&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java (original)
+++ activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java Tue Jun 10 22:19:46 2008
@@ -19,15 +19,30 @@
 import org.apache.camel.builder.RouteBuilder;
 
 /**
- * @author martin.gilday
+ * This class defines the routes on the Server. The class extends a base class in Camel {@link RouteBuilder}
+ * that can be used to easily setup the routes in the configure() method.
  */
 // START SNIPPET: e1
 public class ServerRoutes extends RouteBuilder {
 
     @Override
     public void configure() throws Exception {
-        // invoke the bean with the id multiplier, and its multiply method
-        from("jms:queue:numbers").beanRef("multiplier", "multiply");
+        // route from the numbers queue to our business that is a spring bean registered with the id=multiplier
+        // Camel will introspect the multiplier bean and find the best candidate of the method to invoke.
+        // You can add annotations etc to help Camel find the method to invoke.
+        // As our multiplier bean only have one method its easy for Camel to find the method to use.
+        from("jms:queue:numbers").to("multiplier");
+
+        // Camel has several ways to configure the same routing, we have defined some of them here below
+
+        // as above but with the bean: prefix
+        //from("jms:queue:numbers").to("bean:multiplier");
+
+        // beanRef is using explicity bean bindings to lookup the multiplier bean and invoke the multiply method
+        //from("jms:queue:numbers").beanRef("multiplier", "multiply");
+
+        // the same as above but expressed as a URI configuration
+        //from("jms:queue:numbers").to("bean:multiplier?methodName=multiply");
     }
 
 }

Modified: activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java?rev=666530&r1=666529&r2=666530&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java (original)
+++ activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java Tue Jun 10 22:19:46 2008
@@ -19,7 +19,7 @@
 import org.springframework.stereotype.Service;
 
 /**
- * @author martin.gilday
+ * This is the implementation of the business service.
  */
 // START SNIPPET: e1
 @Service(value = "multiplier")