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