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