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 2017/04/22 08:32:38 UTC

[2/4] camel git commit: Improved docs on EIPs which requires a scheduled thread pool

Improved docs on EIPs which requires a scheduled thread pool


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ed56589b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ed56589b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ed56589b

Branch: refs/heads/master
Commit: ed56589b4fb94efc84174fff9546e755accc49d9
Parents: 87cea3d
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Apr 22 09:57:20 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Apr 22 09:57:20 2017 +0200

----------------------------------------------------------------------
 camel-core/src/main/docs/eips/throttle-eip.adoc              | 2 +-
 .../java/org/apache/camel/model/AggregateDefinition.java     | 2 +-
 .../org/apache/camel/model/ProcessorDefinitionHelper.java    | 4 ++--
 .../main/java/org/apache/camel/model/ThrottleDefinition.java | 8 ++++----
 4 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ed56589b/camel-core/src/main/docs/eips/throttle-eip.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/eips/throttle-eip.adoc b/camel-core/src/main/docs/eips/throttle-eip.adoc
index 2d2f722..aa37602 100644
--- a/camel-core/src/main/docs/eips/throttle-eip.adoc
+++ b/camel-core/src/main/docs/eips/throttle-eip.adoc
@@ -10,7 +10,7 @@ The Throttle EIP supports 5 options which are listed below:
 [width="100%",cols="3,1m,6",options="header"]
 |=======================================================================
 | Name | Java Type | Description
-| executorServiceRef | String | Sets the ExecutorService which could be used by throttle definition
+| executorServiceRef | String | To use a custom thread pool (ScheduledExecutorService) by the throttler.
 | timePeriodMillis | Long | Sets the time period during which the maximum request count is valid for
 | asyncDelayed | Boolean | Enables asynchronous delay which means the thread will not block while delaying.
 | callerRunsWhenRejected | Boolean | Whether or not the caller should run the task when it was rejected by the thread pool. Is by default true

http://git-wip-us.apache.org/repos/asf/camel/blob/ed56589b/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java b/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
index 1766289..79b20d0 100644
--- a/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java
@@ -213,7 +213,7 @@ public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition
                 timeoutThreadPool = routeContext.getCamelContext().getExecutorServiceManager().newScheduledThreadPool(this,
                         AggregateProcessor.AGGREGATE_TIMEOUT_CHECKER, timeoutCheckerExecutorServiceRef);
                 if (timeoutThreadPool == null) {
-                    throw new IllegalArgumentException("ExecutorServiceRef " + timeoutCheckerExecutorServiceRef + " not found in registry or as a thread pool profile.");
+                    throw new IllegalArgumentException("ExecutorServiceRef " + timeoutCheckerExecutorServiceRef + " not found in registry (as an ScheduledExecutorService instance) or as a thread pool profile.");
                 }
                 shutdownTimeoutThreadPool = true;
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/ed56589b/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java b/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
index 50b777c..62a0a82 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinitionHelper.java
@@ -464,7 +464,7 @@ public final class ProcessorDefinitionHelper {
             // lookup in registry first and use existing thread pool if exists
             ExecutorService answer = lookupExecutorServiceRef(routeContext, name, definition, definition.getExecutorServiceRef());
             if (answer == null) {
-                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry or as a thread pool profile.");
+                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry (as an ExecutorService instance) or as a thread pool profile.");
             }
             return answer;
         } else if (useDefault) {
@@ -546,7 +546,7 @@ public final class ProcessorDefinitionHelper {
         } else if (definition.getExecutorServiceRef() != null) {
             ScheduledExecutorService answer = lookupScheduledExecutorServiceRef(routeContext, name, definition, definition.getExecutorServiceRef());
             if (answer == null) {
-                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry or as a thread pool profile.");
+                throw new IllegalArgumentException("ExecutorServiceRef " + definition.getExecutorServiceRef() + " not found in registry (as an ScheduledExecutorService instance) or as a thread pool profile.");
             }
             return answer;
         } else if (useDefault) {

http://git-wip-us.apache.org/repos/asf/camel/blob/ed56589b/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
index 48d2a02..613d2b3 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java
@@ -176,9 +176,9 @@ public class ThrottleDefinition extends ExpressionNode implements ExecutorServic
     }
 
     /**
-     * Sets the ExecutorService which could be used by throttle definition
+     * To use a custom thread pool (ScheduledExecutorService) by the throttler.
      *
-     * @param executorService  
+     * @param executorService  the custom thread pool (must be scheduled)
      * @return the builder
      */
     public ThrottleDefinition executorService(ExecutorService executorService) {
@@ -187,9 +187,9 @@ public class ThrottleDefinition extends ExpressionNode implements ExecutorServic
     }
 
     /**
-     * Sets the ExecutorService which could be used by throttle definition
+     * To use a custom thread pool (ScheduledExecutorService) by the throttler.
      *
-     * @param executorServiceRef the reference id of the Executor Service  
+     * @param executorServiceRef the reference id of the thread pool (must be scheduled)
      * @return the builder
      */
     public ThrottleDefinition executorServiceRef(String executorServiceRef) {