You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2017/02/07 16:33:42 UTC

[5/6] brooklyn-server git commit: Explicitly set shutdown to false for external ExecutorService

Explicitly set shutdown to false for external ExecutorService


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/2a3da72e
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/2a3da72e
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/2a3da72e

Branch: refs/heads/master
Commit: 2a3da72e418d94a7222e8462cf2dd783abba94fa
Parents: d6041d4
Author: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Authored: Mon Feb 6 14:57:53 2017 +0000
Committer: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Committed: Tue Feb 7 12:43:31 2017 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/brooklyn/util/repeat/Repeater.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2a3da72e/utils/common/src/main/java/org/apache/brooklyn/util/repeat/Repeater.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/repeat/Repeater.java b/utils/common/src/main/java/org/apache/brooklyn/util/repeat/Repeater.java
index e2acdc1..0abf0cc 100644
--- a/utils/common/src/main/java/org/apache/brooklyn/util/repeat/Repeater.java
+++ b/utils/common/src/main/java/org/apache/brooklyn/util/repeat/Repeater.java
@@ -159,12 +159,17 @@ public class Repeater implements Callable<Boolean> {
     }
 
     /**
-     * @see #threaded()
+     * Use the passed in {@link ExecutorService executor} to generate threads for every iteration
+     * of the loop. Because the executor is externally managed it will not be
+     * {@link ExecutorService#shutdownNow() shut down} by us when we finish.
+     *
+     * @see {@link #threaded()}
      * @param executor an externally managed {@link ExecutorService} to use when creating threads.
      * @return {@literal this} to aid coding in a fluent style.
      */
     public Repeater threaded(ExecutorService executor) {
         this.executor = executor;
+        this.shutdown = false;
         return this;
     }