activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r520306 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/queue/ camel-core/src/test/java/org/apache/camel/queue/ camel-jms/sr...
Date Tue, 20 Mar 2007 07:53:06 GMT
Author: chirino
Date: Tue Mar 20 00:53:04 2007
New Revision: 520306

URL: http://svn.apache.org/viewvc?view=rev&rev=520306
Log:
The send() method in Endpoint made it look like a Processor, so why not let it be one.
Some smaller cleanups

Removed:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Processors.java
Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContainer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/queue/QueueEndpoint.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/queue/QueueRouteTest.java
    activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java
    activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/jms/JmsRouteTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContainer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContainer.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContainer.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContainer.java Tue
Mar 20 00:53:04 2007
@@ -19,7 +19,6 @@
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.Callable;
 
 import org.apache.camel.builder.RouteBuilder;
@@ -73,6 +72,7 @@
                 factory.build(this);
             }
         };
+        routes(builder);
     }
 
 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Endpoint.java Tue Mar 20
00:53:04 2007
@@ -18,34 +18,36 @@
 
 
 /**
- * Represents an endpoint on which messages can be exchanged
+ * Represents an endpoint that can send and receive message exchanges
  *
  * @version $Revision$
  */
-public interface Endpoint<E>  {
+public interface Endpoint<E> extends Processor<E> {
 
     /**
-     * Returns the string representation of the URI
+     * Returns the string representation of the endpoint URI
      */
     public String getEndpointUri();
 
     /**
-     * Sends the message exchange to this endpoint
+     * Sends an outbound exchange to the endpoint
      */
-    void send(E exchange);
+    void onExchange(E exchange);
     
     /**
      * Create a new exchange for communicating with this endpoint
      */
     E createExchange();
 
-
     /**
      * Called by the container to Activate the endpoint.  Once activated,
-     * the endpoint will start delivering messages inbound exchanges
-     * it receives to the specified processor.
+     * the endpoint will start delivering inbound message exchanges
+     * that are received to the specified processor.
+     *
+     * The processor must be thread safe ( or stateless ) since some endpoints 
+     * may choose to deliver exchanges concurrently to the processor.
      * 
-     * @throws IllegalStateException is the Endpoint has already been activated.
+     * @throws IllegalStateException if the Endpoint has already been activated.
      */
 	public void activate(Processor<E> processor) throws IllegalStateException;
 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ChoiceBuilder.java
Tue Mar 20 00:53:04 2007
@@ -16,10 +16,10 @@
  */
 package org.apache.camel.builder;
 
-import org.apache.camel.Predicate;
-import org.apache.camel.Exchange;
 import org.apache.camel.ChoiceProcessor;
 import org.apache.camel.FilterProcessor;
+import org.apache.camel.Predicate;
+import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 
 import java.util.List;

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
Tue Mar 20 00:53:04 2007
@@ -16,11 +16,11 @@
  */
 package org.apache.camel.builder;
 
+import org.apache.camel.FilterProcessor;
 import org.apache.camel.Predicate;
 import org.apache.camel.Exchange;
 import org.apache.camel.Predicates;
 import org.apache.camel.Processor;
-import org.apache.camel.FilterProcessor;
 
 /**
  * @version $Revision$

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/UndefinedDestinationException.java
Tue Mar 20 00:53:04 2007
@@ -23,7 +23,9 @@
  * @version $Revision$
  */
 public class UndefinedDestinationException extends RuntimeCamelException {
-    public UndefinedDestinationException() {
+	private static final long serialVersionUID = -5980888207885995222L;
+
+	public UndefinedDestinationException() {
         super("No destination defined for this routing rule");
     }
 }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/queue/QueueEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/queue/QueueEndpoint.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/queue/QueueEndpoint.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/queue/QueueEndpoint.java
Tue Mar 20 00:53:04 2007
@@ -42,7 +42,7 @@
         this.queue = queue;
     }
 
-    public void send(E exchange) {
+    public void onExchange(E exchange) {
         queue.add(exchange);
     }
 

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/queue/QueueRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/queue/QueueRouteTest.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/queue/QueueRouteTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/queue/QueueRouteTest.java
Tue Mar 20 00:53:04 2007
@@ -61,7 +61,7 @@
         Endpoint<StringExchange> endpoint = container.endpoint("queue:test.a");
         StringExchange exchange = new StringExchange();
         exchange.setHeader("cheese", 123);
-        endpoint.send(exchange);
+        endpoint.onExchange(exchange);
 
         // now lets sleep for a while
         boolean received = latch.await(5, TimeUnit.SECONDS);

Modified: activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java (original)
+++ activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/jms/JmsEndpoint.java Tue
Mar 20 00:53:04 2007
@@ -61,10 +61,10 @@
     public void send(Exchange exchange) {
         // lets convert to the type of an exchange
         JmsExchange jmsExchange = convertTo(JmsExchange.class, exchange);
-        send(jmsExchange);
+        onExchange(jmsExchange);
     }
 
-    public void send(final JmsExchange exchange) {
+    public void onExchange(final JmsExchange exchange) {
         template.send(destination, new MessageCreator() {
             public Message createMessage(Session session) throws JMSException {
                 Message message = exchange.createMessage(session);

Modified: activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/jms/JmsRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/jms/JmsRouteTest.java?view=diff&rev=520306&r1=520305&r2=520306
==============================================================================
--- activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/jms/JmsRouteTest.java (original)
+++ activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/jms/JmsRouteTest.java Tue
Mar 20 00:53:04 2007
@@ -63,7 +63,7 @@
         JmsExchange exchange2 = endpoint.createExchange();
         //exchange2.setInBody("Hello there!")
         exchange2.setHeader("cheese", 123);
-        endpoint.send(exchange2);
+        endpoint.onExchange(exchange2);
 
         // now lets sleep for a while
         boolean received = latch.await(5, TimeUnit.SECONDS);



Mime
View raw message