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