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 2011/08/12 17:32:52 UTC

svn commit: r1157157 [3/3] - in /camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/component/bean/ camel-core/src/main/java/org/apache/camel/component/dataset/ camel-core/src/main/java/org/apache/...

Copied: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceManagerTest.java (from r1156598, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceManagerTest.java?p2=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceManagerTest.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest.java&r1=1156598&r2=1157157&rev=1157157&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceManagerTest.java Fri Aug 12 15:32:50 2011
@@ -26,13 +26,13 @@ import org.springframework.test.context.
  * @version 
  */
 @ContextConfiguration
-public class CustomExecutorServiceStrategyTest extends AbstractJUnit38SpringContextTests {
+public class CustomExecutorServiceManagerTest extends AbstractJUnit38SpringContextTests {
 
     @Autowired
     protected CamelContext context;
 
     public void testCustomExecutorService() throws Exception {
-        Assert.assertTrue(context.getExecutorServiceManager() instanceof CustomExecutorServiceStrategy);
+        Assert.assertTrue(context.getExecutorServiceManager() instanceof CustomExecutorServiceManager);
     }
 
 }
\ No newline at end of file

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CustomExecutorServiceManagerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/SpringCamelContextThreadPoolProfilesTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/SpringCamelContextThreadPoolProfilesTest.java?rev=1157157&r1=1157156&r2=1157157&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/SpringCamelContextThreadPoolProfilesTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/SpringCamelContextThreadPoolProfilesTest.java Fri Aug 12 15:32:50 2011
@@ -44,7 +44,7 @@ public class SpringCamelContextThreadPoo
         assertEquals(null, profile.getRejectedPolicy());
 
         // create a thread pool from low
-        ExecutorService executor = context.getExecutorServiceManager().getDefaultExecutorService("low", this); // TODO check newThreadPool(this, "MyLow", "low");
+        ExecutorService executor = context.getExecutorServiceManager().newThreadPool(this, "MyLow", "low");
         ThreadPoolExecutor tp = assertIsInstanceOf(ThreadPoolExecutor.class, executor);
         assertEquals(1, tp.getCorePoolSize());
         assertEquals(5, tp.getMaximumPoolSize());
@@ -64,7 +64,7 @@ public class SpringCamelContextThreadPoo
         assertEquals(null, profile.getMaxQueueSize());
 
         // create a thread pool from big
-        ExecutorService executor = context.getExecutorServiceManager().getDefaultExecutorService("big", this); // TODO check newThreadPool(this, "MyBig", "big");
+        ExecutorService executor = context.getExecutorServiceManager().newThreadPool(this, "MyBig", "big");
         ThreadPoolExecutor tp = assertIsInstanceOf(ThreadPoolExecutor.class, executor);
         assertEquals(50, tp.getCorePoolSize());
         assertEquals(100, tp.getMaximumPoolSize());

Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceManagerTest-context.xml (from r1156598, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceManagerTest-context.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceManagerTest-context.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml&r1=1156598&r2=1157157&rev=1157157&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceManagerTest-context.xml Fri Aug 12 15:32:50 2011
@@ -22,7 +22,7 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="myCustomPoolStrategy" depends-on="camel" class="org.apache.camel.spring.config.CustomExecutorServiceStrategy">
+    <bean id="myCustomPoolStrategy" depends-on="camel" class="org.apache.camel.spring.config.CustomExecutorServiceManager">
         <constructor-arg index="0" ref="camel"/>
     </bean>
 

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceManagerTest-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceManagerTest-context.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceManagerTest-context.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java?rev=1157157&r1=1157156&r2=1157157&view=diff
==============================================================================
--- camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java (original)
+++ camel/trunk/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java Fri Aug 12 15:32:50 2011
@@ -34,7 +34,6 @@ import java.util.concurrent.ExecutorServ
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
-import org.apache.camel.builder.ThreadPoolBuilder;
 import org.apache.camel.impl.DefaultConsumer;
 import org.apache.camel.impl.DefaultMessage;
 import org.apache.camel.util.ObjectHelper;
@@ -70,7 +69,7 @@ public class StreamConsumer extends Defa
 
         initializeStream();
 
-        executor = endpoint.getCamelContext().getExecutorServiceManager().getExecutorService(ThreadPoolBuilder.singleThreadExecutor(endpoint.getEndpointUri()), this);
+        executor = endpoint.getCamelContext().getExecutorServiceManager().newSingleThreadExecutor(this, endpoint.getEndpointUri());
         executor.execute(this);
 
         if (endpoint.getGroupLines() < 0) {
@@ -83,7 +82,7 @@ public class StreamConsumer extends Defa
         // important: do not close the stream as it will close the standard
         // system.in etc.
         if (executor != null) {
-            executor.shutdownNow();
+            endpoint.getCamelContext().getExecutorServiceManager().shutdownNow(executor);
             executor = null;
         }
         lines.clear();