This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 6d73e383aef Fixed CS 6d73e383aef is described below commit 6d73e383aef3face63a4c3c3248d9339161cdb44 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri May 13 07:48:32 2022 +0200 Fixed CS --- .../src/main/java/org/apache/camel/main/DownloadThreadPool.java | 3 +++ .../src/main/java/org/apache/camel/main/DownloaderHelper.java | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java index 01108c6206b..da621a190f7 100644 --- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java +++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloadThreadPool.java @@ -25,6 +25,9 @@ import org.apache.camel.util.StopWatch; import org.apache.camel.util.TimeUtils; import org.slf4j.Logger; +/** + * A basic thread pool that run each download task in their own thread, and LOG download activity during download. + */ class DownloadThreadPool { private final ExecutorService executorService = Executors.newCachedThreadPool(); diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloaderHelper.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloaderHelper.java index 66be5d3bd8d..8db2dea2938 100644 --- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloaderHelper.java +++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/DownloaderHelper.java @@ -26,12 +26,15 @@ import org.apache.camel.CamelContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * For downloading dependencies. + */ public final class DownloaderHelper { private static final Logger LOG = LoggerFactory.getLogger(DownloaderHelper.class); private static final String CP = System.getProperty("java.class.path"); - private static final DownloadThreadPool downloader = new DownloadThreadPool(); + private static final DownloadThreadPool DOWNLOAD_THREAD_POOL = new DownloadThreadPool(); private DownloaderHelper() { } @@ -67,7 +70,7 @@ public final class DownloaderHelper { map.put("classifier", ""); String gav = groupId + ":" + artifactId + ":" + version; - downloader.download(LOG, () -> { + DOWNLOAD_THREAD_POOL.download(LOG, () -> { LOG.debug("Downloading: {}", gav); Grape.grab(map); }, gav);