public class DefaultCamelContext extends ServiceSupport implements ModelCamelContext, Suspendable
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
DefaultCamelContext()
Creates the
CamelContext using JndiRegistry as registry,
but will silently fallback and use SimpleRegistry if JNDI cannot be used. |
DefaultCamelContext(Context jndiContext)
Creates the
CamelContext using the given JNDI context as the registry |
DefaultCamelContext(Registry registry)
Creates the
CamelContext using the given registry |
| Modifier and Type | Method and Description |
|---|---|
<T extends CamelContext> |
adapt(Class<T> type)
Adapts this
CamelContext to the specialized type. |
void |
addComponent(String componentName,
Component component)
Adds a component to the context.
|
Endpoint |
addEndpoint(String uri,
Endpoint endpoint)
Adds the endpoint to the
EndpointRegistry using the given URI. |
protected Endpoint |
addEndpointToRegistry(String uri,
Endpoint endpoint)
Strategy to add the given endpoint to the internal endpoint registry
|
void |
addHystrixConfiguration(String id,
HystrixConfigurationDefinition configuration)
Adds the Hystrix configuration
|
void |
addInterceptStrategy(InterceptStrategy interceptStrategy)
Adds the given interceptor strategy
|
void |
addLifecycleStrategy(LifecycleStrategy lifecycleStrategy)
Adds the given lifecycle strategy to be used.
|
void |
addLogListener(LogListener listener)
Adds a
LogListener. |
void |
addRegisterEndpointCallback(EndpointStrategy strategy)
Registers a
callback to allow you to do custom
logic when an Endpoint is about to be registered to the EndpointRegistry. |
void |
addRestConfiguration(RestConfiguration restConfiguration)
Sets a custom
RestConfiguration |
void |
addRestDefinitions(Collection<RestDefinition> restDefinitions)
Adds a collection of rest definitions to the context
|
void |
addRouteDefinition(RouteDefinition routeDefinition)
Add a route definition to the context
Important: Each route in the same
CamelContext must have an unique route id. |
void |
addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Adds a collection of route definitions to the context
Important: Each route in the same
CamelContext must have an unique route id. |
void |
addRoutePolicyFactory(RoutePolicyFactory routePolicyFactory)
Adds the given route policy factory
|
void |
addRoutes(RoutesBuilder builder)
Adds a collection of routes to this CamelContext using the given builder
to build them.
|
void |
addService(Object object)
Adds a service to this CamelContext, which allows this CamelContext to control the lifecycle, ensuring
the service is stopped when the CamelContext stops.
|
void |
addService(Object object,
boolean stopOnShutdown)
Adds a service to this CamelContext.
|
void |
addService(Object object,
boolean stopOnShutdown,
boolean forceStart)
Adds a service to this CamelContext.
|
void |
addServiceCallConfiguration(String serviceName,
ServiceCallConfigurationDefinition configuration)
Adds the service call configuration
|
void |
addStartupListener(StartupListener listener)
Adds the given listener to be invoked when
CamelContext have just been started. |
protected Endpoint |
convertBeanToEndpoint(String uri,
Object bean)
Strategy method for attempting to convert the bean from a
Registry to an endpoint using
some kind of transformation or wrapper |
protected AsyncProcessorAwaitManager |
createAsyncProcessorAwaitManager() |
protected CamelContextNameStrategy |
createCamelContextNameStrategy() |
protected ClassResolver |
createClassResolver() |
protected ComponentResolver |
createComponentResolver()
Lazily create a default implementation
|
ConsumerTemplate |
createConsumerTemplate()
Creates a new
ConsumerTemplate which is started and therefore ready to use right away. |
ConsumerTemplate |
createConsumerTemplate(int maximumCacheSize)
Creates a new
ConsumerTemplate which is started and therefore ready to use right away. |
DataFormat |
createDataFormat(String name)
Creates the given data format given its name.
|
protected DataFormatResolver |
createDataFormatResolver() |
protected UuidGenerator |
createDefaultUuidGenerator() |
protected Endpoint |
createEndpoint(String uri)
A pluggable strategy to allow an endpoint to be created without requiring
a component to be its factory, such as for looking up the URI inside some
Registry |
protected EndpointRegistry<EndpointKey> |
createEndpointRegistry(Map<EndpointKey,Endpoint> endpoints) |
protected ExecutorServiceManager |
createExecutorServiceManager() |
protected FactoryFinderResolver |
createFactoryFinderResolver() |
FluentProducerTemplate |
createFluentProducerTemplate()
Creates a new
FluentProducerTemplate which is started and therefore ready to use right away. |
FluentProducerTemplate |
createFluentProducerTemplate(int maximumCacheSize)
Creates a new
FluentProducerTemplate which is started and therefore ready to use right away. |
protected HeadersMapFactory |
createHeadersMapFactory() |
protected HealthCheckRegistry |
createHealthCheckRegistry() |
protected InflightRepository |
createInflightRepository() |
protected Injector |
createInjector()
Lazily create a default implementation
|
protected LanguageResolver |
createLanguageResolver() |
protected ManagementMBeanAssembler |
createManagementMBeanAssembler()
Lazily create a default implementation
|
protected ManagementNameStrategy |
createManagementNameStrategy() |
protected ManagementStrategy |
createManagementStrategy() |
protected MessageHistoryFactory |
createMessageHistoryFactory() |
protected ModelJAXBContextFactory |
createModelJAXBContextFactory() |
protected NodeIdFactory |
createNodeIdFactory() |
protected PackageScanClassResolver |
createPackageScanClassResolver() |
protected ServicePool<Endpoint,PollingConsumer> |
createPollingConsumerServicePool() |
protected ProcessorFactory |
createProcessorFactory() |
protected ServicePool<Endpoint,Producer> |
createProducerServicePool() |
ProducerTemplate |
createProducerTemplate()
Creates a new
ProducerTemplate which is started and therefore ready to use right away. |
ProducerTemplate |
createProducerTemplate(int maximumCacheSize)
Creates a new
ProducerTemplate which is started and therefore ready to use right away. |
protected Registry |
createRegistry()
Lazily create a default implementation
|
protected RouteController |
createRouteController() |
String |
createRouteStaticEndpointJson(String routeId)
Creates a JSON representation of all the static and dynamic configured endpoints defined in the given route(s).
|
String |
createRouteStaticEndpointJson(String routeId,
boolean includeDynamic)
Creates a JSON representation of all the static (and possible dynamic) configured endpoints defined in the given route(s).
|
protected RuntimeCamelCatalog |
createRuntimeCamelCatalog() |
protected ShutdownStrategy |
createShutdownStrategy() |
protected TransformerRegistry<TransformerKey> |
createTransformerRegistry(List<TransformerDefinition> transformers) |
protected TypeConverter |
createTypeConverter()
Lazily create a default implementation
|
protected UnitOfWorkFactory |
createUnitOfWorkFactory() |
protected ValidatorRegistry<ValidatorKey> |
createValidatorRegistry(List<ValidatorDefinition> validators) |
void |
deferStartService(Object object,
boolean stopOnShutdown)
Defers starting the service until
CamelContext is (almost started) or started and has initialized all its prior services and routes. |
void |
disableJMX()
Disables using JMX as
ManagementStrategy. |
protected void |
doResume()
Implementations override this method to support customized suspend/resume.
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStartCamel() |
protected void |
doStartOrResumeRoutes(Map<String,RouteService> routeServices,
boolean checkClash,
boolean startConsumer,
boolean resumeConsumer,
boolean addingRoutes)
Starts or resumes the routes
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
protected void |
doSuspend()
Implementations override this method to support customized suspend/resume.
|
String |
explainComponentJson(String componentName,
boolean includeAllOptions)
Returns a JSON schema representation of the component parameters (not endpoint parameters) for the given component by its id.
|
String |
explainDataFormatJson(String dataFormatName,
DataFormat dataFormat,
boolean includeAllOptions)
Returns a JSON schema representation of the component parameters (not endpoint parameters) for the given component by its id.
|
String |
explainEipJson(String nameOrId,
boolean includeAllOptions)
Returns a JSON schema representation of the EIP parameters for the given EIP by its id.
|
String |
explainEndpointJson(String uri,
boolean includeAllOptions)
Returns a JSON schema representation of the endpoint parameters for the given endpoint uri.
|
Map<String,Properties> |
findComponents()
Find information about all the Camel components available in the classpath and
Registry. |
Map<String,Properties> |
findEips()
Find information about all the EIPs from camel-core.
|
protected void |
forceLazyInitialization()
Force some lazy initialization to occur upfront before we start any
components and create routes
|
protected void |
forceStopLazyInitialization()
Force clear lazy initialization so they can be re-created on restart
|
ClassLoader |
getApplicationContextClassLoader()
Gets the application CamelContext class loader which may be helpful for running camel in other containers
|
AsyncProcessorAwaitManager |
getAsyncProcessorAwaitManager()
Gets the
AsyncProcessor await manager. |
ClassResolver |
getClassResolver()
Returns the class resolver to be used for loading/lookup of classes.
|
Component |
getComponent(String name)
Gets a component from the CamelContext by name.
|
Component |
getComponent(String name,
boolean autoCreateComponents)
Gets a component from the CamelContext by name.
|
Component |
getComponent(String name,
boolean autoCreateComponents,
boolean autoStart)
Gets a component from the CamelContext by name.
|
<T extends Component> |
getComponent(String name,
Class<T> componentType)
Gets a component from the CamelContext by name and specifying the expected type of component.
|
String |
getComponentDocumentation(String componentName)
Returns the HTML documentation for the given Camel component
|
List<String> |
getComponentNames()
Gets a readonly list of names of the components currently registered
|
String |
getComponentParameterJsonSchema(String componentName)
Returns the JSON schema representation of the component and endpoint parameters for the given component name.
|
ComponentResolver |
getComponentResolver() |
String |
getDataFormatParameterJsonSchema(String dataFormatName)
Returns the JSON schema representation of the
DataFormat parameters for the given data format name. |
DataFormatResolver |
getDataFormatResolver()
Gets the current data format resolver
|
Map<String,DataFormatDefinition> |
getDataFormats()
Gets the data formats that can be referenced in the routes.
|
Debugger |
getDebugger()
Gets the current
Debugger |
InterceptStrategy |
getDefaultBacklogDebugger()
Gets the default backlog debugger
|
InterceptStrategy |
getDefaultBacklogTracer()
Gets the default backlog tracer
|
FactoryFinder |
getDefaultFactoryFinder()
Gets the default FactoryFinder which will be used for the loading the factory class from META-INF
|
InterceptStrategy |
getDefaultTracer()
Gets the default tracer
|
Long |
getDelayer()
Gets the delay value
|
String |
getEipParameterJsonSchema(String eipName)
Returns the JSON schema representation of the EIP parameters for the given EIP name.
|
Endpoint |
getEndpoint(String uri)
Resolves the given name to an
Endpoint of the specified type. |
<T extends Endpoint> |
getEndpoint(String name,
Class<T> endpointType)
Resolves the given name to an
Endpoint of the specified type. |
protected EndpointKey |
getEndpointKey(String uri)
Gets the endpoint key to use for lookup or whe adding endpoints to the
DefaultEndpointRegistry |
protected EndpointKey |
getEndpointKey(String uri,
Endpoint endpoint)
Gets the endpoint key to use for lookup or whe adding endpoints to the
DefaultEndpointRegistry |
protected EndpointKey |
getEndpointKeyPreNormalized(String uri)
Gets the endpoint key to use for lookup or whe adding endpoints to the
DefaultEndpointRegistry |
Map<String,Endpoint> |
getEndpointMap()
Returns a new
Map containing all of the endpoints from the EndpointRegistry |
EndpointRegistry<EndpointKey> |
getEndpointRegistry()
Gets the
EndpointRegistry |
Collection<Endpoint> |
getEndpoints()
Returns a new
Collection of all of the endpoints from the EndpointRegistry |
ErrorHandlerBuilder |
getErrorHandlerBuilder()
Gets the default error handler builder which is inherited by the routes
|
ScheduledExecutorService |
getErrorHandlerExecutorService()
Gets the default shared thread pool for error handlers which
leverages this for asynchronous redelivery tasks.
|
ExecutorServiceManager |
getExecutorServiceManager()
Gets the current
ExecutorServiceManager |
ExecutorServiceStrategy |
getExecutorServiceStrategy()
Deprecated.
|
FactoryFinder |
getFactoryFinder(String path)
Gets the FactoryFinder which will be used for the loading the factory class from META-INF in the given path
|
FactoryFinderResolver |
getFactoryFinderResolver() |
String |
getGlobalOption(String key)
Gets the global option value that can be referenced in the camel context
Important: This has nothing to do with property placeholders, and is just a plain set of key/value pairs
which are used to configure global options on CamelContext, such as a maximum debug logging length etc.
|
Map<String,String> |
getGlobalOptions()
Gets global options that can be referenced in the camel context.
|
HeadersMapFactory |
getHeadersMapFactory()
Gets the
HeadersMapFactory to use. |
HealthCheckRegistry |
getHealthCheckRegistry()
Returns an optional
HealthCheckRegistry, by default no registry is
present and it must be explicit activated. |
HystrixConfigurationDefinition |
getHystrixConfiguration(String id)
Gets the Hystrix configuration by the given name.
|
InflightRepository |
getInflightRepository()
Gets the inflight repository
|
Injector |
getInjector()
Returns the injector used to instantiate objects by type
|
List<InterceptStrategy> |
getInterceptStrategies()
Gets the interceptor strategies
|
List<String> |
getLanguageNames()
Gets a readonly list with the names of the languages currently registered.
|
String |
getLanguageParameterJsonSchema(String languageName)
Returns the JSON schema representation of the
Language parameters for the given language name. |
LanguageResolver |
getLanguageResolver() |
List<LifecycleStrategy> |
getLifecycleStrategies()
Returns the lifecycle strategies used to handle lifecycle notifications
|
Set<LogListener> |
getLogListeners()
Gets a list of
LogListener. |
ManagedCamelContextMBean |
getManagedCamelContext()
Gets the managed Camel CamelContext client api
|
<T extends ManagedProcessorMBean> |
getManagedProcessor(String id,
Class<T> type)
Gets the managed processor client api from any of the routes which with the given id
|
<T extends ManagedRouteMBean> |
getManagedRoute(String routeId,
Class<T> type)
Gets the managed route client api with the given route id
|
ManagementMBeanAssembler |
getManagementMBeanAssembler()
Returns the management mbean assembler
|
String |
getManagementName()
Gets the name this
CamelContext was registered in JMX. |
ManagementNameStrategy |
getManagementNameStrategy()
Gets the current management name strategy
|
ManagementStrategy |
getManagementStrategy()
Gets the management strategy
|
MessageHistoryFactory |
getMessageHistoryFactory()
Gets the current
MessageHistoryFactory |
ModelJAXBContextFactory |
getModelJAXBContextFactory()
Returns the JAXB Context factory used to create Models.
|
String |
getName()
Gets the name (id) of the this CamelContext.
|
CamelContextNameStrategy |
getNameStrategy()
Gets the current name strategy
|
NodeIdFactory |
getNodeIdFactory()
Gets the node id factory
|
PackageScanClassResolver |
getPackageScanClassResolver()
Returns the package scanning class resolver
|
ServicePool<Endpoint,PollingConsumer> |
getPollingConsumerServicePool()
Gets the service pool for
Producer pooling. |
Processor |
getProcessor(String id)
Gets the processor from any of the routes which with the given id
|
<T extends Processor> |
getProcessor(String id,
Class<T> type)
Gets the processor from any of the routes which with the given id
|
ProcessorDefinition |
getProcessorDefinition(String id)
Gets the processor definition from any of the routes which with the given id
|
<T extends ProcessorDefinition> |
getProcessorDefinition(String id,
Class<T> type)
Gets the processor definition from any of the routes which with the given id
|
ProcessorFactory |
getProcessorFactory()
Gets the current
ProcessorFactory |
ServicePool<Endpoint,Producer> |
getProducerServicePool()
Gets the service pool for
Producer pooling. |
Map<String,String> |
getProperties()
Deprecated.
|
protected PropertiesComponent |
getPropertiesComponent()
Gets the properties component in use.
|
String |
getProperty(String key)
Deprecated.
|
String |
getPropertyPrefixToken()
Returns the configured property placeholder prefix token if and only if the CamelContext has
property placeholder abilities, otherwise returns
null. |
String |
getPropertySuffixToken()
Returns the configured property placeholder suffix token if and only if the CamelContext has
property placeholder abilities, otherwise returns
null. |
Registry |
getRegistry()
Returns the registry used to lookup components by name and type such as the Spring ApplicationContext,
JNDI or the OSGi Service Registry
|
<T> T |
getRegistry(Class<T> type)
Returns the registry used to lookup components by name and as the given type
|
ReloadStrategy |
getReloadStrategy()
Returns the
ReloadStrategy if in use. |
RestConfiguration |
getRestConfiguration()
Gets the default REST configuration
|
RestConfiguration |
getRestConfiguration(String component,
boolean defaultIfNotExist)
Gets the REST configuration for the given component
|
Collection<RestConfiguration> |
getRestConfigurations()
Gets all the RestConfiguration's
|
List<RestDefinition> |
getRestDefinitions()
Returns a list of the current REST definitions
|
RestRegistry |
getRestRegistry()
Gets the
RestRegistry to use |
Route |
getRoute(String id)
Gets the route with the given id
|
RouteController |
getRouteController()
NOTE: experimental api
|
RouteDefinition |
getRouteDefinition(String id)
Gets the route definition with the given id
|
List<RouteDefinition> |
getRouteDefinitions()
Returns a list of the current route definitions
|
List<RoutePolicyFactory> |
getRoutePolicyFactories()
Gets the route policy factories
|
List<Route> |
getRoutes()
Returns the current routes in this CamelContext
|
protected Map<String,RouteService> |
getRouteServices() |
List<RouteStartupOrder> |
getRouteStartupOrder()
Returns the order in which the route inputs was started.
|
ServiceStatus |
getRouteStatus(String key)
Returns the current status of the given route
|
RuntimeCamelCatalog |
getRuntimeCamelCatalog()
Gets the associated
RuntimeCamelCatalog for this CamelContext. |
RuntimeEndpointRegistry |
getRuntimeEndpointRegistry()
Gets the
RuntimeEndpointRegistry to use, or null if none is in use. |
ServiceCallConfigurationDefinition |
getServiceCallConfiguration(String serviceName)
Gets the service call configuration by the given name.
|
ShutdownRoute |
getShutdownRoute()
Gets the option to use when shutting down the route.
|
ShutdownRunningTask |
getShutdownRunningTask()
Gets the ShutdownRunningTask option in use when shutting down a route.
|
ShutdownStrategy |
getShutdownStrategy()
Gets the current shutdown strategy
|
SSLContextParameters |
getSSLContextParameters()
Gets the global SSL context parameters if configured.
|
StreamCachingStrategy |
getStreamCachingStrategy()
Gets the
StreamCachingStrategy to use. |
TransformerRegistry<TransformerKey> |
getTransformerRegistry()
Gets the
TransformerRegistry |
List<TransformerDefinition> |
getTransformers()
Gets the transformers that can be referenced in the routes.
|
TypeConverter |
getTypeConverter()
Returns the type converter used to coerce types from one type to another
|
TypeConverterRegistry |
getTypeConverterRegistry()
Returns the type converter registry where type converters can be added or looked up
|
UnitOfWorkFactory |
getUnitOfWorkFactory()
Gets the
UnitOfWorkFactory to use. |
String |
getUptime()
Gets the uptime in a human readable format
|
long |
getUptimeMillis()
Gets the uptime in milli seconds
|
UuidGenerator |
getUuidGenerator()
Gets the current
UuidGenerator |
ValidatorRegistry<ValidatorKey> |
getValidatorRegistry()
Gets the
ValidatorRegistry |
List<ValidatorDefinition> |
getValidators()
Gets the validators that can be referenced in the routes.
|
Component |
hasComponent(String componentName)
Is the given component already registered?
|
Endpoint |
hasEndpoint(String uri)
Is the given endpoint already registered in the
EndpointRegistry |
<T> T |
hasService(Class<T> type)
Has the given service type already been added to this CamelContext?
|
boolean |
hasService(Object object)
Has the given service already been added to this CamelContext?
|
<T> Set<T> |
hasServices(Class<T> type)
Has the given service type already been added to this CamelContext?
|
Boolean |
isAllowUseOriginalMessage()
Gets whether access to the original message from Camel's error handler,
or from
UnitOfWork.getOriginalInMessage() is allowed. |
boolean |
isAutoCreateComponents() |
Boolean |
isAutoStartup()
Gets whether the object should automatically start when Camel starts.
|
Boolean |
isHandleFault()
Returns whether fault handling enabled
|
Boolean |
isLazyLoadTypeConverters()
Deprecated.
|
Boolean |
isLoadTypeConverters()
Sets whether to load custom type converters by scanning classpath.
|
Boolean |
isLogExhaustedMessageBody()
Returns whether to log exhausted message body with message history.
|
Boolean |
isLogMask()
Gets whether security mask for Logging is enabled or not.
|
Boolean |
isMessageHistory()
Returns whether message history is enabled
|
boolean |
isSetupRoutes()
Indicates whether current thread is setting up route(s) as part of starting Camel from spring/blueprint.
|
boolean |
isStartingRoutes()
Indicates whether current thread is starting route(s).
|
Boolean |
isStreamCaching()
Returns whether stream cache is enabled
|
Boolean |
isTracing()
Returns whether tracing enabled
|
Boolean |
isTypeConverterStatisticsEnabled()
Whether or not type converter statistics is enabled.
|
Boolean |
isUseBreadcrumb()
Whether or not breadcrumb is enabled.
|
Boolean |
isUseDataType()
Whether to enable using data type on Camel messages.
|
Boolean |
isUseMDCLogging()
Whether or not MDC logging is being enabled.
|
boolean |
isVetoStarted()
If CamelContext during the start procedure was vetoed, and therefore causing Camel to not start.
|
RestsDefinition |
loadRestsDefinition(InputStream is)
Loads a collection of rest definitions from the given
InputStream. |
RoutesDefinition |
loadRoutesDefinition(InputStream is)
Loads a collection of route definitions from the given
InputStream. |
protected void |
logRouteState(Route route,
String state) |
protected Component |
lookupPropertiesComponent()
|
protected static String |
normalizeEndpointUri(String uri)
Normalize uri so we can do endpoint hits with minor mistakes and parameters is not in the same order.
|
Component |
removeComponent(String componentName)
Removes a previously added component.
|
void |
removeEndpoint(Endpoint endpoint)
Removes the endpoint from the
EndpointRegistry. |
Collection<Endpoint> |
removeEndpoints(String uri)
Removes all endpoints with the given URI from the
EndpointRegistry. |
boolean |
removeRoute(String routeId)
Removes the given route (the route must be stopped before it can be removed).
|
void |
removeRouteDefinition(RouteDefinition routeDefinition)
Removes a route definition from the context - stopping any previously running
routes if any of them are actively running
|
protected boolean |
removeRouteDefinition(String key)
Removes the route definition with the given key.
|
void |
removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Removes a collection of route definitions from the context - stopping any previously running
routes if any of them are actively running
|
boolean |
removeService(Object object)
Removes a service from this CamelContext.
|
Component |
resolveComponent(String name) |
String |
resolveComponentDefaultName(String javaType)
Resolves a component's default name from its java type.
|
DataFormat |
resolveDataFormat(String name)
Resolve a data format given its name
|
DataFormatDefinition |
resolveDataFormatDefinition(String name)
Resolve a data format definition given its name
|
Language |
resolveLanguage(String language)
Resolves a language for creating expressions
|
String |
resolvePropertyPlaceholders(String text)
Parses the given text and resolve any property placeholders - using {{key}}.
|
Transformer |
resolveTransformer(DataType from,
DataType to)
Resolve a transformer given from/to data type.
|
Transformer |
resolveTransformer(String scheme)
Resolve a transformer given a scheme
|
Validator |
resolveValidator(DataType type)
Resolve a validator given from/to data type.
|
void |
resume()
Important: You should override the lifecycle methods that start with do, eg
ServiceSupport.doStart(),
ServiceSupport.doStop(), etc. |
void |
resumeRoute(String routeId)
Resumes the given route if it has been previously suspended
If the route does not support suspension the route will be started instead
|
protected void |
resumeRouteService(RouteService routeService)
Resumes the given route service
|
protected boolean |
routeSupportsSuspension(String routeId) |
protected void |
safelyStartRouteServices(boolean forceAutoStart,
boolean checkClash,
boolean startConsumer,
boolean resumeConsumer,
boolean addingRoutes,
RouteService... routeServices) |
protected void |
safelyStartRouteServices(boolean checkClash,
boolean startConsumer,
boolean resumeConsumer,
boolean addingRoutes,
Collection<RouteService> routeServices)
Starts the routes services in a proper manner which ensures the routes will be started in correct order,
check for clash and that the routes will also be shutdown in correct order as well.
|
void |
setAllowUseOriginalMessage(Boolean allowUseOriginalMessage)
Sets whether to allow access to the original message from Camel's error handler,
or from
UnitOfWork.getOriginalInMessage(). |
void |
setApplicationContextClassLoader(ClassLoader classLoader)
Sets the application CamelContext class loader
|
void |
setAsyncProcessorAwaitManager(AsyncProcessorAwaitManager asyncProcessorAwaitManager)
Sets a custom
AsyncProcessor await manager. |
void |
setAutoCreateComponents(boolean autoCreateComponents) |
void |
setAutoStartup(Boolean autoStartup)
Sets whether the object should automatically start when Camel starts.
|
void |
setClassResolver(ClassResolver classResolver)
Sets the class resolver to be use
|
void |
setComponentResolver(ComponentResolver componentResolver) |
static void |
setContextCounter(int value)
Reset context counter to a preset value.
|
void |
setDataFormatResolver(DataFormatResolver dataFormatResolver)
Sets a custom data format resolver
|
void |
setDataFormats(Map<String,DataFormatDefinition> dataFormats)
Sets the data formats that can be referenced in the routes.
|
void |
setDebugger(Debugger debugger)
Sets a custom
Debugger |
void |
setDefaultBacklogDebugger(InterceptStrategy defaultBacklogDebugger)
Sets a custom backlog debugger to be used as the default backlog debugger.
|
void |
setDefaultBacklogTracer(InterceptStrategy backlogTracer)
Sets a custom backlog tracer to be used as the default backlog tracer.
|
void |
setDefaultTracer(InterceptStrategy tracer)
Sets a custom tracer to be used as the default tracer.
|
void |
setDelayer(Long delay)
Sets a delay value in millis that a message is delayed at every step it takes in the route path,
slowing the process down to better observe what is occurring
Is disabled by default
|
void |
setErrorHandlerBuilder(ErrorHandlerFactory errorHandlerBuilder)
Sets the default error handler builder which is inherited by the routes
|
void |
setExecutorServiceManager(ExecutorServiceManager executorServiceManager)
Sets a custom
ExecutorServiceManager |
void |
setFactoryFinderResolver(FactoryFinderResolver resolver)
Sets the factory finder resolver to use.
|
void |
setGlobalOptions(Map<String,String> globalOptions)
Sets global options that can be referenced in the camel context
Important: This has nothing to do with property placeholders, and is just a plain set of key/value pairs
which are used to configure global options on CamelContext, such as a maximum debug logging length etc.
|
void |
setHandleFault(Boolean handleFault)
Sets whether fault handling is enabled or not (default is disabled).
|
void |
setHeadersMapFactory(HeadersMapFactory headersMapFactory)
Sets a custom
HeadersMapFactory to be used. |
void |
setHealthCheckRegistry(HealthCheckRegistry healthCheckRegistry)
Sets a
HealthCheckRegistry. |
void |
setHystrixConfiguration(HystrixConfigurationDefinition configuration)
Sets the default Hystrix configuration
|
void |
setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
Sets the Hystrix configurations
|
void |
setInflightRepository(InflightRepository repository)
Sets a custom inflight repository to use
|
void |
setInjector(Injector injector) |
void |
setInterceptStrategies(List<InterceptStrategy> interceptStrategies) |
void |
setJndiContext(Context jndiContext)
Sets the registry to the given JNDI context
|
void |
setLanguageResolver(LanguageResolver languageResolver) |
void |
setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters)
Deprecated.
|
void |
setLifecycleStrategies(List<LifecycleStrategy> lifecycleStrategies) |
void |
setLoadTypeConverters(Boolean loadTypeConverters)
Sets whether to load custom type converters by scanning classpath.
|
void |
setLogExhaustedMessageBody(Boolean logExhaustedMessageBody)
Sets whether to log exhausted message body with message history.
|
void |
setLogMask(Boolean logMask)
Sets whether security mask for Logging is enabled or not (default is disabled).
|
void |
setManagementMBeanAssembler(ManagementMBeanAssembler managementMBeanAssembler) |
void |
setManagementName(String managementName) |
void |
setManagementNameStrategy(ManagementNameStrategy managementNameStrategy)
Sets a custom management name strategy
|
void |
setManagementStrategy(ManagementStrategy managementStrategy)
Sets the management strategy to use
|
void |
setMessageHistory(Boolean messageHistory)
Sets whether message history is enabled or not (default is enabled).
|
void |
setMessageHistoryFactory(MessageHistoryFactory messageHistoryFactory)
Sets a custom
MessageHistoryFactory |
void |
setModelJAXBContextFactory(ModelJAXBContextFactory modelJAXBContextFactory)
Sets a custom JAXB Context factory to be used
|
void |
setName(String name)
Sets the name of the this context.
|
void |
setNameStrategy(CamelContextNameStrategy nameStrategy)
Sets a custom name strategy
|
void |
setNodeIdFactory(NodeIdFactory idFactory)
Uses a custom node id factory when generating auto assigned ids to the nodes in the route definitions
|
void |
setPackageScanClassResolver(PackageScanClassResolver packageScanClassResolver)
Sets the package scanning class resolver to use
|
void |
setPollingConsumerServicePool(ServicePool<Endpoint,PollingConsumer> pollingConsumerServicePool)
Sets a pluggable service pool to use for
PollingConsumer pooling. |
void |
setProcessorFactory(ProcessorFactory processorFactory)
Sets a custom
ProcessorFactory |
void |
setProducerServicePool(ServicePool<Endpoint,Producer> producerServicePool)
Sets a pluggable service pool to use for
Producer pooling. |
void |
setProperties(Map<String,String> properties)
Deprecated.
|
void |
setRegistry(Registry registry) |
void |
setReloadStrategy(ReloadStrategy reloadStrategy)
Sets a custom
ReloadStrategy to be used |
void |
setRestConfiguration(RestConfiguration restConfiguration)
Sets a custom
RestConfiguration |
void |
setRestRegistry(RestRegistry restRegistry)
Sets a custom
RestRegistry to use. |
void |
setRouteController(RouteController routeController)
NOTE: experimental api
|
void |
setRoutePolicyFactories(List<RoutePolicyFactory> routePolicyFactories) |
void |
setRoutes(List<Route> routes)
Deprecated.
|
void |
setRuntimeEndpointRegistry(RuntimeEndpointRegistry runtimeEndpointRegistry)
Sets a custom
RuntimeEndpointRegistry to use. |
void |
setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
Sets the default service call configuration
|
void |
setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
Sets the service call configurations
|
void |
setShutdownRoute(ShutdownRoute shutdownRoute)
Sets the ShutdownRoute option for routes.
|
void |
setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
Sets the ShutdownRunningTask option to use when shutting down a route.
|
void |
setShutdownStrategy(ShutdownStrategy shutdownStrategy)
Sets a custom shutdown strategy
|
void |
setSSLContextParameters(SSLContextParameters sslContextParameters)
Sets the global SSL context parameters.
|
void |
setStreamCaching(Boolean cache)
Sets whether stream caching is enabled or not (default is disabled).
|
void |
setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy)
Sets a custom
StreamCachingStrategy to use. |
void |
setTracing(Boolean tracing)
Sets whether tracing is enabled or not (default is disabled).
|
void |
setTransformers(List<TransformerDefinition> transformers)
Sets the transformers that can be referenced in the routes.
|
void |
setTypeConverter(TypeConverter typeConverter) |
void |
setTypeConverterRegistry(TypeConverterRegistry typeConverterRegistry) |
void |
setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled)
Sets whether or not type converter statistics is enabled.
|
void |
setUnitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory)
Sets a custom
UnitOfWorkFactory to use. |
void |
setupRoutes(boolean done)
Method to signal to
CamelContext that the process to initialize setup routes is in progress. |
void |
setUseBreadcrumb(Boolean useBreadcrumb)
Set whether breadcrumb is enabled.
|
void |
setUseDataType(Boolean useDataType)
Whether to enable using data type on Camel messages.
|
void |
setUseMDCLogging(Boolean useMDCLogging)
Set whether MDC is enabled.
|
void |
setUuidGenerator(UuidGenerator uuidGenerator)
Sets a custom
UuidGenerator (should only be set once) |
void |
setValidators(List<ValidatorDefinition> validators)
Sets the validators that can be referenced in the routes.
|
protected boolean |
shouldStartRoutes()
Should we start newly added routes?
|
void |
shutdown()
Important: You should override the lifecycle methods that start with do, eg
ServiceSupport.doStart(),
ServiceSupport.doStop(), etc. |
void |
shutdownRoute(String routeId)
Shutdown and removes the given route using
ShutdownStrategy. |
void |
shutdownRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Shutdown and removes the given route using
ShutdownStrategy with a specified timeout. |
protected void |
shutdownRouteService(RouteService routeService) |
void |
start()
Important: You should override the lifecycle methods that start with do, eg
ServiceSupport.doStart(),
ServiceSupport.doStop(), etc. |
void |
startAllRoutes()
Starts all the routes which currently is not started.
|
void |
startRoute(RouteDefinition route)
Starts the given route if it has been previously stopped
|
void |
startRoute(String routeId)
Starts the given route if it has been previously stopped
|
protected void |
startRouteDefinitions(Collection<RouteDefinition> list) |
protected void |
startRouteService(RouteService routeService,
boolean addingRoutes)
Starts the given route service
|
void |
stop()
Important: You should override the lifecycle methods that start with do, eg
ServiceSupport.doStart(),
ServiceSupport.doStop(), etc. |
void |
stopRoute(RouteDefinition route)
Stops the given route.
|
void |
stopRoute(String routeId)
Stops the given route using
ShutdownStrategy. |
void |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Stops the given route using
ShutdownStrategy with a specified timeout. |
boolean |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit,
boolean abortAfterTimeout)
Stops the given route using
ShutdownStrategy with a specified timeout
and optional abortAfterTimeout mode. |
protected void |
stopRouteService(RouteService routeService) |
protected void |
stopRouteService(RouteService routeService,
boolean removingRoutes) |
void |
suspend()
Important: You should override the lifecycle methods that start with do, eg
ServiceSupport.doStart(),
ServiceSupport.doStop(), etc. |
void |
suspendRoute(String routeId)
Suspends the given route using
ShutdownStrategy. |
void |
suspendRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Suspends the given route using
ShutdownStrategy with a specified timeout. |
protected void |
suspendRouteService(RouteService routeService) |
String |
toString() |
doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspendedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetStatus, getVersionisSuspendedpublic DefaultCamelContext()
CamelContext using JndiRegistry as registry,
but will silently fallback and use SimpleRegistry if JNDI cannot be used.
Use one of the other constructors to force use an explicit registry / JNDI.public DefaultCamelContext(Context jndiContext)
CamelContext using the given JNDI context as the registryjndiContext - the JNDI contextpublic DefaultCamelContext(Registry registry)
CamelContext using the given registryregistry - the registrypublic <T extends CamelContext> T adapt(Class<T> type)
CamelContextCamelContext to the specialized type.
For example to adapt to ModelCamelContext,
or SpringCamelContext, or CdiCamelContext, etc.adapt in interface CamelContexttype - the type to adapt toCamelContext adapted to the given typepublic boolean isVetoStarted()
CamelContextisVetoStarted in interface CamelContextpublic String getName()
CamelContextgetName in interface CamelContextpublic void setName(String name)
name - the namepublic CamelContextNameStrategy getNameStrategy()
CamelContextgetNameStrategy in interface CamelContextpublic void setNameStrategy(CamelContextNameStrategy nameStrategy)
CamelContextsetNameStrategy in interface CamelContextnameStrategy - name strategypublic ManagementNameStrategy getManagementNameStrategy()
CamelContextgetManagementNameStrategy in interface CamelContextpublic void setManagementNameStrategy(ManagementNameStrategy managementNameStrategy)
CamelContextsetManagementNameStrategy in interface CamelContextmanagementNameStrategy - name strategypublic String getManagementName()
CamelContextCamelContext was registered in JMX.
The reason that a CamelContext can have a different name in JMX is the fact to remedy for name clash
in JMX when having multiple CamelContexts in the same JVM. Camel will automatic reassign and use
a free name to avoid failing to start.getManagementName in interface CamelContextpublic void setManagementName(String managementName)
public Component hasComponent(String componentName)
CamelContexthasComponent in interface CamelContextcomponentName - the name of the componentpublic void addComponent(String componentName, Component component)
CamelContextaddComponent in interface CamelContextcomponentName - the name the component is registered ascomponent - the componentpublic Component getComponent(String name)
CamelContextCamelContext.getComponent(String, boolean, boolean).getComponent in interface CamelContextname - the name of the componentpublic Component getComponent(String name, boolean autoCreateComponents)
CamelContextCamelContext.getComponent(String, boolean, boolean).getComponent in interface CamelContextname - the name of the componentautoCreateComponents - whether or not the component should
be lazily created if it does not already existpublic Component getComponent(String name, boolean autoCreateComponents, boolean autoStart)
CamelContextgetComponent in interface CamelContextname - the name of the componentautoCreateComponents - whether or not the component should
be lazily created if it does not already existautoStart - whether to auto start the component if CamelContext is already started.public <T extends Component> T getComponent(String name, Class<T> componentType)
CamelContextgetComponent in interface CamelContextname - the name to lookupcomponentType - the expected typepublic Component resolveComponent(String name)
public Component removeComponent(String componentName)
CamelContextremoveComponent in interface CamelContextcomponentName - the component name to removepublic EndpointRegistry<EndpointKey> getEndpointRegistry()
CamelContextEndpointRegistrygetEndpointRegistry in interface CamelContextpublic Collection<Endpoint> getEndpoints()
CamelContextCollection of all of the endpoints from the EndpointRegistrygetEndpoints in interface CamelContextpublic Map<String,Endpoint> getEndpointMap()
CamelContextMap containing all of the endpoints from the EndpointRegistrygetEndpointMap in interface CamelContextpublic Endpoint hasEndpoint(String uri)
CamelContextEndpointRegistryhasEndpoint in interface CamelContexturi - the URI of the endpointpublic Endpoint addEndpoint(String uri, Endpoint endpoint) throws Exception
CamelContextEndpointRegistry using the given URI.addEndpoint in interface CamelContexturi - the URI to be used to resolve this endpointendpoint - the endpoint to be added to the registryException - if the new endpoint could not be started or the old endpoint could not be stoppedpublic void removeEndpoint(Endpoint endpoint) throws Exception
CamelContextEndpointRegistry.
The endpoint being removed will be stopped first.removeEndpoint in interface CamelContextendpoint - the endpointException - if the endpoint could not be stoppedpublic Collection<Endpoint> removeEndpoints(String uri) throws Exception
CamelContextEndpointRegistry.
The endpoints being removed will be stopped first.removeEndpoints in interface CamelContexturi - an uri or pattern to matchException - if at least one endpoint could not be stoppedfor patternpublic Endpoint getEndpoint(String uri)
CamelContextEndpoint of the specified type.
If the name has a singleton endpoint registered, then the singleton is returned.
Otherwise, a new Endpoint is created and registered in the EndpointRegistry.getEndpoint in interface CamelContexturi - the URI of the endpointpublic <T extends Endpoint> T getEndpoint(String name, Class<T> endpointType)
CamelContextEndpoint of the specified type.
If the name has a singleton endpoint registered, then the singleton is returned.
Otherwise, a new Endpoint is created and registered in the EndpointRegistry.getEndpoint in interface CamelContextname - the name of the endpointendpointType - the expected typepublic void addRegisterEndpointCallback(EndpointStrategy strategy)
CamelContextcallback to allow you to do custom
logic when an Endpoint is about to be registered to the EndpointRegistry.
When a callback is added it will be executed on the already registered endpoints allowing you to catch-upaddRegisterEndpointCallback in interface CamelContextstrategy - callback to be invokedprotected Endpoint addEndpointToRegistry(String uri, Endpoint endpoint)
uri - uri of the endpointendpoint - the endpoint to addprotected static String normalizeEndpointUri(String uri)
uri - the uriResolveEndpointFailedException - if uri cannot be normalizedprotected EndpointKey getEndpointKey(String uri)
DefaultEndpointRegistryuri - the endpoint uriprotected EndpointKey getEndpointKeyPreNormalized(String uri)
DefaultEndpointRegistryuri - the endpoint uri which is pre normalizedprotected EndpointKey getEndpointKey(String uri, Endpoint endpoint)
DefaultEndpointRegistryuri - the endpoint uriendpoint - the endpointpublic void setRouteController(RouteController routeController)
CamelContextsetRouteController in interface CamelContextrouteController - the route controllerpublic RouteController getRouteController()
CamelContextgetRouteController in interface CamelContextpublic List<RouteStartupOrder> getRouteStartupOrder()
CamelContextgetRouteStartupOrder in interface CamelContextpublic List<Route> getRoutes()
CamelContextgetRoutes in interface CamelContextpublic Route getRoute(String id)
CamelContextgetRoute in interface CamelContextid - id of the routepublic Processor getProcessor(String id)
CamelContextgetProcessor in interface CamelContextid - id of the processorpublic <T extends Processor> T getProcessor(String id, Class<T> type)
CamelContextgetProcessor in interface CamelContextid - id of the processortype - the processor typepublic <T extends ManagedProcessorMBean> T getManagedProcessor(String id, Class<T> type)
CamelContextgetManagedProcessor in interface CamelContextid - id of the processortype - the managed processor type from the org.apache.camel.api.management.mbean package.public <T extends ManagedRouteMBean> T getManagedRoute(String routeId, Class<T> type)
CamelContextgetManagedRoute in interface CamelContextrouteId - id of the routetype - the managed route type from the org.apache.camel.api.management.mbean package.public ManagedCamelContextMBean getManagedCamelContext()
CamelContextgetManagedCamelContext in interface CamelContextpublic ProcessorDefinition getProcessorDefinition(String id)
CamelContextgetProcessorDefinition in interface CamelContextid - id of the processor definitionpublic <T extends ProcessorDefinition> T getProcessorDefinition(String id, Class<T> type)
CamelContextgetProcessorDefinition in interface CamelContextid - id of the processor definitiontype - the processor definition type@Deprecated public void setRoutes(List<Route> routes)
public void addRoutes(RoutesBuilder builder) throws Exception
CamelContextCamelContext
is already started. You may want to check the state of CamelContext before
adding the routes, using the CamelContext.getStatus() method.
Important: Each route in the same CamelContext must have an unique route id.
If you use the API from CamelContext or ModelCamelContext to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.addRoutes in interface CamelContextbuilder - the builder which will create the routes and add them to this CamelContextException - if the routes could not be created for whatever reasonpublic RoutesDefinition loadRoutesDefinition(InputStream is) throws Exception
ModelCamelContextInputStream.loadRoutesDefinition in interface CamelContextloadRoutesDefinition in interface ModelCamelContextis - input stream with the route(s) definition to addException - if the route definitions could not be loaded for whatever reasonpublic RestsDefinition loadRestsDefinition(InputStream is) throws Exception
ModelCamelContextInputStream.loadRestsDefinition in interface CamelContextloadRestsDefinition in interface ModelCamelContextis - input stream with the rest(s) definition to addException - if the rest definitions could not be loaded for whatever reasonpublic void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
ModelCamelContextCamelContext must have an unique route id.
If you use the API from CamelContext or ModelCamelContext to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.addRouteDefinitions in interface CamelContextaddRouteDefinitions in interface ModelCamelContextrouteDefinitions - the route(s) definition to addException - if the route definitions could not be created for whatever reasonpublic void addRouteDefinition(RouteDefinition routeDefinition) throws Exception
ModelCamelContextCamelContext must have an unique route id.
If you use the API from CamelContext or ModelCamelContext to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.addRouteDefinition in interface CamelContextaddRouteDefinition in interface ModelCamelContextrouteDefinition - the route definition to addException - if the route definition could not be created for whatever reasonprotected boolean removeRouteDefinition(String key)
public void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
ModelCamelContextremoveRouteDefinitions in interface CamelContextremoveRouteDefinitions in interface ModelCamelContextrouteDefinitions - route(s) definitions to removeException - if the route definitions could not be removed for whatever reasonpublic void removeRouteDefinition(RouteDefinition routeDefinition) throws Exception
ModelCamelContextremoveRouteDefinition in interface CamelContextremoveRouteDefinition in interface ModelCamelContextrouteDefinition - route definition to removeException - if the route definition could not be removed for whatever reasonpublic ServiceStatus getRouteStatus(String key)
CamelContextgetRouteStatus in interface CamelContextkey - the route idpublic void startRoute(RouteDefinition route) throws Exception
ModelCamelContextstartRoute in interface CamelContextstartRoute in interface ModelCamelContextroute - the route to startException - is thrown if the route could not be started for whatever reasonpublic boolean isStartingRoutes()
CamelContextLifecycleStrategy or the likes, in case
they need to react differently.isStartingRoutes in interface CamelContextpublic boolean isSetupRoutes()
CamelContextLifecycleStrategy or the likes, in case
they need to react differently.
As the startup procedure of CamelContext is slightly different when using plain Java versus
Spring or Blueprint, then we need to know when Spring/Blueprint is setting up the routes, which
can happen after the CamelContext itself is in started state, due the asynchronous event nature
of especially Blueprint.isSetupRoutes in interface CamelContextpublic void stopRoute(RouteDefinition route) throws Exception
ModelCamelContextstopRoute in interface CamelContextstopRoute in interface ModelCamelContextroute - the route to stopException - is thrown if the route could not be stopped for whatever reasonpublic void startAllRoutes() throws Exception
CamelContextstartAllRoutes in interface CamelContextException - is thrown if a route could not be started for whatever reasonpublic void startRoute(String routeId) throws Exception
CamelContextstartRoute in interface CamelContextrouteId - the route idException - is thrown if the route could not be started for whatever reasonpublic void resumeRoute(String routeId) throws Exception
CamelContextresumeRoute in interface CamelContextrouteId - the route idException - is thrown if the route could not be resumed for whatever reasonpublic boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception
CamelContextShutdownStrategy with a specified timeout
and optional abortAfterTimeout mode.stopRoute in interface CamelContextrouteId - the route idtimeout - timeouttimeUnit - the unit to useabortAfterTimeout - should abort shutdown after timeoutException - is thrown if the route could not be stopped for whatever reasonCamelContext.suspendRoute(String, long, java.util.concurrent.TimeUnit)public void stopRoute(String routeId) throws Exception
CamelContextShutdownStrategy.stopRoute in interface CamelContextrouteId - the route idException - is thrown if the route could not be stopped for whatever reasonCamelContext.suspendRoute(String)public void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
CamelContextShutdownStrategy with a specified timeout.stopRoute in interface CamelContextrouteId - the route idtimeout - timeouttimeUnit - the unit to useException - is thrown if the route could not be stopped for whatever reasonCamelContext.suspendRoute(String, long, java.util.concurrent.TimeUnit)public void shutdownRoute(String routeId) throws Exception
CamelContextShutdownStrategy.shutdownRoute in interface CamelContextrouteId - the route idException - is thrown if the route could not be shutdown for whatever reasonpublic void shutdownRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
CamelContextShutdownStrategy with a specified timeout.shutdownRoute in interface CamelContextrouteId - the route idtimeout - timeouttimeUnit - the unit to useException - is thrown if the route could not be shutdown for whatever reasonpublic boolean removeRoute(String routeId) throws Exception
CamelContextEndpoints which are in the static cache of
EndpointRegistry and are only used by the route (not used by other routes)
will also be removed. But Endpoints which may have been created as part of routing messages by the route,
and those endpoints are enlisted in the dynamic cache of EndpointRegistry are
not removed. To remove those dynamic kind of endpoints, use the CamelContext.removeEndpoints(String) method.
If not removing those endpoints, they will be kept in the dynamic cache of EndpointRegistry,
but my eventually be removed (evicted) when they have not been in use for a longer period of time; and the
dynamic cache upper limit is hit, and it evicts the least used endpoints.
End users can use this method to remove unwanted routes or temporary routes which no longer is in demand.removeRoute in interface CamelContextrouteId - the route idException - is thrown if the route could not be shutdown for whatever reasonpublic void suspendRoute(String routeId) throws Exception
CamelContextShutdownStrategy.
Suspending a route is more gently than stopping, as the route consumers will be suspended (if they support)
otherwise the consumers will be stopped.
By suspending the route services will be kept running (if possible) and therefore its faster to resume the route.
If the route does not support suspension the route will be stopped insteadsuspendRoute in interface CamelContextrouteId - the route idException - is thrown if the route could not be suspended for whatever reasonpublic void suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
CamelContextShutdownStrategy with a specified timeout.
Suspending a route is more gently than stopping, as the route consumers will be suspended (if they support)
otherwise the consumers will be stopped.
By suspending the route services will be kept running (if possible) and therefore its faster to resume the route.
If the route does not support suspension the route will be stopped insteadsuspendRoute in interface CamelContextrouteId - the route idtimeout - timeouttimeUnit - the unit to useException - is thrown if the route could not be suspended for whatever reasonpublic void addService(Object object) throws Exception
CamelContextCamelContext injected if its CamelContextAware.
The service will also be enlisted in JMX for management (if JMX is enabled).
The service will be started, if its not already started.addService in interface CamelContextobject - the serviceException - can be thrown when starting the servicepublic void addService(Object object, boolean stopOnShutdown) throws Exception
CamelContextCamelContext injected if its CamelContextAware.
The service will also be enlisted in JMX for management (if JMX is enabled).
The service will be started, if its not already started.
If the option closeOnShutdown is true then this CamelContext will control the lifecycle, ensuring
the service is stopped when the CamelContext stops.
If the option closeOnShutdown is false then this CamelContext will not stop the service when the CamelContext stops.addService in interface CamelContextobject - the servicestopOnShutdown - whether to stop the service when this CamelContext shutdown.Exception - can be thrown when starting the servicepublic void addService(Object object, boolean stopOnShutdown, boolean forceStart) throws Exception
CamelContextCamelContext injected if its CamelContextAware.
The service will also be enlisted in JMX for management (if JMX is enabled).
The service will be started, if its not already started.
If the option closeOnShutdown is true then this CamelContext will control the lifecycle, ensuring
the service is stopped when the CamelContext stops.
If the option closeOnShutdown is false then this CamelContext will not stop the service when the CamelContext stops.addService in interface CamelContextobject - the servicestopOnShutdown - whether to stop the service when this CamelContext shutdown.forceStart - whether to force starting the service right now, as otherwise the service may be deferred being started
to later using CamelContext.deferStartService(Object, boolean)Exception - can be thrown when starting the servicepublic boolean removeService(Object object) throws Exception
CamelContextCamelContext.addService(Object) method.
This method will not change the service lifecycle.removeService in interface CamelContextobject - the serviceException - can be thrown if error removing the servicepublic boolean hasService(Object object)
CamelContexthasService in interface CamelContextobject - the servicepublic <T> T hasService(Class<T> type)
CamelContexthasService in interface CamelContexttype - the class typepublic <T> Set<T> hasServices(Class<T> type)
CamelContexthasServices in interface CamelContexttype - the class typepublic void deferStartService(Object object, boolean stopOnShutdown) throws Exception
CamelContextCamelContext is (almost started) or started and has initialized all its prior services and routes.
If CamelContext is already started then the service is started immediately.deferStartService in interface CamelContextobject - the servicestopOnShutdown - whether to stop the service when this CamelContext shutdown. Setting this to true will keep a reference to the service in
this CamelContext until the CamelContext is stopped. So do not use it for short lived services.Exception - can be thrown when starting the service, which is only attempted if CamelContext has already been started when calling this method.public void addStartupListener(StartupListener listener) throws Exception
CamelContextCamelContext have just been started.
This allows listeners to do any custom work after the routes and other services have been started and are running.
Important: The listener will always be invoked, also if the CamelContext has already been
started, see the StartupListener.onCamelContextStarted(CamelContext, boolean) method.addStartupListener in interface CamelContextlistener - the listenerException - can be thrown if CamelContext is already started and the listener is invoked
and cause an exception to be thrownpublic String resolveComponentDefaultName(String javaType)
CamelContextresolveComponentDefaultName in interface CamelContextjavaType - the FQN name of the java typepublic Map<String,Properties> findComponents() throws LoadPropertiesException, IOException
CamelContextRegistry.findComponents in interface CamelContextLoadPropertiesException - is thrown if error during classpath discovery of the componentsIOException - is thrown if error during classpath discovery of the componentspublic Map<String,Properties> findEips() throws LoadPropertiesException, IOException
CamelContextfindEips in interface CamelContextLoadPropertiesException - is thrown if error during classpath discovery of the EIPsIOException - is thrown if error during classpath discovery of the EIPspublic String getComponentDocumentation(String componentName) throws IOException
CamelContextgetComponentDocumentation in interface CamelContextIOExceptionpublic String getComponentParameterJsonSchema(String componentName) throws IOException
CamelContextgetComponentParameterJsonSchema in interface CamelContextIOExceptionpublic String getDataFormatParameterJsonSchema(String dataFormatName) throws IOException
CamelContextDataFormat parameters for the given data format name.getDataFormatParameterJsonSchema in interface CamelContextIOExceptionpublic String getLanguageParameterJsonSchema(String languageName) throws IOException
CamelContextLanguage parameters for the given language name.getLanguageParameterJsonSchema in interface CamelContextIOExceptionpublic String getEipParameterJsonSchema(String eipName) throws IOException
CamelContextgetEipParameterJsonSchema in interface CamelContextIOExceptionpublic String explainEipJson(String nameOrId, boolean includeAllOptions)
CamelContextexplainEipJson in interface CamelContextnameOrId - the name of the EIP (NamedNode.getShortName() or a node id to refer to a specific node from the routes.includeAllOptions - whether to include non configured options also (eg default options)public String explainDataFormatJson(String dataFormatName, DataFormat dataFormat, boolean includeAllOptions)
CamelContextexplainDataFormatJson in interface CamelContextdataFormat - the data format instance.includeAllOptions - whether to include non configured options also (eg default options)public String explainComponentJson(String componentName, boolean includeAllOptions)
CamelContextexplainComponentJson in interface CamelContextcomponentName - the name of the component.includeAllOptions - whether to include non configured options also (eg default options)public String explainEndpointJson(String uri, boolean includeAllOptions)
CamelContextexplainEndpointJson in interface CamelContexturi - the endpoint uriincludeAllOptions - whether to include non configured options also (eg default options)public String createRouteStaticEndpointJson(String routeId)
CamelContextcreateRouteStaticEndpointJson in interface CamelContextrouteId - for a particular route, or null for all routespublic String createRouteStaticEndpointJson(String routeId, boolean includeDynamic)
CamelContextcreateRouteStaticEndpointJson in interface CamelContextrouteId - for a particular route, or null for all routesincludeDynamic - whether to include dynamic endpointspublic Language resolveLanguage(String language)
CamelContextresolveLanguage in interface CamelContextlanguage - name of the languagepublic String getPropertyPrefixToken()
CamelContextnull.getPropertyPrefixToken in interface CamelContextnullpublic String getPropertySuffixToken()
CamelContextnull.getPropertySuffixToken in interface CamelContextnullpublic String resolvePropertyPlaceholders(String text) throws Exception
CamelContextresolvePropertyPlaceholders in interface CamelContexttext - the text such as an endpoint uri or the likesException - is thrown if property placeholders was used and there was an error resolving thempublic TypeConverter getTypeConverter()
CamelContextgetTypeConverter in interface CamelContextpublic void setTypeConverter(TypeConverter typeConverter)
public TypeConverterRegistry getTypeConverterRegistry()
CamelContextgetTypeConverterRegistry in interface CamelContextpublic void setTypeConverterRegistry(TypeConverterRegistry typeConverterRegistry)
public Injector getInjector()
CamelContextgetInjector in interface CamelContextpublic void setInjector(Injector injector)
public ManagementMBeanAssembler getManagementMBeanAssembler()
CamelContextgetManagementMBeanAssembler in interface CamelContextpublic void setManagementMBeanAssembler(ManagementMBeanAssembler managementMBeanAssembler)
public ComponentResolver getComponentResolver()
public void setComponentResolver(ComponentResolver componentResolver)
public LanguageResolver getLanguageResolver()
public void setLanguageResolver(LanguageResolver languageResolver)
public boolean isAutoCreateComponents()
public void setAutoCreateComponents(boolean autoCreateComponents)
public Registry getRegistry()
CamelContextgetRegistry in interface CamelContextpublic <T> T getRegistry(Class<T> type)
CamelContextgetRegistry in interface CamelContexttype - the registry type such as JndiRegistrypublic void setJndiContext(Context jndiContext)
jndiContext - is the JNDI context to use as the registrysetRegistry(org.apache.camel.spi.Registry)public void setRegistry(Registry registry)
public List<LifecycleStrategy> getLifecycleStrategies()
CamelContextgetLifecycleStrategies in interface CamelContextpublic void setLifecycleStrategies(List<LifecycleStrategy> lifecycleStrategies)
public void addLifecycleStrategy(LifecycleStrategy lifecycleStrategy)
CamelContextaddLifecycleStrategy in interface CamelContextlifecycleStrategy - the strategypublic void setupRoutes(boolean done)
CamelContextCamelContext that the process to initialize setup routes is in progress.setupRoutes in interface CamelContextdone - false to start the process, call again with true to signal its done.CamelContext.isSetupRoutes()public List<RouteDefinition> getRouteDefinitions()
ModelCamelContextgetRouteDefinitions in interface CamelContextgetRouteDefinitions in interface ModelCamelContextpublic RouteDefinition getRouteDefinition(String id)
ModelCamelContextgetRouteDefinition in interface CamelContextgetRouteDefinition in interface ModelCamelContextid - id of the routepublic List<RestDefinition> getRestDefinitions()
ModelCamelContextgetRestDefinitions in interface CamelContextgetRestDefinitions in interface ModelCamelContextpublic void addRestDefinitions(Collection<RestDefinition> restDefinitions) throws Exception
ModelCamelContextaddRestDefinitions in interface CamelContextaddRestDefinitions in interface ModelCamelContextrestDefinitions - the rest(s) definition to addException - if the rest definitions could not be created for whatever reasonpublic RestConfiguration getRestConfiguration()
CamelContextgetRestConfiguration in interface CamelContextpublic void setRestConfiguration(RestConfiguration restConfiguration)
CamelContextRestConfigurationsetRestConfiguration in interface CamelContextrestConfiguration - the REST configurationpublic Collection<RestConfiguration> getRestConfigurations()
CamelContextgetRestConfigurations in interface CamelContextpublic void addRestConfiguration(RestConfiguration restConfiguration)
CamelContextRestConfigurationaddRestConfiguration in interface CamelContextrestConfiguration - the REST configurationpublic RestConfiguration getRestConfiguration(String component, boolean defaultIfNotExist)
CamelContextgetRestConfiguration in interface CamelContextcomponent - the component name to get the configurationdefaultIfNotExist - determine if the default configuration is returned if there isn't a
specific configuration for the given componentpublic ServiceCallConfigurationDefinition getServiceCallConfiguration(String serviceName)
CamelContextgetServiceCallConfiguration in interface CamelContextserviceName - name of service, or null to return the default configurationpublic void setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
CamelContextsetServiceCallConfiguration in interface CamelContextconfiguration - the configurationpublic void setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
CamelContextsetServiceCallConfigurations in interface CamelContextconfigurations - the configuration listpublic void addServiceCallConfiguration(String serviceName, ServiceCallConfigurationDefinition configuration)
CamelContextaddServiceCallConfiguration in interface CamelContextserviceName - name of the serviceconfiguration - the configurationpublic HystrixConfigurationDefinition getHystrixConfiguration(String id)
CamelContextgetHystrixConfiguration in interface CamelContextid - id of the configuration, or null to return the default configurationpublic void setHystrixConfiguration(HystrixConfigurationDefinition configuration)
CamelContextsetHystrixConfiguration in interface CamelContextconfiguration - the configurationpublic void setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
CamelContextsetHystrixConfigurations in interface CamelContextconfigurations - the configuration listpublic void addHystrixConfiguration(String id, HystrixConfigurationDefinition configuration)
CamelContextaddHystrixConfiguration in interface CamelContextid - name of the configurationconfiguration - the configurationpublic List<InterceptStrategy> getInterceptStrategies()
CamelContextgetInterceptStrategies in interface CamelContextpublic void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
public void addInterceptStrategy(InterceptStrategy interceptStrategy)
CamelContextaddInterceptStrategy in interface CamelContextinterceptStrategy - the strategypublic List<RoutePolicyFactory> getRoutePolicyFactories()
CamelContextgetRoutePolicyFactories in interface CamelContextpublic void setRoutePolicyFactories(List<RoutePolicyFactory> routePolicyFactories)
public void addRoutePolicyFactory(RoutePolicyFactory routePolicyFactory)
CamelContextaddRoutePolicyFactory in interface CamelContextroutePolicyFactory - the factorypublic Set<LogListener> getLogListeners()
CamelContextLogListener.getLogListeners in interface CamelContextpublic void addLogListener(LogListener listener)
CamelContextLogListener.addLogListener in interface CamelContextpublic void setStreamCaching(Boolean cache)
RuntimeConfigurationsetStreamCaching in interface RuntimeConfigurationcache - whether stream caching is enabled or notpublic Boolean isStreamCaching()
RuntimeConfigurationisStreamCaching in interface RuntimeConfigurationpublic void setTracing(Boolean tracing)
RuntimeConfigurationsetTracing in interface RuntimeConfigurationtracing - whether to enable tracing.public Boolean isTracing()
RuntimeConfigurationisTracing in interface RuntimeConfigurationpublic Boolean isMessageHistory()
RuntimeConfigurationisMessageHistory in interface RuntimeConfigurationpublic void setMessageHistory(Boolean messageHistory)
RuntimeConfigurationsetMessageHistory in interface RuntimeConfigurationmessageHistory - whether message history is enabledpublic void setLogMask(Boolean logMask)
RuntimeConfigurationsetLogMask in interface RuntimeConfigurationlogMask - true if mask is enabledpublic Boolean isLogMask()
RuntimeConfigurationisLogMask in interface RuntimeConfigurationpublic Boolean isLogExhaustedMessageBody()
RuntimeConfigurationisLogExhaustedMessageBody in interface RuntimeConfigurationpublic void setLogExhaustedMessageBody(Boolean logExhaustedMessageBody)
RuntimeConfigurationsetLogExhaustedMessageBody in interface RuntimeConfigurationlogExhaustedMessageBody - whether message body should be loggedpublic Boolean isHandleFault()
RuntimeConfigurationisHandleFault in interface RuntimeConfigurationpublic void setHandleFault(Boolean handleFault)
RuntimeConfigurationsetHandleFault in interface RuntimeConfigurationhandleFault - whether to enable fault handling.public Long getDelayer()
RuntimeConfigurationgetDelayer in interface RuntimeConfigurationpublic void setDelayer(Long delay)
RuntimeConfigurationsetDelayer in interface RuntimeConfigurationdelay - delay in millispublic ProducerTemplate createProducerTemplate()
CamelContextProducerTemplate which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop() when you are done using the template,
to clean up any resources.
Will use cache size defined in Camel property with key Exchange.MAXIMUM_CACHE_POOL_SIZE.
If no key was defined then it will fallback to a default size of 1000.
You can also use the ProducerTemplate.setMaximumCacheSize(int) method to use a custom value
before starting the template.createProducerTemplate in interface CamelContextpublic ProducerTemplate createProducerTemplate(int maximumCacheSize)
CamelContextProducerTemplate which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop() when you are done using the template,
to clean up any resources.createProducerTemplate in interface CamelContextmaximumCacheSize - the maximum cache sizepublic FluentProducerTemplate createFluentProducerTemplate()
CamelContextFluentProducerTemplate which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop() when you are done using the template,
to clean up any resources.
Will use cache size defined in Camel property with key Exchange.MAXIMUM_CACHE_POOL_SIZE.
If no key was defined then it will fallback to a default size of 1000.
You can also use the FluentProducerTemplate.setMaximumCacheSize(int) method to use a custom value
before starting the template.createFluentProducerTemplate in interface CamelContextpublic FluentProducerTemplate createFluentProducerTemplate(int maximumCacheSize)
CamelContextFluentProducerTemplate which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
Important: Make sure to call Service.stop() when you are done using the template,
to clean up any resources.createFluentProducerTemplate in interface CamelContextmaximumCacheSize - the maximum cache sizepublic ConsumerTemplate createConsumerTemplate()
CamelContextConsumerTemplate which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate? as it also applies for ConsumerTemplate.
Important: Make sure to call Service.stop() when you are done using the template,
to clean up any resources.
Will use cache size defined in Camel property with key Exchange.MAXIMUM_CACHE_POOL_SIZE.
If no key was defined then it will fallback to a default size of 1000.
You can also use the ConsumerTemplate.setMaximumCacheSize(int) method to use a custom value
before starting the template.createConsumerTemplate in interface CamelContextpublic ConsumerTemplate createConsumerTemplate(int maximumCacheSize)
CamelContextConsumerTemplate which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate? as it also applies for ConsumerTemplate.
Important: Make sure to call Service.stop() when you are done using the template,
to clean up any resources.createConsumerTemplate in interface CamelContextmaximumCacheSize - the maximum cache sizepublic ErrorHandlerBuilder getErrorHandlerBuilder()
CamelContextgetErrorHandlerBuilder in interface CamelContextpublic void setErrorHandlerBuilder(ErrorHandlerFactory errorHandlerBuilder)
CamelContextsetErrorHandlerBuilder in interface CamelContexterrorHandlerBuilder - the builderpublic ScheduledExecutorService getErrorHandlerExecutorService()
CamelContextgetErrorHandlerExecutorService in interface CamelContextpublic void setProducerServicePool(ServicePool<Endpoint,Producer> producerServicePool)
CamelContextProducer pooling.setProducerServicePool in interface CamelContextproducerServicePool - the poolpublic ServicePool<Endpoint,Producer> getProducerServicePool()
CamelContextProducer pooling.getProducerServicePool in interface CamelContextpublic ServicePool<Endpoint,PollingConsumer> getPollingConsumerServicePool()
CamelContextProducer pooling.getPollingConsumerServicePool in interface CamelContextpublic void setPollingConsumerServicePool(ServicePool<Endpoint,PollingConsumer> pollingConsumerServicePool)
CamelContextPollingConsumer pooling.setPollingConsumerServicePool in interface CamelContextpollingConsumerServicePool - the poolpublic UnitOfWorkFactory getUnitOfWorkFactory()
CamelContextUnitOfWorkFactory to use.getUnitOfWorkFactory in interface CamelContextpublic void setUnitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory)
CamelContextUnitOfWorkFactory to use.setUnitOfWorkFactory in interface CamelContextpublic RuntimeEndpointRegistry getRuntimeEndpointRegistry()
CamelContextRuntimeEndpointRegistry to use, or null if none is in use.getRuntimeEndpointRegistry in interface CamelContextpublic void setRuntimeEndpointRegistry(RuntimeEndpointRegistry runtimeEndpointRegistry)
CamelContextRuntimeEndpointRegistry to use.setRuntimeEndpointRegistry in interface CamelContextpublic String getUptime()
CamelContextgetUptime in interface CamelContextpublic long getUptimeMillis()
CamelContextgetUptimeMillis in interface CamelContextprotected void doSuspend() throws Exception
ServiceSupportdoSuspend in class ServiceSupportExceptionprotected void doResume() throws Exception
ServiceSupportdoResume in class ServiceSupportExceptionpublic void start() throws Exception
ServiceSupportServiceSupport.doStart(),
ServiceSupport.doStop(), etc. where you implement your logic. The methods ServiceSupport.start(), ServiceSupport.stop() should
NOT be overriden as they are used internally to keep track of the state of this service and properly
invoke the operation in a safe manner.start in interface CamelContextstart in interface Servicestart in class ServiceSupportException - is thrown if starting failedpublic void stop() throws Exception
ServiceSupportServiceSupport.doStart(),
ServiceSupport.doStop(), etc. where you implement your logic. The methods ServiceSupport.start(), ServiceSupport.stop() should
NOT be overriden as they are used internally to keep track of the state of this service and properly
invoke the operation in a safe manner.stop in interface CamelContextstop in interface Servicestop in class ServiceSupportException - is thrown if stopping failedpublic void suspend() throws Exception
ServiceSupportServiceSupport.doStart(),
ServiceSupport.doStop(), etc. where you implement your logic. The methods ServiceSupport.start(), ServiceSupport.stop() should
NOT be overriden as they are used internally to keep track of the state of this service and properly
invoke the operation in a safe manner.suspend in interface SuspendableServicesuspend in class ServiceSupportException - is thrown if suspending failedpublic void resume() throws Exception
ServiceSupportServiceSupport.doStart(),
ServiceSupport.doStop(), etc. where you implement your logic. The methods ServiceSupport.start(), ServiceSupport.stop() should
NOT be overriden as they are used internally to keep track of the state of this service and properly
invoke the operation in a safe manner.resume in interface SuspendableServiceresume in class ServiceSupportException - is thrown if resuming failedpublic void shutdown() throws Exception
ServiceSupportServiceSupport.doStart(),
ServiceSupport.doStop(), etc. where you implement your logic. The methods ServiceSupport.start(), ServiceSupport.stop() should
NOT be overriden as they are used internally to keep track of the state of this service and properly
invoke the operation in a safe manner.shutdown in interface ShutdownableServiceshutdown in class ServiceSupportException - thrown if shutting down failedprotected void doStart() throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStartCamel() throws Exception
Exceptionprotected void doStop() throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class ServiceSupportExceptionServiceSupport.doStart()protected void doStartOrResumeRoutes(Map<String,RouteService> routeServices, boolean checkClash, boolean startConsumer, boolean resumeConsumer, boolean addingRoutes) throws Exception
routeServices - the routes to start (will only start a route if its not already started)checkClash - whether to check for startup ordering clashstartConsumer - whether the route consumer should be started. Can be used to warmup the route without starting the consumer.resumeConsumer - whether the route consumer should be resumed.addingRoutes - whether we are adding new routesException - is thrown if error starting routesprotected boolean routeSupportsSuspension(String routeId)
protected void startRouteDefinitions(Collection<RouteDefinition> list) throws Exception
Exceptionprotected void startRouteService(RouteService routeService, boolean addingRoutes) throws Exception
Exceptionprotected void resumeRouteService(RouteService routeService) throws Exception
Exceptionprotected void stopRouteService(RouteService routeService, boolean removingRoutes) throws Exception
Exceptionprotected void logRouteState(Route route, String state)
protected void stopRouteService(RouteService routeService) throws Exception
Exceptionprotected void shutdownRouteService(RouteService routeService) throws Exception
Exceptionprotected void suspendRouteService(RouteService routeService) throws Exception
Exceptionprotected void safelyStartRouteServices(boolean checkClash, boolean startConsumer, boolean resumeConsumer, boolean addingRoutes, Collection<RouteService> routeServices) throws Exception
checkClash - whether to check for startup order clashstartConsumer - whether the route consumer should be started. Can be used to warmup the route without starting the consumer.resumeConsumer - whether the route consumer should be resumed.addingRoutes - whether we are adding new routesrouteServices - the routesException - is thrown if error starting the routesprotected void safelyStartRouteServices(boolean forceAutoStart, boolean checkClash, boolean startConsumer, boolean resumeConsumer, boolean addingRoutes, RouteService... routeServices) throws Exception
protected void forceLazyInitialization()
protected void forceStopLazyInitialization()
protected TypeConverter createTypeConverter()
protected Injector createInjector()
protected ManagementMBeanAssembler createManagementMBeanAssembler()
protected ComponentResolver createComponentResolver()
protected Registry createRegistry()
protected Endpoint createEndpoint(String uri)
Registryuri - the uri for the endpoint to be createdprotected Endpoint convertBeanToEndpoint(String uri, Object bean)
Registry to an endpoint using
some kind of transformation or wrapperuri - the uri for the endpoint (and name in the registry)bean - the bean to be converted to an endpoint, which will be not nullprotected boolean shouldStartRoutes()
protected PropertiesComponent getPropertiesComponent()
null if no properties component is in use.public void setDataFormats(Map<String,DataFormatDefinition> dataFormats)
ModelCamelContextsetDataFormats in interface CamelContextsetDataFormats in interface ModelCamelContextdataFormats - the data formatspublic Map<String,DataFormatDefinition> getDataFormats()
ModelCamelContextgetDataFormats in interface CamelContextgetDataFormats in interface ModelCamelContext@Deprecated public Map<String,String> getProperties()
getProperties in interface CamelContextpublic Map<String,String> getGlobalOptions()
CamelContextCamelContext.resolvePropertyPlaceholders(String) method and see more details
at the property placeholder documentation.getGlobalOptions in interface CamelContext@Deprecated public void setProperties(Map<String,String> properties)
setProperties in interface CamelContextpublic void setGlobalOptions(Map<String,String> globalOptions)
CamelContextCamelContext.resolvePropertyPlaceholders(String) method and see more details
at the property placeholder documentation.setGlobalOptions in interface CamelContextglobalOptions - global options that can be referenced in the camel contextpublic FactoryFinder getDefaultFactoryFinder()
CamelContextgetDefaultFactoryFinder in interface CamelContextpublic FactoryFinderResolver getFactoryFinderResolver()
public void setFactoryFinderResolver(FactoryFinderResolver resolver)
CamelContextsetFactoryFinderResolver in interface CamelContextresolver - the factory finder resolverpublic FactoryFinder getFactoryFinder(String path) throws NoFactoryAvailableException
CamelContextgetFactoryFinder in interface CamelContextpath - the META-INF pathNoFactoryAvailableException - is thrown if a factory could not be foundpublic ClassResolver getClassResolver()
CamelContextgetClassResolver in interface CamelContextpublic void setClassResolver(ClassResolver classResolver)
CamelContextsetClassResolver in interface CamelContextclassResolver - the resolverpublic PackageScanClassResolver getPackageScanClassResolver()
CamelContextgetPackageScanClassResolver in interface CamelContextpublic void setPackageScanClassResolver(PackageScanClassResolver packageScanClassResolver)
CamelContextsetPackageScanClassResolver in interface CamelContextpackageScanClassResolver - the resolverpublic List<String> getComponentNames()
CamelContextgetComponentNames in interface CamelContextpublic List<String> getLanguageNames()
CamelContextgetLanguageNames in interface CamelContextpublic ModelJAXBContextFactory getModelJAXBContextFactory()
CamelContextgetModelJAXBContextFactory in interface CamelContextpublic void setModelJAXBContextFactory(ModelJAXBContextFactory modelJAXBContextFactory)
CamelContextsetModelJAXBContextFactory in interface CamelContextmodelJAXBContextFactory - a JAXB Context factorypublic NodeIdFactory getNodeIdFactory()
CamelContextgetNodeIdFactory in interface CamelContextpublic void setNodeIdFactory(NodeIdFactory idFactory)
CamelContextsetNodeIdFactory in interface CamelContextidFactory - custom factory to usepublic ManagementStrategy getManagementStrategy()
CamelContextgetManagementStrategy in interface CamelContextpublic void setManagementStrategy(ManagementStrategy managementStrategy)
CamelContextsetManagementStrategy in interface CamelContextmanagementStrategy - the management strategypublic InterceptStrategy getDefaultTracer()
CamelContextgetDefaultTracer in interface CamelContextpublic void setDefaultTracer(InterceptStrategy tracer)
CamelContextsetDefaultTracer in interface CamelContexttracer - the custom tracer to use as default tracerpublic InterceptStrategy getDefaultBacklogTracer()
CamelContextgetDefaultBacklogTracer in interface CamelContextpublic void setDefaultBacklogTracer(InterceptStrategy backlogTracer)
CamelContextsetDefaultBacklogTracer in interface CamelContextbacklogTracer - the custom tracer to use as default backlog tracerpublic InterceptStrategy getDefaultBacklogDebugger()
CamelContextgetDefaultBacklogDebugger in interface CamelContextpublic void setDefaultBacklogDebugger(InterceptStrategy defaultBacklogDebugger)
CamelContextsetDefaultBacklogDebugger in interface CamelContextdefaultBacklogDebugger - the custom debugger to use as default backlog debuggerpublic void disableJMX()
CamelContextManagementStrategy.
Important: This method must be called before the CamelContext is started.disableJMX in interface CamelContextpublic InflightRepository getInflightRepository()
CamelContextgetInflightRepository in interface CamelContextpublic void setInflightRepository(InflightRepository repository)
CamelContextsetInflightRepository in interface CamelContextrepository - the repositorypublic AsyncProcessorAwaitManager getAsyncProcessorAwaitManager()
CamelContextAsyncProcessor await manager.getAsyncProcessorAwaitManager in interface CamelContextpublic void setAsyncProcessorAwaitManager(AsyncProcessorAwaitManager asyncProcessorAwaitManager)
CamelContextAsyncProcessor await manager.setAsyncProcessorAwaitManager in interface CamelContextasyncProcessorAwaitManager - the managerpublic void setAutoStartup(Boolean autoStartup)
RuntimeConfigurationCamelContexts are always started.
CamelContext then that takes precedence
and no routes is started. You would need to start CamelContext explicit using
the CamelContext.start() method, to start the context, and then
you would need to start the routes manually using CamelContext.startRoute(String).
Default is true to always start up.setAutoStartup in interface RuntimeConfigurationautoStartup - whether to start up automatically.public Boolean isAutoStartup()
RuntimeConfigurationCamelContexts are always started.
isAutoStartup in interface RuntimeConfiguration@Deprecated public Boolean isLazyLoadTypeConverters()
CamelContextisLazyLoadTypeConverters in interface CamelContext@Deprecated public void setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters)
CamelContextsetLazyLoadTypeConverters in interface CamelContextlazyLoadTypeConverters - true to load lazy, false to load on startuppublic Boolean isLoadTypeConverters()
CamelContextisLoadTypeConverters in interface CamelContextpublic void setLoadTypeConverters(Boolean loadTypeConverters)
CamelContextsetLoadTypeConverters in interface CamelContextloadTypeConverters - whether to load custom type converters.public Boolean isTypeConverterStatisticsEnabled()
CamelContextisTypeConverterStatisticsEnabled in interface CamelContextpublic void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled)
CamelContextorg.apache.camel.spi.TypeConverterRegistry#getStatistics()#setTypeConverterStatisticsEnabled(Boolean) method,
or from JMX on the ManagedTypeConverterRegistryMBean mbean.setTypeConverterStatisticsEnabled in interface CamelContexttypeConverterStatisticsEnabled - true to enable, false to disablepublic Boolean isUseMDCLogging()
CamelContextisUseMDCLogging in interface CamelContextpublic void setUseMDCLogging(Boolean useMDCLogging)
CamelContextsetUseMDCLogging in interface CamelContextuseMDCLogging - true to enable MDC logging, false to disablepublic Boolean isUseDataType()
CamelContextisUseDataType in interface CamelContextpublic void setUseDataType(Boolean useDataType)
CamelContextsetUseDataType in interface CamelContextuseDataType - true to enable data type on Camel messages.public Boolean isUseBreadcrumb()
CamelContextisUseBreadcrumb in interface CamelContextpublic void setUseBreadcrumb(Boolean useBreadcrumb)
CamelContextsetUseBreadcrumb in interface CamelContextuseBreadcrumb - true to enable breadcrumb, false to disablepublic ClassLoader getApplicationContextClassLoader()
CamelContextgetApplicationContextClassLoader in interface CamelContextpublic void setApplicationContextClassLoader(ClassLoader classLoader)
CamelContextsetApplicationContextClassLoader in interface CamelContextclassLoader - the class loaderpublic DataFormatResolver getDataFormatResolver()
CamelContextgetDataFormatResolver in interface CamelContextpublic void setDataFormatResolver(DataFormatResolver dataFormatResolver)
CamelContextsetDataFormatResolver in interface CamelContextdataFormatResolver - the resolverpublic DataFormat resolveDataFormat(String name)
CamelContextresolveDataFormat in interface CamelContextname - the data format name or a reference to it in the Registrypublic DataFormat createDataFormat(String name)
CamelContextcreateDataFormat in interface CamelContextname - the data format name or a reference to a data format factory in the Registrypublic DataFormatDefinition resolveDataFormatDefinition(String name)
ModelCamelContextresolveDataFormatDefinition in interface CamelContextresolveDataFormatDefinition in interface ModelCamelContextname - the data format definition name or a reference to it in the Registry@Deprecated protected Component lookupPropertiesComponent()
public ShutdownStrategy getShutdownStrategy()
CamelContextgetShutdownStrategy in interface CamelContextpublic void setShutdownStrategy(ShutdownStrategy shutdownStrategy)
CamelContextsetShutdownStrategy in interface CamelContextshutdownStrategy - the custom strategypublic ShutdownRoute getShutdownRoute()
RuntimeConfigurationgetShutdownRoute in interface RuntimeConfigurationpublic void setShutdownRoute(ShutdownRoute shutdownRoute)
RuntimeConfigurationsetShutdownRoute in interface RuntimeConfigurationshutdownRoute - the option to use.public ShutdownRunningTask getShutdownRunningTask()
RuntimeConfigurationgetShutdownRunningTask in interface RuntimeConfigurationpublic void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
RuntimeConfigurationsetShutdownRunningTask in interface RuntimeConfigurationshutdownRunningTask - the option to use.public void setAllowUseOriginalMessage(Boolean allowUseOriginalMessage)
RuntimeConfigurationUnitOfWork.getOriginalInMessage().
Turning this off can optimize performance, as defensive copy of the original message is not needed.setAllowUseOriginalMessage in interface RuntimeConfigurationallowUseOriginalMessage - the option to use.public Boolean isAllowUseOriginalMessage()
RuntimeConfigurationUnitOfWork.getOriginalInMessage() is allowed.isAllowUseOriginalMessage in interface RuntimeConfigurationpublic ExecutorServiceManager getExecutorServiceManager()
CamelContextExecutorServiceManagergetExecutorServiceManager in interface CamelContext@Deprecated public ExecutorServiceStrategy getExecutorServiceStrategy()
CamelContextExecutorServiceStrategygetExecutorServiceStrategy in interface CamelContextpublic void setExecutorServiceManager(ExecutorServiceManager executorServiceManager)
CamelContextExecutorServiceManagersetExecutorServiceManager in interface CamelContextexecutorServiceManager - the custom managerpublic ProcessorFactory getProcessorFactory()
CamelContextProcessorFactorygetProcessorFactory in interface CamelContextpublic void setProcessorFactory(ProcessorFactory processorFactory)
CamelContextProcessorFactorysetProcessorFactory in interface CamelContextprocessorFactory - the custom factorypublic MessageHistoryFactory getMessageHistoryFactory()
CamelContextMessageHistoryFactorygetMessageHistoryFactory in interface CamelContextpublic void setMessageHistoryFactory(MessageHistoryFactory messageHistoryFactory)
CamelContextMessageHistoryFactorysetMessageHistoryFactory in interface CamelContextmessageHistoryFactory - the custom factorypublic Debugger getDebugger()
CamelContextDebuggergetDebugger in interface CamelContextpublic void setDebugger(Debugger debugger)
CamelContextDebuggersetDebugger in interface CamelContextdebugger - the debuggerpublic UuidGenerator getUuidGenerator()
CamelContextUuidGeneratorgetUuidGenerator in interface CamelContextpublic void setUuidGenerator(UuidGenerator uuidGenerator)
CamelContextUuidGenerator (should only be set once)setUuidGenerator in interface CamelContextuuidGenerator - the UUID Generatorpublic StreamCachingStrategy getStreamCachingStrategy()
CamelContextStreamCachingStrategy to use.getStreamCachingStrategy in interface CamelContextpublic void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy)
CamelContextStreamCachingStrategy to use.setStreamCachingStrategy in interface CamelContextpublic RestRegistry getRestRegistry()
CamelContextRestRegistry to usegetRestRegistry in interface CamelContextpublic void setRestRegistry(RestRegistry restRegistry)
CamelContextRestRegistry to use.setRestRegistry in interface CamelContext@Deprecated public String getProperty(String key)
getProperty in interface CamelContextpublic String getGlobalOption(String key)
CamelContextCamelContext.resolvePropertyPlaceholders(String) method and see more details
at the property placeholder documentation.getGlobalOption in interface CamelContextpublic ReloadStrategy getReloadStrategy()
CamelContextReloadStrategy if in use.getReloadStrategy in interface CamelContextpublic void setReloadStrategy(ReloadStrategy reloadStrategy)
CamelContextReloadStrategy to be usedsetReloadStrategy in interface CamelContextpublic void setTransformers(List<TransformerDefinition> transformers)
CamelContextsetTransformers in interface CamelContexttransformers - the transformerspublic List<TransformerDefinition> getTransformers()
CamelContextgetTransformers in interface CamelContextpublic Transformer resolveTransformer(String scheme)
CamelContextresolveTransformer in interface CamelContextscheme - data model name.public Transformer resolveTransformer(DataType from, DataType to)
CamelContextresolveTransformer in interface CamelContextfrom - from data typeto - to data typepublic TransformerRegistry<TransformerKey> getTransformerRegistry()
CamelContextTransformerRegistrygetTransformerRegistry in interface CamelContextpublic void setValidators(List<ValidatorDefinition> validators)
CamelContextsetValidators in interface CamelContextvalidators - the validatorspublic List<ValidatorDefinition> getValidators()
CamelContextgetValidators in interface CamelContextpublic Validator resolveValidator(DataType type)
CamelContextresolveValidator in interface CamelContexttype - the data typepublic ValidatorRegistry<ValidatorKey> getValidatorRegistry()
CamelContextValidatorRegistrygetValidatorRegistry in interface CamelContextpublic RuntimeCamelCatalog getRuntimeCamelCatalog()
CamelContextRuntimeCamelCatalog for this CamelContext.getRuntimeCamelCatalog in interface CamelContextpublic void setSSLContextParameters(SSLContextParameters sslContextParameters)
CamelContextsetSSLContextParameters in interface CamelContextpublic SSLContextParameters getSSLContextParameters()
CamelContextgetSSLContextParameters in interface CamelContextpublic HeadersMapFactory getHeadersMapFactory()
CamelContextHeadersMapFactory to use.getHeadersMapFactory in interface CamelContextpublic void setHeadersMapFactory(HeadersMapFactory headersMapFactory)
CamelContextHeadersMapFactory to be used.setHeadersMapFactory in interface CamelContextprotected Map<String,RouteService> getRouteServices()
protected ManagementStrategy createManagementStrategy()
public static void setContextCounter(int value)
value - new value for the context counterprotected UuidGenerator createDefaultUuidGenerator()
protected ModelJAXBContextFactory createModelJAXBContextFactory()
public HealthCheckRegistry getHealthCheckRegistry()
CamelContextHealthCheckRegistry, by default no registry is
present and it must be explicit activated. Components can register/unregister
health checks in response to life-cycle events (i.e. start/stop).
This registry is not used by the camel context but it is up to the impl to
properly use it, i.e.
- a RouteController could use the registry to decide to restart a route
with failing health checks
- spring boot could integrate such checks within its health endpoint or
make it available only as separate endpoint.getHealthCheckRegistry in interface CamelContextpublic void setHealthCheckRegistry(HealthCheckRegistry healthCheckRegistry)
HealthCheckRegistry.setHealthCheckRegistry in interface CamelContextprotected NodeIdFactory createNodeIdFactory()
protected FactoryFinderResolver createFactoryFinderResolver()
protected ClassResolver createClassResolver()
protected ProcessorFactory createProcessorFactory()
protected DataFormatResolver createDataFormatResolver()
protected MessageHistoryFactory createMessageHistoryFactory()
protected InflightRepository createInflightRepository()
protected AsyncProcessorAwaitManager createAsyncProcessorAwaitManager()
protected RouteController createRouteController()
protected HealthCheckRegistry createHealthCheckRegistry()
protected ShutdownStrategy createShutdownStrategy()
protected PackageScanClassResolver createPackageScanClassResolver()
protected ExecutorServiceManager createExecutorServiceManager()
protected ServicePool<Endpoint,Producer> createProducerServicePool()
protected ServicePool<Endpoint,PollingConsumer> createPollingConsumerServicePool()
protected UnitOfWorkFactory createUnitOfWorkFactory()
protected RuntimeCamelCatalog createRuntimeCamelCatalog()
protected CamelContextNameStrategy createCamelContextNameStrategy()
protected ManagementNameStrategy createManagementNameStrategy()
protected HeadersMapFactory createHeadersMapFactory()
protected LanguageResolver createLanguageResolver()
protected EndpointRegistry<EndpointKey> createEndpointRegistry(Map<EndpointKey,Endpoint> endpoints)
protected ValidatorRegistry<ValidatorKey> createValidatorRegistry(List<ValidatorDefinition> validators) throws Exception
Exceptionprotected TransformerRegistry<TransformerKey> createTransformerRegistry(List<TransformerDefinition> transformers) throws Exception
ExceptionApache Camel