Package org.apache.camel.main
Class DefaultRoutesCollector
java.lang.Object
org.apache.camel.main.DefaultRoutesCollector
- All Implemented Interfaces:
RoutesCollector
A default
RoutesCollector
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
<org.apache.camel.RoutesBuilder> collectAdditionalRoutesFromRegistry
(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Strategy to allow collecting additional routes from registry.Collection
<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.protected void
doCollectRoutesFromDirectory
(org.apache.camel.CamelContext camelContext, List<org.apache.camel.RoutesBuilder> builders, String excludePattern, String includePattern, boolean optional) protected <T> Collection
<T> findByType
(org.apache.camel.CamelContext camelContext, Class<T> type) Strategy to discover a specific route builder type from the registry.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!)
-
Field Details
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
DefaultRoutesCollector
public DefaultRoutesCollector()
-
-
Method Details
-
isIgnoreLoadingError
public boolean isIgnoreLoadingError()Description copied from interface:RoutesCollector
Whether to ignore route loading and compilation errors (use this with care!)- Specified by:
isIgnoreLoadingError
in interfaceRoutesCollector
-
setIgnoreLoadingError
public void setIgnoreLoadingError(boolean ignoreLoadingError) Description copied from interface:RoutesCollector
Whether to ignore route loading and compilation errors (use this with care!)- Specified by:
setIgnoreLoadingError
in interfaceRoutesCollector
-
collectRoutesFromRegistry
public Collection<org.apache.camel.RoutesBuilder> collectRoutesFromRegistry(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Description copied from interface:RoutesCollector
Collects theRoutesBuilder
instances which was discovered from theRegistry
such as Spring or CDI bean containers.- Specified by:
collectRoutesFromRegistry
in interfaceRoutesCollector
- 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
public Collection<org.apache.camel.RoutesBuilder> collectRoutesFromDirectory(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Description copied from interface:RoutesCollector
Collects allRoutesBuilder
from the given directory.- Specified by:
collectRoutesFromDirectory
in interfaceRoutesCollector
- Parameters:
camelContext
- the Camel ContextexcludePattern
- exclude pattern (see routesExcludePattern option)includePattern
- include pattern (see routesIncludePattern option)- Returns:
- the discovered RoutesBuilder or an empty collection
-
doCollectRoutesFromDirectory
-
findRouteResourcesFromDirectory
public Collection<org.apache.camel.spi.Resource> findRouteResourcesFromDirectory(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Description copied from interface:RoutesCollector
Finds all routes asResource
from the given directory.- Specified by:
findRouteResourcesFromDirectory
in interfaceRoutesCollector
- 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
-
collectAdditionalRoutesFromRegistry
protected Collection<org.apache.camel.RoutesBuilder> collectAdditionalRoutesFromRegistry(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Strategy to allow collecting additional routes from registry.- Parameters:
camelContext
- the contextexcludePattern
- the exclusion patternincludePattern
- the inclusion pattern
-
findByType
Strategy to discover a specific route builder type from the registry. This allows Spring Boot or other runtimes to do custom lookup.
-