001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.camel.spring.xml;
018
019import java.util.ArrayList;
020import java.util.List;
021import java.util.Map;
022
023import javax.xml.bind.annotation.XmlAccessType;
024import javax.xml.bind.annotation.XmlAccessorType;
025import javax.xml.bind.annotation.XmlAttribute;
026import javax.xml.bind.annotation.XmlElement;
027import javax.xml.bind.annotation.XmlElements;
028import javax.xml.bind.annotation.XmlRootElement;
029import javax.xml.bind.annotation.XmlTransient;
030
031import org.apache.camel.CamelContext;
032import org.apache.camel.LoggingLevel;
033import org.apache.camel.RoutesBuilder;
034import org.apache.camel.RuntimeCamelException;
035import org.apache.camel.ShutdownRoute;
036import org.apache.camel.ShutdownRunningTask;
037import org.apache.camel.StartupSummaryLevel;
038import org.apache.camel.TypeConverterExists;
039import org.apache.camel.builder.RouteBuilder;
040import org.apache.camel.component.properties.PropertiesComponent;
041import org.apache.camel.core.xml.AbstractCamelContextFactoryBean;
042import org.apache.camel.core.xml.AbstractCamelFactoryBean;
043import org.apache.camel.core.xml.CamelJMXAgentDefinition;
044import org.apache.camel.core.xml.CamelPropertyPlaceholderDefinition;
045import org.apache.camel.core.xml.CamelRouteControllerDefinition;
046import org.apache.camel.core.xml.CamelStreamCachingStrategyDefinition;
047import org.apache.camel.model.ContextScanDefinition;
048import org.apache.camel.model.FaultToleranceConfigurationDefinition;
049import org.apache.camel.model.GlobalOptionsDefinition;
050import org.apache.camel.model.InterceptDefinition;
051import org.apache.camel.model.InterceptFromDefinition;
052import org.apache.camel.model.InterceptSendToEndpointDefinition;
053import org.apache.camel.model.OnCompletionDefinition;
054import org.apache.camel.model.OnExceptionDefinition;
055import org.apache.camel.model.PackageScanDefinition;
056import org.apache.camel.model.Resilience4jConfigurationDefinition;
057import org.apache.camel.model.RestContextRefDefinition;
058import org.apache.camel.model.RouteBuilderDefinition;
059import org.apache.camel.model.RouteConfigurationContextRefDefinition;
060import org.apache.camel.model.RouteConfigurationDefinition;
061import org.apache.camel.model.RouteContextRefDefinition;
062import org.apache.camel.model.RouteDefinition;
063import org.apache.camel.model.RouteTemplateContextRefDefinition;
064import org.apache.camel.model.RouteTemplateDefinition;
065import org.apache.camel.model.TemplatedRouteDefinition;
066import org.apache.camel.model.ThreadPoolProfileDefinition;
067import org.apache.camel.model.cloud.ServiceCallConfigurationDefinition;
068import org.apache.camel.model.dataformat.DataFormatsDefinition;
069import org.apache.camel.model.rest.RestConfigurationDefinition;
070import org.apache.camel.model.rest.RestDefinition;
071import org.apache.camel.model.transformer.TransformersDefinition;
072import org.apache.camel.model.validator.ValidatorsDefinition;
073import org.apache.camel.spi.Metadata;
074import org.apache.camel.spi.PackageScanFilter;
075import org.apache.camel.spi.Registry;
076import org.apache.camel.spring.SpringCamelContext;
077import org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer;
078import org.apache.camel.support.CamelContextHelper;
079import org.apache.camel.util.StopWatch;
080import org.slf4j.Logger;
081import org.slf4j.LoggerFactory;
082import org.springframework.beans.factory.DisposableBean;
083import org.springframework.beans.factory.FactoryBean;
084import org.springframework.beans.factory.InitializingBean;
085import org.springframework.beans.factory.config.BeanPostProcessor;
086import org.springframework.context.ApplicationContext;
087import org.springframework.context.ApplicationContextAware;
088import org.springframework.context.ApplicationListener;
089import org.springframework.context.Lifecycle;
090import org.springframework.context.Phased;
091import org.springframework.context.event.ContextRefreshedEvent;
092import org.springframework.core.Ordered;
093
094import static org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException;
095
096/**
097 * CamelContext using XML configuration.
098 */
099@Metadata(label = "spring,configuration")
100@XmlRootElement(name = "camelContext")
101@XmlAccessorType(XmlAccessType.FIELD)
102public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<SpringCamelContext>
103        implements FactoryBean<SpringCamelContext>, InitializingBean, DisposableBean, ApplicationContextAware, Lifecycle,
104        Phased, ApplicationListener<ContextRefreshedEvent>, Ordered {
105
106    private static final Logger LOG = LoggerFactory.getLogger(CamelContextFactoryBean.class);
107
108    @XmlAttribute(name = "depends-on")
109    @Metadata(displayName = "Depends On")
110    private String dependsOn;
111    @XmlAttribute
112    @Metadata(defaultValue = "Default")
113    private StartupSummaryLevel startupSummaryLevel;
114    @XmlAttribute
115    private String trace;
116    @XmlAttribute
117    private String backlogTrace;
118    @XmlAttribute
119    private String tracePattern;
120    @XmlAttribute
121    private String traceLoggingFormat;
122    @XmlAttribute
123    private String debug;
124    @XmlAttribute
125    @Metadata(defaultValue = "false")
126    private String messageHistory;
127    @XmlAttribute
128    @Metadata(defaultValue = "false")
129    private String sourceLocationEnabled;
130    @XmlAttribute
131    @Metadata(defaultValue = "false")
132    private String logMask;
133    @XmlAttribute
134    private String logExhaustedMessageBody;
135    @XmlAttribute
136    private String streamCache;
137    @XmlAttribute
138    private String delayer;
139    @XmlAttribute
140    private String errorHandlerRef;
141    @XmlAttribute
142    @Metadata(defaultValue = "true")
143    private String autoStartup;
144    @XmlAttribute
145    @Metadata(defaultValue = "true")
146    private String shutdownEager;
147    @XmlAttribute
148    @Metadata(defaultValue = "false")
149    private String dumpRoutes;
150    @XmlAttribute
151    @Metadata(displayName = "Use MDC Logging")
152    private String useMDCLogging;
153    @XmlAttribute
154    @Metadata(displayName = "MDC Logging Keys Pattern")
155    private String mdcLoggingKeysPattern;
156    @XmlAttribute
157    private String useDataType;
158    @XmlAttribute
159    private String useBreadcrumb;
160    @XmlAttribute
161    @Metadata(defaultValue = "true")
162    private String beanPostProcessorEnabled;
163    @XmlAttribute
164    private String allowUseOriginalMessage;
165    @XmlAttribute
166    private String caseInsensitiveHeaders;
167    @XmlAttribute
168    private String autowiredEnabled;
169    @XmlAttribute
170    private String runtimeEndpointRegistryEnabled;
171    @XmlAttribute
172    @Metadata(defaultValue = "#name#")
173    private String managementNamePattern;
174    @XmlAttribute
175    @Metadata(defaultValue = "Camel (#camelId#) thread ##counter# - #name#")
176    private String threadNamePattern;
177    @XmlAttribute
178    @Metadata(defaultValue = "Default")
179    private ShutdownRoute shutdownRoute;
180    @XmlAttribute
181    @Metadata(defaultValue = "CompleteCurrentTaskOnly")
182    private ShutdownRunningTask shutdownRunningTask;
183    @XmlAttribute
184    @Metadata(defaultValue = "false")
185    private String loadTypeConverters;
186    @XmlAttribute
187    private String typeConverterStatisticsEnabled;
188    @XmlAttribute
189    @Metadata(defaultValue = "false")
190    private String loadHealthChecks;
191    @XmlAttribute
192    private String inflightRepositoryBrowseEnabled;
193    @XmlAttribute
194    @Metadata(defaultValue = "Ignore")
195    private TypeConverterExists typeConverterExists;
196    @XmlAttribute
197    @Metadata(defaultValue = "DEBUG")
198    private LoggingLevel typeConverterExistsLoggingLevel;
199    @XmlElement(name = "globalOptions")
200    private GlobalOptionsDefinition globalOptions;
201    @XmlElement(name = "propertyPlaceholder", type = CamelPropertyPlaceholderDefinition.class)
202    private CamelPropertyPlaceholderDefinition camelPropertyPlaceholder;
203    @XmlElement(name = "package")
204    private String[] packages = {};
205    @XmlElement(name = "packageScan", type = PackageScanDefinition.class)
206    private PackageScanDefinition packageScan;
207    @XmlElement(name = "contextScan", type = ContextScanDefinition.class)
208    private ContextScanDefinition contextScan;
209    @XmlElement(name = "streamCaching", type = CamelStreamCachingStrategyDefinition.class)
210    private CamelStreamCachingStrategyDefinition camelStreamCachingStrategy;
211    @XmlElement(name = "jmxAgent", type = CamelJMXAgentDefinition.class)
212    @Metadata(displayName = "JMX Agent")
213    private CamelJMXAgentDefinition camelJMXAgent;
214    @XmlElement(name = "routeController", type = CamelRouteControllerDefinition.class)
215    private CamelRouteControllerDefinition camelRouteController;
216    @XmlElements({
217            @XmlElement(name = "template", type = CamelProducerTemplateFactoryBean.class),
218            @XmlElement(name = "fluentTemplate", type = CamelFluentProducerTemplateFactoryBean.class),
219            @XmlElement(name = "consumerTemplate", type = CamelConsumerTemplateFactoryBean.class) })
220    private List<AbstractCamelFactoryBean<?>> beansFactory;
221    @XmlElements({
222            @XmlElement(name = "errorHandler", type = SpringErrorHandlerDefinition.class) })
223    private List<?> beans;
224    @XmlElement(name = "defaultServiceCallConfiguration")
225    private ServiceCallConfigurationDefinition defaultServiceCallConfiguration;
226    @XmlElement(name = "serviceCallConfiguration", type = ServiceCallConfigurationDefinition.class)
227    private List<ServiceCallConfigurationDefinition> serviceCallConfigurations;
228    @XmlElement(name = "defaultResilience4jConfiguration")
229    private Resilience4jConfigurationDefinition defaultResilience4jConfiguration;
230    @XmlElement(name = "resilience4jConfiguration", type = Resilience4jConfigurationDefinition.class)
231    private List<Resilience4jConfigurationDefinition> resilience4jConfigurations;
232    @XmlElement(name = "defaultFaultToleranceConfiguration")
233    private FaultToleranceConfigurationDefinition defaultFaultToleranceConfiguration;
234    @XmlElement(name = "faultToleranceConfiguration", type = Resilience4jConfigurationDefinition.class)
235    private List<FaultToleranceConfigurationDefinition> faultToleranceConfigurations;
236    @XmlElement(name = "routeConfigurationContextRef")
237    private List<RouteConfigurationContextRefDefinition> routeConfigurationRefs = new ArrayList<>();
238    @XmlElement(name = "routeTemplateContextRef")
239    private List<RouteTemplateContextRefDefinition> routeTemplateRefs = new ArrayList<>();
240    @XmlElement(name = "routeBuilder")
241    private List<RouteBuilderDefinition> builderRefs = new ArrayList<>();
242    @XmlElement(name = "routeContextRef")
243    private List<RouteContextRefDefinition> routeRefs = new ArrayList<>();
244    @XmlElement(name = "restContextRef")
245    private List<RestContextRefDefinition> restRefs = new ArrayList<>();
246    @XmlElement(name = "threadPoolProfile")
247    private List<ThreadPoolProfileDefinition> threadPoolProfiles;
248    @XmlElement(name = "threadPool")
249    private List<CamelThreadPoolFactoryBean> threadPools;
250    @XmlElement(name = "endpoint")
251    private List<CamelEndpointFactoryBean> endpoints;
252    @XmlElement(name = "dataFormats")
253    private DataFormatsDefinition dataFormats;
254    @XmlElement(name = "transformers")
255    private TransformersDefinition transformers;
256    @XmlElement(name = "validators")
257    private ValidatorsDefinition validators;
258    @XmlElement(name = "redeliveryPolicyProfile")
259    private List<CamelRedeliveryPolicyFactoryBean> redeliveryPolicies;
260    @XmlElement(name = "onException")
261    private List<OnExceptionDefinition> onExceptions = new ArrayList<>();
262    @XmlElement(name = "onCompletion")
263    private List<OnCompletionDefinition> onCompletions = new ArrayList<>();
264    @XmlElement(name = "intercept")
265    private List<InterceptDefinition> intercepts = new ArrayList<>();
266    @XmlElement(name = "interceptFrom")
267    private List<InterceptFromDefinition> interceptFroms = new ArrayList<>();
268    @XmlElement(name = "interceptSendToEndpoint")
269    private List<InterceptSendToEndpointDefinition> interceptSendToEndpoints = new ArrayList<>();
270    @XmlElement(name = "restConfiguration")
271    private RestConfigurationDefinition restConfiguration;
272    @XmlElement(name = "rest")
273    private List<RestDefinition> rests = new ArrayList<>();
274    @XmlElement(name = "routeConfiguration")
275    private List<RouteConfigurationDefinition> routeConfigurations = new ArrayList<>();
276    @XmlElement(name = "routeTemplate")
277    private List<RouteTemplateDefinition> routeTemplates = new ArrayList<>();
278    @XmlElement(name = "templatedRoute")
279    private List<TemplatedRouteDefinition> templatedRoutes = new ArrayList<>();
280    @XmlElement(name = "route")
281    private List<RouteDefinition> routes = new ArrayList<>();
282    @XmlTransient
283    private SpringCamelContext context;
284    @XmlTransient
285    private ClassLoader contextClassLoaderOnStart;
286    @XmlTransient
287    private ApplicationContext applicationContext;
288    @XmlTransient
289    private BeanPostProcessor beanPostProcessor;
290    @XmlTransient
291    private boolean implicitId;
292
293    @Override
294    public Class<SpringCamelContext> getObjectType() {
295        return SpringCamelContext.class;
296    }
297
298    @Override
299    protected <S> S getBeanForType(Class<S> clazz) {
300        S bean = null;
301        String[] names = getApplicationContext().getBeanNamesForType(clazz, true, true);
302        if (names.length == 1) {
303            bean = getApplicationContext().getBean(names[0], clazz);
304        }
305        if (bean == null) {
306            ApplicationContext parentContext = getApplicationContext().getParent();
307            if (parentContext != null) {
308                names = parentContext.getBeanNamesForType(clazz, true, true);
309                if (names.length == 1) {
310                    bean = parentContext.getBean(names[0], clazz);
311                }
312            }
313        }
314        return bean;
315    }
316
317    @Override
318    protected void findRouteBuildersByPackageScan(String[] packages, PackageScanFilter filter, List<RoutesBuilder> builders)
319            throws Exception {
320        // add filter to class resolver which then will filter
321        getContext().getPackageScanClassResolver().addFilter(filter);
322
323        PackageScanRouteBuilderFinder finder = new PackageScanRouteBuilderFinder(
324                getContext(), packages, getContextClassLoaderOnStart(),
325                getBeanPostProcessor(), getContext().getPackageScanClassResolver());
326        finder.appendBuilders(builders);
327
328        // and remove the filter
329        getContext().getPackageScanClassResolver().removeFilter(filter);
330    }
331
332    @Override
333    protected void findRouteBuildersByContextScan(
334            PackageScanFilter filter, boolean includeNonSingletons, List<RoutesBuilder> builders)
335            throws Exception {
336        ContextScanRouteBuilderFinder finder = new ContextScanRouteBuilderFinder(getContext(), filter, includeNonSingletons);
337        finder.appendBuilders(builders);
338    }
339
340    @Override
341    protected void initBeanPostProcessor(SpringCamelContext context) {
342        if (beanPostProcessor != null) {
343            if (beanPostProcessor instanceof ApplicationContextAware) {
344                ((ApplicationContextAware) beanPostProcessor).setApplicationContext(applicationContext);
345            }
346            if (beanPostProcessor instanceof CamelBeanPostProcessor) {
347                ((CamelBeanPostProcessor) beanPostProcessor).setCamelContext(getContext());
348            }
349            // register the bean post processor on camel context
350            if (beanPostProcessor instanceof org.apache.camel.spi.CamelBeanPostProcessor) {
351                context.setBeanPostProcessor((org.apache.camel.spi.CamelBeanPostProcessor) beanPostProcessor);
352            }
353        }
354    }
355
356    @Override
357    protected void postProcessBeforeInit(RouteBuilder builder) {
358        if (beanPostProcessor != null) {
359            // Inject the annotated resource
360            beanPostProcessor.postProcessBeforeInitialization(builder, builder.toString());
361        }
362    }
363
364    @Override
365    public void afterPropertiesSet() throws Exception {
366        StopWatch watch = new StopWatch();
367
368        super.afterPropertiesSet();
369
370        Boolean shutdownEager = CamelContextHelper.parseBoolean(getContext(), getShutdownEager());
371        if (shutdownEager != null) {
372            LOG.debug("Using shutdownEager: {}", shutdownEager);
373            getContext().setShutdownEager(shutdownEager);
374        }
375
376        LOG.debug("afterPropertiesSet() took {} millis", watch.taken());
377    }
378
379    @Override
380    protected void initCustomRegistry(SpringCamelContext context) {
381        Registry registry = getBeanForType(Registry.class);
382        if (registry != null) {
383            LOG.info("Using custom Registry: {}", registry);
384            context.setRegistry(registry);
385        }
386    }
387
388    @Override
389    protected void initPropertyPlaceholder() throws Exception {
390        super.initPropertyPlaceholder();
391
392        Map<String, BridgePropertyPlaceholderConfigurer> beans
393                = applicationContext.getBeansOfType(BridgePropertyPlaceholderConfigurer.class);
394        if (beans.size() == 1) {
395            // setup properties component that uses this beans
396            BridgePropertyPlaceholderConfigurer configurer = beans.values().iterator().next();
397            String id = beans.keySet().iterator().next();
398            LOG.info("Bridging Camel and Spring property placeholder configurer with id: {}", id);
399
400            // get properties component
401            PropertiesComponent pc = (PropertiesComponent) getContext().getPropertiesComponent();
402            // use the spring system properties mode which has a different value than Camel may have
403            pc.setSystemPropertiesMode(configurer.getSystemPropertiesMode());
404
405            // replace existing resolver with us
406            configurer.setParser(pc.getPropertiesParser());
407            // use the bridge to handle the resolve and parsing
408            pc.setPropertiesParser(configurer);
409            // use the bridge as property source
410            pc.addPropertiesSource(configurer);
411
412        } else if (beans.size() > 1) {
413            LOG.warn(
414                    "Cannot bridge Camel and Spring property placeholders, as exact only 1 bean of type BridgePropertyPlaceholderConfigurer"
415                     + " must be defined, was {} beans defined.",
416                    beans.size());
417        }
418    }
419
420    @Override
421    public void start() {
422        try {
423            setupRoutes();
424        } catch (Exception e) {
425            throw wrapRuntimeCamelException(e);
426        }
427        // when the routes are setup we need to start the Camel context
428        context.start();
429    }
430
431    @Override
432    public void stop() {
433        if (context != null) {
434            context.stop();
435        }
436    }
437
438    @Override
439    public boolean isRunning() {
440        return context != null && context.isRunning();
441    }
442
443    @Override
444    public int getPhase() {
445        // the factory starts the context from
446        // onApplicationEvent(ContextRefreshedEvent) so the phase we're
447        // in only influences when the context is to be stopped, and
448        // we want the CamelContext to be first in line to get stopped
449        // if we wanted the phase to be considered while starting, we
450        // would need to implement SmartLifecycle (see
451        // DefaultLifecycleProcessor::startBeans)
452        // we use LOWEST_PRECEDENCE here as this is taken into account
453        // only when stopping and then in reversed order
454        return LOWEST_PRECEDENCE - 1;
455    }
456
457    @Override
458    public int getOrder() {
459        // CamelContextFactoryBean implements Ordered so that it's the 
460        // second to last in ApplicationListener to receive events,
461        // SpringCamelContext should be the last one, this is important
462        // for startup as we want all resources to be ready and all
463        // routes added to the context (see setupRoutes() and
464        // org.apache.camel.spring.boot.RoutesCollector)
465        return LOWEST_PRECEDENCE - 1;
466    }
467
468    @Override
469    public void onApplicationEvent(final ContextRefreshedEvent event) {
470        // start the CamelContext when the Spring ApplicationContext is
471        // done initializing, as the last step in ApplicationContext
472        // being started/refreshed, there could be a race condition with
473        // other ApplicationListeners that react to
474        // ContextRefreshedEvent but this is the best that we can do
475        if (event.getSource() instanceof ApplicationContext) {
476            ApplicationContext appCtx = (ApplicationContext) event.getSource();
477            if (appCtx.getId().endsWith(":management")) {
478                //don't start camel context if
479                //event is from the self management ApplicationContext
480                return;
481            }
482        }
483        start();
484    }
485
486    // Properties
487    // -------------------------------------------------------------------------
488
489    public ApplicationContext getApplicationContext() {
490        if (applicationContext == null) {
491            throw new IllegalArgumentException("No applicationContext has been injected!");
492        }
493        return applicationContext;
494    }
495
496    @Override
497    public void setApplicationContext(ApplicationContext applicationContext) {
498        this.applicationContext = applicationContext;
499    }
500
501    public void setBeanPostProcessor(BeanPostProcessor postProcessor) {
502        this.beanPostProcessor = postProcessor;
503    }
504
505    public BeanPostProcessor getBeanPostProcessor() {
506        return beanPostProcessor;
507    }
508
509    // Implementation methods
510    // -------------------------------------------------------------------------
511
512    /**
513     * Create the context
514     */
515    protected SpringCamelContext createContext() {
516        SpringCamelContext ctx = newCamelContext();
517        ctx.setApplicationContext(getApplicationContext());
518        ctx.setName(getId());
519
520        return ctx;
521    }
522
523    /**
524     * Apply additional configuration to the context
525     */
526    protected void configure(SpringCamelContext ctx) {
527        try {
528            // allow any custom configuration, such as when running in camel-spring-boot
529            if (applicationContext.containsBean("xmlCamelContextConfigurer")) {
530                XmlCamelContextConfigurer configurer
531                        = applicationContext.getBean("xmlCamelContextConfigurer", XmlCamelContextConfigurer.class);
532                if (configurer != null) {
533                    configurer.configure(applicationContext, ctx);
534                }
535            }
536        } catch (Exception e) {
537            // error during configuration
538            throw RuntimeCamelException.wrapRuntimeCamelException(e);
539        }
540    }
541
542    protected SpringCamelContext newCamelContext() {
543        return new SpringCamelContext();
544    }
545
546    @Override
547    public SpringCamelContext getContext(boolean create) {
548        if (context == null && create) {
549            context = createContext();
550            configure(context);
551            context.build();
552        }
553        return context;
554    }
555
556    public void setContext(SpringCamelContext context) {
557        this.context = context;
558    }
559
560    @Override
561    public List<RouteDefinition> getRoutes() {
562        return routes;
563    }
564
565    /**
566     * Contains the Camel routes
567     */
568    @Override
569    public void setRoutes(List<RouteDefinition> routes) {
570        this.routes = routes;
571    }
572
573    @Override
574    public List<RouteConfigurationDefinition> getRouteConfigurations() {
575        return routeConfigurations;
576    }
577
578    /**
579     * Contains the Camel route configurations
580     */
581    @Override
582    public void setRouteConfigurations(List<RouteConfigurationDefinition> routeConfigurations) {
583        this.routeConfigurations = routeConfigurations;
584    }
585
586    @Override
587    public List<RouteTemplateDefinition> getRouteTemplates() {
588        return routeTemplates;
589    }
590
591    /**
592     * Contains the Camel route templates
593     */
594    @Override
595    public void setRouteTemplates(List<RouteTemplateDefinition> routeTemplates) {
596        this.routeTemplates = routeTemplates;
597    }
598
599    @Override
600    public List<TemplatedRouteDefinition> getTemplatedRoutes() {
601        return templatedRoutes;
602    }
603
604    /**
605     * Contains the Camel templated routes
606     */
607    @Override
608    public void setTemplatedRoutes(List<TemplatedRouteDefinition> templatedRoutes) {
609        this.templatedRoutes = templatedRoutes;
610    }
611
612    @Override
613    public List<RestDefinition> getRests() {
614        return rests;
615    }
616
617    /**
618     * Contains the rest services defined using the rest-dsl
619     */
620    @Override
621    public void setRests(List<RestDefinition> rests) {
622        this.rests = rests;
623    }
624
625    @Override
626    public RestConfigurationDefinition getRestConfiguration() {
627        return restConfiguration;
628    }
629
630    /**
631     * Configuration for rest-dsl
632     */
633    public void setRestConfiguration(RestConfigurationDefinition restConfiguration) {
634        this.restConfiguration = restConfiguration;
635    }
636
637    @Override
638    public List<CamelEndpointFactoryBean> getEndpoints() {
639        return endpoints;
640    }
641
642    /**
643     * Configuration of endpoints
644     */
645    public void setEndpoints(List<CamelEndpointFactoryBean> endpoints) {
646        this.endpoints = endpoints;
647    }
648
649    @Override
650    public List<CamelRedeliveryPolicyFactoryBean> getRedeliveryPolicies() {
651        return redeliveryPolicies;
652    }
653
654    @Override
655    public List<InterceptDefinition> getIntercepts() {
656        return intercepts;
657    }
658
659    /**
660     * Configuration of interceptors.
661     */
662    public void setIntercepts(List<InterceptDefinition> intercepts) {
663        this.intercepts = intercepts;
664    }
665
666    @Override
667    public List<InterceptFromDefinition> getInterceptFroms() {
668        return interceptFroms;
669    }
670
671    /**
672     * Configuration of interceptors that triggers from the beginning of routes.
673     */
674    public void setInterceptFroms(List<InterceptFromDefinition> interceptFroms) {
675        this.interceptFroms = interceptFroms;
676    }
677
678    @Override
679    public List<InterceptSendToEndpointDefinition> getInterceptSendToEndpoints() {
680        return interceptSendToEndpoints;
681    }
682
683    /**
684     * Configuration of interceptors that triggers sending messages to endpoints.
685     */
686    public void setInterceptSendToEndpoints(List<InterceptSendToEndpointDefinition> interceptSendToEndpoints) {
687        this.interceptSendToEndpoints = interceptSendToEndpoints;
688    }
689
690    @Override
691    public GlobalOptionsDefinition getGlobalOptions() {
692        return globalOptions;
693    }
694
695    /**
696     * Configuration of CamelContext properties such as limit of debug logging and other general options.
697     */
698    public void setGlobalOptions(GlobalOptionsDefinition globalOptions) {
699        this.globalOptions = globalOptions;
700    }
701
702    @Override
703    public String[] getPackages() {
704        return packages;
705    }
706
707    /**
708     * Sets the package names to be recursively searched for Java classes which extend
709     * {@link org.apache.camel.builder.RouteBuilder} to be auto-wired up to the {@link CamelContext} as a route. Note
710     * that classes are excluded if they are specifically configured in the spring.xml
711     * <p/>
712     * A more advanced configuration can be done using
713     * {@link #setPackageScan(org.apache.camel.model.PackageScanDefinition)}
714     *
715     * @param packages the package names which are recursively searched
716     * @see            #setPackageScan(org.apache.camel.model.PackageScanDefinition)
717     */
718    public void setPackages(String[] packages) {
719        this.packages = packages;
720    }
721
722    @Override
723    public PackageScanDefinition getPackageScan() {
724        return packageScan;
725    }
726
727    /**
728     * Sets the package scanning information. Package scanning allows for the automatic discovery of certain camel
729     * classes at runtime for inclusion e.g. {@link org.apache.camel.builder.RouteBuilder} implementations
730     *
731     * @param packageScan the package scan
732     */
733    @Override
734    public void setPackageScan(PackageScanDefinition packageScan) {
735        this.packageScan = packageScan;
736    }
737
738    @Override
739    public ContextScanDefinition getContextScan() {
740        return contextScan;
741    }
742
743    /**
744     * Sets the context scanning (eg Spring's ApplicationContext) information. Context scanning allows for the automatic
745     * discovery of Camel routes runtime for inclusion e.g. {@link org.apache.camel.builder.RouteBuilder}
746     * implementations
747     *
748     * @param contextScan the context scan
749     */
750    @Override
751    public void setContextScan(ContextScanDefinition contextScan) {
752        this.contextScan = contextScan;
753    }
754
755    @Override
756    public CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder() {
757        return camelPropertyPlaceholder;
758    }
759
760    /**
761     * Configuration of property placeholder
762     */
763    public void setCamelPropertyPlaceholder(CamelPropertyPlaceholderDefinition camelPropertyPlaceholder) {
764        this.camelPropertyPlaceholder = camelPropertyPlaceholder;
765    }
766
767    @Override
768    public CamelStreamCachingStrategyDefinition getCamelStreamCachingStrategy() {
769        return camelStreamCachingStrategy;
770    }
771
772    /**
773     * Configuration of stream caching.
774     */
775    public void setCamelStreamCachingStrategy(CamelStreamCachingStrategyDefinition camelStreamCachingStrategy) {
776        this.camelStreamCachingStrategy = camelStreamCachingStrategy;
777    }
778
779    @Override
780    public CamelRouteControllerDefinition getCamelRouteController() {
781        return camelRouteController;
782    }
783
784    /**
785     * Configuration of route controller.
786     */
787    public void setCamelRouteController(CamelRouteControllerDefinition camelRouteController) {
788        this.camelRouteController = camelRouteController;
789    }
790
791    /**
792     * Configuration of JMX Agent.
793     */
794    public void setCamelJMXAgent(CamelJMXAgentDefinition agent) {
795        camelJMXAgent = agent;
796    }
797
798    @Override
799    public String getTrace() {
800        return trace;
801    }
802
803    /**
804     * Sets whether tracing is enabled or not.
805     *
806     * To use tracing then this must be enabled on startup to be installed in the CamelContext.
807     */
808    public void setTrace(String trace) {
809        this.trace = trace;
810    }
811
812    public StartupSummaryLevel getStartupSummaryLevel() {
813        return startupSummaryLevel;
814    }
815
816    /**
817     * Controls the level of information logged during startup (and shutdown) of CamelContext.
818     */
819    public void setStartupSummaryLevel(StartupSummaryLevel startupSummaryLevel) {
820        this.startupSummaryLevel = startupSummaryLevel;
821    }
822
823    @Override
824    public String getBacklogTrace() {
825        return backlogTrace;
826    }
827
828    /**
829     * Sets whether backlog tracing is enabled or not.
830     *
831     * To use backlog tracing then this must be enabled on startup to be installed in the CamelContext.
832     */
833    public void setBacklogTrace(String backlogTrace) {
834        this.backlogTrace = backlogTrace;
835    }
836
837    @Override
838    public String getDebug() {
839        return debug;
840    }
841
842    /**
843     * Sets whether debugging is enabled or not.
844     *
845     * To use debugging then this must be enabled on startup to be installed in the CamelContext.
846     */
847    public void setDebug(String debug) {
848        this.debug = debug;
849    }
850
851    @Override
852    public String getTracePattern() {
853        return tracePattern;
854    }
855
856    /**
857     * Tracing pattern to match which node EIPs to trace. For example to match all To EIP nodes, use to*. The pattern
858     * matches by node and route id's Multiple patterns can be separated by comma.
859     */
860    public void setTracePattern(String tracePattern) {
861        this.tracePattern = tracePattern;
862    }
863
864    @Override
865    public String getTraceLoggingFormat() {
866        return traceLoggingFormat;
867    }
868
869    /**
870     * To use a custom tracing logging format.
871     *
872     * The default format (arrow, routeId, label) is: %-4.4s [%-12.12s] [%-33.33s]
873     */
874    public void setTraceLoggingFormat(String traceLoggingFormat) {
875        this.traceLoggingFormat = traceLoggingFormat;
876    }
877
878    @Override
879    public String getMessageHistory() {
880        return messageHistory;
881    }
882
883    /**
884     * Sets whether message history is enabled or not.
885     */
886    public void setMessageHistory(String messageHistory) {
887        this.messageHistory = messageHistory;
888    }
889
890    @Override
891    public String getSourceLocationEnabled() {
892        return sourceLocationEnabled;
893    }
894
895    /**
896     * Whether to capture precise source location:line-number for all EIPs in Camel routes.
897     *
898     * Enabling this will impact parsing Java based routes (also Groovy, Kotlin, etc.) on startup as this uses JDK
899     * StackTraceElement to calculate the location from the Camel route, which comes with a performance cost. This only
900     * impact startup, not the performance of the routes at runtime.
901     */
902    public void setSourceLocationEnabled(String sourceLocationEnabled) {
903        this.sourceLocationEnabled = sourceLocationEnabled;
904    }
905
906    @Override
907    public String getLogMask() {
908        return logMask;
909    }
910
911    /**
912     * Sets whether security mask for Logging is enabled or not.
913     */
914    public void setLogMask(String logMask) {
915        this.logMask = logMask;
916    }
917
918    @Override
919    public String getLogExhaustedMessageBody() {
920        return logExhaustedMessageBody;
921    }
922
923    /**
924     * Sets whether to log exhausted message body with message history.
925     */
926    public void setLogExhaustedMessageBody(String logExhaustedMessageBody) {
927        this.logExhaustedMessageBody = logExhaustedMessageBody;
928    }
929
930    @Override
931    public String getStreamCache() {
932        return streamCache;
933    }
934
935    /**
936     * Sets whether stream caching is enabled or not.
937     */
938    public void setStreamCache(String streamCache) {
939        this.streamCache = streamCache;
940    }
941
942    @Override
943    public String getDelayer() {
944        return delayer;
945    }
946
947    /**
948     * Sets a delay value in millis that a message is delayed at every step it takes in the route path, slowing the
949     * process down to better observe what is occurring
950     */
951    public void setDelayer(String delayer) {
952        this.delayer = delayer;
953    }
954
955    @Override
956    public String getAutoStartup() {
957        return autoStartup;
958    }
959
960    /**
961     * Sets whether the object should automatically start when Camel starts.
962     * <p/>
963     * <b>Important:</b> Currently only routes can be disabled, as {@link CamelContext}s are always started. <br/>
964     * <b>Note:</b> When setting auto startup <tt>false</tt> on {@link CamelContext} then that takes precedence and
965     * <i>no</i> routes is started. You would need to start {@link CamelContext} explicit using the
966     * {@link org.apache.camel.CamelContext#start()} method, to start the context, and then you would need to start the
967     * routes manually using {@link org.apache.camel.spi.RouteController#startRoute(String)}.
968     */
969    public void setAutoStartup(String autoStartup) {
970        this.autoStartup = autoStartup;
971    }
972
973    public String getShutdownEager() {
974        return shutdownEager;
975    }
976
977    /**
978     * Whether to shutdown CamelContext eager when Spring is shutting down. This ensure a cleaner shutdown of Camel, as
979     * dependent bean's are not shutdown at this moment. The bean's will then be shutdown after camelContext.
980     */
981    public void setShutdownEager(String shutdownEager) {
982        this.shutdownEager = shutdownEager;
983    }
984
985    @Override
986    public String getDumpRoutes() {
987        return dumpRoutes;
988    }
989
990    /**
991     * If dumping is enabled then Camel will during startup dump all loaded routes (incl rests and route templates)
992     * represented as XML DSL into the log. This is intended for trouble shooting or to assist during development.
993     *
994     * Sensitive information that may be configured in the route endpoints could potentially be included in the dump
995     * output and is therefore not recommended to be used for production usage.
996     *
997     * This requires to have camel-xml-jaxb on the classpath to be able to dump the routes as XML.
998     */
999    public void setDumpRoutes(String dumpRoutes) {
1000        this.dumpRoutes = dumpRoutes;
1001    }
1002
1003    @Override
1004    public String getUseMDCLogging() {
1005        return useMDCLogging;
1006    }
1007
1008    /**
1009     * Set whether <a href="http://www.slf4j.org/api/org/slf4j/MDC.html">MDC</a> is enabled.
1010     */
1011    public void setUseMDCLogging(String useMDCLogging) {
1012        this.useMDCLogging = useMDCLogging;
1013    }
1014
1015    public String getMDCLoggingKeysPattern() {
1016        return mdcLoggingKeysPattern;
1017    }
1018
1019    /**
1020     * Sets the pattern used for determine which custom MDC keys to propagate during message routing when the routing
1021     * engine continues routing asynchronously for the given message. Setting this pattern to * will propagate all
1022     * custom keys. Or setting the pattern to foo*,bar* will propagate any keys starting with either foo or bar. Notice
1023     * that a set of standard Camel MDC keys are always propagated which starts with camel. as key name.
1024     *
1025     * The match rules are applied in this order (case insensitive):
1026     *
1027     * 1. exact match, returns true 2. wildcard match (pattern ends with a * and the name starts with the pattern),
1028     * returns true 3. regular expression match, returns true 4. otherwise returns false
1029     */
1030    public void setMDCLoggingKeysPattern(String mdcLoggingKeysPattern) {
1031        this.mdcLoggingKeysPattern = mdcLoggingKeysPattern;
1032    }
1033
1034    @Override
1035    public String getUseDataType() {
1036        return useDataType;
1037    }
1038
1039    /**
1040     * Whether to enable using data type on Camel messages.
1041     * <p/>
1042     * Data type are automatic turned on if:
1043     * <ul>
1044     * <li>one ore more routes has been explicit configured with input and output types</li>
1045     * <li>when using rest-dsl with binding turned on</li>
1046     * </ul>
1047     * Otherwise data type is default off.
1048     */
1049    public void setUseDataType(String useDataType) {
1050        this.useDataType = useDataType;
1051    }
1052
1053    @Override
1054    public String getUseBreadcrumb() {
1055        return useBreadcrumb;
1056    }
1057
1058    /**
1059     * Set whether breadcrumb is enabled.
1060     */
1061    public void setUseBreadcrumb(String useBreadcrumb) {
1062        this.useBreadcrumb = useBreadcrumb;
1063    }
1064
1065    @Override
1066    public String getBeanPostProcessorEnabled() {
1067        return beanPostProcessorEnabled;
1068    }
1069
1070    /**
1071     * Can be used to turn off bean post processing.
1072     *
1073     * Be careful to turn this off, as this means that beans that use Camel annotations such as
1074     * {@link org.apache.camel.EndpointInject}, {@link org.apache.camel.ProducerTemplate},
1075     * {@link org.apache.camel.Produce}, {@link org.apache.camel.Consume} etc will not be injected and in use.
1076     *
1077     * Turning this off should only be done if you are sure you do not use any of these Camel features.
1078     *
1079     * Not all runtimes allow turning this off (such as camel-blueprint or camel-cdi with XML).
1080     *
1081     * The default value is true (enabled).
1082     */
1083    public void setBeanPostProcessorEnabled(String beanPostProcessorEnabled) {
1084        this.beanPostProcessorEnabled = beanPostProcessorEnabled;
1085    }
1086
1087    @Override
1088    public String getAllowUseOriginalMessage() {
1089        return allowUseOriginalMessage;
1090    }
1091
1092    /**
1093     * Sets whether to allow access to the original message from Camel's error handler, or from
1094     * {@link org.apache.camel.spi.UnitOfWork#getOriginalInMessage()}.
1095     * <p/>
1096     * Turning this off can optimize performance, as defensive copy of the original message is not needed.
1097     */
1098    public void setAllowUseOriginalMessage(String allowUseOriginalMessage) {
1099        this.allowUseOriginalMessage = allowUseOriginalMessage;
1100    }
1101
1102    @Override
1103    public String getCaseInsensitiveHeaders() {
1104        return caseInsensitiveHeaders;
1105    }
1106
1107    /**
1108     * Whether to use case sensitive or insensitive headers.
1109     *
1110     * Important: When using case sensitive (this is set to false). Then the map is case sensitive which means headers
1111     * such as content-type and Content-Type are two different keys which can be a problem for some protocols such as
1112     * HTTP based, which rely on case insensitive headers. However case sensitive implementations can yield faster
1113     * performance. Therefore use case sensitive implementation with care.
1114     *
1115     * Default is true.
1116     */
1117    public void setCaseInsensitiveHeaders(String caseInsensitiveHeaders) {
1118        this.caseInsensitiveHeaders = caseInsensitiveHeaders;
1119    }
1120
1121    @Override
1122    public String getAutowiredEnabled() {
1123        return autowiredEnabled;
1124    }
1125
1126    /**
1127     * Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as
1128     * autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets
1129     * configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection
1130     * factories, AWS Clients, etc.
1131     *
1132     * Default is true.
1133     */
1134    public void setAutowiredEnabled(String autowiredEnabled) {
1135        this.autowiredEnabled = autowiredEnabled;
1136    }
1137
1138    @Override
1139    public String getRuntimeEndpointRegistryEnabled() {
1140        return runtimeEndpointRegistryEnabled;
1141    }
1142
1143    /**
1144     * Sets whether {@link org.apache.camel.spi.RuntimeEndpointRegistry} is enabled.
1145     */
1146    public void setRuntimeEndpointRegistryEnabled(String runtimeEndpointRegistryEnabled) {
1147        this.runtimeEndpointRegistryEnabled = runtimeEndpointRegistryEnabled;
1148    }
1149
1150    @Override
1151    public String getInflightRepositoryBrowseEnabled() {
1152        return inflightRepositoryBrowseEnabled;
1153    }
1154
1155    /**
1156     * Sets whether the inflight repository should allow browsing each inflight exchange.
1157     *
1158     * This is by default disabled as there is a very slight performance overhead when enabled.
1159     */
1160    public void setInflightRepositoryBrowseEnabled(String inflightRepositoryBrowseEnabled) {
1161        this.inflightRepositoryBrowseEnabled = inflightRepositoryBrowseEnabled;
1162    }
1163
1164    @Override
1165    public String getManagementNamePattern() {
1166        return managementNamePattern;
1167    }
1168
1169    /**
1170     * The naming pattern for creating the CamelContext management name.
1171     */
1172    public void setManagementNamePattern(String managementNamePattern) {
1173        this.managementNamePattern = managementNamePattern;
1174    }
1175
1176    @Override
1177    public String getThreadNamePattern() {
1178        return threadNamePattern;
1179    }
1180
1181    /**
1182     * Sets the thread name pattern used for creating the full thread name.
1183     * <p/>
1184     * The default pattern is: <tt>Camel (#camelId#) thread ##counter# - #name#</tt>
1185     * <p/>
1186     * Where <tt>#camelId#</tt> is the name of the {@link org.apache.camel.CamelContext} <br/>
1187     * and <tt>#counter#</tt> is a unique incrementing counter. <br/>
1188     * and <tt>#name#</tt> is the regular thread name. <br/>
1189     * You can also use <tt>#longName#</tt> is the long thread name which can includes endpoint parameters etc.
1190     */
1191    public void setThreadNamePattern(String threadNamePattern) {
1192        this.threadNamePattern = threadNamePattern;
1193    }
1194
1195    @Override
1196    public String getLoadTypeConverters() {
1197        return loadTypeConverters;
1198    }
1199
1200    /**
1201     * Whether to load custom type converters by scanning classpath. This is used for backwards compatibility with Camel
1202     * 2.x. Its recommended to migrate to use fast type converter loading by setting @Converter(loader = true) on your
1203     * custom type converter classes.
1204     */
1205    public void setLoadTypeConverters(String loadTypeConverters) {
1206        this.loadTypeConverters = loadTypeConverters;
1207    }
1208
1209    @Override
1210    public String getLoadHealthChecks() {
1211        return loadHealthChecks;
1212    }
1213
1214    /**
1215     * Whether to load custom health checks by scanning classpath.
1216     */
1217    public void setLoadHealthChecks(String loadHealthChecks) {
1218        this.loadHealthChecks = loadHealthChecks;
1219    }
1220
1221    @Override
1222    public String getTypeConverterStatisticsEnabled() {
1223        return typeConverterStatisticsEnabled;
1224    }
1225
1226    /**
1227     * Sets whether or not type converter statistics is enabled.
1228     * <p/>
1229     * By default the type converter utilization statistics is disabled. <b>Notice:</b> If enabled then there is a
1230     * slight performance impact under very heavy load.
1231     * <p/>
1232     * You can enable/disable the statistics at runtime using the
1233     * {@link org.apache.camel.spi.TypeConverterRegistry#getStatistics()#setTypeConverterStatisticsEnabled(Boolean)}
1234     * method, or from JMX on the {@link org.apache.camel.api.management.mbean.ManagedTypeConverterRegistryMBean} mbean.
1235     */
1236    public void setTypeConverterStatisticsEnabled(String typeConverterStatisticsEnabled) {
1237        this.typeConverterStatisticsEnabled = typeConverterStatisticsEnabled;
1238    }
1239
1240    @Override
1241    public TypeConverterExists getTypeConverterExists() {
1242        return typeConverterExists;
1243    }
1244
1245    /**
1246     * What should happen when attempting to add a duplicate type converter.
1247     * <p/>
1248     * The default behavior is to ignore the duplicate.
1249     */
1250    public void setTypeConverterExists(TypeConverterExists typeConverterExists) {
1251        this.typeConverterExists = typeConverterExists;
1252    }
1253
1254    @Override
1255    public LoggingLevel getTypeConverterExistsLoggingLevel() {
1256        return typeConverterExistsLoggingLevel;
1257    }
1258
1259    /**
1260     * The logging level to use when logging that a type converter already exists when attempting to add a duplicate
1261     * type converter.
1262     * <p/>
1263     * The default logging level is <tt>DEBUG</tt>
1264     */
1265    public void setTypeConverterExistsLoggingLevel(LoggingLevel typeConverterExistsLoggingLevel) {
1266        this.typeConverterExistsLoggingLevel = typeConverterExistsLoggingLevel;
1267    }
1268
1269    @Override
1270    public CamelJMXAgentDefinition getCamelJMXAgent() {
1271        return camelJMXAgent;
1272    }
1273
1274    @Override
1275    public List<RouteConfigurationContextRefDefinition> getRouteConfigurationRefs() {
1276        return routeConfigurationRefs;
1277    }
1278
1279    /**
1280     * Refers to XML route configurations to include as route configurations in this CamelContext.
1281     */
1282    public void setRouteConfigurationRefs(List<RouteConfigurationContextRefDefinition> routeConfigurationRefs) {
1283        this.routeConfigurationRefs = routeConfigurationRefs;
1284    }
1285
1286    @Override
1287    public List<RouteTemplateContextRefDefinition> getRouteTemplateRefs() {
1288        return routeTemplateRefs;
1289    }
1290
1291    /**
1292     * Refers to XML route templates to include as route templates in this CamelContext.
1293     */
1294    public void setRouteTemplateRefs(List<RouteTemplateContextRefDefinition> routeTemplateRefs) {
1295        this.routeTemplateRefs = routeTemplateRefs;
1296    }
1297
1298    @Override
1299    public List<RouteBuilderDefinition> getBuilderRefs() {
1300        return builderRefs;
1301    }
1302
1303    /**
1304     * Refers to Java {@link RouteBuilder} instances to include as routes in this CamelContext.
1305     */
1306    public void setBuilderRefs(List<RouteBuilderDefinition> builderRefs) {
1307        this.builderRefs = builderRefs;
1308    }
1309
1310    @Override
1311    public List<RouteContextRefDefinition> getRouteRefs() {
1312        return routeRefs;
1313    }
1314
1315    /**
1316     * Refers to XML routes to include as routes in this CamelContext.
1317     */
1318    public void setRouteRefs(List<RouteContextRefDefinition> routeRefs) {
1319        this.routeRefs = routeRefs;
1320    }
1321
1322    @Override
1323    public List<RestContextRefDefinition> getRestRefs() {
1324        return restRefs;
1325    }
1326
1327    /**
1328     * Refers to XML rest-dsl to include as REST services in this CamelContext.
1329     */
1330    public void setRestRefs(List<RestContextRefDefinition> restRefs) {
1331        this.restRefs = restRefs;
1332    }
1333
1334    @Override
1335    public String getErrorHandlerRef() {
1336        return errorHandlerRef;
1337    }
1338
1339    /**
1340     * Sets the name of the error handler object used to default the error handling strategy
1341     */
1342    public void setErrorHandlerRef(String errorHandlerRef) {
1343        this.errorHandlerRef = errorHandlerRef;
1344    }
1345
1346    /**
1347     * Configuration of data formats.
1348     */
1349    public void setDataFormats(DataFormatsDefinition dataFormats) {
1350        this.dataFormats = dataFormats;
1351    }
1352
1353    @Override
1354    public DataFormatsDefinition getDataFormats() {
1355        return dataFormats;
1356    }
1357
1358    /**
1359     * Configuration of transformers.
1360     */
1361    public void setTransformers(TransformersDefinition transformers) {
1362        this.transformers = transformers;
1363    }
1364
1365    @Override
1366    public TransformersDefinition getTransformers() {
1367        return transformers;
1368    }
1369
1370    /**
1371     * Configuration of validators.
1372     */
1373    public void setValidators(ValidatorsDefinition validators) {
1374        this.validators = validators;
1375    }
1376
1377    @Override
1378    public ValidatorsDefinition getValidators() {
1379        return validators;
1380    }
1381
1382    /**
1383     * Configuration of redelivery settings.
1384     */
1385    public void setRedeliveryPolicies(List<CamelRedeliveryPolicyFactoryBean> redeliveryPolicies) {
1386        this.redeliveryPolicies = redeliveryPolicies;
1387    }
1388
1389    @Override
1390    public List<AbstractCamelFactoryBean<?>> getBeansFactory() {
1391        return beansFactory;
1392    }
1393
1394    /**
1395     * Miscellaneous configurations
1396     */
1397    public void setBeansFactory(List<AbstractCamelFactoryBean<?>> beansFactory) {
1398        this.beansFactory = beansFactory;
1399    }
1400
1401    @Override
1402    public List<?> getBeans() {
1403        return beans;
1404    }
1405
1406    /**
1407     * Miscellaneous configurations
1408     */
1409    public void setBeans(List<?> beans) {
1410        this.beans = beans;
1411    }
1412
1413    @Override
1414    public ServiceCallConfigurationDefinition getDefaultServiceCallConfiguration() {
1415        return defaultServiceCallConfiguration;
1416    }
1417
1418    /**
1419     * ServiceCall EIP default configuration
1420     */
1421    public void setDefaultServiceCallConfiguration(ServiceCallConfigurationDefinition defaultServiceCallConfiguration) {
1422        this.defaultServiceCallConfiguration = defaultServiceCallConfiguration;
1423    }
1424
1425    @Override
1426    public List<ServiceCallConfigurationDefinition> getServiceCallConfigurations() {
1427        return serviceCallConfigurations;
1428    }
1429
1430    /**
1431     * ServiceCall EIP configurations
1432     */
1433    public void setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> serviceCallConfigurations) {
1434        this.serviceCallConfigurations = serviceCallConfigurations;
1435    }
1436
1437    @Override
1438    public Resilience4jConfigurationDefinition getDefaultResilience4jConfiguration() {
1439        return defaultResilience4jConfiguration;
1440    }
1441
1442    /**
1443     * Resilience4j EIP default configuration
1444     */
1445    public void setDefaultResilience4jConfiguration(Resilience4jConfigurationDefinition defaultResilience4jConfiguration) {
1446        this.defaultResilience4jConfiguration = defaultResilience4jConfiguration;
1447    }
1448
1449    @Override
1450    public List<Resilience4jConfigurationDefinition> getResilience4jConfigurations() {
1451        return resilience4jConfigurations;
1452    }
1453
1454    /**
1455     * Resilience4j Circuit Breaker EIP configurations
1456     */
1457    public void setResilience4jConfigurations(List<Resilience4jConfigurationDefinition> resilience4jConfigurations) {
1458        this.resilience4jConfigurations = resilience4jConfigurations;
1459    }
1460
1461    @Override
1462    public FaultToleranceConfigurationDefinition getDefaultFaultToleranceConfiguration() {
1463        return defaultFaultToleranceConfiguration;
1464    }
1465
1466    /**
1467     * MicroProfile Fault Tolerance EIP default configuration
1468     */
1469    public void setDefaultFaultToleranceConfiguration(
1470            FaultToleranceConfigurationDefinition defaultFaultToleranceConfiguration) {
1471        this.defaultFaultToleranceConfiguration = defaultFaultToleranceConfiguration;
1472    }
1473
1474    @Override
1475    public List<FaultToleranceConfigurationDefinition> getFaultToleranceConfigurations() {
1476        return faultToleranceConfigurations;
1477    }
1478
1479    /**
1480     * MicroProfile Circuit Breaker EIP configurations
1481     */
1482    public void setFaultToleranceConfigurations(List<FaultToleranceConfigurationDefinition> faultToleranceConfigurations) {
1483        this.faultToleranceConfigurations = faultToleranceConfigurations;
1484    }
1485
1486    /**
1487     * Configuration of error handlers that triggers on exceptions thrown.
1488     */
1489    public void setOnExceptions(List<OnExceptionDefinition> onExceptions) {
1490        this.onExceptions = onExceptions;
1491    }
1492
1493    @Override
1494    public List<OnExceptionDefinition> getOnExceptions() {
1495        return onExceptions;
1496    }
1497
1498    @Override
1499    public List<OnCompletionDefinition> getOnCompletions() {
1500        return onCompletions;
1501    }
1502
1503    /**
1504     * Configuration of sub routes to run at the completion of routing.
1505     */
1506    public void setOnCompletions(List<OnCompletionDefinition> onCompletions) {
1507        this.onCompletions = onCompletions;
1508    }
1509
1510    @Override
1511    public ShutdownRoute getShutdownRoute() {
1512        return shutdownRoute;
1513    }
1514
1515    /**
1516     * Sets the ShutdownRoute option for routes.
1517     */
1518    public void setShutdownRoute(ShutdownRoute shutdownRoute) {
1519        this.shutdownRoute = shutdownRoute;
1520    }
1521
1522    @Override
1523    public ShutdownRunningTask getShutdownRunningTask() {
1524        return shutdownRunningTask;
1525    }
1526
1527    /**
1528     * Sets the ShutdownRunningTask option to use when shutting down a route.
1529     */
1530    public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) {
1531        this.shutdownRunningTask = shutdownRunningTask;
1532    }
1533
1534    @Override
1535    public List<ThreadPoolProfileDefinition> getThreadPoolProfiles() {
1536        return threadPoolProfiles;
1537    }
1538
1539    /**
1540     * Configuration of thread pool profiles.
1541     */
1542    public void setThreadPoolProfiles(List<ThreadPoolProfileDefinition> threadPoolProfiles) {
1543        this.threadPoolProfiles = threadPoolProfiles;
1544    }
1545
1546    public List<CamelThreadPoolFactoryBean> getThreadPools() {
1547        return threadPools;
1548    }
1549
1550    /**
1551     * Configuration of thread pool
1552     */
1553    public void setThreadPools(List<CamelThreadPoolFactoryBean> threadPools) {
1554        this.threadPools = threadPools;
1555    }
1556
1557    @Override
1558    public String getDependsOn() {
1559        return dependsOn;
1560    }
1561
1562    /**
1563     * List of other bean id's this CamelContext depends up. Multiple bean id's can be separated by comma.
1564     */
1565    public void setDependsOn(String dependsOn) {
1566        this.dependsOn = dependsOn;
1567    }
1568
1569    public boolean isImplicitId() {
1570        return implicitId;
1571    }
1572
1573    public void setImplicitId(boolean flag) {
1574        implicitId = flag;
1575    }
1576}