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