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