Interface ComponentResolver
public interface ComponentResolver
Pluggable strategy for autoloading a
Component instance from a URI scheme the first time
that scheme is encountered by a CamelContext.
When a route references an endpoint URI whose scheme is not yet registered in the context, Camel queries the active
ComponentResolver with the scheme name. The default implementation reads the service class name from
META-INF/services/org/apache/camel/component/<name> on the classpath, instantiates it, and adds it to the
context. Alternative resolvers (for example Spring, OSGi, or custom container integrations) may satisfy the lookup
from their own registries instead.
Component discovery is lazy: only components that are actually referenced in routes are loaded.- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable ComponentresolveComponent(String name, CamelContext context) Attempts to resolve the component for the given URI
-
Method Details
-
resolveComponent
Attempts to resolve the component for the given URI- Parameters:
name- the component name to resolvecontext- the context to load the component if it can be resolved- Returns:
- the component which is added to the context or null if it cannot be resolved
- Throws:
Exception- is thrown if the component could not be loaded
-