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