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.RestContextRefDefinition;
052import org.apache.camel.model.RouteBuilderDefinition;
053import org.apache.camel.model.RouteContextRefDefinition;
054import org.apache.camel.model.RouteDefinition;
055import org.apache.camel.model.ThreadPoolProfileDefinition;
056import org.apache.camel.model.config.PropertiesDefinition;
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
183    public Class<BlueprintCamelContext> getObjectType() {
184        return BlueprintCamelContext.class;
185    }
186
187    @Override
188    public BlueprintCamelContext getContext(boolean create) {
189        if (context == null && create) {
190            context = createContext();
191            if (!isImplicitId()) {
192                context.setName(getId());
193            }
194        }
195        return context;
196    }
197
198    public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
199        this.blueprintContainer = blueprintContainer;
200    }
201
202    public void setBundleContext(BundleContext bundleContext) {
203        this.bundleContext = bundleContext;
204    }
205
206    protected BlueprintCamelContext createContext() {
207        return new BlueprintCamelContext(bundleContext, blueprintContainer);
208    }
209
210    @Override
211    protected void initCustomRegistry(BlueprintCamelContext context) {
212        Registry registry = getBeanForType(Registry.class);
213        if (registry != null) {
214            LOG.info("Using custom Registry: " + registry);
215            context.setRegistry(registry);
216        }
217    }
218
219    @Override
220    protected <S> S getBeanForType(Class<S> clazz) {
221        Collection<S> objects = BlueprintContainerRegistry.lookupByType(blueprintContainer, clazz).values();
222        if (objects.size() == 1) {
223            return objects.iterator().next();
224        }
225        return null;
226    }
227
228    @Override
229    protected void initPropertyPlaceholder() throws Exception {
230        super.initPropertyPlaceholder();
231
232        // if blueprint property resolver is enabled on CamelContext then bridge PropertiesComponent to blueprint
233        if (isUseBlueprintPropertyResolver()) {
234            // lookup existing configured properties component
235            PropertiesComponent pc = getContext().getComponent("properties", PropertiesComponent.class);
236
237            BlueprintPropertiesParser parser = new BlueprintPropertiesParser(pc, blueprintContainer, pc.getPropertiesParser());
238            BlueprintPropertiesResolver resolver = new BlueprintPropertiesResolver(pc.getPropertiesResolver(), parser);
239
240            // any extra properties
241            ServiceReference<?> ref = bundleContext.getServiceReference(PropertiesComponent.OVERRIDE_PROPERTIES);
242            if (ref != null) {
243                Properties extra = (Properties) bundleContext.getService(ref);
244                if (extra != null) {
245                    pc.setOverrideProperties(extra);
246                }
247            }
248
249            // no locations has been set, so its a default component
250            if (pc.getLocations() == null) {
251                StringBuilder sb = new StringBuilder();
252                String[] ids = parser.lookupPropertyPlaceholderIds();
253                for (String id : ids) {
254                    sb.append("blueprint:").append(id).append(",");
255                }
256                if (sb.length() > 0) {
257                    // location supports multiple separated by comma
258                    pc.setLocation(sb.toString());
259                }
260            }
261
262            if (pc.getLocations() != null) {
263                // bridge camel properties with blueprint
264                pc.setPropertiesParser(parser);
265                pc.setPropertiesResolver(resolver);
266            }
267        }
268    }
269
270    @Override
271    protected void initBeanPostProcessor(BlueprintCamelContext context) {
272    }
273
274    @Override
275    protected void postProcessBeforeInit(RouteBuilder builder) {
276    }
277
278    @Override
279    protected void findRouteBuildersByPackageScan(String[] packages, PackageScanFilter filter, List<RoutesBuilder> builders) throws Exception {
280        // add filter to class resolver which then will filter
281        getContext().getPackageScanClassResolver().addFilter(filter);
282        ClassLoader classLoader = new BundleDelegatingClassLoader(bundleContext.getBundle());
283        PackageScanRouteBuilderFinder finder = new PackageScanRouteBuilderFinder(getContext(), packages, classLoader,
284                                                                                 getContext().getPackageScanClassResolver());
285        finder.appendBuilders(builders);
286
287        // and remove the filter
288        getContext().getPackageScanClassResolver().removeFilter(filter);
289    }
290
291    @Override
292    protected void findRouteBuildersByContextScan(PackageScanFilter filter, List<RoutesBuilder> builders) throws Exception {
293        ContextScanRouteBuilderFinder finder = new ContextScanRouteBuilderFinder(getContext(), filter);
294        finder.appendBuilders(builders);
295    }
296
297    @Override
298    public void afterPropertiesSet() throws Exception {
299        super.afterPropertiesSet();
300        // setup the application context classloader with the bundle delegating classloader
301        ClassLoader cl = new BundleDelegatingClassLoader(bundleContext.getBundle());
302        LOG.debug("Set the application context classloader to: {}", cl);
303        getContext().setApplicationContextClassLoader(cl);
304        getContext().getManagementStrategy().addEventNotifier(new OsgiCamelContextPublisher(bundleContext));
305        try {
306            getClass().getClassLoader().loadClass("org.osgi.service.event.EventAdmin");
307            getContext().getManagementStrategy().addEventNotifier(new OsgiEventAdminNotifier(bundleContext));
308        } catch (Throwable t) {
309            // Ignore, if the EventAdmin package is not available, just don't use it
310            LOG.debug("EventAdmin package is not available, just don't use it");
311        }
312        // ensure routes is setup
313        setupRoutes();
314    }
315
316    public String getDependsOn() {
317        return dependsOn;
318    }
319
320    public void setDependsOn(String dependsOn) {
321        this.dependsOn = dependsOn;
322    }
323
324    public String getAutoStartup() {
325        return autoStartup;
326    }
327
328    public void setAutoStartup(String autoStartup) {
329        this.autoStartup = autoStartup;
330    }
331
332    public String getUseMDCLogging() {
333        return useMDCLogging;
334    }
335
336    public void setUseMDCLogging(String useMDCLogging) {
337        this.useMDCLogging = useMDCLogging;
338    }
339
340    public String getUseBreadcrumb() {
341        return useBreadcrumb;
342    }
343
344    public void setUseBreadcrumb(String useBreadcrumb) {
345        this.useBreadcrumb = useBreadcrumb;
346    }
347
348    public String getAllowUseOriginalMessage() {
349        return allowUseOriginalMessage;
350    }
351
352    public void setAllowUseOriginalMessage(String allowUseOriginalMessage) {
353        this.allowUseOriginalMessage = allowUseOriginalMessage;
354    }
355
356    public String getRuntimeEndpointRegistryEnabled() {
357        return runtimeEndpointRegistryEnabled;
358    }
359
360    public void setRuntimeEndpointRegistryEnabled(String runtimeEndpointRegistryEnabled) {
361        this.runtimeEndpointRegistryEnabled = runtimeEndpointRegistryEnabled;
362    }
363
364    public String getManagementNamePattern() {
365        return managementNamePattern;
366    }
367
368    public void setManagementNamePattern(String managementNamePattern) {
369        this.managementNamePattern = managementNamePattern;
370    }
371
372    public String getThreadNamePattern() {
373        return threadNamePattern;
374    }
375
376    public void setThreadNamePattern(String threadNamePattern) {
377        this.threadNamePattern = threadNamePattern;
378    }
379
380    @Deprecated
381    public Boolean getLazyLoadTypeConverters() {
382        // use false by default
383        return lazyLoadTypeConverters != null ? lazyLoadTypeConverters : Boolean.FALSE;
384    }
385
386    @Deprecated
387    public void setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters) {
388        this.lazyLoadTypeConverters = lazyLoadTypeConverters;
389    }
390
391    public Boolean getTypeConverterStatisticsEnabled() {
392        return typeConverterStatisticsEnabled;
393    }
394
395    public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) {
396        this.typeConverterStatisticsEnabled = typeConverterStatisticsEnabled;
397    }
398
399    public ShutdownRoute getShutdownRoute() {
400        return shutdownRoute;
401    }
402
403    public void setShutdownRoute(ShutdownRoute shutdownRoute) {
404        this.shutdownRoute = shutdownRoute;
405    }
406
407    public ShutdownRunningTask getShutdownRunningTask() {
408        return shutdownRunningTask;
409    }
410
411    public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) {
412        this.shutdownRunningTask = shutdownRunningTask;
413    }
414
415    public CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder() {
416        return camelPropertyPlaceholder;
417    }
418
419    public void setCamelPropertyPlaceholder(CamelPropertyPlaceholderDefinition camelPropertyPlaceholder) {
420        this.camelPropertyPlaceholder = camelPropertyPlaceholder;
421    }
422
423    public List<RouteContextRefDefinition> getRouteRefs() {
424        return routeRefs;
425    }
426
427    public void setRouteRefs(List<RouteContextRefDefinition> routeRefs) {
428        this.routeRefs = routeRefs;
429    }
430
431    public List<RestContextRefDefinition> getRestRefs() {
432        return restRefs;
433    }
434
435    public void setRestRefs(List<RestContextRefDefinition> restRefs) {
436        this.restRefs = restRefs;
437    }
438
439    public List<CamelRedeliveryPolicyFactoryBean> getRedeliveryPolicies() {
440        return redeliveryPolicies;
441    }
442
443    public void setRedeliveryPolicies(List<CamelRedeliveryPolicyFactoryBean> redeliveryPolicies) {
444        this.redeliveryPolicies = redeliveryPolicies;
445    }
446
447    public List<ThreadPoolProfileDefinition> getThreadPoolProfiles() {
448        return threadPoolProfiles;
449    }
450
451    public void setThreadPoolProfiles(List<ThreadPoolProfileDefinition> threadPoolProfiles) {
452        this.threadPoolProfiles = threadPoolProfiles;
453    }
454
455    public List<CamelThreadPoolFactoryBean> getThreadPools() {
456        return threadPools;
457    }
458
459    public void setThreadPools(List<CamelThreadPoolFactoryBean> threadPools) {
460        this.threadPools = threadPools;
461    }
462
463    public String getTrace() {
464        return trace;
465    }
466
467    public void setTrace(String trace) {
468        this.trace = trace;
469    }
470
471    public String getMessageHistory() {
472        return messageHistory;
473    }
474
475    public void setMessageHistory(String messageHistory) {
476        this.messageHistory = messageHistory;
477    }
478
479    public String getStreamCache() {
480        return streamCache;
481    }
482
483    public void setStreamCache(String streamCache) {
484        this.streamCache = streamCache;
485    }
486
487    public String getDelayer() {
488        return delayer;
489    }
490
491    public void setDelayer(String delayer) {
492        this.delayer = delayer;
493    }
494
495    public String getHandleFault() {
496        return handleFault;
497    }
498
499    public void setHandleFault(String handleFault) {
500        this.handleFault = handleFault;
501    }
502
503    public String getErrorHandlerRef() {
504        return errorHandlerRef;
505    }
506
507    public void setErrorHandlerRef(String errorHandlerRef) {
508        this.errorHandlerRef = errorHandlerRef;
509    }
510
511    public PropertiesDefinition getProperties() {
512        return properties;
513    }
514
515    public void setProperties(PropertiesDefinition properties) {
516        this.properties = properties;
517    }
518
519    public String[] getPackages() {
520        return packages;
521    }
522
523    public void setPackages(String[] packages) {
524        this.packages = packages;
525    }
526
527    public PackageScanDefinition getPackageScan() {
528        return packageScan;
529    }
530
531    public void setPackageScan(PackageScanDefinition packageScan) {
532        this.packageScan = packageScan;
533    }
534
535    public ContextScanDefinition getContextScan() {
536        return contextScan;
537    }
538
539    public void setContextScan(ContextScanDefinition contextScan) {
540        this.contextScan = contextScan;
541    }
542
543    public CamelJMXAgentDefinition getCamelJMXAgent() {
544        return camelJMXAgent;
545    }
546
547    public void setCamelJMXAgent(CamelJMXAgentDefinition camelJMXAgent) {
548        this.camelJMXAgent = camelJMXAgent;
549    }
550
551    public CamelStreamCachingStrategyDefinition getCamelStreamCachingStrategy() {
552        return camelStreamCachingStrategy;
553    }
554
555    public void setCamelStreamCachingStrategy(CamelStreamCachingStrategyDefinition camelStreamCachingStrategy) {
556        this.camelStreamCachingStrategy = camelStreamCachingStrategy;
557    }
558
559    public List<?> getBeans() {
560        return beans;
561    }
562
563    public void setBeans(List<?> beans) {
564        this.beans = beans;
565    }
566
567    public List<RouteBuilderDefinition> getBuilderRefs() {
568        return builderRefs;
569    }
570
571    public void setBuilderRefs(List<RouteBuilderDefinition> builderRefs) {
572        this.builderRefs = builderRefs;
573    }
574
575    public List<CamelEndpointFactoryBean> getEndpoints() {
576        return endpoints;
577    }
578
579    public void setEndpoints(List<CamelEndpointFactoryBean> endpoints) {
580        this.endpoints = endpoints;
581    }
582
583    public DataFormatsDefinition getDataFormats() {
584        return dataFormats;
585    }
586
587    public void setDataFormats(DataFormatsDefinition dataFormats) {
588        this.dataFormats = dataFormats;
589    }
590
591    public List<OnExceptionDefinition> getOnExceptions() {
592        return onExceptions;
593    }
594
595    public void setOnExceptions(List<OnExceptionDefinition> onExceptions) {
596        this.onExceptions = onExceptions;
597    }
598
599    public List<OnCompletionDefinition> getOnCompletions() {
600        return onCompletions;
601    }
602
603    public void setOnCompletions(List<OnCompletionDefinition> onCompletions) {
604        this.onCompletions = onCompletions;
605    }
606
607    public List<InterceptDefinition> getIntercepts() {
608        return intercepts;
609    }
610
611    public void setIntercepts(List<InterceptDefinition> intercepts) {
612        this.intercepts = intercepts;
613    }
614
615    public List<InterceptFromDefinition> getInterceptFroms() {
616        return interceptFroms;
617    }
618
619    public void setInterceptFroms(List<InterceptFromDefinition> interceptFroms) {
620        this.interceptFroms = interceptFroms;
621    }
622
623    public List<InterceptSendToEndpointDefinition> getInterceptSendToEndpoints() {
624        return interceptSendToEndpoints;
625    }
626
627    public void setInterceptSendToEndpoints(List<InterceptSendToEndpointDefinition> interceptSendToEndpoints) {
628        this.interceptSendToEndpoints = interceptSendToEndpoints;
629    }
630
631    public List<RouteDefinition> getRoutes() {
632        return routes;
633    }
634
635    public void setRoutes(List<RouteDefinition> routes) {
636        this.routes = routes;
637    }
638
639    public List<RestDefinition> getRests() {
640        return rests;
641    }
642
643    public void setRests(List<RestDefinition> rests) {
644        this.rests = rests;
645    }
646
647    public RestConfigurationDefinition getRestConfiguration() {
648        return restConfiguration;
649    }
650
651    public void setRestConfiguration(RestConfigurationDefinition restConfiguration) {
652        this.restConfiguration = restConfiguration;
653    }
654
655    public boolean isImplicitId() {
656        return implicitId;
657    }
658    
659    public void setImplicitId(boolean flag) {
660        implicitId = flag;
661    }
662
663    public Boolean getUseBlueprintPropertyResolver() {
664        return useBlueprintPropertyResolver;
665    }
666
667    public void setUseBlueprintPropertyResolver(Boolean useBlueprintPropertyResolver) {
668        this.useBlueprintPropertyResolver = useBlueprintPropertyResolver;
669    }
670
671    public boolean isUseBlueprintPropertyResolver() {
672        // enable by default
673        return useBlueprintPropertyResolver == null || useBlueprintPropertyResolver.booleanValue();
674    }
675
676}