Package org.apache.camel
Interface Component
-
- All Superinterfaces:
AutoCloseable
,CamelContextAware
,Service
public interface Component extends CamelContextAware, Service
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Endpoint
createEndpoint(String uri)
Attempt to resolve an endpoint for the given URI if the component is capable of handling the URI.Endpoint
createEndpoint(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 PropertyConfigurer
getComponentPropertyConfigurer()
Gets the componentPropertyConfigurer
.default String
getDefaultName()
Gets the default name of the component.default PropertyConfigurer
getEndpointPropertyConfigurer()
Gets the endpointPropertyConfigurer
.default <T extends ComponentExtension>
Optional<T>getExtension(Class<T> extensionType)
Gets the extension of the given type.default Collection<Class<? extends ComponentExtension>>
getSupportedExtensions()
Gets a list of supported extensions.default boolean
isAutowiredEnabled()
Whether autowiring is enabled.static <T> T
trySetComponent(T object, Component component)
Set theComponent
context if the component is an instance ofComponentAware
.boolean
useRawUri()
Whether to use raw or encoded uri, when creating endpoints.-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
-
-
-
Method Detail
-
createEndpoint
Endpoint createEndpoint(String uri) throws Exception
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).- Parameters:
uri
- the URI to create; either raw or encoded (default)- Returns:
- a newly created
Endpoint
or null if this component cannot createEndpoint
instances using the given uri - Throws:
Exception
- is thrown if error creating the endpoint- See Also:
useRawUri()
-
createEndpoint
Endpoint createEndpoint(String uri, Map<String,Object> parameters) throws Exception
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).- Parameters:
uri
- the URI to create; either raw or encoded (default)parameters
- the parameters for the endpoint- Returns:
- a newly created
Endpoint
or null if this component cannot createEndpoint
instances using the given uri - Throws:
Exception
- is thrown if error creating the endpoint- See Also:
useRawUri()
-
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
default PropertyConfigurer getComponentPropertyConfigurer()
Gets the componentPropertyConfigurer
.- Returns:
- the configurer, or null if the component does not support using property configurer.
-
getEndpointPropertyConfigurer
default PropertyConfigurer getEndpointPropertyConfigurer()
Gets the endpointPropertyConfigurer
.- Returns:
- the configurer, or null if the endpoint does not support using property configurer.
-
getSupportedExtensions
default Collection<Class<? extends ComponentExtension>> getSupportedExtensions()
Gets a list of supported extensions.- Returns:
- the list of extensions.
-
getExtension
default <T extends ComponentExtension> Optional<T> getExtension(Class<T> extensionType)
Gets the extension of the given type.- Parameters:
extensionType
- tye type of the extensions- Returns:
- an optional extension
-
trySetComponent
static <T> T trySetComponent(T object, Component component)
Set theComponent
context if the component is an instance ofComponentAware
.
-
getDefaultName
default String 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.
-
-