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 2019/10/06 14:06:20 UTC
[camel-quarkus] 01/02: chore: do not use deprecated methods
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-quarkus.git
commit 8fe41e08db0223dbe076aa91e4ce234884245e0d
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Sun Oct 6 14:14:08 2019 +0200
chore: do not use deprecated methods
---
.../org/apache/camel/quarkus/core/CamelMainRecorder.java | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
index 139ca38..c2d206c 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
@@ -24,7 +24,6 @@ import io.quarkus.runtime.ShutdownContext;
import io.quarkus.runtime.annotations.Recorder;
import org.apache.camel.CamelContext;
import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.MainListener;
import org.apache.camel.model.Model;
import org.apache.camel.support.ResourceHelper;
@@ -62,17 +61,10 @@ public class CamelMainRecorder {
RuntimeValue<CamelMain> main,
RuntimeValue<RoutesBuilder> routesBuilder) {
- RoutesBuilder builder = routesBuilder.getValue();
-
- // TODO: camel main may need to support RoutesBuilder instead of RouteBuilder only
- if (!(builder instanceof RouteBuilder)) {
- throw new IllegalArgumentException("Cannot handle routes builder of type: '" + builder.getClass().getName() + "'");
- }
-
try {
- main.getValue().addRouteBuilder((RouteBuilder)builder);
+ main.getValue().addRoutesBuilder(routesBuilder.getValue());
} catch (Exception e) {
- throw new RuntimeException("Could not add route builder '" + builder.getClass().getName() + "'", e);
+ throw new RuntimeException("Could not add route builder '" + routesBuilder.getValue().getClass().getName() + "'", e);
}
}