camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r772076 [2/2] - in /camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/component/seda/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/impl/converter/ ...
Date Wed, 06 May 2009 07:08:16 GMT
Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala?rev=772076&r1=772075&r2=772076&view=diff
==============================================================================
--- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
(original)
+++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SAbstractDefinition.scala
Wed May  6 07:08:14 2009
@@ -110,8 +110,6 @@
   
   def setheader(name: String, expression: Exchange => Any) = new SProcessorDefinition(target.setHeader(name,
expression).asInstanceOf[ProcessorDefinition[P] forSome {type P}])
   
-  def thread(count: Int) = new SThreadDefinition(target.thread(count))
-  
   def unmarshal(format: DataFormatDefinition) = {
     target.unmarshal(format)
     this

Modified: camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala?rev=772076&r1=772075&r2=772076&view=diff
==============================================================================
--- camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
(original)
+++ camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/builder/RouteBuilder.scala
Wed May  6 07:08:14 2009
@@ -88,7 +88,6 @@
   def rollback = stack.top.rollback
   def setbody(expression : Exchange => Any) = stack.top.setbody(expression)
   def setheader(name: String, expression: Exchange => Any) = stack.top.setheader(name,
expression)
-  def thread(count: Int) = stack.top.thread(count)
   def unmarshal(format: DataFormatDefinition) = stack.top.unmarshal(format)
   def wiretap(uri: String) = stack.top.wiretap(uri)
   def aggregate(expression: Exchange => Any) = stack.top.aggregate(expression)

Modified: camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java?rev=772076&r1=772075&r2=772076&view=diff
==============================================================================
--- camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
(original)
+++ camel/trunk/components/camel-test/src/main/java/org/apache/camel/test/TestSupport.java
Wed May  6 07:08:14 2009
@@ -21,6 +21,7 @@
 
 import junit.framework.TestCase;
 import org.apache.camel.CamelContext;
+import org.apache.camel.Channel;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
@@ -34,7 +35,6 @@
 import org.apache.camel.builder.ValueBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.DefaultExchange;
-import org.apache.camel.processor.DelegateAsyncProcessor;
 import org.apache.camel.processor.DelegateProcessor;
 import org.apache.camel.util.ExchangeHelper;
 import org.apache.camel.util.PredicateAssertHelper;
@@ -328,9 +328,7 @@
      */
     protected Processor unwrap(Processor processor) {
         while (true) {
-            if (processor instanceof DelegateAsyncProcessor) {
-                processor = ((DelegateAsyncProcessor)processor).getProcessor();
-            } else if (processor instanceof DelegateProcessor) {
+            if (processor instanceof DelegateProcessor) {
                 processor = ((DelegateProcessor)processor).getProcessor();
             } else {
                 return processor;
@@ -339,6 +337,24 @@
     }
 
     /**
+     * If a processor is wrapped with a bunch of DelegateProcessor or DelegateAsyncProcessor
objects
+     * this call will drill through them and return the Channel.
+     * <p/>
+     * Returns null if no channel is found.
+     */
+    protected Channel unwrapChannel(Processor processor) {
+        while (true) {
+            if (processor instanceof Channel) {
+                return (Channel) processor;
+            } else if (processor instanceof DelegateProcessor) {
+                processor = ((DelegateProcessor)processor).getProcessor();
+            } else {
+                return null;
+            }
+        }
+    }
+
+    /**
      * Recursively delete a directory, useful to zapping test data
      *
      * @param file the directory to be deleted



Mime
View raw message