Package org.apache.camel.main
Class DefaultRoutesCollector
java.lang.Object
org.apache.camel.main.DefaultRoutesCollector
- All Implemented Interfaces:
RoutesCollector
A default
RoutesCollector.-
Field Summary
Fields -
Constructor Summary
Constructors -
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 allRoutesBuilderfrom the given directory.Collection<org.apache.camel.RoutesBuilder> collectRoutesFromRegistry(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Collects theRoutesBuilderinstances which was discovered from theRegistrysuch as Spring or CDI bean containers.protected voiddoCollectRoutesFromDirectory(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 asResourcefrom the given directory.booleanWhether to ignore route loading and compilation errors (use this with care!)voidsetIgnoreLoadingError(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:RoutesCollectorWhether to ignore route loading and compilation errors (use this with care!)- Specified by:
isIgnoreLoadingErrorin interfaceRoutesCollector
-
setIgnoreLoadingError
public void setIgnoreLoadingError(boolean ignoreLoadingError) Description copied from interface:RoutesCollectorWhether to ignore route loading and compilation errors (use this with care!)- Specified by:
setIgnoreLoadingErrorin interfaceRoutesCollector
-
collectRoutesFromRegistry
public Collection<org.apache.camel.RoutesBuilder> collectRoutesFromRegistry(org.apache.camel.CamelContext camelContext, String excludePattern, String includePattern) Description copied from interface:RoutesCollectorCollects theRoutesBuilderinstances which was discovered from theRegistrysuch as Spring or CDI bean containers.- Specified by:
collectRoutesFromRegistryin 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:RoutesCollectorCollects allRoutesBuilderfrom the given directory.- Specified by:
collectRoutesFromDirectoryin 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:RoutesCollectorFinds all routes asResourcefrom the given directory.- Specified by:
findRouteResourcesFromDirectoryin interfaceRoutesCollector- Parameters:
camelContext- the Camel ContextexcludePattern- exclude pattern (see routesExcludePattern option)includePattern- include pattern (see routesIncludePattern option)- Returns:
- the discovered routes as
Resourceor 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.
-