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     */
017    package org.apache.camel.spring;
018    
019    import java.util.ArrayList;
020    import java.util.List;
021    import java.util.Map;
022    import javax.xml.bind.annotation.XmlAccessType;
023    import javax.xml.bind.annotation.XmlAccessorType;
024    import javax.xml.bind.annotation.XmlAttribute;
025    import javax.xml.bind.annotation.XmlElement;
026    import javax.xml.bind.annotation.XmlElements;
027    import javax.xml.bind.annotation.XmlRootElement;
028    import javax.xml.bind.annotation.XmlTransient;
029    
030    import org.apache.camel.CamelContext;
031    import org.apache.camel.RoutesBuilder;
032    import org.apache.camel.ShutdownRoute;
033    import org.apache.camel.ShutdownRunningTask;
034    import org.apache.camel.builder.RouteBuilder;
035    import org.apache.camel.component.properties.PropertiesComponent;
036    import org.apache.camel.core.xml.AbstractCamelContextFactoryBean;
037    import org.apache.camel.core.xml.CamelJMXAgentDefinition;
038    import org.apache.camel.core.xml.CamelPropertyPlaceholderDefinition;
039    import org.apache.camel.core.xml.CamelProxyFactoryDefinition;
040    import org.apache.camel.core.xml.CamelServiceExporterDefinition;
041    import org.apache.camel.core.xml.CamelStreamCachingStrategyDefinition;
042    import org.apache.camel.model.ContextScanDefinition;
043    import org.apache.camel.model.InterceptDefinition;
044    import org.apache.camel.model.InterceptFromDefinition;
045    import org.apache.camel.model.InterceptSendToEndpointDefinition;
046    import org.apache.camel.model.OnCompletionDefinition;
047    import org.apache.camel.model.OnExceptionDefinition;
048    import org.apache.camel.model.PackageScanDefinition;
049    import org.apache.camel.model.RouteBuilderDefinition;
050    import org.apache.camel.model.RouteContextRefDefinition;
051    import org.apache.camel.model.RouteDefinition;
052    import org.apache.camel.model.ThreadPoolProfileDefinition;
053    import org.apache.camel.model.config.PropertiesDefinition;
054    import org.apache.camel.model.dataformat.DataFormatsDefinition;
055    import org.apache.camel.spi.PackageScanFilter;
056    import org.apache.camel.spi.Registry;
057    import org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer;
058    import org.slf4j.Logger;
059    import org.slf4j.LoggerFactory;
060    import org.springframework.beans.factory.DisposableBean;
061    import org.springframework.beans.factory.FactoryBean;
062    import org.springframework.beans.factory.InitializingBean;
063    import org.springframework.beans.factory.config.BeanPostProcessor;
064    import org.springframework.context.ApplicationContext;
065    import org.springframework.context.ApplicationContextAware;
066    import org.springframework.context.ApplicationEvent;
067    import org.springframework.context.ApplicationListener;
068    import org.springframework.context.event.ContextRefreshedEvent;
069    
070    import static org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException;
071    
072    /**
073     * A Spring {@link FactoryBean} to create and initialize a
074     * {@link SpringCamelContext} and install routes either explicitly configured in
075     * Spring XML or found by searching the classpath for Java classes which extend
076     * {@link RouteBuilder} using the nested {@link #setPackages(String[])}.
077     *
078     * @version 
079     */
080    @XmlRootElement(name = "camelContext")
081    @XmlAccessorType(XmlAccessType.FIELD)
082    @SuppressWarnings("unused")
083    public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<SpringCamelContext>
084            implements FactoryBean<SpringCamelContext>, InitializingBean, DisposableBean, ApplicationContextAware, ApplicationListener<ApplicationEvent> {
085        private static final Logger LOG = LoggerFactory.getLogger(CamelContextFactoryBean.class);
086    
087        @XmlAttribute(name = "depends-on", required = false)
088        private String dependsOn;
089        @XmlAttribute(required = false)
090        private String trace;
091        @XmlAttribute(required = false)
092        private String messageHistory;
093        @XmlAttribute(required = false)
094        private String streamCache;
095        @XmlAttribute(required = false)
096        private String delayer;
097        @XmlAttribute(required = false)
098        private String handleFault;
099        @XmlAttribute(required = false)
100        private String errorHandlerRef;
101        @XmlAttribute(required = false)
102        private String autoStartup;
103        @XmlAttribute(required = false)
104        private String useMDCLogging;
105        @XmlAttribute(required = false)
106        private String useBreadcrumb;
107        @XmlAttribute(required = false)
108        private String allowUseOriginalMessage;
109        @XmlAttribute(required = false)
110        private String managementNamePattern;
111        @XmlAttribute(required = false)
112        private String threadNamePattern;
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        @XmlElement(name = "properties", required = false)
123        private PropertiesDefinition properties;
124        @XmlElement(name = "propertyPlaceholder", type = CamelPropertyPlaceholderDefinition.class, required = false)
125        private CamelPropertyPlaceholderDefinition camelPropertyPlaceholder;
126        @XmlElement(name = "package", required = false)
127        private String[] packages = {};
128        @XmlElement(name = "packageScan", type = PackageScanDefinition.class, required = false)
129        private PackageScanDefinition packageScan;
130        @XmlElement(name = "contextScan", type = ContextScanDefinition.class, required = false)
131        private ContextScanDefinition contextScan;
132        @XmlElement(name = "streamCaching", type = CamelStreamCachingStrategyDefinition.class, required = false)
133        private CamelStreamCachingStrategyDefinition camelStreamCachingStrategy;
134        @XmlElement(name = "jmxAgent", type = CamelJMXAgentDefinition.class, required = false)
135        private CamelJMXAgentDefinition camelJMXAgent;
136        @XmlElements({
137                @XmlElement(name = "template", type = CamelProducerTemplateFactoryBean.class, required = false),
138                @XmlElement(name = "consumerTemplate", type = CamelConsumerTemplateFactoryBean.class, required = false),
139                @XmlElement(name = "proxy", type = CamelProxyFactoryDefinition.class, required = false),
140                @XmlElement(name = "export", type = CamelServiceExporterDefinition.class, required = false),
141                @XmlElement(name = "errorHandler", type = ErrorHandlerDefinition.class, required = false)})
142        private List<?> beans;
143        @XmlElement(name = "routeBuilder", required = false)
144        private List<RouteBuilderDefinition> builderRefs = new ArrayList<RouteBuilderDefinition>();
145        @XmlElement(name = "routeContextRef", required = false)
146        private List<RouteContextRefDefinition> routeRefs = new ArrayList<RouteContextRefDefinition>();
147        @XmlElement(name = "threadPoolProfile", required = false)
148        private List<ThreadPoolProfileDefinition> threadPoolProfiles;
149        @XmlElement(name = "threadPool", required = false)
150        private List<CamelThreadPoolFactoryBean> threadPools;
151        @XmlElement(name = "endpoint", required = false)
152        private List<CamelEndpointFactoryBean> endpoints;
153        @XmlElement(name = "dataFormats", required = false)
154        private DataFormatsDefinition dataFormats;
155        @XmlElement(name = "redeliveryPolicyProfile", required = false)
156        private List<CamelRedeliveryPolicyFactoryBean> redeliveryPolicies;
157        @XmlElement(name = "onException", required = false)
158        private List<OnExceptionDefinition> onExceptions = new ArrayList<OnExceptionDefinition>();
159        @XmlElement(name = "onCompletion", required = false)
160        private List<OnCompletionDefinition> onCompletions = new ArrayList<OnCompletionDefinition>();
161        @XmlElement(name = "intercept", required = false)
162        private List<InterceptDefinition> intercepts = new ArrayList<InterceptDefinition>();
163        @XmlElement(name = "interceptFrom", required = false)
164        private List<InterceptFromDefinition> interceptFroms = new ArrayList<InterceptFromDefinition>();
165        @XmlElement(name = "interceptSendToEndpoint", required = false)
166        private List<InterceptSendToEndpointDefinition> interceptSendToEndpoints = new ArrayList<InterceptSendToEndpointDefinition>();
167        @XmlElement(name = "route", required = false)
168        private List<RouteDefinition> routes = new ArrayList<RouteDefinition>();
169        @XmlTransient
170        private SpringCamelContext context;
171        @XmlTransient
172        private ClassLoader contextClassLoaderOnStart;
173        @XmlTransient
174        private ApplicationContext applicationContext;
175        @XmlTransient
176        private BeanPostProcessor beanPostProcessor;
177        @XmlTransient
178        private boolean implicitId;
179        
180    
181        @Override
182        public Class<SpringCamelContext> getObjectType() {
183            return SpringCamelContext.class;
184        }
185        
186        protected <S> S getBeanForType(Class<S> clazz) {
187            S bean = null;
188            String[] names = getApplicationContext().getBeanNamesForType(clazz, true, true);
189            if (names.length == 1) {
190                bean = getApplicationContext().getBean(names[0], clazz);
191            }
192            if (bean == null) {
193                ApplicationContext parentContext = getApplicationContext().getParent();
194                if (parentContext != null) {
195                    names = parentContext.getBeanNamesForType(clazz, true, true);
196                    if (names.length == 1) {
197                        bean = parentContext.getBean(names[0], clazz);
198                    }
199                }
200            }
201            return bean;
202        }
203    
204        @Override
205        protected void findRouteBuildersByPackageScan(String[] packages, PackageScanFilter filter, List<RoutesBuilder> builders) throws Exception {
206            // add filter to class resolver which then will filter
207            getContext().getPackageScanClassResolver().addFilter(filter);
208    
209            PackageScanRouteBuilderFinder finder = new PackageScanRouteBuilderFinder(getContext(), packages, getContextClassLoaderOnStart(),
210                                                                                     getBeanPostProcessor(), getContext().getPackageScanClassResolver());
211            finder.appendBuilders(builders);
212    
213            // and remove the filter
214            getContext().getPackageScanClassResolver().removeFilter(filter);
215        }
216    
217        @Override
218        protected void findRouteBuildersByContextScan(PackageScanFilter filter, List<RoutesBuilder> builders) throws Exception {
219            ContextScanRouteBuilderFinder finder = new ContextScanRouteBuilderFinder(getContext(), filter);
220            finder.appendBuilders(builders);
221        }
222    
223        protected void initBeanPostProcessor(SpringCamelContext context) {
224            if (beanPostProcessor != null) {
225                if (beanPostProcessor instanceof ApplicationContextAware) {
226                    ((ApplicationContextAware) beanPostProcessor).setApplicationContext(applicationContext);
227                }
228                if (beanPostProcessor instanceof CamelBeanPostProcessor) {
229                    ((CamelBeanPostProcessor) beanPostProcessor).setCamelContext(getContext());
230                }
231            }
232        }
233    
234        protected void postProcessBeforeInit(RouteBuilder builder) {
235            if (beanPostProcessor != null) {
236                // Inject the annotated resource
237                beanPostProcessor.postProcessBeforeInitialization(builder, builder.toString());
238            }
239        }
240    
241        protected void initCustomRegistry(SpringCamelContext context) {
242            Registry registry = getBeanForType(Registry.class);
243            if (registry != null) {
244                LOG.info("Using custom Registry: " + registry);
245                context.setRegistry(registry);
246            }
247        }
248    
249        @Override
250        protected void initPropertyPlaceholder() throws Exception {
251            super.initPropertyPlaceholder();
252    
253            Map<String, BridgePropertyPlaceholderConfigurer> beans = applicationContext.getBeansOfType(BridgePropertyPlaceholderConfigurer.class);
254            if (beans.size() == 1) {
255                // setup properties component that uses this beans
256                BridgePropertyPlaceholderConfigurer configurer = beans.values().iterator().next();
257                String id = beans.keySet().iterator().next();
258                LOG.info("Bridging Camel and Spring property placeholder configurer with id: " + id);
259    
260                // get properties component
261                PropertiesComponent pc = getContext().getComponent("properties", PropertiesComponent.class);
262                // replace existing resolver with us
263                configurer.setResolver(pc.getPropertiesResolver());
264                configurer.setParser(pc.getPropertiesParser());
265                String ref = "ref:" + id;
266                // use the bridge to handle the resolve and parsing
267                pc.setPropertiesResolver(configurer);
268                pc.setPropertiesParser(configurer);
269                // and update locations to have our as ref first
270                String[] locations = pc.getLocations();
271                String[] updatedLocations;
272                if (locations != null && locations.length > 0) {
273                    updatedLocations = new String[locations.length + 1];
274                    updatedLocations[0] = ref;
275                    System.arraycopy(locations, 0, updatedLocations, 1, locations.length);
276                } else {
277                    updatedLocations = new String[]{ref};
278                }
279                pc.setLocations(updatedLocations);
280            } else if (beans.size() > 1) {
281                LOG.warn("Cannot bridge Camel and Spring property placeholders, as exact only 1 bean of type BridgePropertyPlaceholderConfigurer"
282                        + " must be defined, was {} beans defined.", beans.size());
283            }
284        }
285    
286        public void onApplicationEvent(ApplicationEvent event) {
287            // From Spring 3.0.1, The BeanFactory applicationEventListener 
288            // and Bean's applicationEventListener will be called,
289            // So we just delegate the onApplicationEvent call here.
290    
291            SpringCamelContext context = getContext(false);
292            if (context != null) {
293                // we need to defer setting up routes until Spring has done all its dependency injection
294                // which is only guaranteed to be done when it emits the ContextRefreshedEvent event.
295                if (event instanceof ContextRefreshedEvent) {
296                    try {
297                        setupRoutes();
298                    } catch (Exception e) {
299                        throw wrapRuntimeCamelException(e);
300                    }
301                }
302                // let the spring camel context handle the events
303                context.onApplicationEvent(event);
304            } else {
305                LOG.debug("Publishing spring-event: {}", event);
306    
307                if (event instanceof ContextRefreshedEvent) {
308                    // now lets start the CamelContext so that all its possible
309                    // dependencies are initialized
310                    try {
311                        // we need to defer setting up routes until Spring has done all its dependency injection
312                        // which is only guaranteed to be done when it emits the ContextRefreshedEvent event.
313                        setupRoutes();
314                        LOG.trace("Starting the context now");
315                        getContext().start();
316                    } catch (Exception e) {
317                        throw wrapRuntimeCamelException(e);
318                    }
319                }
320            }
321        }
322    
323        // Properties
324        // -------------------------------------------------------------------------
325    
326        public ApplicationContext getApplicationContext() {
327            if (applicationContext == null) {
328                throw new IllegalArgumentException("No applicationContext has been injected!");
329            }
330            return applicationContext;
331        }
332    
333        public void setApplicationContext(ApplicationContext applicationContext) {
334            this.applicationContext = applicationContext;
335        }
336    
337        public void setBeanPostProcessor(BeanPostProcessor postProcessor) {
338            this.beanPostProcessor = postProcessor;
339        }
340    
341        public BeanPostProcessor getBeanPostProcessor() {
342            return beanPostProcessor;
343        }
344    
345        // Implementation methods
346        // -------------------------------------------------------------------------
347    
348        /**
349         * Create the context
350         */
351        protected SpringCamelContext createContext() {
352            SpringCamelContext ctx = newCamelContext();        
353            ctx.setName(getId());        
354            return ctx;
355        }
356    
357        protected SpringCamelContext newCamelContext() {
358            return new SpringCamelContext(getApplicationContext());
359        }
360    
361        public SpringCamelContext getContext(boolean create) {
362            if (context == null && create) {
363                context = createContext();
364            }
365            return context;
366        }
367    
368        public void setContext(SpringCamelContext context) {
369            this.context = context;
370        }
371    
372        public List<RouteDefinition> getRoutes() {
373            return routes;
374        }
375    
376        public void setRoutes(List<RouteDefinition> routes) {
377            this.routes = routes;
378        }
379    
380        public List<CamelEndpointFactoryBean> getEndpoints() {
381            return endpoints;
382        }
383    
384        public List<CamelRedeliveryPolicyFactoryBean> getRedeliveryPolicies() {
385            return redeliveryPolicies;
386        }
387    
388        public List<InterceptDefinition> getIntercepts() {
389            return intercepts;
390        }
391    
392        public void setIntercepts(List<InterceptDefinition> intercepts) {
393            this.intercepts = intercepts;
394        }
395    
396        public List<InterceptFromDefinition> getInterceptFroms() {
397            return interceptFroms;
398        }
399    
400        public void setInterceptFroms(List<InterceptFromDefinition> interceptFroms) {
401            this.interceptFroms = interceptFroms;
402        }
403    
404        public List<InterceptSendToEndpointDefinition> getInterceptSendToEndpoints() {
405            return interceptSendToEndpoints;
406        }
407    
408        public void setInterceptSendToEndpoints(List<InterceptSendToEndpointDefinition> interceptSendToEndpoints) {
409            this.interceptSendToEndpoints = interceptSendToEndpoints;
410        }
411    
412        public PropertiesDefinition getProperties() {
413            return properties;
414        }
415    
416        public void setProperties(PropertiesDefinition properties) {
417            this.properties = properties;
418        }
419    
420        public String[] getPackages() {
421            return packages;
422        }
423    
424        /**
425         * Sets the package names to be recursively searched for Java classes which
426         * extend {@link org.apache.camel.builder.RouteBuilder} to be auto-wired up to the
427         * {@link CamelContext} as a route. Note that classes are excluded if
428         * they are specifically configured in the spring.xml
429         * <p/>
430         * A more advanced configuration can be done using {@link #setPackageScan(org.apache.camel.model.PackageScanDefinition)}
431         *
432         * @param packages the package names which are recursively searched
433         * @see #setPackageScan(org.apache.camel.model.PackageScanDefinition)
434         */
435        public void setPackages(String[] packages) {
436            this.packages = packages;
437        }
438    
439        public PackageScanDefinition getPackageScan() {
440            return packageScan;
441        }
442    
443        /**
444         * Sets the package scanning information. Package scanning allows for the
445         * automatic discovery of certain camel classes at runtime for inclusion
446         * e.g. {@link org.apache.camel.builder.RouteBuilder} implementations
447         *
448         * @param packageScan the package scan
449         */
450        public void setPackageScan(PackageScanDefinition packageScan) {
451            this.packageScan = packageScan;
452        }
453    
454        public ContextScanDefinition getContextScan() {
455            return contextScan;
456        }
457    
458        /**
459         * Sets the context scanning (eg Spring's ApplicationContext) information.
460         * Context scanning allows for the automatic discovery of Camel routes runtime for inclusion
461         * e.g. {@link org.apache.camel.builder.RouteBuilder} implementations
462         *
463         * @param contextScan the context scan
464         */
465        public void setContextScan(ContextScanDefinition contextScan) {
466            this.contextScan = contextScan;
467        }
468    
469        public CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder() {
470            return camelPropertyPlaceholder;
471        }
472    
473        public void setCamelPropertyPlaceholder(CamelPropertyPlaceholderDefinition camelPropertyPlaceholder) {
474            this.camelPropertyPlaceholder = camelPropertyPlaceholder;
475        }
476    
477        public CamelStreamCachingStrategyDefinition getCamelStreamCachingStrategy() {
478            return camelStreamCachingStrategy;
479        }
480    
481        public void setCamelStreamCachingStrategy(CamelStreamCachingStrategyDefinition camelStreamCachingStrategy) {
482            this.camelStreamCachingStrategy = camelStreamCachingStrategy;
483        }
484    
485        public void setCamelJMXAgent(CamelJMXAgentDefinition agent) {
486            camelJMXAgent = agent;
487        }
488    
489        public String getTrace() {
490            return trace;
491        }
492    
493        public void setTrace(String trace) {
494            this.trace = trace;
495        }
496    
497        public String getMessageHistory() {
498            return messageHistory;
499        }
500    
501        public void setMessageHistory(String messageHistory) {
502            this.messageHistory = messageHistory;
503        }
504    
505        public String getStreamCache() {
506            return streamCache;
507        }
508    
509        public void setStreamCache(String streamCache) {
510            this.streamCache = streamCache;
511        }
512    
513        public String getDelayer() {
514            return delayer;
515        }
516    
517        public void setDelayer(String delayer) {
518            this.delayer = delayer;
519        }
520    
521        public String getHandleFault() {
522            return handleFault;
523        }
524    
525        public void setHandleFault(String handleFault) {
526            this.handleFault = handleFault;
527        }
528    
529        public String getAutoStartup() {
530            return autoStartup;
531        }
532    
533        public void setAutoStartup(String autoStartup) {
534            this.autoStartup = autoStartup;
535        }
536    
537        public String getUseMDCLogging() {
538            return useMDCLogging;
539        }
540    
541        public void setUseMDCLogging(String useMDCLogging) {
542            this.useMDCLogging = useMDCLogging;
543        }
544    
545        public String getUseBreadcrumb() {
546            return useBreadcrumb;
547        }
548    
549        public void setUseBreadcrumb(String useBreadcrumb) {
550            this.useBreadcrumb = useBreadcrumb;
551        }
552    
553        public String getAllowUseOriginalMessage() {
554            return allowUseOriginalMessage;
555        }
556    
557        public void setAllowUseOriginalMessage(String allowUseOriginalMessage) {
558            this.allowUseOriginalMessage = allowUseOriginalMessage;
559        }
560    
561        public String getManagementNamePattern() {
562            return managementNamePattern;
563        }
564    
565        public void setManagementNamePattern(String managementNamePattern) {
566            this.managementNamePattern = managementNamePattern;
567        }
568    
569        public String getThreadNamePattern() {
570            return threadNamePattern;
571        }
572    
573        public void setThreadNamePattern(String threadNamePattern) {
574            this.threadNamePattern = threadNamePattern;
575        }
576    
577        @Deprecated
578        public Boolean getLazyLoadTypeConverters() {
579            return lazyLoadTypeConverters;
580        }
581    
582        @Deprecated
583        public void setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters) {
584            this.lazyLoadTypeConverters = lazyLoadTypeConverters;
585        }
586    
587        public Boolean getTypeConverterStatisticsEnabled() {
588            return typeConverterStatisticsEnabled;
589        }
590    
591        public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) {
592            this.typeConverterStatisticsEnabled = typeConverterStatisticsEnabled;
593        }
594    
595        public CamelJMXAgentDefinition getCamelJMXAgent() {
596            return camelJMXAgent;
597        }
598    
599        public List<RouteBuilderDefinition> getBuilderRefs() {
600            return builderRefs;
601        }
602    
603        public void setBuilderRefs(List<RouteBuilderDefinition> builderRefs) {
604            this.builderRefs = builderRefs;
605        }
606    
607        public List<RouteContextRefDefinition> getRouteRefs() {
608            return routeRefs;
609        }
610    
611        public void setRouteRefs(List<RouteContextRefDefinition> routeRefs) {
612            this.routeRefs = routeRefs;
613        }
614    
615        public String getErrorHandlerRef() {
616            return errorHandlerRef;
617        }
618    
619        /**
620         * Sets the name of the error handler object used to default the error handling strategy
621         *
622         * @param errorHandlerRef the Spring bean ref of the error handler
623         */
624        public void setErrorHandlerRef(String errorHandlerRef) {
625            this.errorHandlerRef = errorHandlerRef;
626        }
627    
628        public void setDataFormats(DataFormatsDefinition dataFormats) {
629            this.dataFormats = dataFormats;
630        }
631    
632        public DataFormatsDefinition getDataFormats() {
633            return dataFormats;
634        }
635    
636        public void setOnExceptions(List<OnExceptionDefinition> onExceptions) {
637            this.onExceptions = onExceptions;
638        }
639    
640        public List<OnExceptionDefinition> getOnExceptions() {
641            return onExceptions;
642        }
643    
644        public List<OnCompletionDefinition> getOnCompletions() {
645            return onCompletions;
646        }
647    
648        public void setOnCompletions(List<OnCompletionDefinition> onCompletions) {
649            this.onCompletions = onCompletions;
650        }
651    
652        public ShutdownRoute getShutdownRoute() {
653            return shutdownRoute;
654        }
655    
656        public void setShutdownRoute(ShutdownRoute shutdownRoute) {
657            this.shutdownRoute = shutdownRoute;
658        }
659    
660        public ShutdownRunningTask getShutdownRunningTask() {
661            return shutdownRunningTask;
662        }
663    
664        public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) {
665            this.shutdownRunningTask = shutdownRunningTask;
666        }
667    
668        public List<ThreadPoolProfileDefinition> getThreadPoolProfiles() {
669            return threadPoolProfiles;
670        }
671    
672        public void setThreadPoolProfiles(List<ThreadPoolProfileDefinition> threadPoolProfiles) {
673            this.threadPoolProfiles = threadPoolProfiles;
674        }
675    
676        public String getDependsOn() {
677            return dependsOn;
678        }
679    
680        public void setDependsOn(String dependsOn) {
681            this.dependsOn = dependsOn;
682        }
683        
684        public boolean isImplicitId() {
685            return implicitId;
686        }
687        
688        public void setImplicitId(boolean flag) {
689            implicitId = flag;
690        }
691    
692    }