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.blueprint; 018 019import java.util.ArrayList; 020import java.util.Collection; 021import java.util.List; 022import java.util.Properties; 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.LoggingLevel; 032import org.apache.camel.RoutesBuilder; 033import org.apache.camel.ShutdownRoute; 034import org.apache.camel.ShutdownRunningTask; 035import org.apache.camel.TypeConverterExists; 036import org.apache.camel.builder.RouteBuilder; 037import org.apache.camel.component.properties.PropertiesComponent; 038import org.apache.camel.core.osgi.OsgiCamelContextPublisher; 039import org.apache.camel.core.osgi.OsgiEventAdminNotifier; 040import org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader; 041import org.apache.camel.core.xml.AbstractCamelContextFactoryBean; 042import org.apache.camel.core.xml.CamelJMXAgentDefinition; 043import org.apache.camel.core.xml.CamelPropertyPlaceholderDefinition; 044import org.apache.camel.core.xml.CamelServiceExporterDefinition; 045import org.apache.camel.core.xml.CamelStreamCachingStrategyDefinition; 046import org.apache.camel.model.ContextScanDefinition; 047import org.apache.camel.model.InterceptDefinition; 048import org.apache.camel.model.InterceptFromDefinition; 049import org.apache.camel.model.InterceptSendToEndpointDefinition; 050import org.apache.camel.model.OnCompletionDefinition; 051import org.apache.camel.model.OnExceptionDefinition; 052import org.apache.camel.model.PackageScanDefinition; 053import org.apache.camel.model.PropertiesDefinition; 054import org.apache.camel.model.RestContextRefDefinition; 055import org.apache.camel.model.RouteBuilderDefinition; 056import org.apache.camel.model.RouteContextRefDefinition; 057import org.apache.camel.model.RouteDefinition; 058import org.apache.camel.model.ThreadPoolProfileDefinition; 059import org.apache.camel.model.dataformat.DataFormatsDefinition; 060import org.apache.camel.model.rest.RestConfigurationDefinition; 061import org.apache.camel.model.rest.RestDefinition; 062import org.apache.camel.spi.PackageScanFilter; 063import org.apache.camel.spi.Registry; 064import org.osgi.framework.BundleContext; 065import org.osgi.framework.ServiceReference; 066import org.osgi.service.blueprint.container.BlueprintContainer; 067import org.slf4j.Logger; 068import org.slf4j.LoggerFactory; 069 070/** 071 * A bean to create and initialize a {@link BlueprintCamelContext} 072 * and install routes either explicitly configured in 073 * Blueprint XML or found by searching the classpath for Java classes which extend 074 * {@link RouteBuilder} using the nested {@link #setPackages(String[])}. 075 * 076 * @version 077 */ 078@XmlRootElement(name = "camelContext") 079@XmlAccessorType(XmlAccessType.FIELD) 080public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<BlueprintCamelContext> { 081 private static final Logger LOG = LoggerFactory.getLogger(CamelContextFactoryBean.class); 082 083 @XmlAttribute(name = "depends-on", required = false) 084 private String dependsOn; 085 @XmlAttribute(required = false) 086 private String trace; 087 @XmlAttribute(required = false) 088 private String messageHistory; 089 @XmlAttribute(required = false) 090 private String streamCache = "false"; 091 @XmlAttribute(required = false) 092 private String delayer; 093 @XmlAttribute(required = false) 094 private String handleFault; 095 @XmlAttribute(required = false) 096 private String errorHandlerRef; 097 @XmlAttribute(required = false) 098 private String autoStartup = "true"; 099 @XmlAttribute(required = false) 100 private String useMDCLogging; 101 @XmlAttribute(required = false) 102 private String useBreadcrumb; 103 @XmlAttribute(required = false) 104 private String allowUseOriginalMessage; 105 @XmlAttribute(required = false) 106 private String runtimeEndpointRegistryEnabled; 107 @XmlAttribute(required = false) 108 private String managementNamePattern; 109 @XmlAttribute(required = false) 110 private String threadNamePattern; 111 @XmlAttribute(required = false) 112 private Boolean useBlueprintPropertyResolver; 113 @XmlAttribute(required = false) 114 private ShutdownRoute shutdownRoute; 115 @XmlAttribute(required = false) 116 private ShutdownRunningTask shutdownRunningTask; 117 @XmlAttribute(required = false) 118 @Deprecated 119 private Boolean lazyLoadTypeConverters; 120 @XmlAttribute(required = false) 121 private Boolean typeConverterStatisticsEnabled; 122 @XmlAttribute(required = false) 123 private TypeConverterExists typeConverterExists; 124 @XmlAttribute(required = false) 125 private LoggingLevel typeConverterExistsLoggingLevel; 126 @XmlElement(name = "properties", required = false) 127 private PropertiesDefinition properties; 128 @XmlElement(name = "propertyPlaceholder", type = CamelPropertyPlaceholderDefinition.class, required = false) 129 private CamelPropertyPlaceholderDefinition camelPropertyPlaceholder; 130 @XmlElement(name = "package", required = false) 131 private String[] packages = {}; 132 @XmlElement(name = "packageScan", type = PackageScanDefinition.class, required = false) 133 private PackageScanDefinition packageScan; 134 @XmlElement(name = "contextScan", type = ContextScanDefinition.class, required = false) 135 private ContextScanDefinition contextScan; 136 @XmlElement(name = "jmxAgent", type = CamelJMXAgentDefinition.class, required = false) 137 private CamelJMXAgentDefinition camelJMXAgent; 138 @XmlElement(name = "streamCaching", type = CamelStreamCachingStrategyDefinition.class, required = false) 139 private CamelStreamCachingStrategyDefinition camelStreamCachingStrategy; 140 @XmlElements({ 141 @XmlElement(name = "template", type = CamelProducerTemplateFactoryBean.class, required = false), 142 @XmlElement(name = "consumerTemplate", type = CamelConsumerTemplateFactoryBean.class, required = false), 143 @XmlElement(name = "proxy", type = CamelProxyFactoryBean.class, required = false), 144 @XmlElement(name = "export", type = CamelServiceExporterDefinition.class, required = false), 145 @XmlElement(name = "errorHandler", type = CamelErrorHandlerFactoryBean.class, required = false)}) 146 private List<?> beans; 147 @XmlElement(name = "routeBuilder", required = false) 148 private List<RouteBuilderDefinition> builderRefs = new ArrayList<RouteBuilderDefinition>(); 149 @XmlElement(name = "routeContextRef", required = false) 150 private List<RouteContextRefDefinition> routeRefs = new ArrayList<RouteContextRefDefinition>(); 151 @XmlElement(name = "restContextRef", required = false) 152 private List<RestContextRefDefinition> restRefs = new ArrayList<RestContextRefDefinition>(); 153 @XmlElement(name = "threadPoolProfile", required = false) 154 private List<ThreadPoolProfileDefinition> threadPoolProfiles; 155 @XmlElement(name = "threadPool", required = false) 156 private List<CamelThreadPoolFactoryBean> threadPools; 157 @XmlElement(name = "endpoint", required = false) 158 private List<CamelEndpointFactoryBean> endpoints; 159 @XmlElement(name = "dataFormats", required = false) 160 private DataFormatsDefinition dataFormats; 161 @XmlElement(name = "redeliveryPolicyProfile", required = false) 162 private List<CamelRedeliveryPolicyFactoryBean> redeliveryPolicies; 163 @XmlElement(name = "onException", required = false) 164 private List<OnExceptionDefinition> onExceptions = new ArrayList<OnExceptionDefinition>(); 165 @XmlElement(name = "onCompletion", required = false) 166 private List<OnCompletionDefinition> onCompletions = new ArrayList<OnCompletionDefinition>(); 167 @XmlElement(name = "intercept", required = false) 168 private List<InterceptDefinition> intercepts = new ArrayList<InterceptDefinition>(); 169 @XmlElement(name = "interceptFrom", required = false) 170 private List<InterceptFromDefinition> interceptFroms = new ArrayList<InterceptFromDefinition>(); 171 @XmlElement(name = "interceptSendToEndpoint", required = false) 172 private List<InterceptSendToEndpointDefinition> interceptSendToEndpoints = new ArrayList<InterceptSendToEndpointDefinition>(); 173 @XmlElement(name = "restConfiguration", required = false) 174 private RestConfigurationDefinition restConfiguration; 175 @XmlElement(name = "rest", required = false) 176 private List<RestDefinition> rests = new ArrayList<RestDefinition>(); 177 @XmlElement(name = "route", required = false) 178 private List<RouteDefinition> routes = new ArrayList<RouteDefinition>(); 179 @XmlTransient 180 private BlueprintCamelContext context; 181 @XmlTransient 182 private BlueprintContainer blueprintContainer; 183 @XmlTransient 184 private BundleContext bundleContext; 185 @XmlTransient 186 private boolean implicitId; 187 @XmlTransient 188 private OsgiCamelContextPublisher osgiCamelContextPublisher; 189 190 public Class<BlueprintCamelContext> getObjectType() { 191 return BlueprintCamelContext.class; 192 } 193 194 @Override 195 public BlueprintCamelContext getContext(boolean create) { 196 if (context == null && create) { 197 context = createContext(); 198 if (!isImplicitId()) { 199 context.setName(getId()); 200 } 201 } 202 return context; 203 } 204 205 public void setBlueprintContainer(BlueprintContainer blueprintContainer) { 206 this.blueprintContainer = blueprintContainer; 207 } 208 209 public void setBundleContext(BundleContext bundleContext) { 210 this.bundleContext = bundleContext; 211 } 212 213 protected BlueprintCamelContext createContext() { 214 return new BlueprintCamelContext(bundleContext, blueprintContainer); 215 } 216 217 @Override 218 protected void initCustomRegistry(BlueprintCamelContext context) { 219 Registry registry = getBeanForType(Registry.class); 220 if (registry != null) { 221 LOG.info("Using custom Registry: " + registry); 222 context.setRegistry(registry); 223 } 224 } 225 226 @Override 227 protected <S> S getBeanForType(Class<S> clazz) { 228 Collection<S> objects = BlueprintContainerRegistry.lookupByType(blueprintContainer, clazz).values(); 229 if (objects.size() == 1) { 230 return objects.iterator().next(); 231 } 232 return null; 233 } 234 235 @Override 236 protected void initPropertyPlaceholder() throws Exception { 237 super.initPropertyPlaceholder(); 238 239 // if blueprint property resolver is enabled on CamelContext then bridge PropertiesComponent to blueprint 240 if (isUseBlueprintPropertyResolver()) { 241 // lookup existing configured properties component 242 PropertiesComponent pc = getContext().getComponent("properties", PropertiesComponent.class); 243 244 BlueprintPropertiesParser parser = new BlueprintPropertiesParser(pc, blueprintContainer, pc.getPropertiesParser()); 245 BlueprintPropertiesResolver resolver = new BlueprintPropertiesResolver(pc.getPropertiesResolver(), parser); 246 247 // any extra properties 248 ServiceReference<?> ref = bundleContext.getServiceReference(PropertiesComponent.OVERRIDE_PROPERTIES); 249 if (ref != null) { 250 Properties extra = (Properties) bundleContext.getService(ref); 251 if (extra != null) { 252 pc.setOverrideProperties(extra); 253 } 254 } 255 256 // no locations has been set, so its a default component 257 if (pc.getLocations() == null) { 258 StringBuilder sb = new StringBuilder(); 259 String[] ids = parser.lookupPropertyPlaceholderIds(); 260 for (String id : ids) { 261 sb.append("blueprint:").append(id).append(","); 262 } 263 if (sb.length() > 0) { 264 // location supports multiple separated by comma 265 pc.setLocation(sb.toString()); 266 } 267 } 268 269 if (pc.getLocations() != null) { 270 // bridge camel properties with blueprint 271 pc.setPropertiesParser(parser); 272 pc.setPropertiesResolver(resolver); 273 } 274 } 275 } 276 277 @Override 278 protected void initBeanPostProcessor(BlueprintCamelContext context) { 279 } 280 281 @Override 282 protected void postProcessBeforeInit(RouteBuilder builder) { 283 } 284 285 @Override 286 protected void findRouteBuildersByPackageScan(String[] packages, PackageScanFilter filter, List<RoutesBuilder> builders) throws Exception { 287 // add filter to class resolver which then will filter 288 getContext().getPackageScanClassResolver().addFilter(filter); 289 ClassLoader classLoader = new BundleDelegatingClassLoader(bundleContext.getBundle()); 290 PackageScanRouteBuilderFinder finder = new PackageScanRouteBuilderFinder(getContext(), packages, classLoader, 291 getContext().getPackageScanClassResolver()); 292 finder.appendBuilders(builders); 293 294 // and remove the filter 295 getContext().getPackageScanClassResolver().removeFilter(filter); 296 } 297 298 @Override 299 protected void findRouteBuildersByContextScan(PackageScanFilter filter, boolean includeNonSingletons, List<RoutesBuilder> builders) throws Exception { 300 ContextScanRouteBuilderFinder finder = new ContextScanRouteBuilderFinder(getContext(), filter, includeNonSingletons); 301 finder.appendBuilders(builders); 302 } 303 304 @Override 305 public void afterPropertiesSet() throws Exception { 306 super.afterPropertiesSet(); 307 // setup the application context classloader with the bundle delegating classloader 308 ClassLoader cl = new BundleDelegatingClassLoader(bundleContext.getBundle()); 309 LOG.debug("Set the application context classloader to: {}", cl); 310 getContext().setApplicationContextClassLoader(cl); 311 osgiCamelContextPublisher = new OsgiCamelContextPublisher(bundleContext); 312 osgiCamelContextPublisher.start(); 313 getContext().getManagementStrategy().addEventNotifier(osgiCamelContextPublisher); 314 try { 315 getClass().getClassLoader().loadClass("org.osgi.service.event.EventAdmin"); 316 getContext().getManagementStrategy().addEventNotifier(new OsgiEventAdminNotifier(bundleContext)); 317 } catch (Throwable t) { 318 // Ignore, if the EventAdmin package is not available, just don't use it 319 LOG.debug("EventAdmin package is not available, just don't use it"); 320 } 321 // ensure routes is setup 322 setupRoutes(); 323 } 324 325 @Override 326 public void destroy() throws Exception { 327 super.destroy(); 328 if (osgiCamelContextPublisher != null) { 329 osgiCamelContextPublisher.shutdown(); 330 } 331 } 332 333 public String getDependsOn() { 334 return dependsOn; 335 } 336 337 public void setDependsOn(String dependsOn) { 338 this.dependsOn = dependsOn; 339 } 340 341 public String getAutoStartup() { 342 return autoStartup; 343 } 344 345 public void setAutoStartup(String autoStartup) { 346 this.autoStartup = autoStartup; 347 } 348 349 public String getUseMDCLogging() { 350 return useMDCLogging; 351 } 352 353 public void setUseMDCLogging(String useMDCLogging) { 354 this.useMDCLogging = useMDCLogging; 355 } 356 357 public String getUseBreadcrumb() { 358 return useBreadcrumb; 359 } 360 361 public void setUseBreadcrumb(String useBreadcrumb) { 362 this.useBreadcrumb = useBreadcrumb; 363 } 364 365 public String getAllowUseOriginalMessage() { 366 return allowUseOriginalMessage; 367 } 368 369 public void setAllowUseOriginalMessage(String allowUseOriginalMessage) { 370 this.allowUseOriginalMessage = allowUseOriginalMessage; 371 } 372 373 public String getRuntimeEndpointRegistryEnabled() { 374 return runtimeEndpointRegistryEnabled; 375 } 376 377 public void setRuntimeEndpointRegistryEnabled(String runtimeEndpointRegistryEnabled) { 378 this.runtimeEndpointRegistryEnabled = runtimeEndpointRegistryEnabled; 379 } 380 381 public String getManagementNamePattern() { 382 return managementNamePattern; 383 } 384 385 public void setManagementNamePattern(String managementNamePattern) { 386 this.managementNamePattern = managementNamePattern; 387 } 388 389 public String getThreadNamePattern() { 390 return threadNamePattern; 391 } 392 393 public void setThreadNamePattern(String threadNamePattern) { 394 this.threadNamePattern = threadNamePattern; 395 } 396 397 @Deprecated 398 public Boolean getLazyLoadTypeConverters() { 399 // use false by default 400 return lazyLoadTypeConverters != null ? lazyLoadTypeConverters : Boolean.FALSE; 401 } 402 403 @Deprecated 404 public void setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters) { 405 this.lazyLoadTypeConverters = lazyLoadTypeConverters; 406 } 407 408 public Boolean getTypeConverterStatisticsEnabled() { 409 return typeConverterStatisticsEnabled; 410 } 411 412 public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) { 413 this.typeConverterStatisticsEnabled = typeConverterStatisticsEnabled; 414 } 415 416 public TypeConverterExists getTypeConverterExists() { 417 return typeConverterExists; 418 } 419 420 public void setTypeConverterExists(TypeConverterExists typeConverterExists) { 421 this.typeConverterExists = typeConverterExists; 422 } 423 424 public LoggingLevel getTypeConverterExistsLoggingLevel() { 425 return typeConverterExistsLoggingLevel; 426 } 427 428 public void setTypeConverterExistsLoggingLevel(LoggingLevel typeConverterExistsLoggingLevel) { 429 this.typeConverterExistsLoggingLevel = typeConverterExistsLoggingLevel; 430 } 431 432 public ShutdownRoute getShutdownRoute() { 433 return shutdownRoute; 434 } 435 436 public void setShutdownRoute(ShutdownRoute shutdownRoute) { 437 this.shutdownRoute = shutdownRoute; 438 } 439 440 public ShutdownRunningTask getShutdownRunningTask() { 441 return shutdownRunningTask; 442 } 443 444 public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) { 445 this.shutdownRunningTask = shutdownRunningTask; 446 } 447 448 public CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder() { 449 return camelPropertyPlaceholder; 450 } 451 452 public void setCamelPropertyPlaceholder(CamelPropertyPlaceholderDefinition camelPropertyPlaceholder) { 453 this.camelPropertyPlaceholder = camelPropertyPlaceholder; 454 } 455 456 public List<RouteContextRefDefinition> getRouteRefs() { 457 return routeRefs; 458 } 459 460 public void setRouteRefs(List<RouteContextRefDefinition> routeRefs) { 461 this.routeRefs = routeRefs; 462 } 463 464 public List<RestContextRefDefinition> getRestRefs() { 465 return restRefs; 466 } 467 468 public void setRestRefs(List<RestContextRefDefinition> restRefs) { 469 this.restRefs = restRefs; 470 } 471 472 public List<CamelRedeliveryPolicyFactoryBean> getRedeliveryPolicies() { 473 return redeliveryPolicies; 474 } 475 476 public void setRedeliveryPolicies(List<CamelRedeliveryPolicyFactoryBean> redeliveryPolicies) { 477 this.redeliveryPolicies = redeliveryPolicies; 478 } 479 480 public List<ThreadPoolProfileDefinition> getThreadPoolProfiles() { 481 return threadPoolProfiles; 482 } 483 484 public void setThreadPoolProfiles(List<ThreadPoolProfileDefinition> threadPoolProfiles) { 485 this.threadPoolProfiles = threadPoolProfiles; 486 } 487 488 public List<CamelThreadPoolFactoryBean> getThreadPools() { 489 return threadPools; 490 } 491 492 public void setThreadPools(List<CamelThreadPoolFactoryBean> threadPools) { 493 this.threadPools = threadPools; 494 } 495 496 public String getTrace() { 497 return trace; 498 } 499 500 public void setTrace(String trace) { 501 this.trace = trace; 502 } 503 504 public String getMessageHistory() { 505 return messageHistory; 506 } 507 508 public void setMessageHistory(String messageHistory) { 509 this.messageHistory = messageHistory; 510 } 511 512 public String getStreamCache() { 513 return streamCache; 514 } 515 516 public void setStreamCache(String streamCache) { 517 this.streamCache = streamCache; 518 } 519 520 public String getDelayer() { 521 return delayer; 522 } 523 524 public void setDelayer(String delayer) { 525 this.delayer = delayer; 526 } 527 528 public String getHandleFault() { 529 return handleFault; 530 } 531 532 public void setHandleFault(String handleFault) { 533 this.handleFault = handleFault; 534 } 535 536 public String getErrorHandlerRef() { 537 return errorHandlerRef; 538 } 539 540 public void setErrorHandlerRef(String errorHandlerRef) { 541 this.errorHandlerRef = errorHandlerRef; 542 } 543 544 public PropertiesDefinition getProperties() { 545 return properties; 546 } 547 548 public void setProperties(PropertiesDefinition properties) { 549 this.properties = properties; 550 } 551 552 public String[] getPackages() { 553 return packages; 554 } 555 556 public void setPackages(String[] packages) { 557 this.packages = packages; 558 } 559 560 public PackageScanDefinition getPackageScan() { 561 return packageScan; 562 } 563 564 public void setPackageScan(PackageScanDefinition packageScan) { 565 this.packageScan = packageScan; 566 } 567 568 public ContextScanDefinition getContextScan() { 569 return contextScan; 570 } 571 572 public void setContextScan(ContextScanDefinition contextScan) { 573 this.contextScan = contextScan; 574 } 575 576 public CamelJMXAgentDefinition getCamelJMXAgent() { 577 return camelJMXAgent; 578 } 579 580 public void setCamelJMXAgent(CamelJMXAgentDefinition camelJMXAgent) { 581 this.camelJMXAgent = camelJMXAgent; 582 } 583 584 public CamelStreamCachingStrategyDefinition getCamelStreamCachingStrategy() { 585 return camelStreamCachingStrategy; 586 } 587 588 public void setCamelStreamCachingStrategy(CamelStreamCachingStrategyDefinition camelStreamCachingStrategy) { 589 this.camelStreamCachingStrategy = camelStreamCachingStrategy; 590 } 591 592 public List<?> getBeans() { 593 return beans; 594 } 595 596 public void setBeans(List<?> beans) { 597 this.beans = beans; 598 } 599 600 public List<RouteBuilderDefinition> getBuilderRefs() { 601 return builderRefs; 602 } 603 604 public void setBuilderRefs(List<RouteBuilderDefinition> builderRefs) { 605 this.builderRefs = builderRefs; 606 } 607 608 public List<CamelEndpointFactoryBean> getEndpoints() { 609 return endpoints; 610 } 611 612 public void setEndpoints(List<CamelEndpointFactoryBean> endpoints) { 613 this.endpoints = endpoints; 614 } 615 616 public DataFormatsDefinition getDataFormats() { 617 return dataFormats; 618 } 619 620 public void setDataFormats(DataFormatsDefinition dataFormats) { 621 this.dataFormats = dataFormats; 622 } 623 624 public List<OnExceptionDefinition> getOnExceptions() { 625 return onExceptions; 626 } 627 628 public void setOnExceptions(List<OnExceptionDefinition> onExceptions) { 629 this.onExceptions = onExceptions; 630 } 631 632 public List<OnCompletionDefinition> getOnCompletions() { 633 return onCompletions; 634 } 635 636 public void setOnCompletions(List<OnCompletionDefinition> onCompletions) { 637 this.onCompletions = onCompletions; 638 } 639 640 public List<InterceptDefinition> getIntercepts() { 641 return intercepts; 642 } 643 644 public void setIntercepts(List<InterceptDefinition> intercepts) { 645 this.intercepts = intercepts; 646 } 647 648 public List<InterceptFromDefinition> getInterceptFroms() { 649 return interceptFroms; 650 } 651 652 public void setInterceptFroms(List<InterceptFromDefinition> interceptFroms) { 653 this.interceptFroms = interceptFroms; 654 } 655 656 public List<InterceptSendToEndpointDefinition> getInterceptSendToEndpoints() { 657 return interceptSendToEndpoints; 658 } 659 660 public void setInterceptSendToEndpoints(List<InterceptSendToEndpointDefinition> interceptSendToEndpoints) { 661 this.interceptSendToEndpoints = interceptSendToEndpoints; 662 } 663 664 public List<RouteDefinition> getRoutes() { 665 return routes; 666 } 667 668 public void setRoutes(List<RouteDefinition> routes) { 669 this.routes = routes; 670 } 671 672 public List<RestDefinition> getRests() { 673 return rests; 674 } 675 676 public void setRests(List<RestDefinition> rests) { 677 this.rests = rests; 678 } 679 680 public RestConfigurationDefinition getRestConfiguration() { 681 return restConfiguration; 682 } 683 684 public void setRestConfiguration(RestConfigurationDefinition restConfiguration) { 685 this.restConfiguration = restConfiguration; 686 } 687 688 public boolean isImplicitId() { 689 return implicitId; 690 } 691 692 public void setImplicitId(boolean flag) { 693 implicitId = flag; 694 } 695 696 public Boolean getUseBlueprintPropertyResolver() { 697 return useBlueprintPropertyResolver; 698 } 699 700 public void setUseBlueprintPropertyResolver(Boolean useBlueprintPropertyResolver) { 701 this.useBlueprintPropertyResolver = useBlueprintPropertyResolver; 702 } 703 704 public boolean isUseBlueprintPropertyResolver() { 705 // enable by default 706 return useBlueprintPropertyResolver == null || useBlueprintPropertyResolver.booleanValue(); 707 } 708 709}