protected void initCamelContext()

in core/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java [1279:1416]


    protected void initCamelContext(T context) throws Exception {
        if (getStartupSummaryLevel() != null) {
            context.setStartupSummaryLevel(getStartupSummaryLevel());
        }
        if (getBeanPostProcessorEnabled() != null) {
            CamelBeanPostProcessor cbpp = PluginHelper.getBeanPostProcessor(context);
            if (cbpp != null) {
                cbpp.setEnabled(CamelContextHelper.parseBoolean(context, getBeanPostProcessorEnabled()));
            }
        }
        if (getStreamCache() != null) {
            context.setStreamCaching(CamelContextHelper.parseBoolean(context, getStreamCache()));
        }
        if (getTrace() != null) {
            String text = CamelContextHelper.parseText(context, getTrace());
            if ("standby".equalsIgnoreCase(text)) {
                context.setTracingStandby(true);
            } else {
                context.setTracing(CamelContextHelper.parseBoolean(context, getTrace()));
            }
        }
        if (getTracePattern() != null) {
            context.setTracingPattern(CamelContextHelper.parseText(context, getTracePattern()));
        }
        if (getTraceLoggingFormat() != null) {
            context.setTracingLoggingFormat(CamelContextHelper.parseText(context, getTraceLoggingFormat()));
        }
        if (getBacklogTrace() != null) {
            context.setBacklogTracing(CamelContextHelper.parseBoolean(context, getBacklogTrace()));
        }
        if (getDebug() != null) {
            context.setDebugging(CamelContextHelper.parseBoolean(context, getDebug()));
        }
        if (getMessageHistory() != null) {
            context.setMessageHistory(CamelContextHelper.parseBoolean(context, getMessageHistory()));
        }
        if (getSourceLocationEnabled() != null) {
            context.setSourceLocationEnabled(CamelContextHelper.parseBoolean(context, getSourceLocationEnabled()));
        }
        if (getLogMask() != null) {
            context.setLogMask(CamelContextHelper.parseBoolean(context, getLogMask()));
        }
        if (getLogExhaustedMessageBody() != null) {
            context.setLogExhaustedMessageBody(CamelContextHelper.parseBoolean(context, getLogExhaustedMessageBody()));
        }
        if (getDelayer() != null) {
            context.setDelayer(CamelContextHelper.parseLong(context, getDelayer()));
        }
        if (getErrorHandlerRef() != null) {
            context.getCamelContextExtension()
                    .setErrorHandlerFactory(new RefErrorHandlerDefinition(getErrorHandlerRef()));
        }
        if (getAutoStartup() != null) {
            context.setAutoStartup(CamelContextHelper.parseBoolean(context, getAutoStartup()));
        }
        if (getUseMDCLogging() != null) {
            context.setUseMDCLogging(CamelContextHelper.parseBoolean(context, getUseMDCLogging()));
        }
        if (getMDCLoggingKeysPattern() != null) {
            context.setMDCLoggingKeysPattern(CamelContextHelper.parseText(context, getMDCLoggingKeysPattern()));
        }
        if (getDumpRoutes() != null) {
            context.setDumpRoutes(CamelContextHelper.parseText(context, getDumpRoutes()));
        }
        if (getUseDataType() != null) {
            context.setUseDataType(CamelContextHelper.parseBoolean(context, getUseDataType()));
        }
        if (getUseBreadcrumb() != null) {
            context.setUseBreadcrumb(CamelContextHelper.parseBoolean(context, getUseBreadcrumb()));
        }
        if (getAllowUseOriginalMessage() != null) {
            context.setAllowUseOriginalMessage(CamelContextHelper.parseBoolean(context, getAllowUseOriginalMessage()));
        }
        if (getCaseInsensitiveHeaders() != null) {
            context.setCaseInsensitiveHeaders(CamelContextHelper.parseBoolean(context, getCaseInsensitiveHeaders()));
        }
        if (getAutowiredEnabled() != null) {
            context.setAutowiredEnabled(CamelContextHelper.parseBoolean(context, getAutowiredEnabled()));
        }
        if (getRuntimeEndpointRegistryEnabled() != null) {
            context.getRuntimeEndpointRegistry()
                    .setEnabled(CamelContextHelper.parseBoolean(context, getRuntimeEndpointRegistryEnabled()));
        }
        if (getManagementNamePattern() != null) {
            context.getManagementNameStrategy()
                    .setNamePattern(CamelContextHelper.parseText(context, getManagementNamePattern()));
        }
        if (getThreadNamePattern() != null) {
            context.getExecutorServiceManager()
                    .setThreadNamePattern(CamelContextHelper.parseText(context, getThreadNamePattern()));
        }
        if (getShutdownRoute() != null) {
            context.setShutdownRoute(getShutdownRoute());
        }
        if (getShutdownRunningTask() != null) {
            context.setShutdownRunningTask(getShutdownRunningTask());
        }
        if (getDataFormats() != null) {
            context.setDataFormats(getDataFormats().asMap());
        }
        if (getTransformers() != null) {
            context.setTransformers(getTransformers().getTransformers());
        }
        if (getValidators() != null) {
            context.setValidators(getValidators().getValidators());
        }
        if (getInflightRepositoryBrowseEnabled() != null) {
            context.getInflightRepository()
                    .setInflightBrowseEnabled(CamelContextHelper.parseBoolean(context, getInflightRepositoryBrowseEnabled()));
        }
        if (getRestConfiguration() != null) {
            getRestConfiguration().asRestConfiguration(context, context.getRestConfiguration());
        }
        if (getDefaultServiceCallConfiguration() != null) {
            context.setServiceCallConfiguration(getDefaultServiceCallConfiguration());
        }
        if (getServiceCallConfigurations() != null) {
            for (ServiceCallConfigurationDefinition bean : getServiceCallConfigurations()) {
                context.addServiceCallConfiguration(bean.getId(), bean);
            }
        }
        if (getDefaultResilience4jConfiguration() != null) {
            context.setResilience4jConfiguration(getDefaultResilience4jConfiguration());
        }
        if (getResilience4jConfigurations() != null) {
            for (Resilience4jConfigurationDefinition bean : getResilience4jConfigurations()) {
                context.addResilience4jConfiguration(bean.getId(), bean);
            }
        }
        if (getDefaultFaultToleranceConfiguration() != null) {
            context.setFaultToleranceConfiguration(getDefaultFaultToleranceConfiguration());
        }
        if (getFaultToleranceConfigurations() != null) {
            for (FaultToleranceConfigurationDefinition bean : getFaultToleranceConfigurations()) {
                context.addFaultToleranceConfiguration(bean.getId(), bean);
            }
        }
    }