public class SpringCamelContext extends org.apache.camel.impl.DefaultCamelContext implements org.springframework.context.Lifecycle, org.springframework.context.ApplicationContextAware, org.springframework.context.Phased, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>, org.springframework.core.Ordered
CamelContext
which
will automatically register itself with Springs lifecycle methods plus allows
spring to be used to customize a any Type Converters
as well as supporting accessing components and beans via the Spring
ApplicationContext
Constructor and Description |
---|
SpringCamelContext() |
SpringCamelContext(org.springframework.context.ApplicationContext applicationContext) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.camel.Endpoint |
convertBeanToEndpoint(String uri,
Object bean) |
protected EventEndpoint |
createEventEndpoint() |
protected org.apache.camel.spi.Injector |
createInjector() |
protected org.apache.camel.spi.ManagementMBeanAssembler |
createManagementMBeanAssembler() |
protected org.apache.camel.spi.ModelJAXBContextFactory |
createModelJAXBContextFactory() |
protected org.apache.camel.spi.Registry |
createRegistry() |
org.springframework.context.ApplicationContext |
getApplicationContext() |
EventEndpoint |
getEventEndpoint()
Deprecated.
|
int |
getOrder() |
int |
getPhase() |
boolean |
isRunning() |
boolean |
isShutdownEager()
Whether to shutdown this
SpringCamelContext eager (first)
when Spring ApplicationContext is being stopped. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setEventEndpoint(EventEndpoint eventEndpoint)
Deprecated.
|
static void |
setNoStart(boolean b) |
void |
setShutdownEager(boolean shutdownEager) |
static SpringCamelContext |
springCamelContext(org.springframework.context.ApplicationContext applicationContext)
Deprecated.
its better to create and boot Spring the standard Spring way and to get hold of CamelContext
using the Spring API.
|
static SpringCamelContext |
springCamelContext(org.springframework.context.ApplicationContext applicationContext,
boolean maybeStart)
Deprecated.
its better to create and boot Spring the standard Spring way and to get hold of CamelContext
using the Spring API.
|
static SpringCamelContext |
springCamelContext(String configLocations)
Deprecated.
its better to create and boot Spring the standard Spring way and to get hold of CamelContext
using the Spring API.
|
void |
start() |
void |
stop() |
String |
toString() |
adapt, addComponent, addEndpoint, addEndpointToRegistry, addHystrixConfiguration, addInterceptStrategy, addLifecycleStrategy, addLogListener, addRegisterEndpointCallback, addRestConfiguration, addRestDefinitions, addRouteDefinition, addRouteDefinitions, addRoutePolicyFactory, addRoutes, addService, addService, addService, addServiceCallConfiguration, addStartupListener, createComponentResolver, createConsumerTemplate, createConsumerTemplate, createDataFormat, createEndpoint, createFluentProducerTemplate, createFluentProducerTemplate, createManagementStrategy, createProducerTemplate, createProducerTemplate, createRouteStaticEndpointJson, createRouteStaticEndpointJson, createTypeConverter, deferStartService, disableJMX, doResume, doStart, doStartOrResumeRoutes, doStop, doSuspend, explainComponentJson, explainDataFormatJson, explainEipJson, explainEndpointJson, findComponents, findEips, forceLazyInitialization, forceStopLazyInitialization, getApplicationContextClassLoader, getAsyncProcessorAwaitManager, getClassResolver, getComponent, getComponent, getComponent, getComponent, getComponentDocumentation, getComponentNames, getComponentParameterJsonSchema, getComponentResolver, getDataFormatParameterJsonSchema, getDataFormatResolver, getDataFormats, getDebugger, getDefaultBacklogDebugger, getDefaultBacklogTracer, getDefaultFactoryFinder, getDefaultTracer, getDelayer, getEipParameterJsonSchema, getEndpoint, getEndpoint, getEndpointKey, getEndpointKey, getEndpointKeyPreNormalized, getEndpointMap, getEndpointRegistry, getEndpoints, getErrorHandlerBuilder, getErrorHandlerExecutorService, getExecutorServiceManager, getExecutorServiceStrategy, getFactoryFinder, getGlobalOption, getGlobalOptions, getHeadersMapFactory, getHealthCheckRegistry, getHystrixConfiguration, getInflightRepository, getInjector, getInterceptStrategies, getLanguageNames, getLanguageParameterJsonSchema, getLanguageResolver, getLifecycleStrategies, getLogListeners, getManagedCamelContext, getManagedProcessor, getManagedRoute, getManagementMBeanAssembler, getManagementName, getManagementNameStrategy, getManagementStrategy, getMessageHistoryFactory, getModelJAXBContextFactory, getName, getNameStrategy, getNodeIdFactory, getPackageScanClassResolver, getPollingConsumerServicePool, getProcessor, getProcessor, getProcessorDefinition, getProcessorDefinition, getProcessorFactory, getProducerServicePool, getProperties, getPropertiesComponent, getProperty, getPropertyPrefixToken, getPropertySuffixToken, getRegistry, getRegistry, getReloadStrategy, getRestConfiguration, getRestConfiguration, getRestConfigurations, getRestDefinitions, getRestRegistry, getRoute, getRouteController, getRouteDefinition, getRouteDefinitions, getRoutePolicyFactories, getRoutes, getRouteServices, getRouteStartupOrder, getRouteStatus, getRuntimeCamelCatalog, getRuntimeEndpointRegistry, getServiceCallConfiguration, getShutdownRoute, getShutdownRunningTask, getShutdownStrategy, getSSLContextParameters, getStreamCachingStrategy, getTransformerRegistry, getTransformers, getTypeConverter, getTypeConverterRegistry, getUnitOfWorkFactory, getUptime, getUptimeMillis, getUuidGenerator, getValidatorRegistry, getValidators, hasComponent, hasEndpoint, hasService, hasService, hasServices, isAllowUseOriginalMessage, isAutoCreateComponents, isAutoStartup, isHandleFault, isLazyLoadTypeConverters, isLoadTypeConverters, isLogExhaustedMessageBody, isLogMask, isMessageHistory, isSetupRoutes, isStartingRoutes, isStreamCaching, isTracing, isTypeConverterStatisticsEnabled, isUseBreadcrumb, isUseDataType, isUseMDCLogging, isVetoStarted, loadRestsDefinition, loadRoutesDefinition, logRouteState, lookupPropertiesComponent, normalizeEndpointUri, removeComponent, removeEndpoint, removeEndpoints, removeRoute, removeRouteDefinition, removeRouteDefinition, removeRouteDefinitions, removeService, resolveComponent, resolveComponentDefaultName, resolveDataFormat, resolveDataFormatDefinition, resolveLanguage, resolvePropertyPlaceholders, resolveTransformer, resolveTransformer, resolveValidator, resume, resumeRoute, resumeRouteService, routeSupportsSuspension, safelyStartRouteServices, safelyStartRouteServices, setAllowUseOriginalMessage, setApplicationContextClassLoader, setAsyncProcessorAwaitManager, setAutoCreateComponents, setAutoStartup, setClassResolver, setComponentResolver, setContextCounter, setDataFormatResolver, setDataFormats, setDebugger, setDefaultBacklogDebugger, setDefaultBacklogTracer, setDefaultTracer, setDelayer, setErrorHandlerBuilder, setExecutorServiceManager, setFactoryFinderResolver, setGlobalOptions, setHandleFault, setHeadersMapFactory, setHealthCheckRegistry, setHystrixConfiguration, setHystrixConfigurations, setInflightRepository, setInjector, setInterceptStrategies, setJndiContext, setLanguageResolver, setLazyLoadTypeConverters, setLifecycleStrategies, setLoadTypeConverters, setLogExhaustedMessageBody, setLogMask, setManagementMBeanAssembler, setManagementName, setManagementNameStrategy, setManagementStrategy, setMessageHistory, setMessageHistoryFactory, setModelJAXBContextFactory, setName, setNameStrategy, setNodeIdFactory, setPackageScanClassResolver, setPollingConsumerServicePool, setProcessorFactory, setProducerServicePool, setProperties, setRegistry, setReloadStrategy, setRestConfiguration, setRestRegistry, setRouteController, setRoutePolicyFactories, setRoutes, setRuntimeEndpointRegistry, setServiceCallConfiguration, setServiceCallConfigurations, setShutdownRoute, setShutdownRunningTask, setShutdownStrategy, setSSLContextParameters, setStreamCaching, setStreamCachingStrategy, setTracing, setTransformers, setTypeConverter, setTypeConverterRegistry, setTypeConverterStatisticsEnabled, setUnitOfWorkFactory, setupRoutes, setUseBreadcrumb, setUseDataType, setUseMDCLogging, setUuidGenerator, setValidators, shouldStartRoutes, shutdown, shutdownRoute, shutdownRoute, shutdownRouteService, startAllRoutes, startRoute, startRoute, startRouteDefinitions, startRouteService, stopRoute, stopRoute, stopRoute, stopRoute, stopRouteService, stopRouteService, suspend, suspendRoute, suspendRoute, suspendRouteService
doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended
public SpringCamelContext()
public SpringCamelContext(org.springframework.context.ApplicationContext applicationContext)
public static void setNoStart(boolean b)
@Deprecated public static SpringCamelContext springCamelContext(org.springframework.context.ApplicationContext applicationContext) throws Exception
Exception
@Deprecated public static SpringCamelContext springCamelContext(org.springframework.context.ApplicationContext applicationContext, boolean maybeStart) throws Exception
Exception
@Deprecated public static SpringCamelContext springCamelContext(String configLocations) throws Exception
Exception
public void start()
start
in interface org.apache.camel.CamelContext
start
in interface org.apache.camel.Service
start
in interface org.springframework.context.Lifecycle
start
in class org.apache.camel.impl.DefaultCamelContext
public void stop()
stop
in interface org.apache.camel.CamelContext
stop
in interface org.apache.camel.Service
stop
in interface org.springframework.context.Lifecycle
stop
in class org.apache.camel.impl.DefaultCamelContext
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public org.springframework.context.ApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
@Deprecated public EventEndpoint getEventEndpoint()
@Deprecated public void setEventEndpoint(EventEndpoint eventEndpoint)
public boolean isShutdownEager()
SpringCamelContext
eager (first)
when Spring ApplicationContext
is being stopped.
Important: This option is default true which ensures we shutdown Camel
before other beans. Setting this to false restores old behavior in earlier
Camel releases, which can be used for special cases to behave as before.public void setShutdownEager(boolean shutdownEager)
isShutdownEager()
protected org.apache.camel.spi.Injector createInjector()
createInjector
in class org.apache.camel.impl.DefaultCamelContext
protected org.apache.camel.spi.ManagementMBeanAssembler createManagementMBeanAssembler()
createManagementMBeanAssembler
in class org.apache.camel.impl.DefaultCamelContext
protected EventEndpoint createEventEndpoint()
protected org.apache.camel.Endpoint convertBeanToEndpoint(String uri, Object bean)
convertBeanToEndpoint
in class org.apache.camel.impl.DefaultCamelContext
protected org.apache.camel.spi.Registry createRegistry()
createRegistry
in class org.apache.camel.impl.DefaultCamelContext
protected org.apache.camel.spi.ModelJAXBContextFactory createModelJAXBContextFactory()
createModelJAXBContextFactory
in class org.apache.camel.impl.DefaultCamelContext
public String toString()
toString
in class org.apache.camel.impl.DefaultCamelContext
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
Apache Camel