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

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

commit 03c92d96a6e35cfaead008b015b93489cde67a34
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat Feb 28 13:16:28 2026 +0100

    CAMEL-23102: camel-jbang - Automatic keep up to date list of Camel 
FactoryFinder as known dependencies
---
 .../platform/http/PlatformHttpPluginRegistry.java  | 25 +++-------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git 
a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpPluginRegistry.java
 
b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpPluginRegistry.java
index 4493687af9ce..fd3c7b63caa8 100644
--- 
a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpPluginRegistry.java
+++ 
b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpPluginRegistry.java
@@ -24,8 +24,8 @@ import java.util.TreeSet;
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.component.platform.http.spi.PlatformHttpPlugin;
-import org.apache.camel.spi.FactoryFinder;
 import org.apache.camel.spi.annotations.JdkService;
+import org.apache.camel.support.ResolverHelper;
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
@@ -41,9 +41,6 @@ public class PlatformHttpPluginRegistry extends ServiceSupport
 
     private static final Logger LOG = 
LoggerFactory.getLogger(PlatformHttpPluginRegistry.class);
 
-    private static final String PLATFORM_HTTP_PLUGIN_FACTORY_PATH
-            = "META-INF/services/org/apache/camel/platform-http/";
-
     private CamelContext camelContext;
     private final Set<PlatformHttpPlugin> plugins = new 
TreeSet<>(Comparator.comparing(PlatformHttpPlugin::getId));
 
@@ -93,24 +90,8 @@ public class PlatformHttpPluginRegistry extends 
ServiceSupport
     }
 
     private PlatformHttpPlugin resolvePluginWithFactoryFinderById(String id) {
-        PlatformHttpPlugin answer = null;
-
-        FactoryFinder factoryFinder
-                = 
getCamelContext().getCamelContextExtension().getBootstrapFactoryFinder(PLATFORM_HTTP_PLUGIN_FACTORY_PATH);
-        Class<?> type = factoryFinder.findOptionalClass(id).orElse(null);
-        if (type != null) {
-            if (PlatformHttpPlugin.class.isAssignableFrom(type)) {
-                answer = (PlatformHttpPlugin) 
camelContext.getInjector().newInstance(type, false);
-                CamelContextAware.trySetCamelContext(answer, camelContext);
-            } else {
-                throw new IllegalArgumentException(
-                        "Resolving platform-http-plugin: " + id
-                                                   + " detected type conflict: 
Not a PlatformHttpPlugin implementation. Found: "
-                                                   + type.getName());
-            }
-        }
-
-        return answer;
+        return ResolverHelper.resolveBootstrapService(camelContext, 
"platform-http/" + id, PlatformHttpPlugin.class)
+                .orElse(null);
     }
 
 }

Reply via email to