Package org.apache.camel.spi
Interface RoutesLoader
- All Superinterfaces:
CamelContextAware
,HasCamelContext
SPI for loading
RoutesBuilder
from a list of Resource
.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfindRoutesBuilders
(Collection<Resource> resources) FindRoutesBuilder
from the give list ofResource
.findRoutesBuilders
(Collection<Resource> resources, boolean optional) FindRoutesBuilder
from the give list ofResource
.default Collection
<RoutesBuilder> findRoutesBuilders
(Resource... resources) FindRoutesBuilder
from the give list ofResource
.getRoutesLoader
(String extension) Looks up aRoutesBuilderLoader
in the registry or fallback to a factory finder mechanism if none found.default void
Initializes the discoveredRoutesBuilderLoader
before its started and used for the first time.boolean
Whether to ignore route loading and compilation errors (use this with care!)default void
loadRoutes
(Collection<Resource> resources) default void
loadRoutes
(Resource... resources) default void
preParseRoute
(Resource resource, boolean optional) Pre-parses theRoutesBuilder
fromResource
.void
setIgnoreLoadingError
(boolean ignoreLoadingError) Whether to ignore route loading and compilation errors (use this with care!)updateRoutes
(Collection<Resource> resources) Loads or updates existingRoutesBuilder
from the give list ofResource
into the currentCamelContext
.updateRoutes
(Resource... resources) Loads or updates existingRoutesBuilder
from the give list ofResource
into the currentCamelContext
.Methods inherited from interface org.apache.camel.CamelContextAware
setCamelContext
Methods inherited from interface org.apache.camel.spi.HasCamelContext
getCamelContext
-
Field Details
-
FACTORY
Service factory key.- See Also:
-
-
Method Details
-
isIgnoreLoadingError
boolean isIgnoreLoadingError()Whether to ignore route loading and compilation errors (use this with care!) -
setIgnoreLoadingError
void setIgnoreLoadingError(boolean ignoreLoadingError) Whether to ignore route loading and compilation errors (use this with care!) -
getRoutesLoader
Looks up aRoutesBuilderLoader
in the registry or fallback to a factory finder mechanism if none found.- Parameters:
extension
- the file extension for which a loader should be found.- Returns:
- a
RoutesBuilderLoader
- Throws:
IllegalArgumentException
- if noRoutesBuilderLoader
can be found for the given file extensionException
-
loadRoutes
- Parameters:
resources
- the resources to be loaded.- Throws:
Exception
-
loadRoutes
- Parameters:
resources
- the resources to be loaded.- Throws:
Exception
-
updateRoutes
Loads or updates existingRoutesBuilder
from the give list ofResource
into the currentCamelContext
. If a route is loaded with a route id for an existing route, then the existing route is stopped and remove, so it can be updated.- Parameters:
resources
- the resources to be loaded or updated.- Returns:
- route ids for the routes that was loaded or updated.
- Throws:
Exception
-
updateRoutes
Loads or updates existingRoutesBuilder
from the give list ofResource
into the currentCamelContext
. If a route is loaded with a route id for an existing route, then the existing route is stopped and remove, so it can be updated.- Parameters:
resources
- the resources to be loaded or updated.- Returns:
- route ids for the routes that was loaded or updated.
- Throws:
Exception
-
findRoutesBuilders
FindRoutesBuilder
from the give list ofResource
.- Parameters:
resources
- the resource to be loaded.- Returns:
- a collection of
RoutesBuilder
- Throws:
Exception
-
findRoutesBuilders
FindRoutesBuilder
from the give list ofResource
.- Parameters:
resources
- the resource to be loaded.- Returns:
- a collection
RoutesBuilder
- Throws:
Exception
-
findRoutesBuilders
Collection<RoutesBuilder> findRoutesBuilders(Collection<Resource> resources, boolean optional) throws Exception FindRoutesBuilder
from the give list ofResource
.- Parameters:
resources
- the resource to be loaded.optional
- whether parsing the resource is optional, such as there is no supported parser for the given resource extension- Returns:
- a collection
RoutesBuilder
- Throws:
Exception
-
preParseRoute
Pre-parses theRoutesBuilder
fromResource
. This is used during bootstrap, to eager detect configurations from route DSL resources which makes it possible to specify configurations that affect the bootstrap, such as by camel-jbang and camel-yaml-dsl.- Parameters:
resource
- the resource to be pre parsed.optional
- whether parsing the resource is optional, such as there is no supported parser for the given resource extension- Throws:
Exception
-
initRoutesBuilderLoader
Initializes the discoveredRoutesBuilderLoader
before its started and used for the first time.
-