Package org.apache.camel.main
Interface RoutesCollector
- All Known Implementing Classes:
DefaultRoutesCollector
public interface RoutesCollector
Collects routes and rests from the various sources (like registry or opinionated classpath locations) and adds these
into the Camel context.
-
Method Summary
Modifier and TypeMethodDescriptionCollection
<org.apache.camel.RoutesBuilder> collectRoutesFromDirectory
(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Collects allRoutesBuilder
from the given directory.Collection
<org.apache.camel.RoutesBuilder> collectRoutesFromRegistry
(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Collects theRoutesBuilder
instances which was discovered from theRegistry
such as Spring or CDI bean containers.Collection
<org.apache.camel.spi.Resource> findRouteResourcesFromDirectory
(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Finds all routes asResource
from the given directory.boolean
Whether to ignore route loading and compilation errors (use this with care!)void
setIgnoreLoadingError
(boolean ignoreLoadingError) Whether to ignore route loading and compilation errors (use this with care!)
-
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!) -
collectRoutesFromRegistry
Collection<org.apache.camel.RoutesBuilder> collectRoutesFromRegistry(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Collects theRoutesBuilder
instances which was discovered from theRegistry
such as Spring or CDI bean containers.- Parameters:
camelContext
- the Camel ContextexcludePattern
- exclude pattern (see javaRoutesExcludePattern option)includePattern
- include pattern (see javaRoutesIncludePattern option)- Returns:
- the discovered routes or an empty list
-
collectRoutesFromDirectory
Collection<org.apache.camel.RoutesBuilder> collectRoutesFromDirectory(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Collects allRoutesBuilder
from the given directory.- Parameters:
camelContext
- the Camel ContextexcludePattern
- exclude pattern (see routesExcludePattern option)includePattern
- include pattern (see routesIncludePattern option)- Returns:
- the discovered RoutesBuilder or an empty collection
-
findRouteResourcesFromDirectory
Collection<org.apache.camel.spi.Resource> findRouteResourcesFromDirectory(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Finds all routes asResource
from the given directory.- Parameters:
camelContext
- the Camel ContextexcludePattern
- exclude pattern (see routesExcludePattern option)includePattern
- include pattern (see routesIncludePattern option)- Returns:
- the discovered routes as
Resource
or an empty collection
-