org.apache.camel.core.xml
Class AbstractCamelContextFactoryBean<T extends org.apache.camel.model.ModelCamelContext>

java.lang.Object
  extended by org.apache.camel.model.IdentifiedType
      extended by org.apache.camel.core.xml.AbstractCamelContextFactoryBean<T>
All Implemented Interfaces:
org.apache.camel.model.RouteContainer

public abstract class AbstractCamelContextFactoryBean<T extends org.apache.camel.model.ModelCamelContext>
extends org.apache.camel.model.IdentifiedType
implements org.apache.camel.model.RouteContainer

A factory to create and initialize a CamelContext and install routes either explicitly configured or found by searching the classpath for Java classes which extend RouteBuilder.

Version:

Field Summary
static String LAZY_LOAD_TYPE_CONVERTERS
          JVM system property to control lazy loading of type converters.
 
Constructor Summary
AbstractCamelContextFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
protected  void findRouteBuilders()
          Strategy method to try find RouteBuilder instances on the classpath
protected abstract  void findRouteBuildersByContextScan(org.apache.camel.spi.PackageScanFilter filter, List<org.apache.camel.RoutesBuilder> builders)
           
protected abstract  void findRouteBuildersByPackageScan(String[] packages, org.apache.camel.spi.PackageScanFilter filter, List<org.apache.camel.RoutesBuilder> builders)
           
abstract  String getAutoStartup()
           
protected abstract
<S> S
getBeanForType(Class<S> clazz)
           
abstract  List<org.apache.camel.model.RouteBuilderDefinition> getBuilderRefs()
           
abstract  CamelJMXAgentDefinition getCamelJMXAgent()
           
abstract  CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder()
           
 T getContext()
           
abstract  T getContext(boolean create)
           
 ClassLoader getContextClassLoaderOnStart()
           
abstract  org.apache.camel.model.ContextScanDefinition getContextScan()
           
abstract  org.apache.camel.model.dataformat.DataFormatsDefinition getDataFormats()
           
abstract  String getDelayer()
           
abstract  String getDependsOn()
           
abstract  List<? extends AbstractCamelEndpointFactoryBean> getEndpoints()
           
abstract  String getErrorHandlerRef()
           
abstract  String getHandleFault()
           
abstract  List<org.apache.camel.model.InterceptFromDefinition> getInterceptFroms()
           
abstract  List<org.apache.camel.model.InterceptDefinition> getIntercepts()
           
abstract  List<org.apache.camel.model.InterceptSendToEndpointDefinition> getInterceptSendToEndpoints()
           
abstract  Boolean getLazyLoadTypeConverters()
           
 Object getObject()
           
 Class getObjectType()
           
abstract  List<org.apache.camel.model.OnCompletionDefinition> getOnCompletions()
           
abstract  List<org.apache.camel.model.OnExceptionDefinition> getOnExceptions()
           
abstract  String[] getPackages()
           
abstract  org.apache.camel.model.PackageScanDefinition getPackageScan()
           
abstract  org.apache.camel.model.config.PropertiesDefinition getProperties()
           
abstract  List<? extends AbstractCamelRedeliveryPolicyFactoryBean> getRedeliveryPolicies()
           
abstract  List<org.apache.camel.model.RouteContextRefDefinition> getRouteRefs()
           
abstract  List<org.apache.camel.model.RouteDefinition> getRoutes()
           
abstract  org.apache.camel.ShutdownRoute getShutdownRoute()
           
abstract  org.apache.camel.ShutdownRunningTask getShutdownRunningTask()
           
abstract  String getStreamCache()
           
abstract  List<org.apache.camel.model.ThreadPoolProfileDefinition> getThreadPoolProfiles()
           
abstract  String getTrace()
           
abstract  String getUseBreadcrumb()
           
abstract  String getUseMDCLogging()
           
protected abstract  void initBeanPostProcessor(T context)
           
protected  void initCamelContext(T ctx)
          Initializes the context
protected abstract  void initCustomRegistry(T context)
           
protected  void initJMXAgent()
           
protected  void initLazyLoadTypeConverteres()
           
protected  void initPropertyPlaceholder()
           
protected  void initRouteRefs()
           
protected  void initThreadPoolProfiles(T context)
           
protected  void installRoutes()
          Strategy to install all available routes into the context
 boolean isSingleton()
           
protected abstract  void postProcessBeforeInit(org.apache.camel.builder.RouteBuilder builder)
           
abstract  void setContextScan(org.apache.camel.model.ContextScanDefinition contextScan)
           
abstract  void setPackageScan(org.apache.camel.model.PackageScanDefinition packageScan)
           
 
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.model.RouteContainer
setRoutes
 

Field Detail

LAZY_LOAD_TYPE_CONVERTERS

public static final String LAZY_LOAD_TYPE_CONVERTERS
JVM system property to control lazy loading of type converters.

See Also:
Constant Field Values
Constructor Detail

AbstractCamelContextFactoryBean

public AbstractCamelContextFactoryBean()
Method Detail

getObject

public Object getObject()
                 throws Exception
Throws:
Exception

getObjectType

public Class getObjectType()

isSingleton

public boolean isSingleton()

getContextClassLoaderOnStart

public ClassLoader getContextClassLoaderOnStart()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Throws:
Exception

initCustomRegistry

protected abstract void initCustomRegistry(T context)

initLazyLoadTypeConverteres

protected void initLazyLoadTypeConverteres()

initJMXAgent

protected void initJMXAgent()
                     throws Exception
Throws:
Exception

initPropertyPlaceholder

protected void initPropertyPlaceholder()
                                throws Exception
Throws:
Exception

initRouteRefs

protected void initRouteRefs()
                      throws Exception
Throws:
Exception

getBeanForType

protected abstract <S> S getBeanForType(Class<S> clazz)

destroy

public void destroy()
             throws Exception
Throws:
Exception

getContext

public T getContext()

getContext

public abstract T getContext(boolean create)

getRoutes

public abstract List<org.apache.camel.model.RouteDefinition> getRoutes()
Specified by:
getRoutes in interface org.apache.camel.model.RouteContainer

getEndpoints

public abstract List<? extends AbstractCamelEndpointFactoryBean> getEndpoints()

getRedeliveryPolicies

public abstract List<? extends AbstractCamelRedeliveryPolicyFactoryBean> getRedeliveryPolicies()

getIntercepts

public abstract List<org.apache.camel.model.InterceptDefinition> getIntercepts()

getInterceptFroms

public abstract List<org.apache.camel.model.InterceptFromDefinition> getInterceptFroms()

getInterceptSendToEndpoints

public abstract List<org.apache.camel.model.InterceptSendToEndpointDefinition> getInterceptSendToEndpoints()

getProperties

public abstract org.apache.camel.model.config.PropertiesDefinition getProperties()

getPackages

public abstract String[] getPackages()

getPackageScan

public abstract org.apache.camel.model.PackageScanDefinition getPackageScan()

setPackageScan

public abstract void setPackageScan(org.apache.camel.model.PackageScanDefinition packageScan)

getContextScan

public abstract org.apache.camel.model.ContextScanDefinition getContextScan()

setContextScan

public abstract void setContextScan(org.apache.camel.model.ContextScanDefinition contextScan)

getCamelPropertyPlaceholder

public abstract CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder()

getTrace

public abstract String getTrace()

getStreamCache

public abstract String getStreamCache()

getDelayer

public abstract String getDelayer()

getHandleFault

public abstract String getHandleFault()

getAutoStartup

public abstract String getAutoStartup()

getUseMDCLogging

public abstract String getUseMDCLogging()

getUseBreadcrumb

public abstract String getUseBreadcrumb()

getLazyLoadTypeConverters

public abstract Boolean getLazyLoadTypeConverters()

getCamelJMXAgent

public abstract CamelJMXAgentDefinition getCamelJMXAgent()

getBuilderRefs

public abstract List<org.apache.camel.model.RouteBuilderDefinition> getBuilderRefs()

getRouteRefs

public abstract List<org.apache.camel.model.RouteContextRefDefinition> getRouteRefs()

getErrorHandlerRef

public abstract String getErrorHandlerRef()

getDataFormats

public abstract org.apache.camel.model.dataformat.DataFormatsDefinition getDataFormats()

getOnExceptions

public abstract List<org.apache.camel.model.OnExceptionDefinition> getOnExceptions()

getOnCompletions

public abstract List<org.apache.camel.model.OnCompletionDefinition> getOnCompletions()

getShutdownRoute

public abstract org.apache.camel.ShutdownRoute getShutdownRoute()

getShutdownRunningTask

public abstract org.apache.camel.ShutdownRunningTask getShutdownRunningTask()

getThreadPoolProfiles

public abstract List<org.apache.camel.model.ThreadPoolProfileDefinition> getThreadPoolProfiles()

getDependsOn

public abstract String getDependsOn()

initCamelContext

protected void initCamelContext(T ctx)
                         throws Exception
Initializes the context

Parameters:
ctx - the context
Throws:
Exception - is thrown if error occurred

initThreadPoolProfiles

protected void initThreadPoolProfiles(T context)
                               throws Exception
Throws:
Exception

initBeanPostProcessor

protected abstract void initBeanPostProcessor(T context)

installRoutes

protected void installRoutes()
                      throws Exception
Strategy to install all available routes into the context

Throws:
Exception

postProcessBeforeInit

protected abstract void postProcessBeforeInit(org.apache.camel.builder.RouteBuilder builder)

findRouteBuilders

protected void findRouteBuilders()
                          throws Exception
Strategy method to try find RouteBuilder instances on the classpath

Throws:
Exception

findRouteBuildersByPackageScan

protected abstract void findRouteBuildersByPackageScan(String[] packages,
                                                       org.apache.camel.spi.PackageScanFilter filter,
                                                       List<org.apache.camel.RoutesBuilder> builders)
                                                throws Exception
Throws:
Exception

findRouteBuildersByContextScan

protected abstract void findRouteBuildersByContextScan(org.apache.camel.spi.PackageScanFilter filter,
                                                       List<org.apache.camel.RoutesBuilder> builders)
                                                throws Exception
Throws:
Exception


Apache CAMEL