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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThis is the handle giving the extension information about the component being processed and allowing to interact with the container lifecycle.static interfaceThis is the handle giving the extension information about the component being processed and allowing to interact with the container lifecycle. -
Method Summary
Modifier and TypeMethodDescription<T> Tconvert(ComponentExtension.ComponentInstance instance, Class<T> component) Note: you can assume supports() was called before going into this method.default Collection<String>getExtensionServices(String plugin) default Collection<ClassFileTransformer>default booleanisActive()voiddefault intpriority()The priority of the extension.booleandefault <T> TUnwrap the current instance to another type.
-
Method Details
-
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
- 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
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
- Parameters:
plugin- the plugin to enrich with services.- Returns:
- the services specific to the extension.
-
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
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
-