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