Interface ComponentExtension


public interface ComponentExtension
Provide a way to interact with component scanning and metadata extraction. Note: it requires to use org.talend.sdk.component.runtime.manager.ComponentManager to be activated.
  • Method Details

    • isActive

      default boolean isActive()
      Returns:
      true if the extension can be used in current environment.
    • onComponent

      Parameters:
      context - the component context allowing to interact with the container.
    • supports

      boolean supports(Class<?> componentType)
      Parameters:
      componentType - the expected framework component type (can be Mapper or Processor).
      Returns:
      true if convert can be used for that kind of component, false otherwise.
    • convert

      <T> T convert(ComponentExtension.ComponentInstance instance, Class<T> component)
      Note: you can assume supports() was called before going into this method.
      Type Parameters:
      T - the generic matching component parameter.
      Parameters:
      instance - the instantiated component (native instance).
      component - the expected framework component type (can be Mapper or Processor).
      Returns:
      an instance of component.
    • getExtensionServices

      default Map<Class<?>,Object> getExtensionServices(String plugin)
      Parameters:
      plugin - the plugin to enrich with services.
      Returns:
      the services specific to the extension.
    • priority

      default int priority()
      The priority of the extension. Extensions are sorted by priority and the first one matching (supports) wins.
      Returns:
      the priority for this extension, smaller is the highest priority.
    • unwrap

      default <T> T unwrap(Class<T> type, Object... args)
      Unwrap the current instance to another type. Useful to access advanced features of some extensions.
      Type Parameters:
      T - the type to cast the extension to.
      Parameters:
      type - the expected type.
      args - optional parameters for the unwrapping.
      Returns:
      the unwrapped instance or null if not supported.
    • getTransformers

      Returns:
      a list of transformer to set on the component classloader.
    • getAdditionalDependencies

      Returns:
      a Stream of dependencies coordinates