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