Package org.apache.camel.spi
Interface RoutesLoader
- All Superinterfaces:
CamelContextAware
SPI for loading
RoutesBuilder from a list of Resource.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfindRoutesBuilders(Collection<Resource> resources) FindRoutesBuilderfrom the give list ofResource.findRoutesBuilders(Collection<Resource> resources, boolean optional) FindRoutesBuilderfrom the give list ofResource.default Collection<RoutesBuilder>findRoutesBuilders(Resource... resources) FindRoutesBuilderfrom the give list ofResource.getRoutesLoader(String extension) Looks up aRoutesBuilderLoaderin the registry or fallback to a factory finder mechanism if none found.default voidInitializes the discoveredRoutesBuilderLoaderbefore its started and used for the first time.default voidloadRoutes(Collection<Resource> resources) default voidloadRoutes(Resource... resources) default voidpreParseRoute(Resource resource, boolean optional) Pre-parses theRoutesBuilderfromResource.updateRoutes(Collection<Resource> resources) Loads or updates existingRoutesBuilderfrom the give list ofResourceinto the currentCamelContext.updateRoutes(Resource... resources) Loads or updates existingRoutesBuilderfrom the give list ofResourceinto the currentCamelContext.Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
Field Details
-
FACTORY
Service factory key.- See Also:
-
-
Method Details
-
getRoutesLoader
Looks up aRoutesBuilderLoaderin 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 noRoutesBuilderLoadercan 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 existingRoutesBuilderfrom the give list ofResourceinto 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 existingRoutesBuilderfrom the give list ofResourceinto 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
FindRoutesBuilderfrom the give list ofResource.- Parameters:
resources- the resource to be loaded.- Returns:
- a collection of
RoutesBuilder - Throws:
Exception
-
findRoutesBuilders
FindRoutesBuilderfrom 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 FindRoutesBuilderfrom 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 theRoutesBuilderfromResource. 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 discoveredRoutesBuilderLoaderbefore its started and used for the first time.
-