public RuntimeValue createContext()

in extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelContextRecorder.java [51:99]


    public RuntimeValue<CamelContext> createContext(
            RuntimeValue<Registry> registry,
            RuntimeValue<TypeConverterRegistry> typeConverterRegistry,
            RuntimeValue<ModelJAXBContextFactory> contextFactory,
            RuntimeValue<ModelToXMLDumper> xmlModelDumper,
            RuntimeValue<ModelToYAMLDumper> yamlModelDumper,
            RuntimeValue<FactoryFinderResolver> factoryFinderResolver,
            RuntimeValue<ComponentNameResolver> componentNameResolver,
            RuntimeValue<PackageScanClassResolver> packageScanClassResolver,
            RuntimeValue<ModelReifierFactory> modelReifierFactory,
            RuntimeValue<Clock> bootClock,
            BeanContainer beanContainer,
            String version,
            CamelConfig config) {

        FastCamelContext context = new FastCamelContext(
                version,
                xmlModelDumper.getValue(),
                yamlModelDumper.getValue());

        context.getClock().add(ContextEvents.BOOT, bootClock.getValue());

        final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        // Set ClassLoader first as some actions depend on it being available
        ExtendedCamelContext extendedCamelContext = context.getCamelContextExtension();
        context.setApplicationContextClassLoader(tccl);
        extendedCamelContext.addContextPlugin(FactoryFinderResolver.class, factoryFinderResolver.getValue());
        extendedCamelContext.addContextPlugin(RuntimeCamelCatalog.class, new CamelRuntimeCatalog(config.runtimeCatalog()));
        //variable repository factory depends on factoryFinder and classLoader, therefore has to be initialized afterwards
        extendedCamelContext.addContextPlugin(VariableRepositoryFactory.class, new DefaultVariableRepositoryFactory(context));
        extendedCamelContext.setRegistry(registry.getValue());

        context.setModelReifierFactory(modelReifierFactory.getValue());

        TypeConverterRegistry typeConverterRegistryValue = typeConverterRegistry.getValue();
        typeConverterRegistryValue.setInjector(new FastTypeConverterInjector(context));
        context.setTypeConverterRegistry(typeConverterRegistryValue);
        context.setLoadTypeConverters(false);

        extendedCamelContext.addContextPlugin(ModelJAXBContextFactory.class, contextFactory.getValue());
        extendedCamelContext.addContextPlugin(PackageScanClassResolver.class, packageScanClassResolver.getValue());
        context.build();
        extendedCamelContext.addContextPlugin(ComponentNameResolver.class, componentNameResolver.getValue());

        // register to the container
        beanContainer.beanInstance(CamelProducers.class).setContext(context);

        return new RuntimeValue<>(context);
    }