public class SpringCamelContext extends org.apache.camel.impl.DefaultCamelContext implements InitializingBean, DisposableBean, ApplicationContextAware
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(ApplicationContext applicationContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
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.Registry |
createRegistry() |
void |
destroy() |
ApplicationContext |
getApplicationContext() |
EventEndpoint |
getEventEndpoint()
Deprecated.
|
boolean |
isShutdownEager()
Whether to shutdown this
SpringCamelContext eager (first)
when Spring ApplicationContext is being stopped. |
void |
onApplicationEvent(ApplicationEvent event) |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setEventEndpoint(EventEndpoint eventEndpoint)
Deprecated.
|
static void |
setNoStart(boolean b) |
void |
setShutdownEager(boolean shutdownEager) |
static SpringCamelContext |
springCamelContext(ApplicationContext applicationContext) |
static SpringCamelContext |
springCamelContext(ApplicationContext applicationContext,
boolean maybeStart) |
static SpringCamelContext |
springCamelContext(String configLocations) |
String |
toString() |
addComponent, addEndpoint, addEndpointToRegistry, addInterceptStrategy, addLifecycleStrategy, addRegisterEndpointCallback, addRestDefinitions, addRouteDefinition, addRouteDefinitions, addRoutePolicyFactory, addRoutes, addService, addService, addStartupListener, createComponentResolver, createConsumerTemplate, createConsumerTemplate, createEndpoint, createManagementStrategy, createProducerTemplate, createProducerTemplate, createRouteStaticEndpointJson, createRouteStaticEndpointJson, createTypeConverter, disableJMX, doResume, doStart, doStartOrResumeRoutes, doStop, doSuspend, findComponents, forceLazyInitialization, forceStopLazyInitialization, getApplicationContextClassLoader, getClassResolver, getComponent, getComponent, getComponent, getComponentDocumentation, getComponentNames, getComponentResolver, getDataFormatResolver, getDataFormats, getDebugger, getDefaultBacklogDebugger, getDefaultBacklogTracer, getDefaultFactoryFinder, getDefaultTracer, getDelayer, getEndpoint, getEndpoint, getEndpointKey, getEndpointKey, getEndpointMap, getEndpoints, getErrorHandlerBuilder, getErrorHandlerExecutorService, getExecutorServiceManager, getExecutorServiceStrategy, getFactoryFinder, getInflightRepository, getInjector, getInterceptStrategies, getLanguageNames, getLanguageResolver, getLifecycleStrategies, getManagementMBeanAssembler, getManagementName, getManagementNameStrategy, getManagementStrategy, getName, getNameStrategy, getNodeIdFactory, getPackageScanClassResolver, getProcessorFactory, getProducerServicePool, getProperties, getPropertiesComponent, getProperty, getPropertyPrefixToken, getPropertySuffixToken, getRegistry, getRegistry, getRestConfiguration, getRestDefinitions, getRestRegistry, getRoute, getRouteDefinition, getRouteDefinitions, getRoutePolicyFactories, getRoutes, getRouteServices, getRouteStartupOrder, getRouteStatus, getRuntimeEndpointRegistry, getShutdownRoute, getShutdownRunningTask, getShutdownStrategy, getStreamCachingStrategy, getTypeConverter, getTypeConverterRegistry, getUnitOfWorkFactory, getUptime, getUuidGenerator, hasComponent, hasEndpoint, hasService, hasService, isAllowUseOriginalMessage, isAutoCreateComponents, isAutoStartup, isHandleFault, isLazyLoadTypeConverters, isMessageHistory, isSetupRoutes, isStartingRoutes, isStreamCaching, isTracing, isTypeConverterStatisticsEnabled, isUseBreadcrumb, isUseMDCLogging, loadRoutesDefinition, logRouteState, lookupPropertiesComponent, normalizeEndpointUri, removeComponent, removeEndpoints, removeRoute, removeRouteDefinition, removeRouteDefinition, removeRouteDefinitions, removeService, resolveDataFormat, resolveDataFormatDefinition, resolveLanguage, resolvePropertyPlaceholders, resumeRoute, resumeRouteService, routeSupportsSuspension, safelyStartRouteServices, safelyStartRouteServices, setAllowUseOriginalMessage, setApplicationContextClassLoader, setAutoCreateComponents, setAutoStartup, setClassResolver, setComponentResolver, setContextCounter, setDataFormatResolver, setDataFormats, setDebugger, setDefaultBacklogDebugger, setDefaultBacklogTracer, setDefaultTracer, setDelayer, setErrorHandlerBuilder, setExecutorServiceManager, setFactoryFinderResolver, setHandleFault, setInflightRepository, setInjector, setInterceptStrategies, setJndiContext, setLanguageResolver, setLazyLoadTypeConverters, setLifecycleStrategies, setManagementMBeanAssembler, setManagementName, setManagementNameStrategy, setManagementStrategy, setMessageHistory, setName, setNameStrategy, setNodeIdFactory, setPackageScanClassResolver, setProcessorFactory, setProducerServicePool, setProperties, setRegistry, setRestConfiguration, setRestRegistry, setRoutePolicyFactories, setRoutes, setRuntimeEndpointRegistry, setShutdownRoute, setShutdownRunningTask, setShutdownStrategy, setStreamCaching, setStreamCachingStrategy, setTracing, setTypeConverter, setTypeConverterRegistry, setTypeConverterStatisticsEnabled, setUnitOfWorkFactory, setupRoutes, setUseBreadcrumb, setUseMDCLogging, setUuidGenerator, shouldStartRoutes, shutdownRoute, shutdownRoute, shutdownRouteService, start, startAllRoutes, startRoute, startRoute, startRouteDefinitions, startRouteService, stopRoute, stopRoute, stopRoute, stopRoute, stopRouteService, stopRouteService, suspendRoute, suspendRoute, suspendRouteServicedoShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, stop, suspendpublic SpringCamelContext()
public SpringCamelContext(ApplicationContext applicationContext)
public static void setNoStart(boolean b)
public static SpringCamelContext springCamelContext(ApplicationContext applicationContext) throws Exception
Exceptionpublic static SpringCamelContext springCamelContext(ApplicationContext applicationContext, boolean maybeStart) throws Exception
Exceptionpublic static SpringCamelContext springCamelContext(String configLocations) throws Exception
Exceptionpublic void afterPropertiesSet() throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void destroy() throws Exception
destroy in interface DisposableBeanExceptionpublic void onApplicationEvent(ApplicationEvent event)
public ApplicationContext getApplicationContext()
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansException@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.DefaultCamelContextprotected org.apache.camel.spi.ManagementMBeanAssembler createManagementMBeanAssembler()
createManagementMBeanAssembler in class org.apache.camel.impl.DefaultCamelContextprotected EventEndpoint createEventEndpoint()
protected org.apache.camel.Endpoint convertBeanToEndpoint(String uri, Object bean)
convertBeanToEndpoint in class org.apache.camel.impl.DefaultCamelContextprotected org.apache.camel.spi.Registry createRegistry()
createRegistry in class org.apache.camel.impl.DefaultCamelContextApache Camel