Interface Component

All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, Service

public interface Component extends CamelContextAware, Service
A component is a factory of Endpoint objects.
  • Method Details

    • 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.

      See useRawUri() 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 create Endpoint instances using the given uri
      Throws:
      Exception - is thrown if error creating the endpoint
      See Also:
    • 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.

      See useRawUri() 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 create Endpoint instances using the given uri
      Throws:
      Exception - is thrown if error creating the endpoint
      See Also:
    • 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 component PropertyConfigurer.
      Returns:
      the configurer, or null if the component does not support using property configurer.
    • getEndpointPropertyConfigurer

      default PropertyConfigurer getEndpointPropertyConfigurer()
      Gets the endpoint PropertyConfigurer.
      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 the Component context if the component is an instance of ComponentAware.
    • 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.