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