You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sample-parent/sample-features/loading-analysis/README.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# Dynamic Dependencies Module
1
+
# Loading Analysis Module
2
2
3
3
## Overview
4
4
5
-
The `dynamic-dependencies` module provides several TCK connector plugins designed to validate the `@DynamicDependencies` feature integration, at design time and runtime. It contains several connectors organized into two categories:
5
+
The `loading-analysis` module provides several TCK connector plugins designed to validate the `@DynamicDependencies` feature integration, at design time and runtime. It contains several connectors organized into two categories:
6
6
7
7
- Firsts are connectors with a service that inherits `AbstractDynamicDependenciesService` and that check:
8
8
- All supported ways to call `@DynamicDependencies` annotated services, according to expected configuration types
@@ -52,10 +52,10 @@ As you can see in the previous example, the annotated `@DynamicDependencies` ser
52
52
(_This documentation will not mention the deprecated `DynamicDependencySupported` provided by the `tDataprepRun` connector._)
53
53
54
54
So, 3 TCK modules have been designed, each one provide a service with one of those parameter types:
Those 3 modules has the module `dynamic-dependencies-common` as dependency. They all have a service that inherits `AbstractDynamicDependenciesService`, that implements the `@DynamicDependencies` annotated method.
Those 3 modules has the module `loading-dependencies-common` as dependency. They all have a service that inherits `AbstractDynamicDependenciesService`, that implements the `@DynamicDependencies` annotated method.
59
59
60
60
#### How to configure them?
61
61
Each of those TCK modules provide an input connector in which you can configure:
@@ -113,12 +113,12 @@ It will generate TCK/records containing those fields:
In this exemple we can see that we try to load the class `org.talend.sdk.component.sample.feature.loadinganalysis.config.Dependency` from the dependency `org.talend.sdk.samplefeature.dynamicdependencies:dynamic-dependencies-common`.
130
+
In this exemple we can see that we try to load the class `org.talend.sdk.component.sample.feature.loadinganalysis.config.Dependency` from the dependency `org.talend.sdk.component.loading-analysis:loading-dependencies-common`.
131
131
The version is `N/A` since it is not needed, the dependency is a static one and is loaded at build time.
132
132
The `DynamicDependencyWithXxxInput` is well loaded from `org.talend.sdk.component.classloader.ConfigurableClassLoader` as the class to test.
133
133
@@ -199,7 +199,7 @@ In that example, we can see that we don't try to load a class, `clazz: N/A`, but
199
199
```
200
200
201
201
## Check SPI and resource loading
202
-
The `dynamic-depdencies-with-spi` provides an input connector that will try to load:
202
+
The `loading-services-and-resources` provides an input connector that will try to load:
203
203
- The SPI implementation from a static dependency
204
204
- The SPI implementation from a dynamic dependency
205
205
- The SPI implementation provided by the runtime
@@ -222,7 +222,7 @@ It generates TCK records containing those fields:
222
222
-`workingDirectory`: the value of the property `user.dir`
223
223
224
224
### The first record checks SPI implementation provided by a static dependency
225
-
The SPI implementation is provided by the dependency `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-dependency`.
225
+
The SPI implementation is provided by the dependency `org.talend.sdk.component.loading-analysis:service-provider-from-dependency`.
@@ -241,7 +241,7 @@ The SPI implementation is provided by the dependency `org.talend.sdk.samplefeatu
241
241
We can see that the SPI implementation has been well loaded, since the value is retrieved, and has been loaded by the container classloader `ConfigurableClassLoader` as expected.
242
242
243
243
### The second record checks SPI implementation provided by a dynamic dependency
244
-
The spi implementation is provided by the dependency `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-dynamic-dependency`. It is returned by the `@DynamicDependency` service.
244
+
The spi implementation is provided by the dependency `org.talend.sdk.component.loading-analysis:service-provider-from-dynamic-dependency`. It is returned by the `@DynamicDependency` service.
@@ -260,7 +260,7 @@ The spi implementation is provided by the dependency `org.talend.sdk.samplefeatu
260
260
In this second record, we see that the SPI implementation has been loaded from the `ConfigurableClassLoader`.
261
261
262
262
### The third record checks SPI implementation provided by the runtime
263
-
The spi implementation is provided by the dependency `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-external-dependency`. In the studio, we can add this library using the `tLibraryLoad` connector.
263
+
The spi implementation is provided by the dependency `org.talend.sdk.component.loading-analysis:service-provider-from-external-dependency`. In the studio, we can add this library using the `tLibraryLoad` connector.
@@ -305,13 +305,13 @@ Here is the json documentation contained in the `value` field:
305
305
}
306
306
```
307
307
The `DynamicDependenciesWithSPIInput` connector tries to load some resources using `DynamicDependenciesWithSPIService.class.getClassLoader().getResourceAsStream(resource)`:
308
-
-`FROM_DEPENDENCY/resource.properties`: this resource exists only in `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-dependency` module. The resource value is copied in the `contentFromResourceDependency` field of the record.
309
-
-`FROM_DYNAMIC_DEPENDENCY/resource.properties`: this resource exists only in `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-dynamic-dependency` module. The resource value is copied in the `contentFromResourceDynamicDependency` field of the record.
310
-
-`FROM_EXTERNAL_DEPENDENCY/resource.properties`: this resource exists only in `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-external-dependency` module. The resource value is copied in the `contentFromResourceExternalDependency` field of the record.
308
+
-`FROM_DEPENDENCY/resource.properties`: this resource exists only in `org.talend.sdk.component.loading-analysis:service-provider-from-dependency` module. The resource value is copied in the `contentFromResourceDependency` field of the record.
309
+
-`FROM_DYNAMIC_DEPENDENCY/resource.properties`: this resource exists only in `org.talend.sdk.component.loading-analysis:service-provider-from-dynamic-dependency` module. The resource value is copied in the `contentFromResourceDynamicDependency` field of the record.
310
+
-`FROM_EXTERNAL_DEPENDENCY/resource.properties`: this resource exists only in `org.talend.sdk.component.loading-analysis:service-provider-from-external-dependency` module. The resource value is copied in the `contentFromResourceExternalDependency` field of the record.
311
311
312
312
All those three resources are successfully loaded in this example.
313
313
314
314
The last field, `contentFromMultipleResources` contain the result of loading multiple resources at once using `DynamicDependenciesWithSPIService.class.getClassLoader().getResources(resource)` for the resource path `FROM_MULTIPLE/resource.txt`.
315
-
This resource exists in all the three modules `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-dependency`, `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-dynamic-dependency`, `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-external-dependency`.
315
+
This resource exists in all the three modules `org.talend.sdk.component.loading-analysis:service-provider-from-dependency`, `org.talend.sdk.component.loading-analysis:service-provider-from-dynamic-dependency`, `org.talend.sdk.component.loading-analysis:service-provider-from-external-dependency`.
316
316
So, 3 values should be concatenated in this field if everything were loaded. In the example, the content of this resource is successfully loaded from static and dynamic dependencies, but twice for each! And, the `FROM_MULTIPLE/resource.txt`
317
-
in `org.talend.sdk.samplefeature.dynamicdependencies:service-provider-from-external-dependency` is not found.
317
+
in `org.talend.sdk.component.loading-analysis:service-provider-from-external-dependency` is not found.
0 commit comments