Skip to content

Commit 13c05d7

Browse files
authored
Rename Pico Module (helidon-io#6682)
* resolved issue helidon-io#6610
1 parent d130dce commit 13c05d7

37 files changed

Lines changed: 88 additions & 82 deletions

nima/webserver/webserver/src/main/java/module-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import io.helidon.common.features.api.Feature;
1818
import io.helidon.common.features.api.HelidonFlavor;
1919
import io.helidon.nima.webserver.http.spi.SinkProvider;
20+
import io.helidon.pico.api.ModuleComponent;
2021

2122
/**
2223
* Loom based WebServer.
@@ -72,5 +73,5 @@
7273
uses SinkProvider;
7374

7475
provides io.helidon.nima.webserver.spi.ServerConnectionProvider with io.helidon.nima.webserver.http1.Http1ConnectionProvider;
75-
provides io.helidon.pico.api.Module with io.helidon.nima.webserver.Pico$$Module;
76+
provides ModuleComponent with io.helidon.nima.webserver.Pico$$Module;
7677
}

pico/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Request and Session scopes are simply not made available in Pico. We believe tha
4949
* Dependency - An <i>injection point</i> represents what is considered to be a dependency, perhaps <i>qualified</i> or Optional, on another service or contract. This is just another what to describe an <i>injection point</i>.
5050
* Activator (aka ServiceProvider) - This is what is code generated by Pico to lazily activate your <i>service</i> instance(s) in the Pico <i>services registry</i>, and it handles resolving all <i>dependencies</i> it has, along with <i>inject</i>ing the fields, methods, etc. that are required to be satisfied as part of that activation process.
5151
* Services (aka services registry) - This is the collection of all services that are known to the JVM/runtime in Pico.
52-
* Module - This is where your application will "bind" services into the <i>services registry</i> - typically code generated, and typically with one module per jar/module in your application.
52+
* ModuleComponent - This is where your application will "bind" services into the <i>services registry</i> - typically code generated, and typically with one module per jar/module in your application.
5353
* Application - The fully realized set of modules and services/service providers that constitute your application, and code-generated using <b>Helidon Pico Tooling</b>.
5454

5555
## Getting Started

pico/api/src/main/java/io/helidon/pico/api/Application.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* <p>
2626
* Note: instances of this type are not eligible for injection.
2727
*
28-
* @see Module
28+
* @see ModuleComponent
2929
*/
3030
@Contract
3131
public interface Application extends OptionallyNamed {

pico/api/src/main/java/io/helidon/pico/api/Module.java renamed to pico/api/src/main/java/io/helidon/pico/api/ModuleComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @see Application
3030
*/
3131
@Contract
32-
public interface Module extends OptionallyNamed {
32+
public interface ModuleComponent extends OptionallyNamed {
3333

3434
/**
3535
* Called by the provider implementation at bootstrapping time to bind all services / service providers to the

pico/api/src/main/java/io/helidon/pico/api/PicoServicesConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,25 +279,25 @@ public boolean usesCompileTimeApplications() {
279279

280280

281281
/**
282-
* The key that controls whether any {@link io.helidon.pico.api.Module}'s
282+
* The key that controls whether any {@link io.helidon.pico.api.ModuleComponent}'s
283283
* (typically produced at compile-time by Pico tooling) can be discovered and is used during Pico startup processing. It is
284284
* strongly suggested for developers to adopt a compile-time strategy for producing the dependency/injection model as it will
285285
* lead to faster startup times as well as be deterministic and validated during compile-time instead of at runtime.
286286
*/
287287
public static final String KEY_USES_COMPILE_TIME_MODULES = "uses-compile-time-modules";
288288
/**
289-
* The default value for this is true, meaning that the Pico will attempt to find and use {@link io.helidon.pico.api.Module} code
289+
* The default value for this is true, meaning that the Pico will attempt to find and use {@link io.helidon.pico.api.ModuleComponent} code
290290
* generated during compile-time (see Pico's APT <i>processor</i> and <i>maven-plugin</i> modules for usage).
291291
*/
292292
public static final String DEFAULT_USES_COMPILE_TIME_MODULES = "true";
293293

294294
/**
295-
* Flag indicating whether compile-time generated {@link io.helidon.pico.api.Module}'s should be used at Pico's startup
295+
* Flag indicating whether compile-time generated {@link io.helidon.pico.api.ModuleComponent}'s should be used at Pico's startup
296296
* initialization. Setting this value to false will have no affect if the underlying provider does not support compile-time
297297
* generation via {@link #supportsCompileTime()}.
298298
*
299299
* @return the flag indicating whether the provider is permitted to use Application generated code from compile-time
300-
* @see io.helidon.pico.api.Module
300+
* @see ModuleComponent
301301
* @see io.helidon.pico.api.Activator
302302
*/
303303
@ConfiguredOption(key = KEY_USES_COMPILE_TIME_MODULES, value = DEFAULT_USES_COMPILE_TIME_MODULES)
@@ -310,7 +310,7 @@ public boolean usesCompileTimeModules() {
310310
* The key that represents whether the provider supports compile-time code generation of DI artifacts.
311311
*
312312
* @see io.helidon.pico.api.Application
313-
* @see io.helidon.pico.api.Module
313+
* @see io.helidon.pico.api.ModuleComponent
314314
* @see io.helidon.pico.api.Activator
315315
* @see #usesCompileTimeApplications()
316316
* @see #usesCompileTimeModules()

pico/api/src/main/java/io/helidon/pico/api/ServiceProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public interface ServiceProvider<T> extends InjectionPointProvider<T>, Weighted
115115
* The agent/instance to be used for binding this service provider to the pico application that was code generated.
116116
*
117117
* @return the service provider that should be used for binding, or empty if this provider does not support binding
118-
* @see Module
118+
* @see ModuleComponent
119119
* @see ServiceBinder
120120
* @see ServiceProviderBindable
121121
*/

pico/api/src/main/java/io/helidon/pico/api/ServiceProviderBindable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* and thereby works in conjunction with the {@link ServiceBinder} during pico service registry
2424
* initialization.
2525
* <p>
26-
* The only guarantee the provider implementation has is ensuring that {@link Module} instances
26+
* The only guarantee the provider implementation has is ensuring that {@link ModuleComponent} instances
2727
* are bound to the pico services instances, as well as informed on the module name.
2828
* <p>
2929
* Generally this class should be called internally by the framework, and typically occurs only during initialization sequences.
@@ -36,7 +36,7 @@ public interface ServiceProviderBindable<T> extends ServiceProvider<T> {
3636

3737
/**
3838
* Called to inform a service provider the module name it is bound to. Will only be called when there is a non-null
39-
* module name associated for the given {@link Module}. A service provider can be associated with
39+
* module name associated for the given {@link ModuleComponent}. A service provider can be associated with
4040
* 0..1 modules.
4141
*
4242
* @param moduleName the non-null module name

pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractApplicationCreatorMojo.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import io.helidon.pico.api.CallingContextFactory;
3838
import io.helidon.pico.api.DefaultCallingContext;
3939
import io.helidon.pico.api.DefaultServiceInfoCriteria;
40-
import io.helidon.pico.api.Module;
40+
import io.helidon.pico.api.ModuleComponent;
4141
import io.helidon.pico.api.PicoServices;
4242
import io.helidon.pico.api.PicoServicesConfig;
4343
import io.helidon.pico.api.ServiceProvider;
@@ -143,9 +143,9 @@ String getThisModuleName() {
143143
return moduleName;
144144
}
145145

146-
ServiceProvider<Module> lookupThisModule(String name,
147-
Services services) {
148-
return services.lookupFirst(Module.class, name, false).orElseThrow(() -> noModuleFoundError(name));
146+
ServiceProvider<ModuleComponent> lookupThisModule(String name,
147+
Services services) {
148+
return services.lookupFirst(ModuleComponent.class, name, false).orElseThrow(() -> noModuleFoundError(name));
149149
}
150150

151151
String getClassPrefixName() {
@@ -260,7 +260,9 @@ protected void innerExecute() {
260260
ApplicationCreator creator = applicationCreator();
261261

262262
List<ServiceProvider<?>> allModules = services
263-
.lookupAll(DefaultServiceInfoCriteria.builder().addContractImplemented(Module.class.getName()).build());
263+
.lookupAll(DefaultServiceInfoCriteria.builder()
264+
.addContractImplemented(ModuleComponent.class.getName())
265+
.build());
264266
getLog().info("processing modules: " + toDescriptions(allModules));
265267
if (allModules.isEmpty()) {
266268
warn("no modules to process");
@@ -284,7 +286,7 @@ protected void innerExecute() {
284286
? moduleInfoPathRef.get().getPath()
285287
: null;
286288
String moduleInfoModuleName = getThisModuleName();
287-
ServiceProvider<Module> moduleSp = lookupThisModule(moduleInfoModuleName, services);
289+
ServiceProvider<ModuleComponent> moduleSp = lookupThisModule(moduleInfoModuleName, services);
288290
String packageName = determinePackageName(Optional.ofNullable(moduleSp), serviceTypeNames, descriptor, true);
289291

290292
CodeGenPaths codeGenPaths = DefaultCodeGenPaths.builder()

pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractCreatorMojo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import io.helidon.common.types.DefaultTypeName;
2828
import io.helidon.common.types.TypeName;
29-
import io.helidon.pico.api.Module;
29+
import io.helidon.pico.api.ModuleComponent;
3030
import io.helidon.pico.api.PicoServicesConfig;
3131
import io.helidon.pico.api.ServiceProvider;
3232
import io.helidon.pico.tools.AbstractCreator;
@@ -264,7 +264,7 @@ public void execute() throws MojoExecutionException {
264264
* @param persistIt pass true to write it to scratch, so that we can use it in the future for this module
265265
* @return the package name (which also typically doubles as the application name)
266266
*/
267-
protected String determinePackageName(Optional<ServiceProvider<Module>> optModuleSp,
267+
protected String determinePackageName(Optional<ServiceProvider<ModuleComponent>> optModuleSp,
268268
Collection<TypeName> typeNames,
269269
ModuleInfoDescriptor descriptor,
270270
boolean persistIt) {
@@ -276,7 +276,7 @@ protected String determinePackageName(Optional<ServiceProvider<Module>> optModul
276276
return packageName;
277277
}
278278

279-
ServiceProvider<Module> moduleSp = optModuleSp.orElse(null);
279+
ServiceProvider<ModuleComponent> moduleSp = optModuleSp.orElse(null);
280280
if (moduleSp != null) {
281281
packageName = DefaultTypeName.createFromTypeName(moduleSp.serviceInfo().serviceTypeName()).packageName();
282282
} else {

pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExternalModuleCreatorMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
import static io.helidon.pico.maven.plugin.MavenPluginUtils.externalModuleCreator;
5252

5353
/**
54-
* Responsible for creating pico {@link io.helidon.pico.api.Activator}'s and a {@link io.helidon.pico.api.Module}
54+
* Responsible for creating pico {@link io.helidon.pico.api.Activator}'s and a {@link io.helidon.pico.api.ModuleComponent}
5555
* wrapping a set of packages from an external third-party jar.
5656
*/
5757
@Mojo(name = "external-module-create", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true,

0 commit comments

Comments
 (0)