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