|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultCamelContext
public class DefaultCamelContext
Represents the context used to configure routes and the policies to use.
Constructor Summary | |
---|---|
DefaultCamelContext()
|
|
DefaultCamelContext(Context jndiContext)
Creates the CamelContext using the given JNDI context as the registry |
|
DefaultCamelContext(Registry registry)
Creates the CamelContext using the given registry |
Method Summary | ||
---|---|---|
void |
addComponent(String componentName,
Component component)
Adds a component to the context. |
|
Endpoint |
addEndpoint(String uri,
Endpoint endpoint)
Adds the endpoint to the context using the given URI. |
|
protected Endpoint |
addEndpointToRegistry(String uri,
Endpoint endpoint)
Strategy to add the given endpoint to the internal endpoint registry |
|
void |
addInterceptStrategy(InterceptStrategy interceptStrategy)
Adds the given interceptor strategy |
|
void |
addLifecycleStrategy(LifecycleStrategy lifecycleStrategy)
Adds the given lifecycle strategy to be used. |
|
void |
addRegisterEndpointCallback(EndpointStrategy strategy)
Registers a callback to allow you to do custom
logic when an Endpoint is about to be registered to the CamelContext endpoint registry. |
|
void |
addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Adds a collection of route definitions to the context |
|
void |
addRoutes(RoutesBuilder builder)
Adds a collection of routes to this context using the given builder to build them |
|
void |
addService(Object object)
Adds a service, starting it so that it will be stopped with this context The added service will also be enlisted in JMX for management (if JMX is enabled) |
|
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 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. |
|
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 Injector |
createInjector()
Lazily create a default implementation |
|
protected ManagementStrategy |
createManagementStrategy()
|
|
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 TypeConverter |
createTypeConverter()
Lazily create a default implementation |
|
void |
disableJMX()
Disables using JMX as ManagementStrategy . |
|
protected void |
doStart()
|
|
protected void |
doStop()
|
|
protected void |
forceLazyInitialization()
Lets force some lazy initialization to occur upfront before we start any components and create routes |
|
ClassLoader |
getApplicationContextClassLoader()
Gets the the application context class loader which may be helpful for running camel in other containers |
|
ClassResolver |
getClassResolver()
Returns the class resolver to be used for loading/lookup of classes. |
|
Component |
getComponent(String name)
Gets a component from the context by name. |
|
|
getComponent(String name,
Class<T> componentType)
Gets a component from the context by name and specifying the expected type of component. |
|
List<String> |
getComponentNames()
Gets a readonly list of names of the components currently registered |
|
ComponentResolver |
getComponentResolver()
|
|
DataFormatResolver |
getDataFormatResolver()
Gets the current data format resolver |
|
Map<String,DataFormatDefinition> |
getDataFormats()
Gets the data formats that can be referenced in the routes. |
|
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 |
|
Endpoint |
getEndpoint(String uri)
Resolves the given name to an Endpoint of the specified type. |
|
|
getEndpoint(String name,
Class<T> endpointType)
Resolves the given name to an Endpoint of the specified type. |
|
protected String |
getEndpointKey(String uri,
Endpoint endpoint)
|
|
Map<String,Endpoint> |
getEndpointMap()
Returns a new Map containing all of the active endpoints with the key of the map being their unique key. |
|
Collection<Endpoint> |
getEndpoints()
Returns the collection of all registered endpoints. |
|
ErrorHandlerBuilder |
getErrorHandlerBuilder()
Gets the default error handler builder which is inherited by the routes |
|
ExecutorServiceStrategy |
getExecutorServiceStrategy()
Gets the current ExecutorServiceStrategy |
|
FactoryFinder |
getFactoryFinder(String path)
Gets the FactoryFinder which will be used for the loading the factory class from META-INF in the given path |
|
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. |
|
LanguageResolver |
getLanguageResolver()
|
|
List<LifecycleStrategy> |
getLifecycleStrategies()
Returns the lifecycle strategies used to handle lifecycle notifications |
|
ManagementStrategy |
getManagementStrategy()
Gets the management strategy |
|
String |
getName()
Gets the name of the this context. |
|
NodeIdFactory |
getNodeIdFactory()
Gets the node id factory |
|
PackageScanClassResolver |
getPackageScanClassResolver()
Returns the package scanning class resolver |
|
ServicePool<Endpoint,Producer> |
getProducerServicePool()
Gets the service pool for Producer pooling. |
|
Map<String,String> |
getProperties()
Gets the properties that can be referenced in the camel context |
|
Registry |
getRegistry()
Returns the registry used to lookup components by name and type such as the Spring ApplicationContext, JNDI or the OSGi Service Registry |
|
Route |
getRoute(String id)
Gets the route with the given id |
|
RouteDefinition |
getRouteDefinition(String id)
Gets the route definition with the given id |
|
List<RouteDefinition> |
getRouteDefinitions()
Returns a list of the current route definitions |
|
List<Route> |
getRoutes()
Returns the current routes in this context |
|
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 |
|
ShutdownRoute |
getShutdownRoute()
Gets the option to use when shutting down route. |
|
ShutdownRunningTask |
getShutdownRunningTask()
Gets the option to use when shutting down a route and how to act when it has running tasks. |
|
ShutdownStrategy |
getShutdownStrategy()
Gets the current shutdown strategy |
|
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 |
|
Component |
hasComponent(String componentName)
Is the given component already registered? |
|
Endpoint |
hasEndpoint(String uri)
Is the given endpoint already registered? |
|
boolean |
hasService(Object object)
Has the given service already been added? |
|
boolean |
isAutoCreateComponents()
|
|
Boolean |
isAutoStartup()
Gets whether it should automatic start when Camel starts. |
|
Boolean |
isHandleFault()
Returns whether tracing enabled |
|
Boolean |
isStreamCaching()
Returns whether stream cache is enabled |
|
Boolean |
isTracing()
Returns whether tracing enabled |
|
Component |
removeComponent(String componentName)
Deprecated. |
|
void |
removeRouteDefinition(RouteDefinition routeDefinition)
|
|
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 |
|
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 uri)
Parses the given text and resolve any property placeholders - using {{key}}. |
|
void |
setApplicationContextClassLoader(ClassLoader classLoader)
Sets the application context class loader |
|
void |
setAutoCreateComponents(boolean autoCreateComponents)
|
|
void |
setAutoStartup(Boolean autoStartup)
Sets whether it should automatic 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 |
setDefaultTracer(InterceptStrategy defaultTracer)
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, to slow things down to better helps you to see what goes Is disabled by default |
|
void |
setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
Sets the default error handler builder which is inherited by the routes |
|
void |
setExecutorServiceStrategy(ExecutorServiceStrategy executorServiceStrategy)
Sets a custom ExecutorServiceStrategy |
|
void |
setFactoryFinderResolver(FactoryFinderResolver resolver)
Sets the factory finder resolver to use. |
|
void |
setHandleFault(Boolean handleFault)
Sets whether handle fault is enabled or not (default is disabled). |
|
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 |
setLifecycleStrategies(List<LifecycleStrategy> lifecycleStrategies)
|
|
void |
setManagementStrategy(ManagementStrategy managementStrategy)
Sets the management strategy to use |
|
void |
setName(String name)
Sets the name of the this context. |
|
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 |
setProducerServicePool(ServicePool<Endpoint,Producer> producerServicePool)
Sets a pluggable service pool to use for Producer pooling. |
|
void |
setProperties(Map<String,String> properties)
Sets the properties that can be referenced in the camel context |
|
void |
setRegistry(Registry registry)
|
|
void |
setRoutes(List<Route> routes)
|
|
void |
setShutdownRoute(ShutdownRoute shutdownRoute)
Sets the option to use when shutting down routes. |
|
void |
setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
Sets the option to use when shutting down a route and how to act when it has running tasks. |
|
void |
setShutdownStrategy(ShutdownStrategy shutdownStrategy)
Sets a custom shutdown strategy |
|
void |
setStreamCaching(Boolean cache)
Sets whether stream caching is enabled or not (default is disabled). |
|
void |
setTracing(Boolean tracing)
Sets whether tracing is enabled or not (default is disabled). |
|
void |
setTypeConverter(TypeConverter typeConverter)
|
|
void |
setTypeConverterRegistry(TypeConverterRegistry typeConverterRegistry)
|
|
protected boolean |
shouldStartRoutes()
Should we start newly added routes? |
|
void |
shutdownRoute(String routeId)
Shutdown the given route using ShutdownStrategy . |
|
void |
shutdownRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Shutdown the given route using ShutdownStrategy with a specified timeout. |
|
void |
start()
Starts the service |
|
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)
Starts the given route service |
|
void |
stopRoute(RouteDefinition route)
Stops the given route. |
|
void |
stopRoute(String routeId)
Stops the given route. |
|
String |
toString()
|
Methods inherited from class org.apache.camel.impl.ServiceSupport |
---|
addChildService, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, shutdown, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.camel.CamelContext |
---|
getStatus, getVersion |
Methods inherited from interface org.apache.camel.Service |
---|
stop |
Constructor Detail |
---|
public DefaultCamelContext()
public DefaultCamelContext(Context jndiContext)
CamelContext
using the given JNDI context as the registry
jndiContext
- the JNDI contextpublic DefaultCamelContext(Registry registry)
CamelContext
using the given registry
registry
- the registryMethod Detail |
---|
public String getName()
CamelContext
getName
in interface CamelContext
public void setName(String name)
name
- the namepublic Component hasComponent(String componentName)
CamelContext
hasComponent
in interface CamelContext
componentName
- the name of the component
public void addComponent(String componentName, Component component)
CamelContext
addComponent
in interface CamelContext
componentName
- the name the component is registered ascomponent
- the componentpublic Component getComponent(String name)
CamelContext
getComponent
in interface CamelContext
name
- the name of the component
public <T extends Component> T getComponent(String name, Class<T> componentType)
CamelContext
getComponent
in interface CamelContext
name
- the name to lookupcomponentType
- the expected type
@Deprecated public Component removeComponent(String componentName)
CamelContext
removeComponent
in interface CamelContext
componentName
- the component name to remove
public Collection<Endpoint> getEndpoints()
CamelContext
getEndpoints
in interface CamelContext
public Map<String,Endpoint> getEndpointMap()
CamelContext
getEndpointMap
in interface CamelContext
public Endpoint hasEndpoint(String uri)
CamelContext
hasEndpoint
in interface CamelContext
uri
- the URI of the endpoint
public Endpoint addEndpoint(String uri, Endpoint endpoint) throws Exception
CamelContext
addEndpoint
in interface CamelContext
uri
- the URI to be used to resolve this endpointendpoint
- the endpoint to be added to the context
Exception
- if the new endpoint could not be started or the old endpoint could not be stoppedpublic Endpoint getEndpoint(String uri)
CamelContext
Endpoint
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.
getEndpoint
in interface CamelContext
uri
- the URI of the endpoint
public <T extends Endpoint> T getEndpoint(String name, Class<T> endpointType)
CamelContext
Endpoint
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.
getEndpoint
in interface CamelContext
name
- the name of the endpointendpointType
- the expected type
public void addRegisterEndpointCallback(EndpointStrategy strategy)
CamelContext
callback
to allow you to do custom
logic when an Endpoint
is about to be registered to the CamelContext
endpoint registry.
When a callback is added it will be executed on the already registered endpoints allowing you to catch-up
addRegisterEndpointCallback
in interface CamelContext
strategy
- callback to be invokedprotected Endpoint addEndpointToRegistry(String uri, Endpoint endpoint)
uri
- uri of endpointendpoint
- the endpoint to add
public List<RouteStartupOrder> getRouteStartupOrder()
public List<Route> getRoutes()
CamelContext
getRoutes
in interface CamelContext
public Route getRoute(String id)
CamelContext
getRoute
in interface CamelContext
id
- id of the route
public void setRoutes(List<Route> routes)
public void addRoutes(RoutesBuilder builder) throws Exception
CamelContext
addRoutes
in interface CamelContext
builder
- the builder which will create the routes and add them to this context
Exception
- if the routes could not be created for whatever reasonpublic void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
CamelContext
addRouteDefinitions
in interface CamelContext
routeDefinitions
- the route definitions to add
Exception
- if the route definition could not be created for whatever reasonpublic boolean removeRouteDefinition(String key)
public void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
CamelContext
removeRouteDefinitions
in interface CamelContext
routeDefinitions
- route definitions
Exception
- if the route definition could not be removed for whatever reasonpublic void removeRouteDefinition(RouteDefinition routeDefinition) throws Exception
Exception
public ServiceStatus getRouteStatus(String key)
CamelContext
getRouteStatus
in interface CamelContext
key
- the route id
public void startRoute(RouteDefinition route) throws Exception
CamelContext
startRoute
in interface CamelContext
route
- the route to start
Exception
- is thrown if the route could not be started for whatever reasonpublic void startRoute(String routeId) throws Exception
CamelContext
startRoute
in interface CamelContext
routeId
- the route id
Exception
- is thrown if the route could not be started for whatever reasonpublic void stopRoute(RouteDefinition route) throws Exception
CamelContext
CamelContext.getRouteDefinitions()
unless you use the CamelContext.removeRouteDefinitions(java.util.Collection)
stopRoute
in interface CamelContext
route
- the route to stop
Exception
- is thrown if the route could not be stopped for whatever reasonpublic void stopRoute(String routeId) throws Exception
CamelContext
CamelContext.getRouteDefinitions()
unless you use the CamelContext.removeRouteDefinitions(java.util.Collection)
stopRoute
in interface CamelContext
routeId
- the route id
Exception
- is thrown if the route could not be stopped for whatever reasonpublic void shutdownRoute(String routeId) throws Exception
CamelContext
ShutdownStrategy
.
It will remain in the list of route definitions return by CamelContext.getRouteDefinitions()
unless you use the CamelContext.removeRouteDefinitions(java.util.Collection)
shutdownRoute
in interface CamelContext
routeId
- the route id
Exception
- is thrown if the route could not be shutdown for whatever reasonpublic void shutdownRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
CamelContext
ShutdownStrategy
with a specified timeout.
It will remain in the list of route definitions return by CamelContext.getRouteDefinitions()
unless you use the CamelContext.removeRouteDefinitions(java.util.Collection)
shutdownRoute
in interface CamelContext
routeId
- the route idtimeout
- timeouttimeUnit
- the unit to use
Exception
- is thrown if the route could not be shutdown for whatever reasonpublic void addService(Object object) throws Exception
CamelContext
addService
in interface CamelContext
object
- the service
Exception
- can be thrown when starting the servicepublic boolean hasService(Object object)
CamelContext
hasService
in interface CamelContext
object
- the service
public Language resolveLanguage(String language)
CamelContext
resolveLanguage
in interface CamelContext
language
- name of the language
public String resolvePropertyPlaceholders(String uri) throws Exception
CamelContext
resolvePropertyPlaceholders
in interface CamelContext
uri
- the text such as an endpoint uri or the likes
Exception
- is thrown if property placeholders was used and there was an error resolving thempublic TypeConverter getTypeConverter()
CamelContext
getTypeConverter
in interface CamelContext
public void setTypeConverter(TypeConverter typeConverter)
public TypeConverterRegistry getTypeConverterRegistry()
CamelContext
getTypeConverterRegistry
in interface CamelContext
public void setTypeConverterRegistry(TypeConverterRegistry typeConverterRegistry)
public Injector getInjector()
CamelContext
getInjector
in interface CamelContext
public void setInjector(Injector injector)
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()
CamelContext
getRegistry
in interface CamelContext
public 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()
CamelContext
getLifecycleStrategies
in interface CamelContext
public void setLifecycleStrategies(List<LifecycleStrategy> lifecycleStrategies)
public void addLifecycleStrategy(LifecycleStrategy lifecycleStrategy)
CamelContext
addLifecycleStrategy
in interface CamelContext
lifecycleStrategy
- the strategypublic List<RouteDefinition> getRouteDefinitions()
CamelContext
getRouteDefinitions
in interface CamelContext
public RouteDefinition getRouteDefinition(String id)
CamelContext
getRouteDefinition
in interface CamelContext
id
- id of the route
public List<InterceptStrategy> getInterceptStrategies()
CamelContext
getInterceptStrategies
in interface CamelContext
public void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
public void addInterceptStrategy(InterceptStrategy interceptStrategy)
CamelContext
addInterceptStrategy
in interface CamelContext
interceptStrategy
- the strategypublic void setStreamCaching(Boolean cache)
RuntimeConfiguration
setStreamCaching
in interface RuntimeConfiguration
cache
- whether stream caching is enabled or notpublic Boolean isStreamCaching()
RuntimeConfiguration
isStreamCaching
in interface RuntimeConfiguration
public void setTracing(Boolean tracing)
RuntimeConfiguration
setTracing
in interface RuntimeConfiguration
tracing
- whether tracing is enabled or not.public Boolean isTracing()
RuntimeConfiguration
isTracing
in interface RuntimeConfiguration
public Boolean isHandleFault()
RuntimeConfiguration
isHandleFault
in interface RuntimeConfiguration
public void setHandleFault(Boolean handleFault)
RuntimeConfiguration
setHandleFault
in interface RuntimeConfiguration
handleFault
- whether handle fault is enabled or not.public Long getDelayer()
RuntimeConfiguration
getDelayer
in interface RuntimeConfiguration
public void setDelayer(Long delay)
RuntimeConfiguration
setDelayer
in interface RuntimeConfiguration
delay
- delay in millispublic ProducerTemplate createProducerTemplate()
CamelContext
ProducerTemplate
which is started and therefore ready to use right away.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
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 CamelContext
public ProducerTemplate createProducerTemplate(int maximumCacheSize)
CamelContext
ProducerTemplate
which is started and therefore ready to use right away.
You must start the template before its being used.
See this FAQ before use:
Why does Camel use too many threads with ProducerTemplate?
createProducerTemplate
in interface CamelContext
maximumCacheSize
- the maximum cache size
public ConsumerTemplate createConsumerTemplate()
CamelContext
ConsumerTemplate
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.
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 CamelContext
public ConsumerTemplate createConsumerTemplate(int maximumCacheSize)
CamelContext
ConsumerTemplate
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.
createConsumerTemplate
in interface CamelContext
maximumCacheSize
- the maximum cache size
public ErrorHandlerBuilder getErrorHandlerBuilder()
CamelContext
getErrorHandlerBuilder
in interface CamelContext
public void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
CamelContext
setErrorHandlerBuilder
in interface CamelContext
errorHandlerBuilder
- the builderpublic void setProducerServicePool(ServicePool<Endpoint,Producer> producerServicePool)
CamelContext
Producer
pooling.
setProducerServicePool
in interface CamelContext
producerServicePool
- the poolpublic ServicePool<Endpoint,Producer> getProducerServicePool()
CamelContext
Producer
pooling.
getProducerServicePool
in interface CamelContext
public void start() throws Exception
Service
start
in interface Service
start
in class ServiceSupport
Exception
- is thrown if starting failedprotected void doStart() throws Exception
doStart
in class ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class ServiceSupport
Exception
protected void startRouteDefinitions(Collection<RouteDefinition> list) throws Exception
Exception
protected void startRouteService(RouteService routeService) throws Exception
Exception
protected void forceLazyInitialization()
protected TypeConverter createTypeConverter()
protected Injector createInjector()
protected ComponentResolver createComponentResolver()
protected Registry createRegistry()
protected Endpoint createEndpoint(String uri)
Registry
uri
- the uri for the endpoint to be created
protected Endpoint convertBeanToEndpoint(String uri, Object bean)
Registry
to an endpoint using
some kind of transformation or wrapper
uri
- the uri for the endpoint (and name in the registry)bean
- the bean to be converted to an endpoint, which will be not null
protected boolean shouldStartRoutes()
public void setDataFormats(Map<String,DataFormatDefinition> dataFormats)
CamelContext
setDataFormats
in interface CamelContext
dataFormats
- the data formatspublic Map<String,DataFormatDefinition> getDataFormats()
CamelContext
getDataFormats
in interface CamelContext
public Map<String,String> getProperties()
CamelContext
getProperties
in interface CamelContext
public void setProperties(Map<String,String> properties)
CamelContext
setProperties
in interface CamelContext
properties
- propertiespublic FactoryFinder getDefaultFactoryFinder()
CamelContext
getDefaultFactoryFinder
in interface CamelContext
public void setFactoryFinderResolver(FactoryFinderResolver resolver)
CamelContext
setFactoryFinderResolver
in interface CamelContext
resolver
- the factory finder resolverpublic FactoryFinder getFactoryFinder(String path) throws NoFactoryAvailableException
CamelContext
getFactoryFinder
in interface CamelContext
path
- the META-INF path
NoFactoryAvailableException
- is thrown if a factory could not be foundpublic ClassResolver getClassResolver()
CamelContext
getClassResolver
in interface CamelContext
public void setClassResolver(ClassResolver classResolver)
CamelContext
setClassResolver
in interface CamelContext
classResolver
- the resolverpublic PackageScanClassResolver getPackageScanClassResolver()
CamelContext
getPackageScanClassResolver
in interface CamelContext
public void setPackageScanClassResolver(PackageScanClassResolver packageScanClassResolver)
CamelContext
setPackageScanClassResolver
in interface CamelContext
packageScanClassResolver
- the resolverpublic List<String> getComponentNames()
CamelContext
getComponentNames
in interface CamelContext
public List<String> getLanguageNames()
CamelContext
getLanguageNames
in interface CamelContext
public NodeIdFactory getNodeIdFactory()
CamelContext
getNodeIdFactory
in interface CamelContext
public void setNodeIdFactory(NodeIdFactory idFactory)
CamelContext
setNodeIdFactory
in interface CamelContext
idFactory
- custom factory to usepublic ManagementStrategy getManagementStrategy()
CamelContext
getManagementStrategy
in interface CamelContext
public void setManagementStrategy(ManagementStrategy managementStrategy)
CamelContext
setManagementStrategy
in interface CamelContext
managementStrategy
- the management strategypublic InterceptStrategy getDefaultTracer()
CamelContext
getDefaultTracer
in interface CamelContext
public void setDefaultTracer(InterceptStrategy defaultTracer)
CamelContext
setDefaultTracer
in interface CamelContext
defaultTracer
- the custom tracer to use as default tracerpublic void disableJMX()
CamelContext
ManagementStrategy
.
disableJMX
in interface CamelContext
public InflightRepository getInflightRepository()
CamelContext
getInflightRepository
in interface CamelContext
public void setInflightRepository(InflightRepository repository)
CamelContext
setInflightRepository
in interface CamelContext
repository
- the repositorypublic void setAutoStartup(Boolean autoStartup)
RuntimeConfiguration
CamelContext
itself are always started}
setAutoStartup
in interface RuntimeConfiguration
autoStartup
- whether to auto startup.public Boolean isAutoStartup()
RuntimeConfiguration
isAutoStartup
in interface RuntimeConfiguration
public ClassLoader getApplicationContextClassLoader()
CamelContext
getApplicationContextClassLoader
in interface CamelContext
public void setApplicationContextClassLoader(ClassLoader classLoader)
CamelContext
setApplicationContextClassLoader
in interface CamelContext
classLoader
- the class loaderpublic DataFormatResolver getDataFormatResolver()
CamelContext
getDataFormatResolver
in interface CamelContext
public void setDataFormatResolver(DataFormatResolver dataFormatResolver)
CamelContext
setDataFormatResolver
in interface CamelContext
dataFormatResolver
- the resolverpublic DataFormat resolveDataFormat(String name)
CamelContext
resolveDataFormat
in interface CamelContext
name
- the data format name or a reference to it in the Registry
public DataFormatDefinition resolveDataFormatDefinition(String name)
CamelContext
resolveDataFormatDefinition
in interface CamelContext
name
- the data format definition name or a reference to it in the Registry
public ShutdownStrategy getShutdownStrategy()
CamelContext
getShutdownStrategy
in interface CamelContext
public void setShutdownStrategy(ShutdownStrategy shutdownStrategy)
CamelContext
setShutdownStrategy
in interface CamelContext
shutdownStrategy
- the custom strategypublic ShutdownRoute getShutdownRoute()
RuntimeConfiguration
getShutdownRoute
in interface RuntimeConfiguration
public void setShutdownRoute(ShutdownRoute shutdownRoute)
RuntimeConfiguration
setShutdownRoute
in interface RuntimeConfiguration
shutdownRoute
- the option to use.public ShutdownRunningTask getShutdownRunningTask()
RuntimeConfiguration
getShutdownRunningTask
in interface RuntimeConfiguration
public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask)
RuntimeConfiguration
BatchConsumer
which has a group
of messages to process. With this option you can control whether it should complete the entire
group or stop after the current message has been processed.
setShutdownRunningTask
in interface RuntimeConfiguration
shutdownRunningTask
- the option to use.public ExecutorServiceStrategy getExecutorServiceStrategy()
CamelContext
ExecutorServiceStrategy
getExecutorServiceStrategy
in interface CamelContext
public void setExecutorServiceStrategy(ExecutorServiceStrategy executorServiceStrategy)
CamelContext
ExecutorServiceStrategy
setExecutorServiceStrategy
in interface CamelContext
executorServiceStrategy
- the custom strategyprotected String getEndpointKey(String uri, Endpoint endpoint)
protected Map<String,RouteService> getRouteServices()
protected ManagementStrategy createManagementStrategy()
public String toString()
toString
in class Object
public static void setContextCounter(int value)
value
- new value for the CONTEXT_COUNTER
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |