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