If you are doing a hot restart then it's advised to use the suspend/resume methods which ensure a faster
restart but also allows any internal state to be kept as is.
The stop/start approach will do a cold restart of Camel, where all internal state is reset.

End users are advised to use suspend/resume. Using stop is for shutting down Camel and it's not guaranteed that
when it's being started again using the start method that Camel will operate consistently.

getManagementName

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.

getUptime

addService

Adds a service to this context, which allows this context to control the lifecycle, ensuring
the service is stopped when the context stops.

The service will also have CamelContext 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

The service will also have CamelContext 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 context will control the lifecycle, ensuring
the service is stopped when the context stops.
If the option closeOnShutdown is false then this context will not stop the service when the context stops.

Parameters:

object - the service

closeOnShutdown - whether to close the service when this CamelContext shutdown.

getEndpointRegistry

getEndpoint

Resolves the given name to an 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 in the EndpointRegistry.

Parameters:

uri - the URI of the endpoint

Returns:

the endpoint

getEndpoint

Resolves the given name to an 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 in the EndpointRegistry.

getRoute

addRoutes

Adds a collection of routes to this context using the given builder
to build them.

Important: The added routes will only be started, if CamelContext
is already started. You may want to check the state of CamelContext before
adding the routes, using the 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.

Parameters:

builder - the builder which will create the routes and add them to this context

removeRoute

Removes the given route (the route must be stopped before it can be removed).

A route which is removed will be unregistered from JMX, have its services stopped/shutdown and the route
definition etc. will also be removed. All the resources related to the route will be stopped and cleared.

Important: When removing a route, the Endpoints 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 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.

Parameters:

routeId - the route id

Returns:

true if the route was removed, false if the route could not be removed because its not stopped

Throws:

Exception - is thrown if the route could not be shutdown for whatever reason

isSetupRoutes

Indicates whether current thread is setting up route(s) as part of starting Camel from spring/blueprint.

This can be useful to know by LifecycleStrategy 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.

setTypeConverterStatisticsEnabled

By default the type converter utilization statistics is disabled.
Notice: If enabled then there is a slight performance impact under very heavy load.

You can enable/disable the statistics at runtime using the
org.apache.camel.spi.TypeConverterRegistry#getStatistics()#setTypeConverterStatisticsEnabled(Boolean) method,
or from JMX on the ManagedTypeConverterRegistryMBean mbean.