ppalaga commented on a change in pull request #226: Use MainSupport as base for running Camel URL: https://github.com/apache/camel-quarkus/pull/226#discussion_r331464787
########## File path: extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java ########## @@ -16,88 +16,98 @@ */ package org.apache.camel.quarkus.core.runtime; -import io.quarkus.arc.runtime.BeanContainerListener; +import java.util.function.Supplier; + +import io.quarkus.arc.runtime.BeanContainer; import io.quarkus.runtime.RuntimeValue; -import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; -import org.apache.camel.RoutesBuilder; -import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime; +import org.apache.camel.CamelContext; +import org.apache.camel.ExtendedCamelContext; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.quarkus.core.runtime.support.FastCamelContext; +import org.apache.camel.quarkus.core.runtime.support.FastModel; +import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry; import org.apache.camel.spi.Registry; +import org.graalvm.nativeimage.ImageInfo; @Recorder public class CamelRecorder { - public RuntimeValue<CamelRuntime> create(Registry registry) { - - FastCamelRuntime fcr = new FastCamelRuntime(); - fcr.setRegistry(registry); - - return new RuntimeValue<>(fcr); - } - - public void init( - RuntimeValue<CamelRuntime> runtime, - CamelConfig.BuildTime buildTimeConfig) { - - FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue(); - fcr.init(buildTimeConfig); + public RuntimeValue<Registry> createRegistry() { + return new RuntimeValue<>(new RuntimeRegistry()); } - public void start( - ShutdownContext shutdown, - RuntimeValue<CamelRuntime> runtime, - CamelConfig.Runtime runtimeConfig) throws Exception { + @SuppressWarnings("unchecked") + public RuntimeValue<CamelContext> createContext(RuntimeValue<Registry> registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) { Review comment: Sorry I meant static init vs. runtime init. It matters for the kinds of resources available inside the method and it gives a hint about ordering. Of course, the info can be looked up in the IDE, but when in a comment, it helps to faster understand the context. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services