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 2022/03/18 23:28:47 UTC

[camel] 01/03: Polished

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

commit c101bb68480921bca5390b07fdf95df7dbcec333
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Mar 18 18:33:05 2022 +0100

    Polished
---
 .../org/apache/camel/main/BaseMainSupport.java     | 30 +++++++++++-----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 78cbc66..09f2956 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -108,21 +108,6 @@ public abstract class BaseMainSupport extends BaseService {
         helper = new MainHelper();
     }
 
-    private static CamelSagaService resolveLraSagaService(CamelContext camelContext) throws Exception {
-        // lookup in service registry first
-        CamelSagaService answer = camelContext.getRegistry().findSingleByType(CamelSagaService.class);
-        if (answer == null) {
-            answer = camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
-                    .newInstance("lra-saga-service", CamelSagaService.class)
-                    .orElseThrow(() -> new IllegalArgumentException(
-                            "Cannot find LRASagaService on classpath. Add camel-lra to classpath."));
-
-            // add as service so its discover by saga eip
-            camelContext.addService(answer, true, false);
-        }
-        return answer;
-    }
-
     /**
      * To configure options on Camel Main.
      */
@@ -1472,4 +1457,19 @@ public abstract class BaseMainSupport extends BaseService {
         }
     }
 
+    private static CamelSagaService resolveLraSagaService(CamelContext camelContext) throws Exception {
+        // lookup in service registry first
+        CamelSagaService answer = camelContext.getRegistry().findSingleByType(CamelSagaService.class);
+        if (answer == null) {
+            answer = camelContext.adapt(ExtendedCamelContext.class).getBootstrapFactoryFinder()
+                    .newInstance("lra-saga-service", CamelSagaService.class)
+                    .orElseThrow(() -> new IllegalArgumentException(
+                            "Cannot find LRASagaService on classpath. Add camel-lra to classpath."));
+
+            // add as service so its discover by saga eip
+            camelContext.addService(answer, true, false);
+        }
+        return answer;
+    }
+
 }