You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2021/02/03 20:11:24 UTC

[camel] branch master updated (380cc95 -> b44789a)

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 380cc95  ExpressionClause#initPredicate: Fix race condition in double-checked locking object initialization
     new 787ba04  camel-main: support for true|false for include/exclude patterns
     new b44789a  camel-main: improve DefaultRoutesCollector

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/camel/main/DefaultRoutesCollector.java   | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)


[camel] 01/02: camel-main: support for true|false for include/exclude patterns

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 787ba04056a32b5d0e81f73699a31c1e778fc686
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Wed Feb 3 16:41:04 2021 +0100

    camel-main: support for true|false for include/exclude patterns
---
 .../src/main/java/org/apache/camel/main/DefaultRoutesCollector.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java b/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java
index cbe21d1..9988149 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java
@@ -129,11 +129,15 @@ public class DefaultRoutesCollector implements RoutesCollector {
         StopWatch watch = new StopWatch();
         AtomicInteger count = new AtomicInteger();
 
+        if (ObjectHelper.equal("false", includePattern)) {
+            return answer;
+        }
+
         for (String include : includes) {
             log.debug("Loading additional RoutesBuilder from: {}", include);
             try {
                 for (Resource resource : resolver.findResources(include)) {
-                    if (AntPathMatcher.INSTANCE.anyMatch(excludes, resource.getLocation())) {
+                    if (!"false".equals(excludePattern) && AntPathMatcher.INSTANCE.anyMatch(excludes, resource.getLocation())) {
                         continue;
                     }
 


[camel] 02/02: camel-main: improve DefaultRoutesCollector

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b44789aca7ab4a573be72f03a9a34f68a7ac8aa0
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Wed Feb 3 17:19:26 2021 +0100

    camel-main: improve DefaultRoutesCollector
---
 .../java/org/apache/camel/main/DefaultRoutesCollector.java    | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java b/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java
index 9988149..198697f 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/DefaultRoutesCollector.java
@@ -141,11 +141,16 @@ public class DefaultRoutesCollector implements RoutesCollector {
                         continue;
                     }
 
-                    log.debug("Found route builder from location: {}", include);
-                    ecc.getRoutesLoader().findRoutesBuilders(resource).forEach(builder -> {
+                    Collection<RoutesBuilder> builders = ecc.getRoutesLoader().findRoutesBuilders(resource);
+                    if (builders.isEmpty()) {
+                        continue;
+                    }
+
+                    log.debug("Found {} route builder from location: {}", builders.size(), include);
+                    for (RoutesBuilder builder : builders) {
                         answer.add(builder);
                         count.incrementAndGet();
-                    });
+                    }
                 }
             } catch (FileNotFoundException e) {
                 log.debug("No RoutesBuilder found in {}. Skipping detection.", include);