Interface Component
- All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, Service
A component is a factory of
Endpoint objects.
A component is registered in the CamelContext under a URI scheme (for example "kafka" or
"file") and is responsible for creating Endpoint instances for URIs that match that scheme.
Components participate in the Camel lifecycle as Services: they are started before any of their endpoints and
stopped after the last endpoint is stopped.- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable EndpointcreateEndpoint(String uri) Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI.@Nullable EndpointcreateEndpoint(String uri, Map<String, Object> parameters) Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI.default @Nullable PropertyConfigurerGets the componentPropertyConfigurer.default @Nullable StringGets the default name of the component.default @Nullable PropertyConfigurerGets the endpointPropertyConfigurer.default <T extends ComponentExtension>
Optional<T> getExtension(Class<T> extensionType) Gets the extension of the given type.default Collection<Class<? extends ComponentExtension>> Gets a list of supported extensions.default booleanWhether autowiring is enabled.static <T> TtrySetComponent(T object, Component component) Set theComponentcontext if the component is an instance ofComponentAware.booleanWhether to use raw or encoded uri, when creating endpoints.Methods inherited from interface CamelContextAware
setCamelContextMethods inherited from interface HasCamelContext
getCamelContext
-
Method Details
-
createEndpoint
Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI. SeeuseRawUri()for controlling whether the passed in uri should be as-is (raw), or encoded (default). -
createEndpoint
Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI. SeeuseRawUri()for controlling whether the passed in uri should be as-is (raw), or encoded (default). -
useRawUri
boolean useRawUri()Whether to use raw or encoded uri, when creating endpoints. Notice: When using raw uris, then the parameter values is raw as well.- Returns:
- true to use raw uris, false to use encoded uris (default).
-
getComponentPropertyConfigurer
Gets the componentPropertyConfigurer.- Returns:
- the configurer, or null if the component does not support using property configurer.
-
getEndpointPropertyConfigurer
Gets the endpointPropertyConfigurer.- Returns:
- the configurer, or null if the endpoint does not support using property configurer.
-
getSupportedExtensions
Gets a list of supported extensions.- Returns:
- the list of extensions.
-
getExtension
Gets the extension of the given type.- Parameters:
extensionType- tye type of the extensions- Returns:
- an optional extension
-
trySetComponent
Set theComponentcontext if the component is an instance ofComponentAware. -
getDefaultName
Gets the default name of the component. -
isAutowiredEnabled
default boolean isAutowiredEnabled()Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.
-