From 2446eab98c0f96888644400d141cf8e2ae7e73b9 Mon Sep 17 00:00:00 2001 From: Jeff Trent Date: Tue, 11 Jul 2023 17:21:53 -0400 Subject: [PATCH 1/5] rename --- bom/pom.xml | 42 +-- .../processor/GeneratedAnnotationHandler.java | 2 +- config/config/pom.xml | 16 +- .../io/helidon/config/ConfigProducer.java | 2 +- .../io/helidon/config/spi/ConfigSource.java | 2 +- config/config/src/main/java/module-info.java | 8 +- config/tests/service-registry/pom.xml | 12 +- .../service/registry/ConfigProducerTest.java | 16 +- .../service/registry/TestConfigSource.java | 2 +- .../src/test/resources/application.yaml | 2 +- .../injection_intro.adoc} | 52 ++- docs/sitegen.yaml | 30 +- etc/checkstyle-suppressions.xml | 8 +- etc/copyright-exclude.txt | 2 +- examples/{pico => inject}/README.md | 4 +- .../{pico => inject}/application/README.md | 22 +- examples/{pico => inject}/application/pom.xml | 32 +- .../examples/inject}/application/Main.java | 14 +- .../inject}/application/package-info.java | 4 +- .../src/main/resources/logging.properties | 0 .../InjectionApplicationTest.java} | 22 +- examples/{pico => inject}/basics/README.md | 16 +- examples/{pico => inject}/basics/pom.xml | 26 +- .../helidon/examples/inject}/basics/Big.java | 2 +- .../examples/inject}/basics/BigHammer.java | 2 +- .../examples/inject}/basics/Hammer.java | 4 +- .../examples/inject}/basics/Little.java | 2 +- .../examples/inject}/basics/LittleHammer.java | 2 +- .../helidon/examples/inject}/basics/Main.java | 18 +- .../helidon/examples/inject}/basics/Tool.java | 4 +- .../examples/inject}/basics/ToolBox.java | 8 +- .../examples/inject}/basics/package-info.java | 4 +- .../src/main/resources/logging.properties | 0 examples/inject/configdriven/README.md | 28 ++ .../{pico => inject}/configdriven/pom.xml | 26 +- .../examples/inject}/configdriven/Drill.java | 6 +- .../configdriven/DrillConfigBlueprint.java | 4 +- .../examples/inject}/configdriven/Main.java | 16 +- .../inject/configdriven}/package-info.java | 4 +- .../src/main/resources/application.yaml | 2 +- .../src/main/resources/logging.properties | 0 examples/inject/interceptors/README.md | 21 ++ .../{pico => inject}/interceptors/pom.xml | 18 +- .../examples/inject}/interceptors/Main.java | 10 +- .../inject}/interceptors/ScrewDriver.java | 2 +- .../examples/inject}/interceptors/Turn.java | 4 +- .../inject}/interceptors/TurnInterceptor.java | 9 +- .../inject}/interceptors/TurningTool.java | 6 +- .../inject/interceptors/package-info.java | 20 ++ .../src/main/resources/logging.properties | 0 examples/{pico => inject}/pom.xml | 6 +- examples/{pico => inject}/providers/README.md | 16 +- examples/{pico => inject}/providers/pom.xml | 22 +- .../inject}/providers/AngleGrinderSaw.java | 4 +- .../examples/inject}/providers/Blade.java | 11 +- .../inject}/providers/BladeProvider.java | 18 +- .../inject}/providers/CircularSaw.java | 4 +- .../examples/inject}/providers/HandSaw.java | 2 +- .../examples/inject}/providers/Main.java | 14 +- .../examples/inject}/providers/Nail.java | 11 +- .../examples/inject}/providers/NailGun.java | 8 +- .../inject}/providers/NailProvider.java | 2 +- .../examples/inject}/providers/Saw.java | 12 +- .../inject}/providers/SizedBlade.java | 2 +- .../inject}/providers/StandardNail.java | 2 +- .../examples/inject}/providers/TableSaw.java | 6 +- .../inject/providers}/package-info.java | 4 +- .../src/main/resources/logging.properties | 0 .../inject}/providers/AllenWrench.java | 2 +- .../inject}/providers/ProvidersTest.java | 6 +- .../examples/inject}/providers/Wrench.java | 4 +- examples/nima/fault-tolerance/pom.xml | 18 +- .../nima/faulttolerance/GreetEndpoint.java | 6 +- .../PlatformExecutorProvider.java | 4 +- .../src/main/resources/application.yaml | 4 +- .../faulttolerance/FaultToleranceTest.java | 9 +- examples/pico/configdriven/README.md | 28 -- examples/pico/interceptors/README.md | 21 -- examples/pom.xml | 2 +- inject/README.md | 336 ++++++++++++++++++ {pico => inject}/api/README.md | 26 +- {pico => inject}/api/pom.xml | 8 +- .../helidon/inject}/api/AccessModifier.java | 2 +- .../io/helidon/inject}/api/ActivationLog.java | 4 +- .../api/ActivationLogEntryBlueprint.java | 4 +- .../inject}/api/ActivationLogQuery.java | 4 +- .../inject}/api/ActivationPhaseReceiver.java | 6 +- .../api/ActivationRequestBlueprint.java | 4 +- .../api/ActivationResultBlueprint.java | 6 +- .../helidon/inject}/api/ActivationStatus.java | 4 +- .../io/helidon/inject}/api/Activator.java | 6 +- .../io/helidon/inject}/api/Application.java | 4 +- .../inject}/api/BootstrapBlueprint.java | 21 +- .../inject}/api/CallingContextBlueprint.java | 6 +- .../inject}/api/CallingContextFactory.java | 12 +- .../io/helidon/inject}/api/ClassNamed.java | 2 +- .../helidon/inject}/api/CommonQualifiers.java | 2 +- .../api/ContextualServiceQueryBlueprint.java | 6 +- .../java/io/helidon/inject}/api/Contract.java | 10 +- .../api/DeActivationRequestBlueprint.java | 6 +- .../io/helidon/inject}/api/DeActivator.java | 4 +- .../api/DependenciesInfoBlueprint.java | 8 +- .../inject}/api/DependencyInfoBlueprint.java | 6 +- .../inject}/api/DependencyInfoComparator.java | 4 +- .../inject}/api/ElementInfoBlueprint.java | 4 +- .../io/helidon/inject}/api/ElementKind.java | 2 +- .../java/io/helidon/inject}/api/Event.java | 2 +- .../inject}/api/ExternalContracts.java | 4 +- .../java/io/helidon/inject}/api/Helidon.java | 12 +- .../inject/api/InjectionException.java | 22 +- .../api/InjectionPointInfoBlueprint.java | 4 +- .../inject}/api/InjectionPointProvider.java | 18 +- .../InjectionServiceProviderException.java | 36 +- .../helidon/inject/api/InjectionServices.java | 76 ++-- .../api/InjectionServicesConfigBlueprint.java | 42 ++- .../inject/api/InjectionServicesHolder.java | 52 +-- .../java/io/helidon/inject}/api/Injector.java | 20 +- .../inject}/api/InjectorOptionsBlueprint.java | 10 +- .../io/helidon/inject}/api/Intercepted.java | 6 +- .../inject}/api/InterceptedTrigger.java | 8 +- .../io/helidon/inject}/api/Interceptor.java | 4 +- .../api/InternalBootstrapBlueprint.java | 6 +- .../api/InvocationContextBlueprint.java | 4 +- .../inject}/api/InvocationException.java | 6 +- .../helidon/inject}/api/MetricsBlueprint.java | 8 +- .../helidon/inject}/api/ModuleComponent.java | 4 +- .../helidon/inject}/api/OptionallyNamed.java | 4 +- .../java/io/helidon/inject}/api/Phase.java | 6 +- .../inject}/api/PostConstructMethod.java | 4 +- .../helidon/inject}/api/PreDestroyMethod.java | 4 +- .../inject}/api/QualifierBlueprint.java | 4 +- .../io/helidon/inject}/api/Qualifiers.java | 2 +- .../io/helidon/inject}/api/Resettable.java | 4 +- .../java/io/helidon/inject}/api/RunLevel.java | 6 +- .../io/helidon/inject}/api/ServiceBinder.java | 4 +- .../api/ServiceInfoBasicsBlueprint.java | 10 +- .../inject}/api/ServiceInfoBlueprint.java | 8 +- .../api/ServiceInfoBuildInterceptor.java | 2 +- .../api/ServiceInfoCriteriaBlueprint.java | 10 +- .../api/ServiceInjectionPlanBinder.java | 4 +- .../helidon/inject}/api/ServiceProvider.java | 6 +- .../inject}/api/ServiceProviderBindable.java | 24 +- .../ServiceProviderInjectionException.java | 22 +- .../inject}/api/ServiceProviderProvider.java | 4 +- .../java/io/helidon/inject}/api/Services.java | 41 +-- .../io/helidon/inject}/api/Startable.java | 4 +- .../io/helidon/inject}/api/package-info.java | 20 +- .../inject}/spi/InjectionPlanBlueprint.java | 8 +- .../inject}/spi/InjectionResolver.java | 14 +- .../inject/spi/InjectionServicesProvider.java | 18 +- .../io/helidon/inject}/spi/package-info.java | 6 +- .../api/src/main/java/module-info.java | 12 +- .../inject/api/InjectionServicesTest.java | 36 +- .../PriorityAndServiceTypeComparatorTest.java | 24 +- .../io/helidon/inject}/api/QualifierTest.java | 4 +- .../AbstractInjectionServices.java | 24 +- .../api/testsubjects/InjectionServices1.java | 14 +- .../InjectionServices1Provider.java | 16 +- .../api/testsubjects/InjectionServices2.java | 10 +- .../InjectionServices2Provider.java | 16 +- .../api/testsubjects/InjectionServices3.java | 10 +- .../InjectionServices3Provider.java | 16 +- ...lidon.inject.spi.InjectionServicesProvider | 6 +- {pico => inject}/configdriven/README.md | 3 +- {pico => inject}/configdriven/api/pom.xml | 12 +- .../inject}/configdriven/api/ConfigBean.java | 4 +- .../configdriven/api/ConfigBeanFactory.java | 4 +- .../configdriven/api/ConfigDriven.java | 2 +- .../configdriven/api/NamedInstance.java | 2 +- .../inject/configdriven/api/package-info.java | 20 ++ .../api/src/main/java/module-info.java | 8 +- {pico => inject}/configdriven/pom.xml | 10 +- .../configdriven/processor/README.md | 2 +- .../configdriven/processor/pom.xml | 12 +- .../configdriven/processor/ConfigBean.java | 2 +- .../processor/ConfigBeanAnnotation.java | 4 +- .../processor/ConfigDrivenAnnotation.java | 4 +- .../processor/ConfigDrivenProcessor.java | 16 +- .../configdriven/processor/package-info.java | 20 ++ .../processor/src/main/java/module-info.java | 10 +- inject/configdriven/runtime/README.md | 3 + {pico => inject}/configdriven/runtime/pom.xml | 20 +- .../runtime/ConfigBeanRegistry.java | 11 +- .../runtime/ConfigBeanRegistryImpl.java | 35 +- .../ConfigDrivenServiceProviderBase.java | 76 ++-- .../runtime/ConfigDrivenUtils.java | 4 +- .../runtime/ConfiguredServiceProvider.java | 10 +- .../configdriven/runtime/NameComparator.java | 4 +- .../runtime/UnconfiguredServiceProvider.java | 24 +- .../configdriven/runtime}/package-info.java | 4 +- .../runtime/src/main/java/module-info.java | 12 +- .../configdriven/tests/config/pom.xml | 28 +- .../config/EnumRelatedConfigBlueprint.java | 2 +- .../tests/config/FakeClientAuth.java | 2 +- .../FakeComponentTracingConfigBlueprint.java | 2 +- .../tests/config/FakeKeyConfigBlueprint.java | 2 +- .../config/FakeKeystoreConfigBlueprint.java | 2 +- .../tests/config/FakeNettyClientAuth.java | 2 +- .../FakePathTracingConfigBlueprint.java | 2 +- .../tests/config/FakeRoutingConfig.java | 2 +- .../config/FakeServerConfigBlueprint.java | 2 +- .../tests/config/FakeServerLifecycle.java | 2 +- .../config/FakeSocketConfigBlueprint.java | 4 +- .../FakeSpanLogTracingConfigBlueprint.java | 2 +- .../FakeSpanTracingConfigBlueprint.java | 2 +- .../tests/config/FakeTlsWSNotDrivenByCB.java | 4 +- .../config/FakeTraceableConfigBlueprint.java | 2 +- .../configdriven/tests/config/FakeTracer.java | 2 +- .../config/FakeTracingConfigBlueprint.java | 2 +- .../tests/config/FakeWebServer.java | 4 +- .../tests/config/FakeWebServerContract.java | 4 +- ...tDrivenAndHavingConfiguredByOverrides.java | 4 +- .../FakeWebServerTlsConfigBlueprint.java | 4 +- .../config/SSLContextConfigBlueprint.java | 2 +- .../config/TestClientConfigBlueprint.java | 4 +- .../config/TestCommonConfigBlueprint.java | 2 +- .../config/TestServerConfigBlueprint.java | 4 +- .../tests/config/package-info.java | 2 +- .../config/src/main/java/module-info.java | 10 +- .../tests/config/AbstractConfigBeanTest.java | 2 +- .../tests/config/BasicConfigBeanTest.java | 2 +- .../config/EnumRelatedConfigBeanTest.java | 2 +- .../tests/config/NestedConfigBeanTest.java | 3 +- .../FakeServerConfigPlusTwoNamedSockets.yaml | 0 ...FakeServerConfigPlusTwoUnnamedSockets.yaml | 0 .../config/test/basic-config-bean-test.yaml | 0 .../tests/configuredby-application/README.md | 3 + .../tests/configuredby-application/pom.xml | 44 +-- .../test/ASimpleRunLevelService.java | 10 +- .../test/ApplicationConfigBeanTest.java | 2 +- .../test/ApplicationConfiguredByTest.java | 33 +- .../configdriven/tests/configuredby/README.md | 2 +- .../configdriven/tests/configuredby/pom.xml | 38 +- .../test/ASingletonConfigBeanBlueprint.java | 4 +- .../configuredby/test/ASingletonService.java | 4 +- .../test/ASingletonServiceContract.java | 2 +- .../test/AbstractConfigBeanTest.java | 6 +- .../test/AbstractConfiguredByTest.java | 56 +-- .../test/AbstractServiceBase.java | 2 +- ...meConfiguredServiceWithAnAbstractBase.java | 4 +- .../test/SomeServiceConfigBlueprint.java | 2 +- .../test/SomeServiceInterface.java | 2 +- .../configuredby/test/package-info.java | 2 +- .../configuredby/yaml/test/Async.java | 4 +- .../yaml/test/AsyncConfigBlueprint.java | 6 +- .../yaml/test/BulkheadConfigBlueprint.java | 3 +- .../yaml/test/ServerConfigBlueprint.java | 2 +- .../configuredby/yaml/test/package-info.java | 20 ++ .../configdriven/interceptor/test/IZ.java | 4 +- .../test/TestInterceptorTrigger.java | 4 +- .../configdriven/interceptor/test/ZImpl.java | 7 +- .../test/ZImplConfigBlueprint.java | 3 +- .../configuredby/test/ConfiguredByTest.java | 10 +- .../test/DefaultConfigBeanTest.java | 2 +- .../yaml/test/NamedConfiguredByTest.java | 24 +- .../src/test/resources/application.yaml | 2 +- {pico => inject}/configdriven/tests/pom.xml | 10 +- inject/maven-plugin/README.md | 105 ++++++ .../maven-plugin/etc/spotbugs/exclude.xml | 14 +- {pico => inject}/maven-plugin/pom.xml | 16 +- .../AbstractApplicationCreatorMojo.java | 105 +++--- .../maven/plugin/AbstractCreatorMojo.java | 56 +-- .../maven/plugin/ApplicationCreatorMojo.java | 12 +- .../inject}/maven/plugin/ExecHandler.java | 4 +- .../maven/plugin/ExecutableClassLoader.java | 4 +- .../plugin/ExternalModuleCreatorMojo.java | 36 +- .../maven/plugin/IsolatedThreadGroup.java | 4 +- .../maven/plugin/MavenPluginUtils.java | 45 +-- .../inject}/maven/plugin/QualifierConfig.java | 4 +- .../maven/plugin/ServiceTypeQualifiers.java | 4 +- .../plugin/TestApplicationCreatorMojo.java | 36 +- .../inject}/maven/plugin/TrafficCop.java | 7 +- .../inject/maven/plugin}/package-info.java | 4 +- .../src/main/java/module-info.java | 16 +- {pico => inject}/pom.xml | 10 +- {pico => inject}/processor/README.md | 8 +- .../processor/etc/spotbugs/exclude.xml | 8 +- {pico => inject}/processor/pom.xml | 12 +- .../processor/ActiveProcessorUtils.java | 18 +- .../processor/BaseAnnotationProcessor.java | 4 +- .../inject}/processor/CreatorHandler.java | 20 +- .../processor/CustomAnnotationProcessor.java | 33 +- .../processor/GeneralProcessorUtils.java | 20 +- .../GenericTemplateCreatorDefault.java | 18 +- .../InjectionAnnotationProcessor.java | 135 ++++--- .../processor/MessagerToLogAdapter.java | 4 +- .../processor/ProcessingEventBlueprint.java | 7 +- .../inject}/processor/ProcessingTracker.java | 13 +- .../UnsupportedConstructsProcessor.java | 10 +- .../inject/processor}/package-info.java | 4 +- .../InjectionAnnotationProcessorObserver.java | 11 +- .../inject/processor/spi}/package-info.java | 4 +- .../processor/src/main/java/module-info.java | 22 +- .../CustomAnnotationProcessorTest.java | 28 +- .../ExtensibleGetTemplateProducer.java | 12 +- .../processor/ProcessingTrackerTest.java | 2 +- .../helidon/inject}/processor/TestUtils.java | 4 +- .../inject}/processor/package-info.java | 2 +- .../processor/testsubjects/BasicEndpoint.java | 6 +- .../processor/testsubjects/BasicPath.java | 2 +- .../processor/testsubjects/ExtensibleGET.java | 2 +- .../processor/testsubjects/package-info.java | 2 +- ....tools.spi.CustomAnnotationTemplateCreator | 1 + .../BasicEndpoint_ExtensibleGET._java_ | 6 +- .../templates/inject}/nima/extensible-get.hbs | 0 inject/runtime/README.md | 3 + {pico => inject}/runtime/pom.xml | 12 +- .../runtime/AbstractServiceProvider.java | 261 +++++++------- .../runtime/BoundedServiceProvider.java | 24 +- .../inject}/runtime/DefaultActivationLog.java | 16 +- .../runtime/DefaultInjectionPlanBinder.java | 16 +- .../runtime/DefaultInjectionPlans.java | 108 +++--- .../runtime/DefaultInjectionServices.java | 97 ++--- .../DefaultInjectionServicesConfig.java | 19 +- .../DefaultInjectionServicesProvider.java | 34 +- .../inject}/runtime/DefaultInjector.java | 28 +- .../inject}/runtime/DefaultServices.java | 120 +++---- .../helidon/inject}/runtime/Dependencies.java | 22 +- .../HeldionInjectionPlanBlueprint.java | 9 +- .../HelidonInjectionStartupProvider.java | 6 +- .../InjectionApplicationServiceProvider.java | 20 +- .../inject/runtime/InjectionExceptions.java | 14 +- .../InjectionModuleServiceProvider.java | 22 +- .../inject}/runtime/InterceptedMethod.java | 12 +- .../helidon/inject}/runtime/Invocation.java | 14 +- .../runtime/NonSingletonServiceProvider.java | 8 +- .../inject}/runtime/ServiceBinderDefault.java | 50 +-- .../runtime/ServiceProviderComparator.java | 6 +- .../helidon/inject}/runtime/ServiceUtils.java | 16 +- .../io/helidon/inject}/runtime/State.java | 6 +- .../io/helidon/inject}/runtime/Versions.java | 16 +- .../inject}/runtime/VoidServiceProvider.java | 8 +- .../helidon/inject/runtime/package-info.java | 20 ++ .../runtime/src/main/java/module-info.java | 21 +- .../inject}/runtime/ControlBlueprint.java | 2 +- .../runtime/DefaultActivationLogTest.java | 6 +- .../DefaultInjectionServicesConfigTest.java | 10 +- .../inject}/runtime/InvocationTest.java | 14 +- .../SimpleInjectionTestingSupport.java | 14 +- {pico => inject}/testing/pom.xml | 12 +- .../testing/InjectionTestingSupport.java | 65 ++-- ...flectionBasedSingletonServiceProvider.java | 22 +- .../helidon/inject/testing}/package-info.java | 4 +- .../testing/src/main/java/module-info.java | 8 +- .../runtime => inject/tests/api}/pom.xml | 14 +- .../api/InjectionServicesConfigTest.java | 42 +-- {pico => inject}/tests/interception/pom.xml | 22 +- .../tests/interception/Invocation.java | 2 +- .../inject}/tests/interception/Modify.java | 4 +- .../interception/ModifyingInterceptor.java | 8 +- .../tests/interception/OtherContract.java | 4 +- .../inject}/tests/interception/Repeat.java | 4 +- .../interception/RepeatingInterceptor.java | 10 +- .../inject}/tests/interception/Return.java | 4 +- .../interception/ReturningInterceptor.java | 8 +- .../tests/interception/TheOtherService.java | 2 +- .../tests/interception/TheService.java | 2 +- .../tests/interception/InterceptionTest.java | 14 +- .../InterfaceInterceptionTest.java | 14 +- {pico => inject}/tests/pom.xml | 12 +- .../tests/resources-inject}/pom.xml | 66 ++-- ...AContractWithNoServiceImplementations.java | 4 +- .../tests/inject}/ASerialProviderImpl.java | 4 +- ...AContractWithNoServiceImplementations.java | 2 +- .../inject/tests/inject}/ClassNamedX.java | 2 +- .../inject/tests/inject}/ClassNamedY.java | 2 +- .../SomeOtherLocalNonContractInterface1.java | 4 +- .../inject/tests/inject}/Verification.java | 10 +- .../tests/inject}/interceptor/TestNamed.java | 6 +- .../tests/inject}/interceptor/XImpl.java | 17 +- .../tests/inject}/interceptor/YImpl.java | 17 +- .../inject/tests/inject}/package-info.java | 4 +- .../tests/inject}/provider/FakeConfig.java | 4 +- .../tests/inject}/provider/FakeServer.java | 4 +- .../provider/MyConcreteClassContract.java | 2 +- .../tests/inject}/provider/MyServices.java | 6 +- .../tests/inject}/stacking/Intercepted.java | 4 +- .../inject}/stacking/InterceptedImpl.java | 4 +- .../stacking/MostOuterInterceptedImpl.java | 2 +- .../stacking/OuterInterceptedImpl.java | 2 +- .../tests/inject}/tbox/AbstractBlade.java | 4 +- .../tests/inject}/tbox/AbstractSaw.java | 8 +- .../inject/tests/inject}/tbox/Awl.java | 6 +- .../inject/tests/inject}/tbox/Hammer.java | 8 +- .../inject/tests/inject}/tbox/Lubricant.java | 4 +- .../inject/tests/inject}/tbox/Preferred.java | 4 +- .../inject/tests/inject}/tbox/TableSaw.java | 8 +- .../inject/tests/inject}/tbox/Tool.java | 10 +- .../inject/tests/inject}/tbox/ToolBox.java | 10 +- .../tests/inject}/tbox/impl/AwlImpl.java | 6 +- .../tests/inject}/tbox/impl/BigHammer.java | 6 +- .../inject}/tbox/impl/BladeProvider.java | 12 +- .../tests/inject}/tbox/impl/CoarseBlade.java | 4 +- .../tests/inject}/tbox/impl/DullBlade.java | 4 +- .../tests/inject}/tbox/impl/FineBlade.java | 4 +- .../tests/inject}/tbox/impl/HandSaw.java | 41 +-- .../tests/inject}/tbox/impl/LittleHammer.java | 4 +- .../tests/inject}/tbox/impl/MainToolBox.java | 10 +- .../tests/inject}/tbox/impl/Screwdriver.java | 6 +- .../tests/inject}/tbox/impl/SledgeHammer.java | 4 +- .../tests/inject/tbox/impl}/package-info.java | 4 +- .../tests/inject/tbox}/package-info.java | 4 +- .../src/main/java/module-info.java | 20 +- .../inject}/AnApplicationScopedService.java | 2 +- .../tests/inject}/EmptyListInjectionTest.java | 12 +- .../inject/tests/inject}/JavaxTest.java | 19 +- .../inject/tests/inject}/TestUtils.java | 8 +- .../tests/inject}/TestingSingleton.java | 12 +- .../interceptor/InterceptorRuntimeTest.java | 80 ++--- .../provider/PerRequestProviderTest.java | 22 +- .../stacking/InterceptorStackingTest.java | 22 +- .../tests/inject}/tbox/ToolBoxTest.java | 121 ++++--- .../expected/module-info.java._inject_ | 44 +++ .../expected/tests-module-info.java._inject_ | 10 + .../expected/ximpl-interceptor._java_ | 182 +++++----- .../expected/yimpl-interceptor._java_ | 0 .../tests/resources-plain/pom.xml | 16 +- .../inject}/tests/plain/hello/Hello.java | 4 +- .../inject}/tests/plain/hello/HelloImpl.java | 2 +- .../tests/plain/hello/MyTestQualifier.java | 2 +- .../SomeOtherLocalNonContractInterface2.java | 2 +- .../inject}/tests/plain/hello/World.java | 2 +- .../inject}/tests/plain/hello/WorldImpl.java | 4 +- .../inject}/tests/plain/interceptor/IA.java | 4 +- .../inject}/tests/plain/interceptor/IB.java | 2 +- .../interceptor/InterceptorBasedAnno.java | 4 +- .../interceptor/TestNamedInterceptor.java | 7 +- .../inject}/tests/plain/interceptor/X.java | 2 +- .../src/main/java/module-info.java | 8 +- .../api => inject/tests/runtime}/pom.xml | 14 +- .../runtime/DefaultInjectionPlansTest.java | 38 +- .../runtime/DefaultInjectionServicesTest.java | 24 +- .../HelloInjectionWorldSanityTest.java | 159 +++++---- .../SimpleInjectionTestingSupport.java | 14 +- .../runtime/testsubjects/EmptyModule.java | 6 +- .../HelloInjection$$Application.java | 67 ++++ .../testsubjects/HelloInjection$$Module.java | 16 +- ...elloInjectionImpl$$injectionActivator.java | 131 +++++++ .../testsubjects/HelloInjectionWorld.java | 6 +- .../testsubjects/HelloInjectionWorldImpl.java | 20 +- .../runtime/testsubjects/InjectionWorld.java | 4 +- ...njectionWorldImpl$$injectionActivator.java | 38 +- .../testsubjects/InjectionWorldImpl.java | 14 +- .../io.helidon.inject.api.Application | 2 +- .../io.helidon.inject.api.ModuleComponent | 4 +- {pico => inject}/tests/tck-jsr330/pom.xml | 28 +- .../tests/tck/jsr330/Jsr330TckTest.java | 12 +- {pico => inject}/tools/README.md | 2 +- .../tools/etc/spotbugs/exclude.xml | 18 +- {pico => inject}/tools/pom.xml | 16 +- .../inject}/tools/AbstractCreator.java | 64 ++-- .../inject}/tools/AbstractFilerMessager.java | 2 +- .../ActivatorCodeGenDetailBlueprint.java | 9 +- .../tools/ActivatorCreatorArgsBlueprint.java | 6 +- .../ActivatorCreatorCodeGenBlueprint.java | 36 +- ...ctivatorCreatorConfigOptionsBlueprint.java | 16 +- .../tools/ActivatorCreatorDefault.java | 97 ++--- .../tools/ActivatorCreatorProvider.java | 6 +- .../ActivatorCreatorRequestBlueprint.java | 8 +- .../ActivatorCreatorResponseBlueprint.java | 8 +- .../ApplicationCreatorCodeGenBlueprint.java | 7 +- ...licationCreatorConfigOptionsBlueprint.java | 5 +- .../tools/ApplicationCreatorDefault.java | 91 ++--- .../ApplicationCreatorRequestBlueprint.java | 5 +- .../ApplicationCreatorResponseBlueprint.java | 10 +- .../helidon/inject}/tools/CodeGenFiler.java | 41 ++- .../CodeGenInterceptorRequestBlueprint.java | 5 +- .../inject}/tools/CodeGenPathsBlueprint.java | 5 +- .../helidon/inject}/tools/CodeGenUtils.java | 8 +- .../io/helidon/inject}/tools/CommonUtils.java | 12 +- .../tools/CompilerOptionsBlueprint.java | 2 +- ...tomAnnotationTemplateRequestBlueprint.java | 11 +- ...omAnnotationTemplateResponseBlueprint.java | 5 +- .../CustomAnnotationTemplateResponses.java | 2 +- .../tools/ExternalModuleCreatorDefault.java | 81 ++--- ...ExternalModuleCreatorRequestBlueprint.java | 13 +- ...xternalModuleCreatorResponseBlueprint.java | 8 +- .../tools/GeneralCodeGenDetailBlueprint.java | 2 +- .../tools/GeneralCodeGenNamesBlueprint.java | 10 +- .../tools/GeneralCreatorRequestBlueprint.java | 2 +- .../GeneralCreatorResponseBlueprint.java | 2 +- .../inject}/tools/GenericTemplateCreator.java | 6 +- ...enericTemplateCreatorRequestBlueprint.java | 2 +- .../helidon/inject}/tools/IdAndToString.java | 2 +- .../inject/tools/InjectionSupported.java | 12 +- .../tools/InterceptedElementBlueprint.java | 14 +- .../tools/InterceptionPlanBlueprint.java | 6 +- .../tools/InterceptorCreatorDefault.java | 34 +- .../tools/InterceptorCreatorProvider.java | 6 +- .../InterceptorCreatorResponseBlueprint.java | 2 +- .../java/io/helidon/inject}/tools/JavaC.java | 2 +- .../io/helidon/inject}/tools/Messager.java | 2 +- .../tools/MethodElementInfoBlueprint.java | 7 +- .../inject}/tools/ModuleDetailBlueprint.java | 5 +- .../ModuleInfoCreatorRequestBlueprint.java | 24 +- .../tools/ModuleInfoDescriptorBlueprint.java | 8 +- .../tools/ModuleInfoDescriptorSupport.java | 10 +- .../tools/ModuleInfoItemBlueprint.java | 4 +- .../inject}/tools/ModuleInfoOrdering.java | 2 +- .../helidon/inject}/tools/ModuleInfoUtil.java | 2 +- .../io/helidon/inject}/tools/ModuleUtils.java | 44 ++- .../io/helidon/inject}/tools/Options.java | 50 ++- .../inject}/tools/PermittedProviderType.java | 6 +- .../inject}/tools/ReflectionHandler.java | 4 +- .../inject}/tools/ServicesToProcess.java | 30 +- .../helidon/inject}/tools/TemplateHelper.java | 24 +- .../helidon/inject}/tools/ToolsException.java | 4 +- .../io/helidon/inject}/tools/TypeNames.java | 54 +-- .../io/helidon/inject}/tools/TypeTools.java | 63 ++-- .../helidon/inject/tools}/package-info.java | 6 +- .../inject}/tools/spi/ActivatorCreator.java | 35 +- .../inject}/tools/spi/ApplicationCreator.java | 15 +- .../spi/CustomAnnotationTemplateCreator.java | 8 +- .../tools/spi/ExternalModuleCreator.java | 17 +- .../inject}/tools/spi/InterceptorCreator.java | 20 +- .../tools/spi/ModuleComponentNamer.java | 7 +- .../inject}/tools/spi/package-info.java | 2 +- inject/tools/src/main/java/module-info.java | 53 +++ .../default/interface-based-interceptor.hbs | 20 +- .../templates/inject}/default/module-info.hbs | 0 .../default/no-arg-based-interceptor.hbs | 20 +- .../default/service-provider-activator.hbs | 18 +- ...r-application-empty-servicetypebinding.hbs | 0 ...rovider-application-servicetypebinding.hbs | 0 .../service-provider-application-stub.hbs | 8 +- .../default/service-provider-application.hbs | 4 +- .../default/service-provider-module.hbs | 4 +- .../inject}/tools/AbstractBaseCreator.java | 2 +- .../tools/ActivatorCreatorDefaultTest.java | 14 +- .../tools/ApplicationCreatorDefaultTest.java | 24 +- .../ExternalModuleCreatorDefaultTest.java | 14 +- .../tools/InterceptorCreatorDefaultTest.java | 24 +- .../tools/ModuleInfoDescriptorTest.java | 40 +-- .../inject}/tools/TemplateHelperTest.java | 6 +- .../helidon/inject}/tools/TypeToolsTest.java | 20 +- .../testsubjects/HelloInjectionWorld.java | 6 +- .../testsubjects/HelloInjectionWorldImpl.java | 24 +- .../tools/testsubjects/InjectionWorld.java | 4 +- .../testsubjects/InjectionWorldImpl.java | 14 +- .../src/test/resources/testsubjects/m0._java_ | 12 +- integrations/oci/sdk/README.md | 2 +- integrations/oci/sdk/processor/pom.xml | 4 +- .../OciInjectionProcessorObserver.java | 25 +- .../processor/OciModuleComponentNamer.java | 5 +- .../processor/src/main/java/module-info.java | 14 +- .../service-client-builder-provider.hbs | 8 +- .../templates/service-client-provider.hbs | 10 +- .../OciInjectionProcessorObserverTest.java | 4 +- .../objectstorage$$Oci$$Client._java_ | 10 +- .../objectstorage$$Oci$$ClientBuilder._java_ | 8 +- integrations/oci/sdk/runtime/pom.xml | 20 +- .../OciAuthenticationDetailsProvider.java | 10 +- .../oci/sdk/runtime/OciAvailability.java | 2 +- .../sdk/runtime/OciAvailabilityDefault.java | 4 +- .../oci/sdk/runtime/OciExtension.java | 12 +- .../oci/sdk/runtime/OciRegionProvider.java | 15 +- .../runtime/src/main/java/module-info.java | 8 +- .../OciAuthenticationDetailsProviderTest.java | 26 +- .../oci/sdk/runtime/OciConfigTest.java | 4 +- .../sdk/runtime/OciRegionProviderTest.java | 34 +- .../oci/sdk/tests/test-application/pom.xml | 4 +- .../oci/sdk/tests/test-module1/pom.xml | 4 +- .../oci/sdk/tests/test-module2/pom.xml | 4 +- nima/fault-tolerance/fault-tolerance/pom.xml | 28 +- .../io/helidon/nima/faulttolerance/Async.java | 2 +- .../nima/faulttolerance/AsyncImpl.java | 14 +- .../nima/faulttolerance/AsyncInterceptor.java | 8 +- .../helidon/nima/faulttolerance/Bulkhead.java | 2 +- .../BulkheadConfigBlueprint.java | 2 +- .../faulttolerance/BulkheadInterceptor.java | 6 +- .../nima/faulttolerance/CircuitBreaker.java | 2 +- .../CircuitBreakerConfigBlueprint.java | 2 +- .../faulttolerance/CircuitBreakerImpl.java | 2 +- .../CircuitBreakerInterceptor.java | 6 +- .../faulttolerance/CircuitBreakerMethod.java | 2 +- .../faulttolerance/FallbackInterceptor.java | 12 +- .../nima/faulttolerance/FallbackMethod.java | 2 +- .../nima/faulttolerance/FaultTolerance.java | 2 +- .../nima/faulttolerance/InterceptorBase.java | 16 +- .../io/helidon/nima/faulttolerance/Retry.java | 2 +- .../nima/faulttolerance/RetryInterceptor.java | 6 +- .../nima/faulttolerance/RetryMethod.java | 2 +- .../helidon/nima/faulttolerance/Timeout.java | 2 +- .../faulttolerance/TimeoutInterceptor.java | 6 +- .../src/main/java/module-info.java | 14 +- nima/fault-tolerance/processor/pom.xml | 8 +- .../CircuitBreakerMethodCreator.java | 14 +- .../processor/FallbackMethodCreator.java | 14 +- .../processor/RetryMethodCreator.java | 14 +- .../faulttolerance/processor/Templates.java | 2 +- .../processor/src/main/java/module-info.java | 12 +- .../nima/circuit-breaker-method.java.hbs | 0 .../nima/fallback-method.java.hbs | 0 .../nima/retry-method.java.hbs | 0 nima/http/processor/pom.xml | 8 +- .../http/processor/HttpEndpointCreator.java | 10 +- .../http/processor/HttpMethodCreator.java | 12 +- .../nima/http/processor/Templates.java | 2 +- .../processor/src/main/java/module-info.java | 9 +- nima/tests/integration/imperative/pom.xml | 4 +- nima/webserver/webserver/pom.xml | 32 +- .../io/helidon/nima/webserver/LoomServer.java | 8 +- .../io/helidon/nima/webserver/WebServer.java | 2 +- .../webserver/WebServerConfigBlueprint.java | 2 +- .../nima/webserver/http/GeneratedHandler.java | 2 +- .../nima/webserver/http/HttpFeature.java | 2 +- .../webserver/src/main/java/module-info.java | 10 +- .../webserver/WebServerConfigDrivenTest.java | 28 +- .../src/test/resources/application.yaml | 2 +- pico/README.md | 336 ------------------ pico/configdriven/runtime/README.md | 3 - .../tests/configuredby-application/README.md | 3 - .../configuredby/yaml/test/package-info.java | 20 -- pico/maven-plugin/README.md | 105 ------ .../pico/maven/plugin/package-info.java | 20 -- .../helidon/pico/processor/package-info.java | 20 -- ....tools.spi.CustomAnnotationTemplateCreator | 1 - pico/runtime/README.md | 3 - .../tests/pico/tbox/impl/package-info.java | 20 -- .../expected/module-info.java._pico_ | 44 --- .../expected/tests-module-info.java._pico_ | 10 - .../testsubjects/HelloPico$$Application.java | 67 ---- .../HelloPicoImpl$$picoActivator.java | 130 ------- .../io/helidon/pico/tools/package-info.java | 20 -- pico/tools/src/main/java/module-info.java | 53 --- pom.xml | 4 +- tests/integration/native-image/mp-1/pom.xml | 4 +- .../mp-1/src/main/java/module-info.java | 4 +- tests/integration/native-image/mp-3/pom.xml | 4 +- 629 files changed, 4818 insertions(+), 4744 deletions(-) rename docs/nima/{pico/pico_intro.adoc => inject/injection_intro.adoc} (50%) rename examples/{pico => inject}/README.md (84%) rename examples/{pico => inject}/application/README.md (61%) rename examples/{pico => inject}/application/pom.xml (78%) rename examples/{pico/application/src/main/java/io/helidon/examples/pico => inject/application/src/main/java/io/helidon/examples/inject}/application/Main.java (69%) rename examples/{pico/application/src/main/java/io/helidon/examples/pico => inject/application/src/main/java/io/helidon/examples/inject}/application/package-info.java (84%) rename examples/{pico => inject}/application/src/main/resources/logging.properties (100%) rename examples/{pico/application/src/test/java/io/helidon/examples/pico/application/PicoApplicationTest.java => inject/application/src/test/java/io/helidon/examples/inject/application/InjectionApplicationTest.java} (68%) rename examples/{pico => inject}/basics/README.md (52%) rename examples/{pico => inject}/basics/pom.xml (74%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/Big.java (95%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/BigHammer.java (94%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/Hammer.java (93%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/Little.java (95%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/LittleHammer.java (94%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/Main.java (80%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/Tool.java (90%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/ToolBox.java (92%) rename examples/{pico/basics/src/main/java/io/helidon/examples/pico => inject/basics/src/main/java/io/helidon/examples/inject}/basics/package-info.java (85%) rename examples/{pico => inject}/basics/src/main/resources/logging.properties (100%) create mode 100644 examples/inject/configdriven/README.md rename examples/{pico => inject}/configdriven/pom.xml (80%) rename examples/{pico/configdriven/src/main/java/io/helidon/examples/pico => inject/configdriven/src/main/java/io/helidon/examples/inject}/configdriven/Drill.java (88%) rename examples/{pico/configdriven/src/main/java/io/helidon/examples/pico => inject/configdriven/src/main/java/io/helidon/examples/inject}/configdriven/DrillConfigBlueprint.java (90%) rename examples/{pico/configdriven/src/main/java/io/helidon/examples/pico => inject/configdriven/src/main/java/io/helidon/examples/inject}/configdriven/Main.java (76%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime => examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven}/package-info.java (87%) rename examples/{pico => inject}/configdriven/src/main/resources/application.yaml (98%) rename examples/{pico => inject}/configdriven/src/main/resources/logging.properties (100%) create mode 100644 examples/inject/interceptors/README.md rename examples/{pico => inject}/interceptors/pom.xml (83%) rename examples/{pico/interceptors/src/main/java/io/helidon/examples/pico => inject/interceptors/src/main/java/io/helidon/examples/inject}/interceptors/Main.java (85%) rename examples/{pico/interceptors/src/main/java/io/helidon/examples/pico => inject/interceptors/src/main/java/io/helidon/examples/inject}/interceptors/ScrewDriver.java (95%) rename examples/{pico/interceptors/src/main/java/io/helidon/examples/pico => inject/interceptors/src/main/java/io/helidon/examples/inject}/interceptors/Turn.java (87%) rename examples/{pico/interceptors/src/main/java/io/helidon/examples/pico => inject/interceptors/src/main/java/io/helidon/examples/inject}/interceptors/TurnInterceptor.java (85%) rename examples/{pico/interceptors/src/main/java/io/helidon/examples/pico => inject/interceptors/src/main/java/io/helidon/examples/inject}/interceptors/TurningTool.java (84%) create mode 100644 examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/package-info.java rename examples/{pico => inject}/interceptors/src/main/resources/logging.properties (100%) rename examples/{pico => inject}/pom.xml (89%) rename examples/{pico => inject}/providers/README.md (62%) rename examples/{pico => inject}/providers/pom.xml (79%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/AngleGrinderSaw.java (92%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/Blade.java (63%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/BladeProvider.java (84%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/CircularSaw.java (93%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/HandSaw.java (96%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/Main.java (81%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/Nail.java (63%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/NailGun.java (83%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/NailProvider.java (96%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/Saw.java (60%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/SizedBlade.java (95%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/StandardNail.java (95%) rename examples/{pico/providers/src/main/java/io/helidon/examples/pico => inject/providers/src/main/java/io/helidon/examples/inject}/providers/TableSaw.java (90%) rename {pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor => examples/inject/providers/src/main/java/io/helidon/examples/inject/providers}/package-info.java (88%) rename examples/{pico => inject}/providers/src/main/resources/logging.properties (100%) rename examples/{pico/providers/src/test/java/io/helidon/examples/pico => inject/providers/src/test/java/io/helidon/examples/inject}/providers/AllenWrench.java (94%) rename examples/{pico/providers/src/test/java/io/helidon/examples/pico => inject/providers/src/test/java/io/helidon/examples/inject}/providers/ProvidersTest.java (86%) rename examples/{pico/providers/src/test/java/io/helidon/examples/pico => inject/providers/src/test/java/io/helidon/examples/inject}/providers/Wrench.java (87%) delete mode 100644 examples/pico/configdriven/README.md delete mode 100644 examples/pico/interceptors/README.md create mode 100644 inject/README.md rename {pico => inject}/api/README.md (79%) rename {pico => inject}/api/pom.xml (95%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/AccessModifier.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ActivationLog.java (94%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ActivationLogEntryBlueprint.java (97%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ActivationLogQuery.java (92%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ActivationPhaseReceiver.java (86%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ActivationRequestBlueprint.java (94%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ActivationResultBlueprint.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ActivationStatus.java (93%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Activator.java (93%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Application.java (93%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/BootstrapBlueprint.java (60%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/CallingContextBlueprint.java (90%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/CallingContextFactory.java (92%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ClassNamed.java (97%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/CommonQualifiers.java (97%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ContextualServiceQueryBlueprint.java (93%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Contract.java (82%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/DeActivationRequestBlueprint.java (85%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/DeActivator.java (93%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/DependenciesInfoBlueprint.java (93%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/DependencyInfoBlueprint.java (89%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/DependencyInfoComparator.java (94%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ElementInfoBlueprint.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ElementKind.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Event.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ExternalContracts.java (94%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Helidon.java (91%) rename pico/api/src/main/java/io/helidon/pico/api/PicoException.java => inject/api/src/main/java/io/helidon/inject/api/InjectionException.java (63%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/InjectionPointInfoBlueprint.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/InjectionPointProvider.java (80%) rename pico/api/src/main/java/io/helidon/pico/api/PicoServiceProviderException.java => inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java (65%) rename pico/api/src/main/java/io/helidon/pico/api/PicoServices.java => inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java (72%) rename pico/api/src/main/java/io/helidon/pico/api/PicoServicesConfigBlueprint.java => inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java (85%) rename pico/api/src/main/java/io/helidon/pico/api/PicoServicesHolder.java => inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java (75%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Injector.java (81%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/InjectorOptionsBlueprint.java (86%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Intercepted.java (90%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/InterceptedTrigger.java (85%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Interceptor.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/InternalBootstrapBlueprint.java (86%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/InvocationContextBlueprint.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/InvocationException.java (94%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/MetricsBlueprint.java (90%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ModuleComponent.java (93%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/OptionallyNamed.java (91%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Phase.java (95%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/PostConstructMethod.java (90%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/PreDestroyMethod.java (90%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/QualifierBlueprint.java (98%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Qualifiers.java (98%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Resettable.java (91%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/RunLevel.java (92%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceBinder.java (91%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceInfoBasicsBlueprint.java (92%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceInfoBlueprint.java (97%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceInfoBuildInterceptor.java (97%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceInfoCriteriaBlueprint.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceInjectionPlanBinder.java (97%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceProvider.java (96%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceProviderBindable.java (83%) rename pico/api/src/main/java/io/helidon/pico/api/InjectionException.java => inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java (74%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/ServiceProviderProvider.java (95%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Services.java (86%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/Startable.java (94%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/api/package-info.java (53%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/spi/InjectionPlanBlueprint.java (91%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/spi/InjectionResolver.java (83%) rename pico/api/src/main/java/io/helidon/pico/spi/PicoServicesProvider.java => inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java (59%) rename {pico/api/src/main/java/io/helidon/pico => inject/api/src/main/java/io/helidon/inject}/spi/package-info.java (84%) rename {pico => inject}/api/src/main/java/module-info.java (81%) rename pico/api/src/test/java/io/helidon/pico/api/PicoServicesTest.java => inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java (58%) rename {pico/api/src/test/java/io/helidon/pico => inject/api/src/test/java/io/helidon/inject}/api/PriorityAndServiceTypeComparatorTest.java (82%) rename {pico/api/src/test/java/io/helidon/pico => inject/api/src/test/java/io/helidon/inject}/api/QualifierTest.java (97%) rename pico/api/src/test/java/io/helidon/pico/api/testsubjects/AbstractPicoServices.java => inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java (71%) rename pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1.java => inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java (70%) rename pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1Provider.java => inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java (59%) rename pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3.java => inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java (75%) rename pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2Provider.java => inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java (59%) rename pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2.java => inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java (76%) rename pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3Provider.java => inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java (59%) rename pico/api/src/test/resources/META-INF/services/io.helidon.pico.spi.PicoServicesProvider => inject/api/src/test/resources/META-INF/services/io.helidon.inject.spi.InjectionServicesProvider (76%) rename {pico => inject}/configdriven/README.md (68%) rename {pico => inject}/configdriven/api/pom.xml (87%) rename {pico/configdriven/api/src/main/java/io/helidon/pico => inject/configdriven/api/src/main/java/io/helidon/inject}/configdriven/api/ConfigBean.java (95%) rename {pico/configdriven/api/src/main/java/io/helidon/pico => inject/configdriven/api/src/main/java/io/helidon/inject}/configdriven/api/ConfigBeanFactory.java (92%) rename {pico/configdriven/api/src/main/java/io/helidon/pico => inject/configdriven/api/src/main/java/io/helidon/inject}/configdriven/api/ConfigDriven.java (98%) rename {pico/configdriven/api/src/main/java/io/helidon/pico => inject/configdriven/api/src/main/java/io/helidon/inject}/configdriven/api/NamedInstance.java (96%) create mode 100644 inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/package-info.java rename {pico => inject}/configdriven/api/src/main/java/module-info.java (78%) rename {pico => inject}/configdriven/pom.xml (81%) rename {pico => inject}/configdriven/processor/README.md (88%) rename {pico => inject}/configdriven/processor/pom.xml (83%) rename {pico/configdriven/processor/src/main/java/io/helidon/pico => inject/configdriven/processor/src/main/java/io/helidon/inject}/configdriven/processor/ConfigBean.java (98%) rename {pico/configdriven/processor/src/main/java/io/helidon/pico => inject/configdriven/processor/src/main/java/io/helidon/inject}/configdriven/processor/ConfigBeanAnnotation.java (92%) rename {pico/configdriven/processor/src/main/java/io/helidon/pico => inject/configdriven/processor/src/main/java/io/helidon/inject}/configdriven/processor/ConfigDrivenAnnotation.java (91%) rename {pico/configdriven/processor/src/main/java/io/helidon/pico => inject/configdriven/processor/src/main/java/io/helidon/inject}/configdriven/processor/ConfigDrivenProcessor.java (94%) create mode 100644 inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/package-info.java rename {pico => inject}/configdriven/processor/src/main/java/module-info.java (75%) create mode 100644 inject/configdriven/runtime/README.md rename {pico => inject}/configdriven/runtime/pom.xml (85%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico => inject/configdriven/runtime/src/main/java/io/helidon/inject}/configdriven/runtime/ConfigBeanRegistry.java (77%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico => inject/configdriven/runtime/src/main/java/io/helidon/inject}/configdriven/runtime/ConfigBeanRegistryImpl.java (88%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico => inject/configdriven/runtime/src/main/java/io/helidon/inject}/configdriven/runtime/ConfigDrivenServiceProviderBase.java (91%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico => inject/configdriven/runtime/src/main/java/io/helidon/inject}/configdriven/runtime/ConfigDrivenUtils.java (91%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico => inject/configdriven/runtime/src/main/java/io/helidon/inject}/configdriven/runtime/ConfiguredServiceProvider.java (81%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico => inject/configdriven/runtime/src/main/java/io/helidon/inject}/configdriven/runtime/NameComparator.java (92%) rename {pico/configdriven/runtime/src/main/java/io/helidon/pico => inject/configdriven/runtime/src/main/java/io/helidon/inject}/configdriven/runtime/UnconfiguredServiceProvider.java (86%) rename {examples/pico/providers/src/main/java/io/helidon/examples/pico/providers => inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime}/package-info.java (88%) rename {pico => inject}/configdriven/runtime/src/main/java/module-info.java (75%) rename {pico => inject}/configdriven/tests/config/pom.xml (82%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/EnumRelatedConfigBlueprint.java (95%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeClientAuth.java (95%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeComponentTracingConfigBlueprint.java (96%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeKeyConfigBlueprint.java (97%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeKeystoreConfigBlueprint.java (96%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeNettyClientAuth.java (93%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakePathTracingConfigBlueprint.java (96%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeRoutingConfig.java (93%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeServerConfigBlueprint.java (98%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeServerLifecycle.java (93%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeSocketConfigBlueprint.java (95%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeSpanLogTracingConfigBlueprint.java (94%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeSpanTracingConfigBlueprint.java (96%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeTlsWSNotDrivenByCB.java (93%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeTraceableConfigBlueprint.java (96%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeTracer.java (93%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeTracingConfigBlueprint.java (96%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeWebServer.java (93%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeWebServerContract.java (92%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeWebServerNotDrivenAndHavingConfiguredByOverrides.java (90%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/FakeWebServerTlsConfigBlueprint.java (95%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/SSLContextConfigBlueprint.java (95%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/TestClientConfigBlueprint.java (92%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/TestCommonConfigBlueprint.java (96%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/TestServerConfigBlueprint.java (92%) rename {pico/configdriven/tests/config/src/main/java/io/helidon/pico => inject/configdriven/tests/config/src/main/java/io/helidon/inject}/configdriven/tests/config/package-info.java (92%) rename {pico => inject}/configdriven/tests/config/src/main/java/module-info.java (80%) rename {pico/configdriven/tests/config/src/test/java/io/helidon/pico => inject/configdriven/tests/config/src/test/java/io/helidon/inject}/configdriven/tests/config/AbstractConfigBeanTest.java (97%) rename {pico/configdriven/tests/config/src/test/java/io/helidon/pico => inject/configdriven/tests/config/src/test/java/io/helidon/inject}/configdriven/tests/config/BasicConfigBeanTest.java (99%) rename {pico/configdriven/tests/config/src/test/java/io/helidon/pico => inject/configdriven/tests/config/src/test/java/io/helidon/inject}/configdriven/tests/config/EnumRelatedConfigBeanTest.java (97%) rename {pico/configdriven/tests/config/src/test/java/io/helidon/pico => inject/configdriven/tests/config/src/test/java/io/helidon/inject}/configdriven/tests/config/NestedConfigBeanTest.java (98%) rename {pico => inject}/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoNamedSockets.yaml (100%) rename {pico => inject}/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoUnnamedSockets.yaml (100%) rename {pico => inject}/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/basic-config-bean-test.yaml (100%) create mode 100644 inject/configdriven/tests/configuredby-application/README.md rename {pico => inject}/configdriven/tests/configuredby-application/pom.xml (78%) rename {pico/configdriven/tests/configuredby-application/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby-application/src/main/java/io/helidon/inject}/configdriven/configuredby/application/test/ASimpleRunLevelService.java (89%) rename {pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico => inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject}/configdriven/configuredby/test/ApplicationConfigBeanTest.java (93%) rename {pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico => inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject}/configdriven/configuredby/test/ApplicationConfiguredByTest.java (79%) rename {pico => inject}/configdriven/tests/configuredby/README.md (60%) rename {pico => inject}/configdriven/tests/configuredby/pom.xml (79%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/ASingletonConfigBeanBlueprint.java (88%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/ASingletonService.java (92%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/ASingletonServiceContract.java (92%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/AbstractConfigBeanTest.java (96%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/AbstractConfiguredByTest.java (82%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/AbstractServiceBase.java (95%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/SomeConfiguredServiceWithAnAbstractBase.java (90%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/SomeServiceConfigBlueprint.java (93%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/SomeServiceInterface.java (92%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/test/package-info.java (91%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/yaml/test/Async.java (88%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/yaml/test/AsyncConfigBlueprint.java (86%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/yaml/test/BulkheadConfigBlueprint.java (88%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/configuredby/yaml/test/ServerConfigBlueprint.java (93%) create mode 100644 inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/package-info.java rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/interceptor/test/IZ.java (87%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/interceptor/test/TestInterceptorTrigger.java (88%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/interceptor/test/ZImpl.java (86%) rename {pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject}/configdriven/interceptor/test/ZImplConfigBlueprint.java (89%) rename {pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject}/configdriven/configuredby/test/ConfiguredByTest.java (92%) rename {pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject}/configdriven/configuredby/test/DefaultConfigBeanTest.java (92%) rename {pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico => inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject}/configdriven/configuredby/yaml/test/NamedConfiguredByTest.java (77%) rename {pico => inject}/configdriven/tests/configuredby/src/test/resources/application.yaml (98%) rename {pico => inject}/configdriven/tests/pom.xml (83%) create mode 100644 inject/maven-plugin/README.md rename {pico => inject}/maven-plugin/etc/spotbugs/exclude.xml (76%) rename {pico => inject}/maven-plugin/pom.xml (93%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/AbstractApplicationCreatorMojo.java (81%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/AbstractCreatorMojo.java (88%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/ApplicationCreatorMojo.java (84%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/ExecHandler.java (97%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/ExecutableClassLoader.java (95%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/ExternalModuleCreatorMojo.java (87%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/IsolatedThreadGroup.java (98%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/MavenPluginUtils.java (72%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/QualifierConfig.java (97%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/ServiceTypeQualifiers.java (94%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/TestApplicationCreatorMojo.java (79%) rename {pico/maven-plugin/src/main/java/io/helidon/pico => inject/maven-plugin/src/main/java/io/helidon/inject}/maven/plugin/TrafficCop.java (89%) rename {examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors => inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin}/package-info.java (87%) rename {pico => inject}/maven-plugin/src/main/java/module-info.java (69%) rename {pico => inject}/pom.xml (86%) rename {pico => inject}/processor/README.md (80%) rename {pico => inject}/processor/etc/spotbugs/exclude.xml (79%) rename {pico => inject}/processor/pom.xml (89%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/ActiveProcessorUtils.java (95%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/BaseAnnotationProcessor.java (95%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/CreatorHandler.java (81%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/CustomAnnotationProcessor.java (91%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/GeneralProcessorUtils.java (95%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/GenericTemplateCreatorDefault.java (91%) rename pico/processor/src/main/java/io/helidon/pico/processor/PicoAnnotationProcessor.java => inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java (90%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/MessagerToLogAdapter.java (95%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/ProcessingEventBlueprint.java (87%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/ProcessingTracker.java (92%) rename {pico/processor/src/main/java/io/helidon/pico => inject/processor/src/main/java/io/helidon/inject}/processor/UnsupportedConstructsProcessor.java (96%) rename {examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven => inject/processor/src/main/java/io/helidon/inject/processor}/package-info.java (86%) rename pico/processor/src/main/java/io/helidon/pico/processor/spi/PicoAnnotationProcessorObserver.java => inject/processor/src/main/java/io/helidon/inject/processor/spi/InjectionAnnotationProcessorObserver.java (70%) rename {pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api => inject/processor/src/main/java/io/helidon/inject/processor/spi}/package-info.java (89%) rename {pico => inject}/processor/src/main/java/module-info.java (57%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/CustomAnnotationProcessorTest.java (81%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/ExtensibleGetTemplateProducer.java (86%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/ProcessingTrackerTest.java (99%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/TestUtils.java (94%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/package-info.java (94%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/testsubjects/BasicEndpoint.java (89%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/testsubjects/BasicPath.java (95%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/testsubjects/ExtensibleGET.java (94%) rename {pico/processor/src/test/java/io/helidon/pico => inject/processor/src/test/java/io/helidon/inject}/processor/testsubjects/package-info.java (93%) create mode 100644 inject/processor/src/test/resources/META-INF/services/io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator rename {pico => inject}/processor/src/test/resources/expected/BasicEndpoint_ExtensibleGET._java_ (65%) rename {pico/processor/src/test/resources/templates/pico => inject/processor/src/test/resources/templates/inject}/nima/extensible-get.hbs (100%) create mode 100644 inject/runtime/README.md rename {pico => inject}/runtime/pom.xml (91%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/AbstractServiceProvider.java (82%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/BoundedServiceProvider.java (90%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/DefaultActivationLog.java (85%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/DefaultInjectionPlanBinder.java (78%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/DefaultInjectionPlans.java (81%) rename pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServices.java => inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java (87%) rename pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesConfig.java => inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesConfig.java (58%) rename pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesProvider.java => inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java (63%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/DefaultInjector.java (84%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/DefaultServices.java (80%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/Dependencies.java (97%) rename pico/runtime/src/main/java/io/helidon/pico/runtime/PicoInjectionPlanBlueprint.java => inject/runtime/src/main/java/io/helidon/inject/runtime/HeldionInjectionPlanBlueprint.java (80%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/HelidonInjectionStartupProvider.java (88%) rename pico/runtime/src/main/java/io/helidon/pico/runtime/PicoApplicationServiceProvider.java => inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java (66%) rename pico/runtime/src/main/java/io/helidon/pico/runtime/PicoExceptions.java => inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionExceptions.java (82%) rename pico/runtime/src/main/java/io/helidon/pico/runtime/PicoModuleServiceProvider.java => inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java (65%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/InterceptedMethod.java (93%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/Invocation.java (94%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/NonSingletonServiceProvider.java (94%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/ServiceBinderDefault.java (66%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/ServiceProviderComparator.java (95%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/ServiceUtils.java (83%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/State.java (97%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/Versions.java (61%) rename {pico/runtime/src/main/java/io/helidon/pico => inject/runtime/src/main/java/io/helidon/inject}/runtime/VoidServiceProvider.java (91%) create mode 100644 inject/runtime/src/main/java/io/helidon/inject/runtime/package-info.java rename {pico => inject}/runtime/src/main/java/module-info.java (65%) rename {pico/runtime/src/test/java/io/helidon/pico => inject/runtime/src/test/java/io/helidon/inject}/runtime/ControlBlueprint.java (96%) rename {pico/runtime/src/test/java/io/helidon/pico => inject/runtime/src/test/java/io/helidon/inject}/runtime/DefaultActivationLogTest.java (92%) rename pico/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesConfigTest.java => inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java (76%) rename {pico/runtime/src/test/java/io/helidon/pico => inject/runtime/src/test/java/io/helidon/inject}/runtime/InvocationTest.java (97%) rename pico/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java => inject/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java (65%) rename {pico => inject}/testing/pom.xml (86%) rename pico/testing/src/main/java/io/helidon/pico/testing/PicoTestingSupport.java => inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java (58%) rename {pico/testing/src/main/java/io/helidon/pico => inject/testing/src/main/java/io/helidon/inject}/testing/ReflectionBasedSingletonServiceProvider.java (82%) rename {pico/processor/src/main/java/io/helidon/pico/processor/spi => inject/testing/src/main/java/io/helidon/inject/testing}/package-info.java (90%) rename {pico => inject}/testing/src/main/java/module-info.java (82%) rename {pico/tests/runtime => inject/tests/api}/pom.xml (81%) rename pico/tests/api/src/test/java/io/helidon/pico/api/PicoServicesConfigTest.java => inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java (74%) rename {pico => inject}/tests/interception/pom.xml (80%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/Invocation.java (94%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/Modify.java (91%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/ModifyingInterceptor.java (90%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/OtherContract.java (92%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/Repeat.java (91%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/RepeatingInterceptor.java (89%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/Return.java (91%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/ReturningInterceptor.java (90%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/TheOtherService.java (97%) rename {pico/tests/interception/src/main/java/io/helidon/pico => inject/tests/interception/src/main/java/io/helidon/inject}/tests/interception/TheService.java (97%) rename {pico/tests/interception/src/test/java/io/helidon/pico => inject/tests/interception/src/test/java/io/helidon/inject}/tests/interception/InterceptionTest.java (96%) rename {pico/tests/interception/src/test/java/io/helidon/pico => inject/tests/interception/src/test/java/io/helidon/inject}/tests/interception/InterfaceInterceptionTest.java (96%) rename {pico => inject}/tests/pom.xml (85%) rename {pico/tests/resources-pico => inject/tests/resources-inject}/pom.xml (65%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/AContractWithNoServiceImplementations.java (89%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/ASerialProviderImpl.java (95%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/AServiceUsingAContractWithNoServiceImplementations.java (96%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/ClassNamedX.java (94%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/ClassNamedY.java (94%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/SomeOtherLocalNonContractInterface1.java (92%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/Verification.java (97%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/interceptor/TestNamed.java (84%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/interceptor/XImpl.java (86%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/interceptor/YImpl.java (85%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/package-info.java (92%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/provider/FakeConfig.java (90%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/provider/FakeServer.java (90%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/provider/MyConcreteClassContract.java (94%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/provider/MyServices.java (93%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/stacking/Intercepted.java (94%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/stacking/InterceptedImpl.java (94%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/stacking/MostOuterInterceptedImpl.java (95%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/stacking/OuterInterceptedImpl.java (95%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/AbstractBlade.java (89%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/AbstractSaw.java (96%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/Awl.java (87%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/Hammer.java (84%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/Lubricant.java (92%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/Preferred.java (94%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/TableSaw.java (96%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/Tool.java (83%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/ToolBox.java (86%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/AwlImpl.java (86%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/BigHammer.java (87%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/BladeProvider.java (90%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/CoarseBlade.java (89%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/DullBlade.java (89%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/FineBlade.java (89%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/HandSaw.java (77%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/LittleHammer.java (90%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/MainToolBox.java (91%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/Screwdriver.java (84%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject}/tbox/impl/SledgeHammer.java (91%) rename {pico/runtime/src/main/java/io/helidon/pico/runtime => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl}/package-info.java (90%) rename {pico/testing/src/main/java/io/helidon/pico/testing => inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox}/package-info.java (91%) rename {pico/tests/resources-pico => inject/tests/resources-inject}/src/main/java/module-info.java (61%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/AnApplicationScopedService.java (96%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/EmptyListInjectionTest.java (79%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/JavaxTest.java (78%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/TestUtils.java (89%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/TestingSingleton.java (86%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/interceptor/InterceptorRuntimeTest.java (76%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/provider/PerRequestProviderTest.java (75%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/stacking/InterceptorStackingTest.java (81%) rename {pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico => inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject}/tbox/ToolBoxTest.java (74%) create mode 100644 inject/tests/resources-inject/src/test/resources/expected/module-info.java._inject_ create mode 100644 inject/tests/resources-inject/src/test/resources/expected/tests-module-info.java._inject_ rename {pico/tests/resources-pico => inject/tests/resources-inject}/src/test/resources/expected/ximpl-interceptor._java_ (60%) rename {pico/tests/resources-pico => inject/tests/resources-inject}/src/test/resources/expected/yimpl-interceptor._java_ (100%) rename {pico => inject}/tests/resources-plain/pom.xml (74%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/hello/Hello.java (89%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/hello/HelloImpl.java (98%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/hello/MyTestQualifier.java (97%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/hello/SomeOtherLocalNonContractInterface2.java (93%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/hello/World.java (93%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/hello/WorldImpl.java (92%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/interceptor/IA.java (88%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/interceptor/IB.java (93%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/interceptor/InterceptorBasedAnno.java (89%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/interceptor/TestNamedInterceptor.java (91%) rename {pico/tests/resources-plain/src/main/java/io/helidon/pico => inject/tests/resources-plain/src/main/java/io/helidon/inject}/tests/plain/interceptor/X.java (97%) rename {pico => inject}/tests/resources-plain/src/main/java/module-info.java (81%) rename {pico/tests/api => inject/tests/runtime}/pom.xml (80%) rename {pico/tests/runtime/src/test/java/io/helidon/pico => inject/tests/runtime/src/test/java/io/helidon/inject}/runtime/DefaultInjectionPlansTest.java (74%) rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesTest.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesTest.java (66%) rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/HelloPicoWorldSanityTest.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/HelloInjectionWorldSanityTest.java (61%) rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java (67%) rename {pico/tests/runtime/src/test/java/io/helidon/pico => inject/tests/runtime/src/test/java/io/helidon/inject}/runtime/testsubjects/EmptyModule.java (85%) create mode 100644 inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Application.java rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Module.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Module.java (71%) create mode 100644 inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionImpl$$injectionActivator.java rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorld.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorld.java (85%) rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorldImpl.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorldImpl.java (80%) rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorld.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorld.java (90%) rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl$$picoActivator.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl$$injectionActivator.java (50%) rename pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl.java => inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl.java (72%) rename pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.Application => inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.Application (89%) rename pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.ModuleComponent => inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.ModuleComponent (84%) rename {pico => inject}/tests/tck-jsr330/pom.xml (84%) rename {pico/tests/tck-jsr330/src/test/java/io/helidon/pico => inject/tests/tck-jsr330/src/test/java/io/helidon/inject}/tests/tck/jsr330/Jsr330TckTest.java (85%) rename {pico => inject}/tools/README.md (77%) rename {pico => inject}/tools/etc/spotbugs/exclude.xml (75%) rename {pico => inject}/tools/pom.xml (92%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/AbstractCreator.java (84%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/AbstractFilerMessager.java (99%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCodeGenDetailBlueprint.java (84%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCreatorArgsBlueprint.java (93%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCreatorCodeGenBlueprint.java (84%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCreatorConfigOptionsBlueprint.java (74%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCreatorDefault.java (95%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCreatorProvider.java (91%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCreatorRequestBlueprint.java (82%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ActivatorCreatorResponseBlueprint.java (85%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ApplicationCreatorCodeGenBlueprint.java (87%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ApplicationCreatorConfigOptionsBlueprint.java (94%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ApplicationCreatorDefault.java (86%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ApplicationCreatorRequestBlueprint.java (87%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ApplicationCreatorResponseBlueprint.java (77%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CodeGenFiler.java (93%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CodeGenInterceptorRequestBlueprint.java (88%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CodeGenPathsBlueprint.java (94%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CodeGenUtils.java (88%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CommonUtils.java (93%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CompilerOptionsBlueprint.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CustomAnnotationTemplateRequestBlueprint.java (89%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CustomAnnotationTemplateResponseBlueprint.java (88%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/CustomAnnotationTemplateResponses.java (98%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ExternalModuleCreatorDefault.java (81%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ExternalModuleCreatorRequestBlueprint.java (85%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ExternalModuleCreatorResponseBlueprint.java (78%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/GeneralCodeGenDetailBlueprint.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/GeneralCodeGenNamesBlueprint.java (84%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/GeneralCreatorRequestBlueprint.java (98%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/GeneralCreatorResponseBlueprint.java (98%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/GenericTemplateCreator.java (86%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/GenericTemplateCreatorRequestBlueprint.java (99%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/IdAndToString.java (98%) rename pico/tools/src/main/java/io/helidon/pico/tools/PicoSupported.java => inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java (86%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/InterceptedElementBlueprint.java (68%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/InterceptionPlanBlueprint.java (93%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/InterceptorCreatorDefault.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/InterceptorCreatorProvider.java (91%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/InterceptorCreatorResponseBlueprint.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/JavaC.java (99%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/Messager.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/MethodElementInfoBlueprint.java (87%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleDetailBlueprint.java (92%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleInfoCreatorRequestBlueprint.java (76%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleInfoDescriptorBlueprint.java (96%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleInfoDescriptorSupport.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleInfoItemBlueprint.java (98%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleInfoOrdering.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleInfoUtil.java (99%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ModuleUtils.java (92%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/Options.java (78%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/PermittedProviderType.java (85%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ReflectionHandler.java (96%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ServicesToProcess.java (97%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/TemplateHelper.java (91%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/ToolsException.java (92%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/TypeNames.java (82%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/TypeTools.java (96%) rename {pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox => inject/tools/src/main/java/io/helidon/inject/tools}/package-info.java (83%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/spi/ActivatorCreator.java (67%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/spi/ApplicationCreator.java (72%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/spi/CustomAnnotationTemplateCreator.java (84%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/spi/ExternalModuleCreator.java (63%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/spi/InterceptorCreator.java (88%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/spi/ModuleComponentNamer.java (82%) rename {pico/tools/src/main/java/io/helidon/pico => inject/tools/src/main/java/io/helidon/inject}/tools/spi/package-info.java (94%) create mode 100644 inject/tools/src/main/java/module-info.java rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/interface-based-interceptor.hbs (89%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/module-info.hbs (100%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/no-arg-based-interceptor.hbs (89%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/service-provider-activator.hbs (93%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/service-provider-application-empty-servicetypebinding.hbs (100%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/service-provider-application-servicetypebinding.hbs (100%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/service-provider-application-stub.hbs (85%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/service-provider-application.hbs (94%) rename {pico/tools/src/main/resources/templates/pico => inject/tools/src/main/resources/templates/inject}/default/service-provider-module.hbs (94%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/AbstractBaseCreator.java (96%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/ActivatorCreatorDefaultTest.java (88%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/ApplicationCreatorDefaultTest.java (83%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/ExternalModuleCreatorDefaultTest.java (91%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/InterceptorCreatorDefaultTest.java (79%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/ModuleInfoDescriptorTest.java (91%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/TemplateHelperTest.java (97%) rename {pico/tools/src/test/java/io/helidon/pico => inject/tools/src/test/java/io/helidon/inject}/tools/TypeToolsTest.java (94%) rename pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorld.java => inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorld.java (85%) rename pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorldImpl.java => inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorldImpl.java (77%) rename pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorld.java => inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorld.java (90%) rename pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorldImpl.java => inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorldImpl.java (72%) rename {pico => inject}/tools/src/test/resources/testsubjects/m0._java_ (50%) rename nima/fault-tolerance/processor/src/main/resources/templates/{pico => inject}/nima/circuit-breaker-method.java.hbs (100%) rename nima/fault-tolerance/processor/src/main/resources/templates/{pico => inject}/nima/fallback-method.java.hbs (100%) rename nima/fault-tolerance/processor/src/main/resources/templates/{pico => inject}/nima/retry-method.java.hbs (100%) delete mode 100644 pico/README.md delete mode 100644 pico/configdriven/runtime/README.md delete mode 100644 pico/configdriven/tests/configuredby-application/README.md delete mode 100644 pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/package-info.java delete mode 100644 pico/maven-plugin/README.md delete mode 100644 pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/package-info.java delete mode 100644 pico/processor/src/main/java/io/helidon/pico/processor/package-info.java delete mode 100644 pico/processor/src/test/resources/META-INF/services/io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator delete mode 100644 pico/runtime/README.md delete mode 100644 pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/package-info.java delete mode 100644 pico/tests/resources-pico/src/test/resources/expected/module-info.java._pico_ delete mode 100644 pico/tests/resources-pico/src/test/resources/expected/tests-module-info.java._pico_ delete mode 100644 pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Application.java delete mode 100644 pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoImpl$$picoActivator.java delete mode 100644 pico/tools/src/main/java/io/helidon/pico/tools/package-info.java delete mode 100644 pico/tools/src/main/java/module-info.java diff --git a/bom/pom.xml b/bom/pom.xml index c02d198d0d2..54b900ae3ce 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -1388,56 +1388,56 @@ ${helidon.version} - + - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api ${helidon.version} - io.helidon.pico - helidon-pico-tools + io.helidon.inject + helidon-inject-tools ${helidon.version} - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin ${helidon.version} - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing ${helidon.version} - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime ${helidon.version} - + - io.helidon.pico.configdriven - helidon-pico-configdriven-api + io.helidon.inject.configdriven + helidon-inject-configdriven-api ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} - + io.helidon.integrations.oci.sdk helidon-integrations-oci-sdk-processor diff --git a/common/processor/processor/src/main/java/io/helidon/common/processor/GeneratedAnnotationHandler.java b/common/processor/processor/src/main/java/io/helidon/common/processor/GeneratedAnnotationHandler.java index 30b0eafd313..b20bc00af4a 100644 --- a/common/processor/processor/src/main/java/io/helidon/common/processor/GeneratedAnnotationHandler.java +++ b/common/processor/processor/src/main/java/io/helidon/common/processor/GeneratedAnnotationHandler.java @@ -90,7 +90,7 @@ public static String createString(TypeName generator, .toString(); } - // @Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", comments = "version=1") + // @Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", comments = "version=1") private static class DefaultProvider implements GeneratedAnnotationProvider { private static final TypeName GENERATED = TypeName.create("io.helidon.common.Generated"); diff --git a/config/config/pom.xml b/config/config/pom.xml index 41ddf7a4087..2d82c08e3ef 100644 --- a/config/config/pom.xml +++ b/config/config/pom.xml @@ -59,12 +59,12 @@ helidon-logging-jul - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime true @@ -127,8 +127,8 @@ ${helidon.version} - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} @@ -142,8 +142,8 @@ - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} diff --git a/config/config/src/main/java/io/helidon/config/ConfigProducer.java b/config/config/src/main/java/io/helidon/config/ConfigProducer.java index c84e74c036e..f05137f0632 100644 --- a/config/config/src/main/java/io/helidon/config/ConfigProducer.java +++ b/config/config/src/main/java/io/helidon/config/ConfigProducer.java @@ -25,7 +25,7 @@ import io.helidon.common.config.ConfigValue; import io.helidon.common.config.GlobalConfig; import io.helidon.config.spi.ConfigSource; -import io.helidon.pico.api.ExternalContracts; +import io.helidon.inject.api.ExternalContracts; import jakarta.inject.Inject; import jakarta.inject.Provider; diff --git a/config/config/src/main/java/io/helidon/config/spi/ConfigSource.java b/config/config/src/main/java/io/helidon/config/spi/ConfigSource.java index 5516fa34dce..59829aa6974 100644 --- a/config/config/src/main/java/io/helidon/config/spi/ConfigSource.java +++ b/config/config/src/main/java/io/helidon/config/spi/ConfigSource.java @@ -20,7 +20,7 @@ import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * {@link Source} of configuration. diff --git a/config/config/src/main/java/module-info.java b/config/config/src/main/java/module-info.java index 236845d6f49..b9d4cb37964 100644 --- a/config/config/src/main/java/module-info.java +++ b/config/config/src/main/java/module-info.java @@ -34,10 +34,10 @@ requires transitive io.helidon.common; requires transitive io.helidon.common.media.type; - requires io.helidon.pico.api; + requires io.helidon.inject.api; requires static io.helidon.common.features.api; - requires static io.helidon.pico.runtime; + requires static io.helidon.inject.runtime; requires static jakarta.inject; @@ -57,8 +57,8 @@ with io.helidon.config.PropertiesConfigParser; provides io.helidon.common.config.spi.ConfigProvider with io.helidon.config.HelidonConfigProvider; - provides io.helidon.pico.api.ModuleComponent - with io.helidon.config.Pico$$Module; + provides io.helidon.inject.api.ModuleComponent + with io.helidon.config.Injection$$Module; // needed when running with modules - to make private methods accessible opens io.helidon.config to weld.core.impl, io.helidon.microprofile.cdi; diff --git a/config/tests/service-registry/pom.xml b/config/tests/service-registry/pom.xml index 528301f45cd..680d052dda0 100644 --- a/config/tests/service-registry/pom.xml +++ b/config/tests/service-registry/pom.xml @@ -39,8 +39,8 @@ jakarta.inject-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime io.helidon.config @@ -48,8 +48,8 @@ test - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test @@ -72,8 +72,8 @@ - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} diff --git a/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/ConfigProducerTest.java b/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/ConfigProducerTest.java index a958458ec1c..19c0badf958 100644 --- a/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/ConfigProducerTest.java +++ b/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/ConfigProducerTest.java @@ -20,9 +20,9 @@ import io.helidon.common.config.Config; import io.helidon.common.config.GlobalConfig; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.testing.PicoTestingSupport; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.testing.InjectionTestingSupport; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.MethodOrderer; @@ -37,18 +37,18 @@ class ConfigProducerTest { @AfterEach void reset() { - PicoTestingSupport.resetAll(); + InjectionTestingSupport.resetAll(); } @Test @Order(0) // this must be first, as once we set global config, this method will always fail void testConfig() { - PicoServices.globalBootstrap(Bootstrap.builder() + InjectionServices.globalBootstrap(Bootstrap.builder() .config(GlobalConfig.config()) .build()); // value should be overridden using our custom config source - Config config = PicoServices.realizedServices() + Config config = InjectionServices.realizedServices() .lookup(Config.class) .get(); @@ -61,11 +61,11 @@ void testExplicitConfig() { // value should use the config as we provided it GlobalConfig.config(io.helidon.config.Config::create, true); - PicoServices.globalBootstrap(Bootstrap.builder() + InjectionServices.globalBootstrap(Bootstrap.builder() .config(GlobalConfig.config()) .build()); - Config config = PicoServices.realizedServices() + Config config = InjectionServices.realizedServices() .lookup(Config.class) .get(); diff --git a/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/TestConfigSource.java b/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/TestConfigSource.java index e82a4984a46..6769a3ceb99 100644 --- a/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/TestConfigSource.java +++ b/config/tests/service-registry/src/test/java/io/helidon/config/tests/service/registry/TestConfigSource.java @@ -24,7 +24,7 @@ import io.helidon.config.spi.ConfigNode; import io.helidon.config.spi.ConfigSource; import io.helidon.config.spi.NodeConfigSource; -import io.helidon.pico.api.ExternalContracts; +import io.helidon.inject.api.ExternalContracts; import jakarta.inject.Singleton; diff --git a/config/tests/service-registry/src/test/resources/application.yaml b/config/tests/service-registry/src/test/resources/application.yaml index dafcabdd7a7..a0154957f7d 100644 --- a/config/tests/service-registry/src/test/resources/application.yaml +++ b/config/tests/service-registry/src/test/resources/application.yaml @@ -17,6 +17,6 @@ app.value: "file" # needed to reset state of service registry in test -pico: +inject: permits-dynamic: true service-lookup-caching: true diff --git a/docs/nima/pico/pico_intro.adoc b/docs/nima/inject/injection_intro.adoc similarity index 50% rename from docs/nima/pico/pico_intro.adoc rename to docs/nima/inject/injection_intro.adoc index 31f21362e16..2d447baed22 100644 --- a/docs/nima/pico/pico_intro.adoc +++ b/docs/nima/inject/injection_intro.adoc @@ -16,9 +16,9 @@ /////////////////////////////////////////////////////////////////////////////// -= Helidon Pico -:description: about Helidon Pico -:keywords: helidon, java, microservices, reactive, virtual threads += Helidon Injection +:description: about Helidon Injection +:keywords: helidon, inject, injection, java, microservices, reactive, virtual threads @@ -36,63 +36,63 @@ == Overview -Helidon Pico //explain what it is and what it can do. +Helidon Injection //explain what it is and what it can do. == Maven Coordinates -To enable Pico add the following dependencies to your project's `pom.xml` (see Managing Dependencies). +To enable Injection add the following dependencies to your project's `pom.xml` (see Managing Dependencies). -.Pico dependencies +.Injection dependencies [source,java] ---- - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api ${helidon.version} - io.helidon.pico - helidon-pico-types + io.helidon.inject + helidon-inject-types ${helidon.version} ---- == Usage -Once you have planned how each of your resources should support Pico, you specify the Pico behavior in one of two ways: +Once you have planned how each of your resources should support Injection, you specify the behavior in one of two ways: == API -Adding Pico behavior to your Helidon Níma application involves just a few simple steps. +Adding Ijection behavior to your Helidon Níma application involves just a few simple steps. === Maven Coordinates -.Pico API pom.xml +.Injection API pom.xml [source, java] ---- - helidon-pico-api - Helidon Pico API + helidon-inject-inject + Helidon Injection API ---- === Types -The Pico API provides types that are generally useful at compile time to assign special meaning to the type. In this way it also helps with readability and intentions of the code itself. +The Injection API provides types that are generally useful at compile time to assign special meaning to the type. In this way it also helps with readability and intentions of the code itself. -.Pico types pom.xml +.Injection types pom.xml [source, java] ---- - helidon-pico-types - Helidon Pico Types + helidon-inject-types + Helidon Injection Types ---- - * {@link io.helidon.pico.api.Contract} - signifies that the type can be used for lookup in the service registry. - * {@link io.helidon.pico.api.ExternalContracts} - same as Contract, but applied to the implementation class instead. - * {@link io.helidon.pico.api.RunLevel} - ascribes meaning for when the service should start. + * {@link io.helidon.inject.api.Contract} - signifies that the type can be used for lookup in the service registry. + * {@link io.helidon.inject.api.ExternalContracts} - same as Contract, but applied to the implementation class instead. + * {@link io.helidon.inject.api.RunLevel} - ascribes meaning for when the service should start. @@ -101,16 +101,12 @@ The Pico API provides types that are generally useful at compile time to assign == Configuration -Pico Config builder +Injection Config builder == Examples -//optional +//optional == Additional Information - - - - diff --git a/docs/sitegen.yaml b/docs/sitegen.yaml index 71ea1b83bd0..9f6f34596e1 100644 --- a/docs/sitegen.yaml +++ b/docs/sitegen.yaml @@ -98,13 +98,13 @@ backend: - "tracing.adoc" - "webclient.adoc" - type: "MENU" - title: "Pico" - dir: "pico" + title: "Injection" + dir: "inject" glyph: type: "icon" - value: "explore" + value: "explore" sources: - - "pico_intro.adoc" + - "injection_intro.adoc" - type: "MENU" title: "Config" dir: "config" @@ -174,7 +174,7 @@ backend: sources: - "oci.adoc" - "hcv.adoc" - - "neo4j.adoc" + - "neo4j.adoc" - type: "MENU" title: "Metrics" dir: "metrics" @@ -325,13 +325,13 @@ backend: source: "aot.adoc" glyph: type: "icon" - value: "save" + value: "save" - type: "PAGE" title: "GraphQL Server" source: "graphql.adoc" glyph: type: "icon" - value: "graphic_eq" + value: "graphic_eq" - type: "MENU" title: "gRPC" dir: "grpc" @@ -357,7 +357,7 @@ backend: - "oci.adoc" - "hcv.adoc" - "jedis.adoc" - - "neo4j.adoc" + - "neo4j.adoc" - type: "MENU" title: "JAX-RS/Jersey" dir: "jaxrs" @@ -373,13 +373,13 @@ backend: source: "jwt.adoc" glyph: type: "icon" - value: "verified_user" + value: "verified_user" - type: "PAGE" title: "Long Running Actions (LRA)" source: "lra.adoc" glyph: type: "icon" - value: "pending_actions" + value: "pending_actions" - type: "MENU" title: "Metrics" dir: "metrics" @@ -400,7 +400,7 @@ backend: sources: - "openapi.adoc" - "openapi-generator.adoc" - - "openapi-ui.adoc" + - "openapi-ui.adoc" - type: "PAGE" title: "Persistence" source: "persistence.adoc" @@ -440,7 +440,7 @@ backend: source: "scheduling.adoc" glyph: type: "icon" - value: "access_alarm" + value: "access_alarm" - type: "MENU" title: "Security" dir: "security" @@ -457,7 +457,7 @@ backend: source: "server.adoc" glyph: type: "icon" - value: "settings_ethernet" + value: "settings_ethernet" - type: "MENU" title: "Testing" glyph: @@ -477,7 +477,7 @@ backend: source: "websocket.adoc" glyph: type: "icon" - value: "sync_alt" + value: "sync_alt" - type: "GROUP" title: "Helidon SE" dir: "se" @@ -580,7 +580,7 @@ backend: sources: - "oci.adoc" - "hcv.adoc" - - "neo4j.adoc" + - "neo4j.adoc" - type: "MENU" title: "Metrics" dir: "metrics" diff --git a/etc/checkstyle-suppressions.xml b/etc/checkstyle-suppressions.xml index 04c6792b6d4..c9310d82fe8 100644 --- a/etc/checkstyle-suppressions.xml +++ b/etc/checkstyle-suppressions.xml @@ -95,14 +95,14 @@ - + - - - diff --git a/etc/copyright-exclude.txt b/etc/copyright-exclude.txt index b8ccd79e429..39643e9ff88 100644 --- a/etc/copyright-exclude.txt +++ b/etc/copyright-exclude.txt @@ -63,4 +63,4 @@ persistence_3_0.xsd # excluded as this is a test file and we need to validate its content src/test/resources/static/classpath/index.html ._java_ -._pico_ +._inject_ diff --git a/examples/pico/README.md b/examples/inject/README.md similarity index 84% rename from examples/pico/README.md rename to examples/inject/README.md index ebec97c4343..19ad7bd4504 100644 --- a/examples/pico/README.md +++ b/examples/inject/README.md @@ -1,8 +1,8 @@ -# Helidon Pico Examples +# Helidon Injection Examples Each subdirectory contains example code that highlights specific aspects of -Helidon Pico. +Helidon Injection. Suggested path to follow: 1. [basics](./basics) diff --git a/examples/pico/application/README.md b/examples/inject/application/README.md similarity index 61% rename from examples/pico/application/README.md rename to examples/inject/application/README.md index 2d68bb49021..ae4f3347478 100644 --- a/examples/pico/application/README.md +++ b/examples/inject/application/README.md @@ -1,17 +1,17 @@ -# Helidon Pico Application Example +# Helidon Injection Application Example -This example shows how a multi-module application can be created using Helidon Pico. The -[Main.java](./src/main/java/io/helidon/examples/pico/application/Main.java) class shows: +This example shows how a multi-module application can be created using Helidon Injection. The +[Main.java](./src/main/java/io/helidon/examples/inject/application/Main.java) class shows: * multi-module usage (i.e., this module amalgamates [basics](../basics), [providers](../providers), [configdriven](../configdriven), and [interceptors](../interceptors) ). -* compile-time generation of the DI model for the entire multi-module project using the _pico-maven-plugin_ (see [pom.xml](./pom.xml)). -* TestingSupport in [ApplicationTest](src/test/java/io/helidon/examples/pico/application/PicoApplicationTest.java) +* compile-time generation of the DI model for the entire multi-module project using the _inject-maven-plugin_ (see [pom.xml](./pom.xml)). +* TestingSupport in [ApplicationTest](src/test/java/io/helidon/examples/inject/application/InjectionApplicationTest.java) ## Build and run ```bash mvn package -java -jar target/helidon-examples-pico-application.jar +java -jar target/helidon-examples-inject-application.jar ``` Expected Output: @@ -20,7 +20,7 @@ Startup service providers (ranked according to weight, pre-activated): [ToolBox: Highest weighted service provider: NailGun:INIT ----- Nail Gun: (nail provider=NailProvider:INIT); initialized -Highest weighted service provider (after activation): io.helidon.examples.pico.providers.NailGun@7cbd9d24 +Highest weighted service provider (after activation): io.helidon.examples.inject.providers.NailGun@7cbd9d24 ----- Preferred Big Tool: Big Hammer Optional Little Hammer: Optional[Little Hammer] @@ -36,15 +36,15 @@ HandSaw:INIT NailGun:ACTIVE TableSaw:INIT ----- -io.helidon.examples.pico.providers.CircularSaw:: will be injected with Optional.empty +io.helidon.examples.inject.providers.CircularSaw:: will be injected with Optional.empty Circular Saw: (blade=null); initialized -io.helidon.examples.pico.providers.TableSaw:: will be injected with Optional[LARGE Blade] +io.helidon.examples.inject.providers.TableSaw:: will be injected with Optional[LARGE Blade] Table Saw: (blade=LARGE Blade); initialized All service providers (after all activations): [ToolBox:ACTIVE, CircularSaw:ACTIVE, NailGun:ACTIVE, TableSaw:ACTIVE] ----- Service lookup count: 2 ``` -While the output of this example may look similar to the previous [providers](../providers) example, the implementation is different since this example builds (at compile time) [Application.java](target/generated-sources/annotations/io/helidon/examples/pico/application/Pico$$Application.java). This establishes direct bindings to each and every injection point in your application avoiding runtime resolution with the exception for truly dynamic runtime providers (i.e., anything that is config-driven services or _Provider_ type implementations). +While the output of this example may look similar to the previous [providers](../providers) example, the implementation is different since this example builds (at compile time) [Application.java](target/generated-sources/annotations/io/helidon/examples/inject/application/Injection$$Application.java). This establishes direct bindings to each and every injection point in your application avoiding runtime resolution with the exception for truly dynamic runtime providers (i.e., anything that is config-driven services or _Provider_ type implementations). -Note that the lookup count is 2 based upon the direct lookup calls used in the delegated [Main](../basics/src/main/java/io/helidon/examples/pico/basics/Main.java). +Note that the lookup count is 2 based upon the direct lookup calls used in the delegated [Main](../basics/src/main/java/io/helidon/examples/inject/basics/Main.java). diff --git a/examples/pico/application/pom.xml b/examples/inject/application/pom.xml similarity index 78% rename from examples/pico/application/pom.xml rename to examples/inject/application/pom.xml index 6d69509e3d1..5d01aa58162 100644 --- a/examples/pico/application/pom.xml +++ b/examples/inject/application/pom.xml @@ -26,27 +26,27 @@ 4.0.0-SNAPSHOT ../../../applications/nima/pom.xml - io.helidon.examples.pico - helidon-examples-pico-application - Helidon Pico Examples Application + io.helidon.examples.inject + helidon-examples-inject-application + Helidon Injection Examples Application - Example usages of a Pico Application. + Example usages of an Injection Application. - io.helidon.examples.pico.providers.Main + io.helidon.examples.inject.providers.Main - io.helidon.examples.pico - helidon-examples-pico-providers + io.helidon.examples.inject + helidon-examples-inject-providers ${helidon.version} - io.helidon.examples.pico - helidon-examples-pico-configdriven + io.helidon.examples.inject + helidon-examples-inject-configdriven ${helidon.version} @@ -65,8 +65,8 @@ test - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test @@ -74,8 +74,8 @@ - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin ${helidon.version} @@ -94,12 +94,12 @@ - io.helidon.examples.pico.application + io.helidon.examples.inject.application NAMED - io.helidon.examples.pico.providers.BladeProvider - io.helidon.examples.pico.providers.NailProvider + io.helidon.examples.inject.providers.BladeProvider + io.helidon.examples.inject.providers.NailProvider diff --git a/examples/pico/application/src/main/java/io/helidon/examples/pico/application/Main.java b/examples/inject/application/src/main/java/io/helidon/examples/inject/application/Main.java similarity index 69% rename from examples/pico/application/src/main/java/io/helidon/examples/pico/application/Main.java rename to examples/inject/application/src/main/java/io/helidon/examples/inject/application/Main.java index e1226b1246b..0ceb4a7fb74 100644 --- a/examples/pico/application/src/main/java/io/helidon/examples/pico/application/Main.java +++ b/examples/inject/application/src/main/java/io/helidon/examples/inject/application/Main.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.examples.pico.application; +package io.helidon.examples.inject.application; -import io.helidon.pico.api.Metrics; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.Metrics; +import io.helidon.inject.api.InjectionServices; /** - * Application example. Uses the same {@code main()} as {@link io.helidon.examples.pico.basics.Main}. + * Application example. Uses the same {@code main()} as {@link io.helidon.examples.inject.basics.Main}. */ -public class Main extends io.helidon.examples.pico.basics.Main { +public class Main extends io.helidon.examples.inject.basics.Main { /** * Executes the example. @@ -30,9 +30,9 @@ public class Main extends io.helidon.examples.pico.basics.Main { * @param args arguments */ public static void main(String... args) { - io.helidon.examples.pico.basics.Main.main(args); + io.helidon.examples.inject.basics.Main.main(args); - Metrics metrics = PicoServices.picoServices().orElseThrow().metrics().get(); + Metrics metrics = InjectionServices.injectionServices().orElseThrow().metrics().get(); System.out.println("Service lookup count: " + metrics.lookupCount().get()); } diff --git a/examples/pico/application/src/main/java/io/helidon/examples/pico/application/package-info.java b/examples/inject/application/src/main/java/io/helidon/examples/inject/application/package-info.java similarity index 84% rename from examples/pico/application/src/main/java/io/helidon/examples/pico/application/package-info.java rename to examples/inject/application/src/main/java/io/helidon/examples/inject/application/package-info.java index 27ac09e0919..e63973db58d 100644 --- a/examples/pico/application/src/main/java/io/helidon/examples/pico/application/package-info.java +++ b/examples/inject/application/src/main/java/io/helidon/examples/inject/application/package-info.java @@ -15,6 +15,6 @@ */ /** - * Examples of multi-module Application generation in Pico. + * Examples of multi-module Application generation in Injection. */ -package io.helidon.examples.pico.application; +package io.helidon.examples.inject.application; diff --git a/examples/pico/application/src/main/resources/logging.properties b/examples/inject/application/src/main/resources/logging.properties similarity index 100% rename from examples/pico/application/src/main/resources/logging.properties rename to examples/inject/application/src/main/resources/logging.properties diff --git a/examples/pico/application/src/test/java/io/helidon/examples/pico/application/PicoApplicationTest.java b/examples/inject/application/src/test/java/io/helidon/examples/inject/application/InjectionApplicationTest.java similarity index 68% rename from examples/pico/application/src/test/java/io/helidon/examples/pico/application/PicoApplicationTest.java rename to examples/inject/application/src/test/java/io/helidon/examples/inject/application/InjectionApplicationTest.java index a3c45923dc0..31ccbdc289f 100644 --- a/examples/pico/application/src/test/java/io/helidon/examples/pico/application/PicoApplicationTest.java +++ b/examples/inject/application/src/test/java/io/helidon/examples/inject/application/InjectionApplicationTest.java @@ -14,33 +14,33 @@ * limitations under the License. */ -package io.helidon.examples.pico.application; +package io.helidon.examples.inject.application; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Services; -import io.helidon.pico.testing.PicoTestingSupport; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Services; +import io.helidon.inject.testing.InjectionTestingSupport; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; -class PicoApplicationTest { +class InjectionApplicationTest { - protected PicoServices picoServices; + protected InjectionServices injectionServices; protected Services services; @AfterAll static void tearDown() { - PicoTestingSupport.resetAll(); + InjectionTestingSupport.resetAll(); } protected void resetWith(Config config) { - PicoTestingSupport.resetAll(); - this.picoServices = testableServices(config); - this.services = picoServices.services(); + InjectionTestingSupport.resetAll(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @Test diff --git a/examples/pico/basics/README.md b/examples/inject/basics/README.md similarity index 52% rename from examples/pico/basics/README.md rename to examples/inject/basics/README.md index b91b7aae5ff..d5ab6a065d6 100644 --- a/examples/pico/basics/README.md +++ b/examples/inject/basics/README.md @@ -1,18 +1,18 @@ -# Helidon Pico Basic Example +# Helidon Injection Basic Example -This example shows the basics of using Helidon Pico. The -[Main.java](./src/main/java/io/helidon/examples/pico/basics/Main.java) class shows: +This example shows the basics of using Helidon Injection. The +[Main.java](src/main/java/io/helidon/examples/inject/basics/Main.java) class shows: -* programmatic lookup of services in Pico's Services registry in [Main](./src/main/java/io/helidon/examples/pico/basics/Main.java). -* declarative injection in [ToolBox.java](./src/main/java/io/helidon/examples/pico/basics/ToolBox.java). -* lifecycle via PostConstruct and RunLevel in [Main](./src/main/java/io/helidon/examples/pico/basics/Main.java). -* annotation processing and source code generation (see [pom.xml](pom.xml) and [generated-sources](./target/generated-sources/annotations/io/helidon/examples/pico/basics)). +* programmatic lookup of services in the _Services_ registry in [Main](src/main/java/io/helidon/examples/inject/basics/Main.java). +* declarative injection in [ToolBox.java](src/main/java/io/helidon/examples/inject/basics/ToolBox.java). +* lifecycle via PostConstruct and RunLevel in [Main](src/main/java/io/helidon/examples/inject/basics/Main.java). +* annotation processing and source code generation (see [pom.xml](pom.xml) and [generated-sources](target/generated-sources/annotations/io/helidon/examples/inject/basics)). ## Build and run ```bash mvn package -java -jar target/helidon-examples-pico-basics.jar +java -jar target/helidon-examples-inject-basics.jar ``` Expected Output: diff --git a/examples/pico/basics/pom.xml b/examples/inject/basics/pom.xml similarity index 74% rename from examples/pico/basics/pom.xml rename to examples/inject/basics/pom.xml index d8f944b91e6..b4022e9a3aa 100644 --- a/examples/pico/basics/pom.xml +++ b/examples/inject/basics/pom.xml @@ -26,26 +26,26 @@ 4.0.0-SNAPSHOT ../../../applications/nima/pom.xml - io.helidon.examples.pico - helidon-examples-pico-basics - Helidon Pico Examples Basics + io.helidon.examples.inject + helidon-examples-inject-basics + Helidon Injection Examples Basics - Examples of programmatic and declarative usages of Pico. + Examples of programmatic and declarative usages of Injection. - io.helidon.examples.pico.basics.Main + io.helidon.examples.inject.basics.Main - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime jakarta.annotation @@ -61,14 +61,14 @@ maven-compiler-plugin - -Apico.autoAddNonContractInterfaces=false - -Apico.debug=false + -Ainject.autoAddNonContractInterfaces=false + -inject.debug=false true - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Big.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Big.java similarity index 95% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Big.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Big.java index 974cb24d366..0ab0287d556 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Big.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Big.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/BigHammer.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/BigHammer.java similarity index 94% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/BigHammer.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/BigHammer.java index 39b3411f8dd..eab6cfaf221 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/BigHammer.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/BigHammer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; import jakarta.inject.Singleton; diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Hammer.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Hammer.java similarity index 93% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Hammer.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Hammer.java index 74b48ad093c..af4ccb73dfb 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Hammer.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Hammer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; import io.helidon.common.Weight; import io.helidon.common.Weighted; @@ -22,7 +22,7 @@ import jakarta.inject.Singleton; /** - * By adding the {@link Singleton} annotation results in Hammer becoming a Pico service. Services can be looked up + * By adding the {@link Singleton} annotation results in Hammer becoming a service. Services can be looked up * programmatically or declaratively injected via {@link jakarta.inject.Inject}. *

* Here {@link Weight} is used that is higher than the default, making it more preferred in weighted rankings. diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Little.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Little.java similarity index 95% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Little.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Little.java index 3d2b75b8da7..1eb289d4644 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Little.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Little.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/LittleHammer.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/LittleHammer.java similarity index 94% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/LittleHammer.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/LittleHammer.java index 7facc0ac59e..824712912b6 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/LittleHammer.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/LittleHammer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; import jakarta.inject.Singleton; diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Main.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Main.java similarity index 80% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Main.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Main.java index 6dd790a0dae..50007ddc5b6 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Main.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Main.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; import java.util.List; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; /** * Basics example. @@ -35,10 +35,10 @@ public class Main { * @param args arguments */ public static void main(String... args) { - Services services = PicoServices.realizedServices(); + Services services = InjectionServices.realizedServices(); - // 0. Demonstrates programmatic lookup from Pico's Services registry. - // 1. when a service is being managed by a DI provider (like Pico) it should be "looked up" or injected instead of new'ed + // 0. Demonstrates programmatic lookup from the Services registry. + // 1. when a service is being managed by a DI provider (like Helidon Injection) it should be "looked up" or injected instead of new'ed // 2. Notice we get a ServiceProvider - service providers allow for lazy initialization ServiceInfoCriteria criteria = ServiceInfoCriteria.builder() .runLevel(RunLevel.STARTUP) diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Tool.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Tool.java similarity index 90% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Tool.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Tool.java index 339ae70d629..5c72bee20d4 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/Tool.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/Tool.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * An example Tool interface contract. diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/ToolBox.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/ToolBox.java similarity index 92% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/ToolBox.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/ToolBox.java index 0d167aca57f..781b5f6efa6 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/ToolBox.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/ToolBox.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; import java.util.List; import java.util.Objects; @@ -22,7 +22,7 @@ import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.api.RunLevel; +import io.helidon.inject.api.RunLevel; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; @@ -30,7 +30,7 @@ import jakarta.inject.Singleton; /** - * By adding the {@link Singleton} annotation results in ToolBox becoming a Pico service. Services can be looked up + * By adding the {@link Singleton} annotation results in ToolBox becoming a service. Services can be looked up * programmatically or declaratively injected via {@link jakarta.inject.Inject}. *

* Here {@link Weight} is used that is higher than the default, making it more preferred in weighted rankings. @@ -43,7 +43,7 @@ public class ToolBox { private final List> allToolProviders; private Tool preferredBigTool; - // Pico field injection is supported for non-static, non-private methods (but not recommended) + // Field injection is supported for non-static, non-private methods (but not recommended) // Here we are using it to also showcase for Optional usages. @Inject Optional optionalLittleHammer; diff --git a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/package-info.java b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/package-info.java similarity index 85% rename from examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/package-info.java rename to examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/package-info.java index 92acf790e40..5ad11f7d68f 100644 --- a/examples/pico/basics/src/main/java/io/helidon/examples/pico/basics/package-info.java +++ b/examples/inject/basics/src/main/java/io/helidon/examples/inject/basics/package-info.java @@ -15,6 +15,6 @@ */ /** - * Examples of programmatic and declarative usages of Pico. + * Examples of programmatic and declarative usages of Injection. */ -package io.helidon.examples.pico.basics; +package io.helidon.examples.inject.basics; diff --git a/examples/pico/basics/src/main/resources/logging.properties b/examples/inject/basics/src/main/resources/logging.properties similarity index 100% rename from examples/pico/basics/src/main/resources/logging.properties rename to examples/inject/basics/src/main/resources/logging.properties diff --git a/examples/inject/configdriven/README.md b/examples/inject/configdriven/README.md new file mode 100644 index 00000000000..3ca9dfefbf2 --- /dev/null +++ b/examples/inject/configdriven/README.md @@ -0,0 +1,28 @@ +# Helidon Injection Config-Driven Example + +This example shows the basics of using Helidon Injection's Config-Driven Services. The +[Main.java](src/main/java/io/helidon/examples/inject/configdriven/Main.java) class shows: + +* setting up the bootstrap [configuration](./src/main/resources/application.yaml). +* [ConfigBean](src/main/java/io/helidon/examples/inject/configdriven/DrillConfig.java). +* [ConfiguredBy](src/main/java/io/helidon/examples/inject/configdriven/Drill.java) Services. +* annotation processing and source code generation (see [pom.xml](pom.xml) and [generated-sources](target/generated-sources/annotations/io/helidon/examples/inject/configdriven)). + +## Build and run + +```bash +mvn package +java -jar target/helidon-examples-inject-configdriven.jar +``` + +Expected Output: +``` +Preferred (highest weighted) 'Big' Tool: Big Hammer +Optional 'Little' Hammer: Optional[Little Hammer] +Tools in the virtual ToolBox: + tool: Hammer:INIT + tool: BigHammer:ACTIVE + tool: LittleHammer:ACTIVE + tool: Drill{Hand}:PENDING + tool: Drill{Impact}:PENDING +``` diff --git a/examples/pico/configdriven/pom.xml b/examples/inject/configdriven/pom.xml similarity index 80% rename from examples/pico/configdriven/pom.xml rename to examples/inject/configdriven/pom.xml index dfd4d2214ba..bdfa4cb820e 100644 --- a/examples/pico/configdriven/pom.xml +++ b/examples/inject/configdriven/pom.xml @@ -26,27 +26,27 @@ 4.0.0-SNAPSHOT ../../../applications/nima/pom.xml - io.helidon.examples.pico - helidon-examples-pico-configdriven - Helidon Pico Examples Config-Driven + io.helidon.examples.inject + helidon-examples-inject-configdriven + Helidon Injection Examples Config-Driven - Examples of Config-driven services in Pico. + Examples of Config-driven services in Injection. - io.helidon.examples.pico.configdriven.Main + io.helidon.examples.inject.configdriven.Main - io.helidon.examples.pico - helidon-examples-pico-basics + io.helidon.examples.inject + helidon-examples-inject-basics ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime io.helidon.config @@ -74,8 +74,8 @@ - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} @@ -93,8 +93,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} diff --git a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/Drill.java b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/Drill.java similarity index 88% rename from examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/Drill.java rename to examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/Drill.java index b5b66914dba..9c843790410 100644 --- a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/Drill.java +++ b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/Drill.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.examples.pico.configdriven; +package io.helidon.examples.inject.configdriven; import java.util.Objects; -import io.helidon.examples.pico.basics.Tool; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.examples.inject.basics.Tool; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; diff --git a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/DrillConfigBlueprint.java b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/DrillConfigBlueprint.java similarity index 90% rename from examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/DrillConfigBlueprint.java rename to examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/DrillConfigBlueprint.java index 07f231b172e..bf782b095da 100644 --- a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/DrillConfigBlueprint.java +++ b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/DrillConfigBlueprint.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.examples.pico.configdriven; +package io.helidon.examples.inject.configdriven; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; @ConfigBean(repeatable = true) @Prototype.Blueprint diff --git a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/Main.java b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/Main.java similarity index 76% rename from examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/Main.java rename to examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/Main.java index 1dc699ddf89..c6aabe88c2d 100644 --- a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/Main.java +++ b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/Main.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.examples.pico.configdriven; +package io.helidon.examples.inject.configdriven; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.examples.pico.basics.ToolBox; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Services; +import io.helidon.examples.inject.basics.ToolBox; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Services; /** * Config-driven example. @@ -34,7 +34,7 @@ public class Main { * @param args arguments */ public static void main(String... args) { - // we need to first initialize Pico - informing Pico where to find the application's Config + // we need to first initialize Injection - informing the framework where to find the application's Config Config config = Config.builder() .addSource(ConfigSources.classpath("application.yaml")) .disableSystemPropertiesSource() @@ -43,10 +43,10 @@ public static void main(String... args) { Bootstrap bootstrap = Bootstrap.builder() .config(config) .build(); - PicoServices.globalBootstrap(bootstrap); + InjectionServices.globalBootstrap(bootstrap); // this drives config-driven service activations (see the contents of the toolbox being output) - Services services = PicoServices.realizedServices(); + Services services = InjectionServices.realizedServices(); // this will trigger the PostConstruct method to display the contents of the toolbox services.lookupFirst(ToolBox.class).get(); diff --git a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/package-info.java b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/package-info.java similarity index 87% rename from pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/package-info.java rename to examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/package-info.java index 060a7a08863..54f3306b2c0 100644 --- a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/package-info.java +++ b/examples/inject/configdriven/src/main/java/io/helidon/examples/inject/configdriven/package-info.java @@ -15,6 +15,6 @@ */ /** - * Pico's config-driven-service API. + * Examples of Config-Driven Services. */ -package io.helidon.pico.configdriven.runtime; +package io.helidon.examples.inject.configdriven; diff --git a/examples/pico/configdriven/src/main/resources/application.yaml b/examples/inject/configdriven/src/main/resources/application.yaml similarity index 98% rename from examples/pico/configdriven/src/main/resources/application.yaml rename to examples/inject/configdriven/src/main/resources/application.yaml index 4c37d537241..45b8e6e8af8 100644 --- a/examples/pico/configdriven/src/main/resources/application.yaml +++ b/examples/inject/configdriven/src/main/resources/application.yaml @@ -15,7 +15,7 @@ # # these are only needed for unit testing - if there is a repeated setup and tear down, etc. -pico: +inject: permits-dynamic: true drill: diff --git a/examples/pico/configdriven/src/main/resources/logging.properties b/examples/inject/configdriven/src/main/resources/logging.properties similarity index 100% rename from examples/pico/configdriven/src/main/resources/logging.properties rename to examples/inject/configdriven/src/main/resources/logging.properties diff --git a/examples/inject/interceptors/README.md b/examples/inject/interceptors/README.md new file mode 100644 index 00000000000..6500a2dadc1 --- /dev/null +++ b/examples/inject/interceptors/README.md @@ -0,0 +1,21 @@ +# Helidon Injection Providers Example + +This example shows how interceptors can be leveraged to develop using Helidon Injection. The +[Main.java](./src/main/java/io/helidon/examples/inject/providers/Main.java) class shows: + +* Interception basics of Injection. + +## Build and run + +```bash +mvn package +java -jar target/helidon-examples-inject-interceptors.jar +``` + +Expected Output: +``` +Screw Driver (1st turn): +Screw Driver turning right +Screw Driver (2nd turn): +Screw Driver turning right +``` diff --git a/examples/pico/interceptors/pom.xml b/examples/inject/interceptors/pom.xml similarity index 83% rename from examples/pico/interceptors/pom.xml rename to examples/inject/interceptors/pom.xml index 990b5bce979..c3ae8a9321c 100644 --- a/examples/pico/interceptors/pom.xml +++ b/examples/inject/interceptors/pom.xml @@ -26,22 +26,22 @@ 4.0.0-SNAPSHOT ../../../applications/nima/pom.xml - io.helidon.examples.pico - helidon-examples-pico-interceptors - Helidon Pico Examples Interceptors + io.helidon.examples.inject + helidon-examples-inject-interceptors + Helidon Injection Examples Interceptors - Example usages of Pico Interceptors. + Example usages of Injection in Interceptors. - io.helidon.examples.pico.interceptors.Main + io.helidon.examples.inject.interceptors.Main - io.helidon.examples.pico - helidon-examples-pico-basics + io.helidon.examples.inject + helidon-examples-inject-basics ${helidon.version} @@ -70,8 +70,8 @@ true - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} diff --git a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/Main.java b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/Main.java similarity index 85% rename from examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/Main.java rename to examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/Main.java index ab9f6dd2176..5e0ae74355c 100644 --- a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/Main.java +++ b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/Main.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.examples.pico.interceptors; +package io.helidon.examples.inject.interceptors; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; /** * Interceptors example. @@ -31,7 +31,7 @@ public class Main { * @param args arguments */ public static void main(String... args) { - Services services = PicoServices.realizedServices(); + Services services = InjectionServices.realizedServices(); // use the intercepted screwdriver - note that hashCode(), equals(), and toString() are not intercepted ServiceProvider screwDriver = services.lookupFirst(ScrewDriver.class); diff --git a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/ScrewDriver.java b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/ScrewDriver.java similarity index 95% rename from examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/ScrewDriver.java rename to examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/ScrewDriver.java index f4f0eb0e26c..4b0e9420900 100644 --- a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/ScrewDriver.java +++ b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/ScrewDriver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.interceptors; +package io.helidon.examples.inject.interceptors; import jakarta.inject.Singleton; diff --git a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/Turn.java b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/Turn.java similarity index 87% rename from examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/Turn.java rename to examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/Turn.java index 54241cce136..d49bf1fbaee 100644 --- a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/Turn.java +++ b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/Turn.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.examples.pico.interceptors; +package io.helidon.examples.inject.interceptors; -import io.helidon.pico.api.InterceptedTrigger; +import io.helidon.inject.api.InterceptedTrigger; @InterceptedTrigger public @interface Turn { diff --git a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/TurnInterceptor.java b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/TurnInterceptor.java similarity index 85% rename from examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/TurnInterceptor.java rename to examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/TurnInterceptor.java index 8b53e52ed1b..74ee823a692 100644 --- a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/TurnInterceptor.java +++ b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/TurnInterceptor.java @@ -14,17 +14,18 @@ * limitations under the License. */ -package io.helidon.examples.pico.interceptors; +package io.helidon.examples.inject.interceptors; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.InvocationContext; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; import jakarta.inject.Singleton; @ClassNamed(Turn.class) @Singleton @SuppressWarnings("unused") -class TurnInterceptor implements io.helidon.pico.api.Interceptor { +class TurnInterceptor implements Interceptor { @Override @SuppressWarnings("unchecked") diff --git a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/TurningTool.java b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/TurningTool.java similarity index 84% rename from examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/TurningTool.java rename to examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/TurningTool.java index 3d3a296d469..128aa8ba0fc 100644 --- a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/TurningTool.java +++ b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/TurningTool.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.helidon.examples.pico.interceptors; +package io.helidon.examples.inject.interceptors; -import io.helidon.examples.pico.basics.Tool; -import io.helidon.pico.api.Contract; +import io.helidon.examples.inject.basics.Tool; +import io.helidon.inject.api.Contract; @Contract public interface TurningTool extends Tool { diff --git a/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/package-info.java b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/package-info.java new file mode 100644 index 00000000000..5acd84b9f97 --- /dev/null +++ b/examples/inject/interceptors/src/main/java/io/helidon/examples/inject/interceptors/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Examples of Intercepted services in Injection. + */ +package io.helidon.examples.inject.interceptors; diff --git a/examples/pico/interceptors/src/main/resources/logging.properties b/examples/inject/interceptors/src/main/resources/logging.properties similarity index 100% rename from examples/pico/interceptors/src/main/resources/logging.properties rename to examples/inject/interceptors/src/main/resources/logging.properties diff --git a/examples/pico/pom.xml b/examples/inject/pom.xml similarity index 89% rename from examples/pico/pom.xml rename to examples/inject/pom.xml index aaf8c818dd4..78b789a3ac9 100644 --- a/examples/pico/pom.xml +++ b/examples/inject/pom.xml @@ -25,10 +25,10 @@ helidon-examples-project 4.0.0-SNAPSHOT - io.helidon.examples.pico - helidon-examples-pico-project + io.helidon.examples.inject + helidon-examples-inject-project pom - Helidon Pico Examples + Helidon Injection Examples basics diff --git a/examples/pico/providers/README.md b/examples/inject/providers/README.md similarity index 62% rename from examples/pico/providers/README.md rename to examples/inject/providers/README.md index 3014fb949e4..408982af848 100644 --- a/examples/pico/providers/README.md +++ b/examples/inject/providers/README.md @@ -1,18 +1,18 @@ -# Helidon Pico Providers Example +# Helidon Injection Providers Example -This example shows how providers can be leveraged to develop using Helidon Pico. The -[Main.java](./src/main/java/io/helidon/examples/pico/providers/Main.java) class shows: +This example shows how providers can be leveraged to develop using Helidon Injection. The +[Main.java](./src/main/java/io/helidon/examples/inject/providers/Main.java) class shows: * multi-module usage (i.e., this example extends [basics](../basics)). -* [standard Providers](src/main/java/io/helidon/examples/pico/providers/NailProvider.java). -* [InjectionPoint Providers](src/main/java/io/helidon/examples/pico/providers/BladeProvider.java). +* [standard Providers](src/main/java/io/helidon/examples/inject/providers/NailProvider.java). +* [InjectionPoint Providers](src/main/java/io/helidon/examples/inject/providers/BladeProvider.java). * additional lifecycle examples via PostConstruct and RunLevel. ## Build and run ```bash mvn package -java -jar target/helidon-examples-pico-providers.jar +java -jar target/helidon-examples-inject-providers.jar ``` Expected Output: @@ -29,10 +29,10 @@ Tools in the virtual ToolBox: tool: HandSaw:INIT tool: NailGun:INIT tool: TableSaw:INIT -io.helidon.examples.pico.providers.CircularSaw:: will be injected with Optional.empty +io.helidon.examples.inject.providers.CircularSaw:: will be injected with Optional.empty Circular Saw: (blade=null); initialized Nail Gun: (nail provider=NailProvider:INIT); initialized -io.helidon.examples.pico.providers.TableSaw:: will be injected with Optional[LARGE Blade] +io.helidon.examples.inject.providers.TableSaw:: will be injected with Optional[LARGE Blade] Table Saw: (blade=LARGE Blade); initialized All service providers (after all activations): [ToolBox:ACTIVE, CircularSaw:ACTIVE, NailGun:ACTIVE, TableSaw:ACTIVE] ``` diff --git a/examples/pico/providers/pom.xml b/examples/inject/providers/pom.xml similarity index 79% rename from examples/pico/providers/pom.xml rename to examples/inject/providers/pom.xml index 3faf2de02d8..0f5a83629b9 100644 --- a/examples/pico/providers/pom.xml +++ b/examples/inject/providers/pom.xml @@ -26,22 +26,22 @@ 4.0.0-SNAPSHOT ../../../applications/nima/pom.xml - io.helidon.examples.pico - helidon-examples-pico-providers - Helidon Pico Examples Providers + io.helidon.examples.inject + helidon-examples-inject-providers + Helidon Injection Examples Providers - Example usages of Pico Providers. + Example usages of Injection Providers. - io.helidon.examples.pico.providers.Main + io.helidon.examples.inject.providers.Main - io.helidon.examples.pico - helidon-examples-pico-basics + io.helidon.examples.inject + helidon-examples-inject-basics ${helidon.version} @@ -69,13 +69,13 @@ true - -Apico.autoAddNonContractInterfaces=true - -Apico.debug=false + -Ainject.autoAddNonContractInterfaces=true + -Ainject.debug=false - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/AngleGrinderSaw.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/AngleGrinderSaw.java similarity index 92% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/AngleGrinderSaw.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/AngleGrinderSaw.java index a133dae5a49..ea9565c2caf 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/AngleGrinderSaw.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/AngleGrinderSaw.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.Optional; -import io.helidon.examples.pico.basics.Little; +import io.helidon.examples.inject.basics.Little; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Blade.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Blade.java similarity index 63% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Blade.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Blade.java index ab906b7021f..19ec44abb15 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Blade.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Blade.java @@ -14,12 +14,15 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; + +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.Services; /** - * Normally, one would need to place {@link io.helidon.pico.api.Contract} on interfaces. Here, however, we used - * {@code -Apico.autoAddNonContractInterfaces=true} in the {@code pom.xml} thereby making all interfaces into contracts that - * can be found via {@link io.helidon.pico.api.Services#lookup}. + * Normally, one would need to place {@link Contract} on interfaces. Here, however, we used + * {@code -Ainject.autoAddNonContractInterfaces=true} in the {@code pom.xml} thereby making all interfaces into contracts that + * can be found via {@link Services#lookup}. */ //@Contract public interface Blade { diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/BladeProvider.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/BladeProvider.java similarity index 84% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/BladeProvider.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/BladeProvider.java index c3c91407c6d..759cdcd1e36 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/BladeProvider.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/BladeProvider.java @@ -14,20 +14,20 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.lang.annotation.Annotation; import java.util.Collection; import java.util.Optional; import io.helidon.common.LazyValue; -import io.helidon.examples.pico.basics.Big; -import io.helidon.examples.pico.basics.Little; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; +import io.helidon.examples.inject.basics.Big; +import io.helidon.examples.inject.basics.Little; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; import jakarta.inject.Singleton; @@ -63,7 +63,7 @@ public Optional first(ContextualServiceQuery query) { static Optional logAndReturn(Optional result, ContextualServiceQuery query) { InjectionPointInfo ip = query.injectionPointInfo().orElse(null); - // note: a "regular" service lookup via Pico will not have an injection point associated with it + // note: a "regular" service lookup via Injection will not have an injection point associated with it if (ip != null) { System.out.println(ip.serviceTypeName() + "::" + ip.elementName() + " will be injected with " + result); } diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/CircularSaw.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/CircularSaw.java similarity index 93% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/CircularSaw.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/CircularSaw.java index e529ca3eb40..cb951417b6a 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/CircularSaw.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/CircularSaw.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.Optional; -import io.helidon.pico.api.RunLevel; +import io.helidon.inject.api.RunLevel; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/HandSaw.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/HandSaw.java similarity index 96% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/HandSaw.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/HandSaw.java index 07dff59e9bb..1a9961ec302 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/HandSaw.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/HandSaw.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.Optional; diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Main.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Main.java similarity index 81% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Main.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Main.java index 21d229b3aa4..9c706922311 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Main.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Main.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.List; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; /** * Providers example. @@ -35,7 +35,7 @@ public class Main { * @param args arguments */ public static void main(String... args) { - Services services = PicoServices.realizedServices(); + Services services = InjectionServices.realizedServices(); ServiceInfoCriteria criteria = ServiceInfoCriteria.builder() .runLevel(RunLevel.STARTUP) diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Nail.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Nail.java similarity index 63% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Nail.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Nail.java index c1ddcf9143e..b14c5f5837f 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Nail.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Nail.java @@ -14,12 +14,15 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; + +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.Services; /** - * Normally, one would need to place {@link io.helidon.pico.api.Contract} on interfaces. Here, however, we used - * {@code -Apico.autoAddNonContractInterfaces=true} in the {@code pom.xml} thereby making all interfaces into contracts that - * can be found via {@link io.helidon.pico.api.Services#lookup}. + * Normally, one would need to place {@link Contract} on interfaces. Here, however, we used + * {@code -Ainject.autoAddNonContractInterfaces=true} in the {@code pom.xml} thereby making all interfaces into contracts that + * can be found via {@link Services#lookup}. */ //@Contract public interface Nail { diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/NailGun.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/NailGun.java similarity index 83% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/NailGun.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/NailGun.java index 21921f20cd2..f19c713d616 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/NailGun.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/NailGun.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.Objects; -import io.helidon.examples.pico.basics.Tool; -import io.helidon.pico.api.RunLevel; +import io.helidon.examples.inject.basics.Tool; +import io.helidon.inject.api.RunLevel; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; @@ -43,7 +43,7 @@ public String name() { } /** - * This method will be called by Pico after this instance is lazily initialized (because this is the {@link PostConstruct} + * This method will be called by Injection after this instance is lazily initialized (because this is the {@link PostConstruct} * method). */ @PostConstruct diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/NailProvider.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/NailProvider.java similarity index 96% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/NailProvider.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/NailProvider.java index 77f54b7eac3..1d2bd7bfe6b 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/NailProvider.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/NailProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import jakarta.inject.Provider; import jakarta.inject.Singleton; diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Saw.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Saw.java similarity index 60% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Saw.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Saw.java index 317a85b5759..cb73214ea37 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/Saw.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/Saw.java @@ -14,14 +14,16 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; -import io.helidon.examples.pico.basics.Tool; +import io.helidon.examples.inject.basics.Tool; +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.Services; /** - * Normally, one would need to place {@link io.helidon.pico.api.Contract} on interfaces. Here, however, we used - * {@code -Apico.autoAddNonContractInterfaces=true} in the {@code pom.xml} thereby making all interfaces into contracts that - * can be found via {@link io.helidon.pico.api.Services#lookup}. + * Normally, one would need to place {@link Contract} on interfaces. Here, however, we used + * {@code -Ainject.autoAddNonContractInterfaces=true} in the {@code pom.xml} thereby making all interfaces into contracts that + * can be found via {@link Services#lookup}. */ //@Contract public interface Saw extends Tool { diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/SizedBlade.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/SizedBlade.java similarity index 95% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/SizedBlade.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/SizedBlade.java index 2593c5b6524..fdb830560b7 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/SizedBlade.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/SizedBlade.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.Objects; diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/StandardNail.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/StandardNail.java similarity index 95% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/StandardNail.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/StandardNail.java index 75103a3c842..00eb469c237 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/StandardNail.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/StandardNail.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.concurrent.atomic.AtomicInteger; diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/TableSaw.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/TableSaw.java similarity index 90% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/TableSaw.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/TableSaw.java index 006e59694eb..70f9bd2b9a5 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/TableSaw.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/TableSaw.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import java.util.Optional; -import io.helidon.examples.pico.basics.Big; -import io.helidon.pico.api.RunLevel; +import io.helidon.examples.inject.basics.Big; +import io.helidon.inject.api.RunLevel; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; diff --git a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/package-info.java b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/package-info.java similarity index 88% rename from pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/package-info.java rename to examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/package-info.java index 1eab772221e..fd932e1fa0b 100644 --- a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/package-info.java +++ b/examples/inject/providers/src/main/java/io/helidon/examples/inject/providers/package-info.java @@ -15,6 +15,6 @@ */ /** - * Pico Config-Driven processor. + * Examples of providers in Injection. */ -package io.helidon.pico.configdriven.processor; +package io.helidon.examples.inject.providers; diff --git a/examples/pico/providers/src/main/resources/logging.properties b/examples/inject/providers/src/main/resources/logging.properties similarity index 100% rename from examples/pico/providers/src/main/resources/logging.properties rename to examples/inject/providers/src/main/resources/logging.properties diff --git a/examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/AllenWrench.java b/examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/AllenWrench.java similarity index 94% rename from examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/AllenWrench.java rename to examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/AllenWrench.java index d984d1c61f0..e218d8c3245 100644 --- a/examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/AllenWrench.java +++ b/examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/AllenWrench.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; import jakarta.inject.Singleton; diff --git a/examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/ProvidersTest.java b/examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/ProvidersTest.java similarity index 86% rename from examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/ProvidersTest.java rename to examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/ProvidersTest.java index 880762ee70c..105f0e86bf0 100644 --- a/examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/ProvidersTest.java +++ b/examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/ProvidersTest.java @@ -14,14 +14,16 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; + +import io.helidon.examples.inject.basics.ToolBox; import org.junit.jupiter.api.Test; class ProvidersTest { /** - * Through testing, this will additionally have an {@link AllenWrench} in the {@link io.helidon.examples.pico.basics.ToolBox}. + * Through testing, this will additionally have an {@link AllenWrench} in the {@link ToolBox}. */ @Test void main() { diff --git a/examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/Wrench.java b/examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/Wrench.java similarity index 87% rename from examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/Wrench.java rename to examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/Wrench.java index f8cd0580ba2..247e00b3477 100644 --- a/examples/pico/providers/src/test/java/io/helidon/examples/pico/providers/Wrench.java +++ b/examples/inject/providers/src/test/java/io/helidon/examples/inject/providers/Wrench.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.examples.pico.providers; +package io.helidon.examples.inject.providers; -import io.helidon.examples.pico.basics.Tool; +import io.helidon.examples.inject.basics.Tool; public interface Wrench extends Tool { diff --git a/examples/nima/fault-tolerance/pom.xml b/examples/nima/fault-tolerance/pom.xml index 11792a43c8f..2bf32ffe9e6 100644 --- a/examples/nima/fault-tolerance/pom.xml +++ b/examples/nima/fault-tolerance/pom.xml @@ -47,16 +47,16 @@ helidon-nima-webclient - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime io.helidon.config @@ -92,8 +92,8 @@ true - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} @@ -108,7 +108,7 @@ - -Aio.helidon.pico.autoAddNonContractInterfaces=true + -Aio.helidon.inject.autoAddNonContractInterfaces=true --enable-preview diff --git a/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/GreetEndpoint.java b/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/GreetEndpoint.java index 8a3699bfea9..e41037e6a2f 100644 --- a/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/GreetEndpoint.java +++ b/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/GreetEndpoint.java @@ -20,8 +20,8 @@ import io.helidon.common.http.Endpoint; import io.helidon.common.http.Http; +import io.helidon.inject.api.InjectionException; import io.helidon.nima.faulttolerance.FaultTolerance; -import io.helidon.pico.api.PicoException; import jakarta.inject.Singleton; @@ -48,7 +48,7 @@ String greet() { @Endpoint.GET @Endpoint.Path("/{name}") @FaultTolerance.Retry(name = "someName", calls = 2, delayTime = 1, timeUnit = ChronoUnit.SECONDS, overallTimeout = 10, - applyOn = PicoException.class, skipOn = {OutOfMemoryError.class, StackOverflowError.class}) + applyOn = InjectionException.class, skipOn = {OutOfMemoryError.class, StackOverflowError.class}) @FaultTolerance.Fallback("greetNamedFallback") @FaultTolerance.CircuitBreaker @FaultTolerance.Bulkhead(name = "bulkhead-it") @@ -56,7 +56,7 @@ String greetNamed(@Endpoint.PathParam("name") String name, @Endpoint.QueryParam(value = "throw", defaultValue = "false") String shouldThrow, @Endpoint.HeaderParam(Http.Header.HOST_STRING) String hostHeader) { if ("true".equalsIgnoreCase(shouldThrow)) { - throw new PicoException("Failed on purpose"); + throw new InjectionException("Failed on purpose"); } return greeting + " " + name + "! Requested host: " + hostHeader; } diff --git a/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/PlatformExecutorProvider.java b/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/PlatformExecutorProvider.java index 86c6f1f1658..cb42af07f49 100644 --- a/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/PlatformExecutorProvider.java +++ b/examples/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/PlatformExecutorProvider.java @@ -27,8 +27,8 @@ import jakarta.inject.Singleton; /** - * This service will be part of Níma on Pico module. - * It may use pico to get config sources exposed through pico. + * This service will be part of Níma on Injection module. + * It may use Injection to get config sources exposed through pico. */ @Singleton @Named("platform-executor") diff --git a/examples/nima/fault-tolerance/src/main/resources/application.yaml b/examples/nima/fault-tolerance/src/main/resources/application.yaml index c0e37455eb5..6abff8840ca 100644 --- a/examples/nima/fault-tolerance/src/main/resources/application.yaml +++ b/examples/nima/fault-tolerance/src/main/resources/application.yaml @@ -27,5 +27,5 @@ fault-tolerance: executor-name: "platform-executor" other-name: executor-name: "abcd" -pico: - permits-dynamic: true \ No newline at end of file +inject: + permits-dynamic: true diff --git a/examples/nima/fault-tolerance/src/test/java/io/helidon/examples/nima/faulttolerance/FaultToleranceTest.java b/examples/nima/fault-tolerance/src/test/java/io/helidon/examples/nima/faulttolerance/FaultToleranceTest.java index 2bad56e5ee6..6a53912884f 100644 --- a/examples/nima/fault-tolerance/src/test/java/io/helidon/examples/nima/faulttolerance/FaultToleranceTest.java +++ b/examples/nima/fault-tolerance/src/test/java/io/helidon/examples/nima/faulttolerance/FaultToleranceTest.java @@ -22,11 +22,10 @@ import io.helidon.nima.webclient.http1.Http1Client; import io.helidon.nima.webclient.http1.Http1ClientResponse; import io.helidon.nima.webserver.WebServer; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.InjectionServices; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -41,7 +40,7 @@ class FaultToleranceTest { @BeforeAll static void init() { Main.main(new String[0]); - WebServer webServer = PicoServices.realizedServices() + WebServer webServer = InjectionServices.realizedServices() .lookup(WebServer.class) .get(); @@ -60,8 +59,8 @@ static void init() { @AfterAll static void shutDown() { - PicoServices.picoServices() - .map(PicoServices::shutdown); + InjectionServices.injectionServices() + .map(InjectionServices::shutdown); } @Test diff --git a/examples/pico/configdriven/README.md b/examples/pico/configdriven/README.md deleted file mode 100644 index 3d8dcd3f0a5..00000000000 --- a/examples/pico/configdriven/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Helidon Pico Config-Driven Example - -This example shows the basics of using Helidon Pico's Config-Driven Services. The -[Main.java](./src/main/java/io/helidon/examples/pico/configdriven/Main.java) class shows: - -* setting up the bootstrap [configuration](./src/main/resources/application.yaml). -* [ConfigBean](src/main/java/io/helidon/examples/pico/configdriven/DrillConfig.java). -* [ConfiguredBy](src/main/java/io/helidon/examples/pico/configdriven/Drill.java) Services. -* annotation processing and source code generation (see [pom.xml](pom.xml) and [generated-sources](./target/generated-sources/annotations/io/helidon/examples/pico/configdriven)). - -## Build and run - -```bash -mvn package -java -jar target/helidon-examples-pico-configdriven.jar -``` - -Expected Output: -``` -Preferred (highest weighted) 'Big' Tool: Big Hammer -Optional 'Little' Hammer: Optional[Little Hammer] -Tools in the virtual ToolBox: - tool: Hammer:INIT - tool: BigHammer:ACTIVE - tool: LittleHammer:ACTIVE - tool: Drill{Hand}:PENDING - tool: Drill{Impact}:PENDING -``` diff --git a/examples/pico/interceptors/README.md b/examples/pico/interceptors/README.md deleted file mode 100644 index 57e31529381..00000000000 --- a/examples/pico/interceptors/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Helidon Pico Providers Example - -This example shows how interceptors can be leveraged to develop using Helidon Pico. The -[Main.java](./src/main/java/io/helidon/examples/pico/providers/Main.java) class shows: - -* Interception basics of Pico. - -## Build and run - -```bash -mvn package -java -jar target/helidon-examples-pico-interceptors.jar -``` - -Expected Output: -``` -Screw Driver (1st turn): -Screw Driver turning right -Screw Driver (2nd turn): -Screw Driver turning right -``` diff --git a/examples/pom.xml b/examples/pom.xml index 0fb0437db20..21eab1e3159 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -64,7 +64,7 @@ metrics jbatch nima - pico + inject diff --git a/inject/README.md b/inject/README.md new file mode 100644 index 00000000000..74803065e63 --- /dev/null +++ b/inject/README.md @@ -0,0 +1,336 @@ +# helidon-inject + +Helidon Injection is an optional feature in Helidon. At its core it provides these main features: + +1. A service registry. The service registry holds service providers and are (or otherwise can produce) services. Each service provider in the registry advertises its meta-information for what each service provides, and what it requires in the way of dependencies. + +2. A lifecycle engine. Each service provider in the registry remains dormant until there is a "demand for activation". This "demand for activation" is also known as "lazy activation" that can come in different ways. One way is to simply "get" a service (or services) from the registry that matches the meta-information criteria you provide programmatically. If the service (or services) need other services as part of the activation then those services are chain activated, recursively. Helidon Injection provides graceful startup and shutdown at a micro service-level as well as at a macro application level for all services in the service registry. + +3. Integrations and Extensibility. More will be mentioned on this later. + +Over the foundation of these three main features of "services registry", "lifecycle", and "extensibility" there are a number of other tooling and layers that are delivered from various Injection submodules that provide the following additional features and benefits: + +1. A minimalist, compile-time generated dependency injection framework that is free from reflection, and compliant to the JSR-330 injection specification. Compile-time source code generation has a number of advantages, including: (a) pre-runtime validation of the DI model, (b) visibility into your application by providing "less magic", which in turn fosters understandability and debug-ability of your application, (c) deterministic behavior (instead of depending on reflection and classpath ordering, etc.) and (c) performance, since binding the model at compile-time is more efficient than computing it at runtime. Helidon Injection (through its tooling) provides you with a mix of declarative and programmatic ways to build your application. It doesn't have to be just one or the other like other popular frameworks in use today require. Inspiration for Helidon Injection, however, did come from many libraries and frameworks that came before it (e.g., Jakarta Hk2, Google Guice, Spring, CDI, and even OSGi). Foundationally, Injection provides a way to develop declarative code using standard (i.e., javax/jakarta, not Helidon specific) annotation types. + +2. Integrations. Blending services from different providers (e.g., Helidon services like WebServer, your application service, 3rd party service, etc.) becomes natural in the Injection framework, and enables you to build fully-integrated, feature-rich applications more easily. + +3. Extensibility. At the micro level developers can provide their own templates for things like code generation, or even provide an entirely different implementation from this reference implementation Helidon provides. At a macro level (and post the initial release), Injection will be providing a foundation to extend your Guice, Spring, Hk2, CDI, application naturally into one application runtime. The Helidon team fields a number of support questions that involve this area involving "battling DI frameworks" like CDI w/ Hk2. In time, Helidon Injection aims to smooth out this area through the integrations and extensibility features that it will be providing. + +4. Interception. Annotations are provided, that in conjunction with Helidon Injection's code-generation annotation processors, allow services in the service registry to support interception and decoration patterns - without the use of reflection at runtime, which is conducive to native image. + +*** +__Helidon Injection currently support Java 11+, using jakarta.inject or javax.inject, jakarta.annotations or javax.annotations.__ +*** + +The Helidon Team believes that the above features help developers achieve the following goals: +* More IoC options. With Helidon Injection... developers can choose to use an imperative coding style or a declarative IoC style previously only available with CDI using Helidon MP. At the initial release (Helidon 4.0), however, Injection will only be available with Helidon Nima support. +* Compile-time benefits. With Injection... developers can decide to use compile-time code generation into their build process, thereby statically and deterministically wiring their injection model while still enjoying the benefits of a declarative approach for writing their application. Added to this, all code-generated artifacts are in source form instead of bytecode thereby making your application more readable, understandable, consistent, and debuggable. Furthermore, DI model inconsistencies can be found during compile-time instead of at runtime. +* Improved performance. Pushing more into compile-time helps reduce what otherwise would need to occur (often times via reflection) to built/compile-time processing. Native code is generated that is further optimized by the compiler. Additionally, with lazy activation of services, only what is needed is activated. Anything not used may be in the classpath is available, but unless and until there is demand for those services they remain dormant. You control the lifecycle in your application code. +* Additional lifecycle options. Injection can handle micro, service-level activations for your services, as well as offer controlled shutdown if desired. + +Many DI frameworks start simple and over time become bloated with "bells and whistle" type features - the majority of which most developers don't need and will never use; especially in today's world of microservices where the application scope is the JVM process itself. + +*** +The Helidon Injection Framework is a reset back to basics, and perfect for such use cases requiring minimalism but yet still be extensible. This is why Injection intentionally chose to implement the earlier JSR-330 specification at its foundation. Application Scope == Singleton Scope in a microservices world. +*** + +Request and Session scopes are simply not made available in Helidon Injection. We believe that scoping is a recipe for undo complexity, confusion, and bugs for the many developers today. + +## Terminology +* DI - Dependency Injection. +* Inject - The assignment of a service instance to a field or method setter that has been annotated with @Inject - also referred to as an injection point. In Spring this would be referred to as 'Autowired'. +* Injection Plan - The act of determining how your application will resolve each injection point. In Injection this can optionally be performed at compile-time. But even when the injection plan is deferred to runtime it is resolved without using reflection, and is therefore conducive to native image restrictions and enhanced performance. +* Service (aka Bean) - In Spring this would be referred to as a bean with a @Service annotation; These are concrete class types in your application that represents some sort of business logic. +* Scope - This refers to the cardinality of a service instance in your application. +* Singleton - jakarta.inject.Singleton or javax.inject.Singleton - This is the default scope for services in Helidon Injection just like it is in Spring. +* Provided - jakarta.inject.Provider or javax.inject.Provider - If the scope of a service is not Singleton then it is considered to be a Provided scope - and the cardinality will be ascribed to the implementation of the Provider to determine its cardinality. The provider can optionally use the injection point context to determine the appropriate instance and/or cardinality it provides. +* Contract - These are how a service can alias itself for injection. Contracts are typically the interface or abstract base class definitions of a service implementation. Injection points must be based upon either using a contract or service that Injection is aware of, usually through annotation processing at compile time. +* Qualifier - jakarta.inject.qualifier or javax.inject.qualifier - These are meta annotations that can be ascribed to other annotations. One built-in qualifier type is @Named in the same package. +* RunLevel - A way for you to describe when a service shut start up during process lifecycle. The lower the RunLevel the sooner it should start (usually based at 0). +* Dependency - An injection point represents what is considered to be a dependency, perhaps qualified or Optional, on another service or contract. This is just another what to describe an injection point. +* Activator (aka ServiceProvider) - This is what is code generated by Injection to lazily activate your service instance(s) in the Injection Services registry, and it handles resolving all dependencies it has, along with injecting the fields, methods, etc. that are required to be satisfied as part of that activation process. +* Services (aka services registry) - This is the collection of all services that are known to the JVM/runtime in Injection. +* ModuleComponent - This is where your application will "bind" services into the services registry - typically code generated, and typically with one module per jar/module in your application. +* Application - The fully realized set of modules and services/service providers that constitute your application, and code-generated using Helidon Injection Tooling. + +## Getting Started +As stated in the introduction above, the Injection framework aims to provide a minimalist API implementation. As a result, it might be surprising to learn how small the actual API is for Injection - see [inject api](./inject) and the API/annotation types at [inject api](./api/src/main/java/io/helidon/inject). If you are already familiar with [jakarta.inject](https://javadoc.io/doc/jakarta.inject/jakarta.inject-api/latest/index.html) and optionally, [jakarta.annotation](https://javadoc.io/doc/jakarta.annotation/jakarta.annotation-api/latest/jakarta.annotation/jakarta/annotation/package-summary.html) then basically you are ready to go. But if you've never used DI before then first review the basics of [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection). + +The prerequisites are familiarity with dependency injection, Java 11+, and maven 3.8.5+. + +The best way to learn Helidon Injection is by looking at [the examples](../examples/inject). But if you want to immediately get started here are the basics steps: + +1. Put these in your pom.xml or gradle.build file: + Annotation processor dependency / path: +``` + io.helidon.inject + helidon-inject-processor + ${helidon.version} +``` +Compile-time dependency: +``` + + io.helidon.inject + helidon-inject-runtime + ${helidon.version} + +``` + +2. Write your application using w/ standard jakarta.inject.* and jakarta.annotation.* types. Again, see any of [the examples](./examples/README.md) for pointers as needed. + +3. Build and run. In a DI-based framework, the frameworks "owns" the creation of services in accordance with the Scope each service is declared as. You therefore need to get things started by creating demand for the initial service(s) instead of ever calling new directly in your application code. Generally speaking, there are two such ways to get things started at runtime: + +* If you know the class you want to create then look it up directly using the Services SPI. Here is a sample excerpt from [the book example](./examples/book/README.md): + +``` + Services services = InjectionServices.realizedServices(); + // query + ServiceProvider serviceProvider = services.lookupFirst(MyService.class); + // lazily activate + MyService myLazyActivatedService = serviceProvider.get(); +``` + +* If there are a collection of services requiring activation at startup then we recommend annotating those service implementation types with RunLevel(RunLevel.STARTUP) and then use code below in main() to lazily activate those services. Note that whenever List-based injection is used in Injection all services matching the injection criteria will be in the injected (and immutable) list. The list will always be in order according to the Weight annotation value, ranking from the highest weight to the lowest weight. If services are not weighted explicitly, then a default weight is assigned. If the weight is the same for two services, then the secondary ordering will be based on the FN class name of the service types. While Weight determines list order, the RunLevel annotation is used to rank the startup ordering, from the lowest value to the highest value, where RunLevel.STARTUP == 0. The developer is expected to activate these directly using code like the following (the get() lazily creates & activates the underlying service type): + +``` + List> startupServices = services + .lookup(ServiceInfoCriteria.builder().runLevel(RunLevel.STARTUP).build()); + startupServices.stream().forEach(ServiceProvider::get); +``` + +* If the ordering of the list of services is important, remember to use the Weight and/or RunLevel annotations to establish the priority / weighted ordering, and startup ordering. + +## More Advanced Features + +* Injection provides a means to generate "Activators" (the DI supporting types) for externally built modules as well as supporting javax annotated types. + +* Injection offers services the ability to be intercepted. If your service contains any annotation that itself is annotated with InterceptorTrigger then the code generated for that service will support interception. The Helidon Nima project provides these types of examples. + +* Injection provides meta-information for each service in its service registry, including such information as what contracts are provided by each service as well as describing its dependencies. + +* Java Module System support / generation. Injection generates a proposed module-info.java.inject file for your module (look for module-info.java.inject under ./target/inject). + +* Injection provides a maven-plugin that allows the injection graph to be (a) validated for completeness, and (b) deterministically bound to the service implementation - at compile-time. This is demonstrated in each of the examples, the result of which leads to early detection of issues at compile-time instead of at runtime as well as a marked performance enhancement. + +* Testability. The [testing](./testing) module offers a set of types in order to facility for creating fake/mock services for various testing scenarios. + +* Extensibility. The entire Injection Framework is designed to by extended either at a micro level (developers can override mustache/handlebar templates) to the macro level (developers can provide their own implementation of any SPI). Another example of internal extensibility is via our [config-driven](./configdriven) services. + +* Determinism. Injection strives to keep your application as deterministic as possible. Dynamically adding services post-initialization will not be allowed, and will even result in a runtime exception (configurable). Any service that is "a provider" that dynamically creates a service in runtime code will issue build failures or warnings (configurable). All services are always ordered first according to Weight and secondarily according to type name (instead of relying on classpath ordering). Essentially, all areas of Injection attempts to keep your application as deterministic as possible at production runtime. + +## Modules + +* [api](./api) - the Injection API and SPI; depends on jakarta-inject and jakarta-annotations. Required as a maven compile-time dependency for runtime consumption. +* [runtime](./runtime) - contains the default runtime implementation of the Injection API/SPI; depends on the Inject API module above. Requires as a maven compile-time dependency for runtime consumption. +* [config-driven](./configdriven) - Extensions to Injection to integrate directly with the [Helidon Config](../config) subsystem. +* [tools](./tools) - contains the libraries and template-based codegen mustache resources as well as model validation tooling; depends on runtime services. Only required at build time and is not required for Injection at runtime. +* [processor](./processor) - contains the libraries for annotation processing; depends on tools. Only required at build time and is not required for Injection at runtime. +* [maven-plugin](./maven-plugin) - provides code generation Mojo wrappers for maven; depends on tools. Only required at build time and is not required for Injection at runtime. This is what would be used to create your Application. +* [testing](./testing) - provides testing types useful for Injection unit & integration testing. +* [tests](./tests) - used internally for testing Injection. +* [examples](../examples/inject) - providing examples for how to use Injection as well as side-by-side comparisons for Injection compared to Guice, Dagger2, Hk2, etc. + +## How Injection Works + +* The Injection annotation [processor](./processor) will look for standard jakarta/javax inject and jakarta/javax annotation types. When these types are found in a class that is being compiled by javac, Helidon Injection will trigger the creation of an Activator for that service class/type. For example, if you have a FooImpl class implementing Foo interface, and the FooImpl either contains "@Inject" or "@Singleton" then the presence of either of these annotations will trigger the creation of a FooImpl$$injectionActivator to be created. The Activator is used to (a) describe the service in terms of what service contracts (i.e., interfaces) are advertised by FooImpl - in this case Foo (if Foo is annotated with @Contract or if "-Aio.helidon.inject.autoAddNonContractInterfaces=true" is used at compile-time), (b) lifecycle of services including creation, calling injection-based setters, and any PostConstruct or PreDestroy methods. + +* If one or more activators are created at compile-time, then a Injection$$Module is also created to aggregate the services for the given module. Below is an example if a injectionModule from [examples/logger](./examples/logger). At initialization time of Injection, all ModuleComponents will be located using the ServiceLocator and each service will be bound into the Services registry. + +```java +@Generated(value = "io.helidon.inject.tools.creator.impl.DefaultActivatorCreator", comments = "version = 1") +@Singleton @Named(Injection$$Module.NAME) +public class Injection$$Module implements Module { + static final String NAME = "inject.examples.logger.common"; + + @Override + public Optional getName() { + return Optional.of(NAME); + } + + @Override + public String toString() { + return NAME + ":" + getClass().getName(); + } + + @Override + public void configure(ServiceBinder binder) { + binder.bind(io.helidon.inject.examples.logger.common.AnotherCommunicationMode$$injectionActivator.INSTANCE); + binder.bind(io.helidon.inject.examples.logger.common.Communication$$injectionActivator.INSTANCE); + binder.bind(io.helidon.inject.examples.logger.common.DefaultCommunicator$$injectionActivator.INSTANCE); + binder.bind(io.helidon.inject.examples.logger.common.EmailCommunicationMode$$injectionActivator.INSTANCE); + binder.bind(io.helidon.inject.examples.logger.common.ImCommunicationMode$$injectionActivator.INSTANCE); + binder.bind(io.helidon.inject.examples.logger.common.LoggerProvider$$injectionActivator.INSTANCE); + binder.bind(io.helidon.inject.examples.logger.common.SmsCommunicationMode$$injectionActivator.INSTANCE); + } +} +``` + +And just randomly taking one of the generated Activators: +```java +@Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", comments = "version=1") +public class SmsCommunicationMode$$Injection$$Activator + extends io.helidon.inject.runtime.AbstractServiceProvider { + private static final ServiceInfo serviceInfo = + ServiceInfo.builder() + .serviceTypeName(io.helidon.examples.inject.logger.common.SmsCommunicationMode.class.getName()) + .addExternalContractsImplemented(io.helidon.examples.inject.logger.common.CommunicationMode.class.getName()) + .activatorTypeName(SmsCommunicationMode$$Injection$$Activator.class.getName()) + .addScopeTypeName(jakarta.inject.Singleton.class.getName()) + .addQualifier(io.helidon.inject.DefaultQualifier.create(jakarta.inject.Named.class, "sms")) + .build(); + + /** + * The global singleton instance for this service provider activator. + */ + public static final SmsCommunicationMode$$Injection$$Activator INSTANCE = new SmsCommunicationMode$$Injection$$Activator(); + + /** + * Default activator constructor. + */ + protected SmsCommunicationMode$$Injection$$Activator() { + serviceInfo(serviceInfo); + } + + /** + * The service type of the managed service. + * + * @return the service type of the managed service + */ + public Class serviceType() { + return io.helidon.examples.inject.logger.common.SmsCommunicationMode.class; + } + + @Override + public DependenciesInfo dependencies() { + DependenciesInfo deps = Dependencies.builder(io.helidon.examples.inject.logger.common.SmsCommunicationMode.class.getName()) + .add("logger", java.util.logging.Logger.class, ElementKind.FIELD, Access.PACKAGE_PRIVATE) + .build(); + return Dependencies.combine(super.dependencies(), deps); + } + + @Override + protected SmsCommunicationMode createServiceProvider(Map deps) { + return new io.helidon.examples.inject.logger.common.SmsCommunicationMode(); + } + + @Override + protected void doInjectingFields(Object t, Map deps, Set injections, String forServiceType) { + super.doInjectingFields(t, deps, injections, forServiceType); + SmsCommunicationMode target = (SmsCommunicationMode) t; + target.logger = (java.util.logging.Logger) get(deps, "io.helidon.examples.inject.logger.common.logger"); + } + +} +``` + +* As you can see from above example, the Activators are effectively managing the lifecycle and injection of your classes. These generated Activator types are placed in the same package as your class(es). Helidon Injection avoids reflection. This means that only public, protected, and package private injection points are supported. private and static injection points are not supported by the Injection framework. + +* If an annotation in your service is meta-annotated with InterceptedTrigger, then an extra service type is created that will trigger interceptor service code generation. For example, if FooImpl was found to have one such annotation then FooImpl$$Injection$$Interceptor would also be created along with an activator for that interceptor. The interceptor would be created with a higher weight than your FooImpl, and would therefore be "preferred" when a single @Inject is used for Foo or FooImpl. If a list is injected then it would appear towards the head of the list. Once again, all reflection is avoided in these generated classes. Any calls to Foo/FooImpl will be interceptable for any Interceptor that is @Named to handle that type name. Search the test code and Nima code for such examples as this is an advanced feature. + +* The [maven-plugin](./maven-plugin) can optionally be used to avoid Injection lookup resolutions at runtime within each service activation. At startup the Injection framework will attempt to first use the Application to avoid lookups. The best practice is to apply the maven-plugin to create-application on your maven assembly - this is usually your "final" application module that depends upon every other service / module in your entire deployed application. Here is the Injection$$Application from [examples/logger](../examples/inject/logger): + +```java +@Generated({"generator=io.helidon.inject.maven.plugin.ApplicationCreatorMojo", "ver=1"}) +@Singleton @Named(Injection$$Application.NAME) +public class Injection$$Application implements Application { + static final String NAME = "unnamed"; + + @Override + public Optional getName() { + return Optional.of(NAME); + } + + @Override + public String toString() { + return NAME + ":" + getClass().getName(); + } + + @Override + public void configure(ServiceInjectionPlanBinder binder) { + /** + * In module name "inject.examples.logger.common". + * @see {@link io.helidon.inject.examples.logger.common.AnotherCommunicationMode } + */ + binder.bindTo(io.helidon.inject.examples.logger.common.AnotherCommunicationMode$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.logger", + io.helidon.inject.examples.logger.common.LoggerProvider$$injectionActivator.INSTANCE) + .commit(); + + /** + * In module name "inject.examples.logger.common". + * @see {@link io.helidon.inject.examples.logger.common.Communication } + */ + binder.bindTo(io.helidon.inject.examples.logger.common.Communication$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.|2(1)", + io.helidon.inject.examples.logger.common.LoggerProvider$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.|2(2)", + io.helidon.inject.examples.logger.common.DefaultCommunicator$$injectionActivator.INSTANCE) + .commit(); + + /** + * In module name "inject.examples.logger.common". + * @see {@link io.helidon.inject.examples.logger.common.DefaultCommunicator } + */ + binder.bindTo(io.helidon.inject.examples.logger.common.DefaultCommunicator$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.sms", + io.helidon.inject.examples.logger.common.SmsCommunicationMode$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.email", + io.helidon.inject.examples.logger.common.EmailCommunicationMode$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.im", + io.helidon.inject.examples.logger.common.ImCommunicationMode$$imjectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.|1(1)", + io.helidon.inject.examples.logger.common.AnotherCommunicationMode$$injectionActivator.INSTANCE) + .commit(); + + /** + * In module name "inject.examples.logger.common". + * @see {@link io.helidon.inject.examples.logger.common.EmailCommunicationMode } + */ + binder.bindTo(io.helidon.inject.examples.logger.common.EmailCommunicationMode$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.logger", + io.helidon.inject.examples.logger.common.LoggerProvider$$injectionActivator.INSTANCE) + .commit(); + + /** + * In module name "inject.examples.logger.common". + * @see {@link io.helidon.inject.examples.logger.common.ImCommunicationMode } + */ + binder.bindTo(io.helidon.inject.examples.logger.common.ImCommunicationMode$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.logger", + io.helidon.inject.examples.logger.common.LoggerProvider$$injectionActivator.INSTANCE) + .commit(); + + /** + * In module name "inject.examples.logger.common". + * @see {@link io.helidon.inject.examples.logger.common.LoggerProvider } + */ + binder.bindTo(io.helidon.inject.examples.logger.common.LoggerProvider$$injectionActivator.INSTANCE) + .commit(); + + /** + * In module name "inject.examples.logger.common". + * @see {@link io.helidon.inject.examples.logger.common.SmsCommunicationMode } + */ + binder.bindTo(io.helidon.inject.examples.logger.common.SmsCommunicationMode$$injectionActivator.INSTANCE) + .bind("io.helidon.inject.examples.logger.common.logger", + io.helidon.inject.examples.logger.common.LoggerProvider$$injectionActivator.INSTANCE) + .commit(); + } +} +``` + +* The maven-plugin can additionally be used to create the DI supporting types (Activators, Modules, Interceptors, Applications, etc.) from introspecting an external jar - see the [examples](../examples/inject) for details. + +That is basically all there is to know to get started and become productive using Injection. + +## Special Notes to Providers & Contributors +Helidon Injection aims to provide an extensible, SPI-based mechanism. There are many ways Injection can be overridden, extended, or even replaced with a different implementation than what is provided out of the built-in reference implementation modules included. Of course, you can also contribute directly by becoming a committer. However, if you are looking to fork the implementation then you are strongly encouraged to honor the "spirit of this framework" and follow this as a high-level guide: + +* In order to be a Injection provider implementation, the provider must supply an implementation for InjectionServices discoverable by the + ServiceLoader with a higher-than-default Weight. +* All SPI class definitions from the io.helidon.inject.spi package are considered primordial and therefore should not participate in injection or conventionally be considered injectable. +* All service classes that are not targets for injection should be represented under + /META-INF/services/ to be found by the standard ServiceLocator. +* Providers are encouraged to fail-fast during compile time - this implies a sophisticated set of tooling that can and should be applied to create and validate the integrity of the dependency graph at compile time instead of at runtime. +* Providers are encouraged to avoid reflection completely at runtime. +* Providers are encouraged to advertise capabilities and configuration using InjectionServicesConfig. diff --git a/pico/api/README.md b/inject/api/README.md similarity index 79% rename from pico/api/README.md rename to inject/api/README.md index 53790f2b1af..9faed5242be 100644 --- a/pico/api/README.md +++ b/inject/api/README.md @@ -1,19 +1,19 @@ -This module contains all the API and SPI types that are applicable to a Helidon Pico based application. +This module contains all the API and SPI types that are applicable to a Helidon Injection based application. -The API can logically be broken up into two categories - declarative types and imperative/programmatic types. The declarative form is the most common approach for using Pico. +The API can logically be broken up into two categories - declarative types and imperative/programmatic types. The declarative form is the most common approach for using Injection. -The declarative API is small and based upon annotations. This is because most of the supporting annotation types actually come directly from both of the standard javax/jakarta inject and javax/jakarta annotation modules. These standard annotations are supplemented with these proprietary annotation types offered here from Pico: +The declarative API is small and based upon annotations. This is because most of the supporting annotation types actually come directly from both of the standard javax/jakarta inject and javax/jakarta annotation modules. These standard annotations are supplemented with these proprietary annotation types offered here from Injection: -* [@Contract](src/main/java/io/helidon/pico/api/Contract.java) -* [@ExteralContracts](src/main/java/io/helidon/pico/api/ExternalContracts.java) -* [@RunLevel](src/main/java/io/helidon/pico/api/RunLevel.java) +* [@Contract](src/main/java/io/helidon/inject/api/Contract.java) +* [@ExteralContracts](src/main/java/io/helidon/inject/api/ExternalContracts.java) +* [@RunLevel](src/main/java/io/helidon/inject/api/RunLevel.java) The programmatic API is typically used to manually lookup and activate services (those that are typically annotated with @jakarta.inject.Singleton for example) directly. The main entry points for programmatic access can start from one of these two types: -* [PicoServices](src/main/java/io/helidon/pico/api/PicoServices.java) -* [Services](src/main/java/io/helidon/pico/api/Services.java) +* [InjectionServices](src/main/java/io/helidon/inject/api/InjectionServices.java) +* [Services](src/main/java/io/helidon/inject/api/Services.java) -Note that this module only contains the common types for a Helidon Pico services provider. See the [runtime](../runtime) module for the default reference implementation for this API / SPI. +Note that this module only contains the common types for a Helidon Injection service provider. See the [runtime](../runtime) module for the default reference implementation for this API / SPI. ## Declaring a Service @@ -42,7 +42,7 @@ class MySingletonProvider implements jakarta.inject.Provider { } ``` -Pico delegates the cardinality of to the provider implementation for which instance to return to the caller. However, note that the instances returned are not "owned" by Pico - unless those instances are looked up out of the Services registry. +Helidon Injection delegates the cardinality of to the provider implementation for which instance to return to the caller. However, note that the instances returned are not "owned" by the Injection framework - unless those instances are looked up out of the Services registry. ### InjectionPointProvider Here the standard jakarta.inject.Provider<> from above is extended to support contextual knowledge of "who is asking" to be injected with the service. In this way the provider implementation can provide the "right" instance based upon the caller's context. @@ -72,7 +72,7 @@ public class BladeProvider implements InjectionPointProvider { ``` ## Injectable Constructs -Any service can declare field, method, or constructor injection points. The only caveat is that these injectable elements must either be public or package private. Generally speaking, it is considered a best practice to (a) use only an injectable constructor, and (b) only inject Provider instances. Here is an example for best practice depicting all possible usages for injection types supported by Pico. +Any service can declare field, method, or constructor injection points. The only caveat is that these injectable elements must either be public or package private. Generally speaking, it is considered a best practice to (a) use only an injectable constructor, and (b) only inject Provider instances. Here is an example for best practice depicting all possible usages for injection types supported by Helidon Injection. ```java @Singleton @@ -98,12 +98,12 @@ public class MainToolBox implements ToolBox { void setScrewdriver(Screwdriver screwdriver) { } - // called after construction by Pico's lifecycle startup management + // called after construction by Injection's lifecycle startup management @PostConstruct void postConstruct() { } - // called before shutdown by Pico's lifecycle shutdown management + // called before shutdown by Injection's lifecycle shutdown management @PreDestroy void preDestroy() { } diff --git a/pico/api/pom.xml b/inject/api/pom.xml similarity index 95% rename from pico/api/pom.xml rename to inject/api/pom.xml index fb6ae6a902c..a1211f00de2 100644 --- a/pico/api/pom.xml +++ b/inject/api/pom.xml @@ -19,15 +19,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-api - Helidon Pico API / SPI + helidon-inject-api + Helidon Injection API / SPI diff --git a/pico/api/src/main/java/io/helidon/pico/api/AccessModifier.java b/inject/api/src/main/java/io/helidon/inject/api/AccessModifier.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/AccessModifier.java rename to inject/api/src/main/java/io/helidon/inject/api/AccessModifier.java index 36141fcaae1..fb0383bac92 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/AccessModifier.java +++ b/inject/api/src/main/java/io/helidon/inject/api/AccessModifier.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * The access describing the target injection point. diff --git a/pico/api/src/main/java/io/helidon/pico/api/ActivationLog.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationLog.java similarity index 94% rename from pico/api/src/main/java/io/helidon/pico/api/ActivationLog.java rename to inject/api/src/main/java/io/helidon/inject/api/ActivationLog.java index 0694c17bd00..7bc874e01b7 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ActivationLog.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; diff --git a/pico/api/src/main/java/io/helidon/pico/api/ActivationLogEntryBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogEntryBlueprint.java similarity index 97% rename from pico/api/src/main/java/io/helidon/pico/api/ActivationLogEntryBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ActivationLogEntryBlueprint.java index d4c49f99614..3f0736bbbc7 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ActivationLogEntryBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogEntryBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.time.Instant; import java.util.Optional; diff --git a/pico/api/src/main/java/io/helidon/pico/api/ActivationLogQuery.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogQuery.java similarity index 92% rename from pico/api/src/main/java/io/helidon/pico/api/ActivationLogQuery.java rename to inject/api/src/main/java/io/helidon/inject/api/ActivationLogQuery.java index c8e65017c72..4ccda044763 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ActivationLogQuery.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.List; diff --git a/pico/api/src/main/java/io/helidon/pico/api/ActivationPhaseReceiver.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationPhaseReceiver.java similarity index 86% rename from pico/api/src/main/java/io/helidon/pico/api/ActivationPhaseReceiver.java rename to inject/api/src/main/java/io/helidon/inject/api/ActivationPhaseReceiver.java index b024a17d1fc..a9585341898 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ActivationPhaseReceiver.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationPhaseReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * A receiver of events from the {@link Services} registry and providers held by the service registry. *

* Note that only {@link ServiceProvider}'s implement this contract that are also bound to the global - * {@link io.helidon.pico.api.Services} registry are currently capable of receiving events. + * {@link Services} registry are currently capable of receiving events. * * @see ServiceProviderBindable */ diff --git a/pico/api/src/main/java/io/helidon/pico/api/ActivationRequestBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationRequestBlueprint.java similarity index 94% rename from pico/api/src/main/java/io/helidon/pico/api/ActivationRequestBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ActivationRequestBlueprint.java index 2f7404eb614..ce18375bcd7 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ActivationRequestBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationRequestBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; diff --git a/pico/api/src/main/java/io/helidon/pico/api/ActivationResultBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationResultBlueprint.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/ActivationResultBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ActivationResultBlueprint.java index 441d5b1d509..0d03625b388 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ActivationResultBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationResultBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Map; import java.util.Optional; @@ -81,7 +81,7 @@ interface ActivationResultBlueprint { * * @return the resolved injection plan map */ - Map injectionPlans(); + Map injectionPlans(); /** * The dependencies that were resolved or loaded, key'ed by each element's {@link ServiceProvider#id()}. diff --git a/pico/api/src/main/java/io/helidon/pico/api/ActivationStatus.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationStatus.java similarity index 93% rename from pico/api/src/main/java/io/helidon/pico/api/ActivationStatus.java rename to inject/api/src/main/java/io/helidon/inject/api/ActivationStatus.java index 0c9ad004081..8b8ba926474 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ActivationStatus.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationStatus.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * The activation status. This status applies to the {@link ActivationLogEntry} record. diff --git a/pico/api/src/main/java/io/helidon/pico/api/Activator.java b/inject/api/src/main/java/io/helidon/inject/api/Activator.java similarity index 93% rename from pico/api/src/main/java/io/helidon/pico/api/Activator.java rename to inject/api/src/main/java/io/helidon/inject/api/Activator.java index 6ef3a7ce340..f72d5479280 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Activator.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Activator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Activators are responsible for lifecycle creation and lazy activation of service providers. They are responsible for taking the @@ -36,7 +36,7 @@ *

  • Control over creation (i.e., invoke the constructor non-reflectively).
  • *
  • Control over gathering the service requisite dependencies (ctor, field, setters) and optional activation of those.
  • *
  • Invocation of any {@link PostConstructMethod}.
  • - *
  • Responsible to logging to the {@link ActivationLog} - see {@link PicoServices#activationLog()}.
  • + *
  • Responsible to logging to the {@link ActivationLog} - see {@link InjectionServices#activationLog()}.
  • * * * @see DeActivator diff --git a/pico/api/src/main/java/io/helidon/pico/api/Application.java b/inject/api/src/main/java/io/helidon/inject/api/Application.java similarity index 93% rename from pico/api/src/main/java/io/helidon/pico/api/Application.java rename to inject/api/src/main/java/io/helidon/inject/api/Application.java index 65dc68704eb..b83ac0d9c0f 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Application.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * An Application instance, if available at runtime, will be expected to provide a blueprint for all service provider's injection diff --git a/pico/api/src/main/java/io/helidon/pico/api/BootstrapBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java similarity index 60% rename from pico/api/src/main/java/io/helidon/pico/api/BootstrapBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java index f6b982a4477..3c694f2c4d1 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/BootstrapBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,25 +14,26 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; import io.helidon.builder.api.Prototype; import io.helidon.common.config.Config; +import io.helidon.inject.spi.InjectionServicesProvider; /** - * This is the bootstrap needed to provide to {@code Pico} initialization. + * This is the bootstrap needed to provide to {@code Services} initialization. * - * @see io.helidon.pico.spi.PicoServicesProvider - * @see io.helidon.pico.api.PicoServices#globalBootstrap() + * @see InjectionServicesProvider + * @see InjectionServices#globalBootstrap() */ @Prototype.Blueprint interface BootstrapBlueprint { /** - * Provides the base primordial bootstrap configuration to the {@link io.helidon.pico.spi.PicoServicesProvider}. - * The provider will then bootstrap {@link io.helidon.pico.api.PicoServices} using this bootstrap instance. + * Provides the base primordial bootstrap configuration to the {@link InjectionServicesProvider}. + * The provider will then bootstrap {@link InjectionServices} using this bootstrap instance. * then default values will be used accordingly. * * @return the bootstrap helidon configuration @@ -40,9 +41,9 @@ interface BootstrapBlueprint { Optional config(); /** - * In certain conditions Pico services should be initialized but not started (i.e., avoiding calls to {@code PostConstruct} - * etc.). This can be used in special cases where the normal Pico startup should limit lifecycle up to a given phase. Normally - * one should not use this feature - it is mainly used in Pico tooling (e.g., the pico-maven-plugin). + * In certain conditions Injection services should be initialized but not started (i.e., avoiding calls to {@code PostConstruct} + * etc.). This can be used in special cases where the normal Injection startup should limit lifecycle up to a given phase. Normally + * one should not use this feature - it is mainly used in Injection tooling (e.g., the injection maven-plugin). * * @return the phase to stop at during lifecycle */ diff --git a/pico/api/src/main/java/io/helidon/pico/api/CallingContextBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/CallingContextBlueprint.java similarity index 90% rename from pico/api/src/main/java/io/helidon/pico/api/CallingContextBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/CallingContextBlueprint.java index 8383748830b..13f78c21ca2 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/CallingContextBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/CallingContextBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.ArrayList; import java.util.List; @@ -23,12 +23,12 @@ import io.helidon.builder.api.Prototype; /** - * For internal use only to Helidon. Applicable when {@link io.helidon.pico.api.PicoServices#TAG_DEBUG} is enabled. + * For internal use only to Helidon. Applicable when {@link InjectionServices#TAG_DEBUG} is enabled. */ @Prototype.Blueprint(builderInterceptor = CallingContextBlueprint.BuilderInterceptor.class) interface CallingContextBlueprint { /** - * Only populated when {@link io.helidon.pico.api.PicoServices#TAG_DEBUG} is set. + * Only populated when {@link InjectionServices#TAG_DEBUG} is set. * * @return the stack trace for who initialized */ diff --git a/pico/api/src/main/java/io/helidon/pico/api/CallingContextFactory.java b/inject/api/src/main/java/io/helidon/inject/api/CallingContextFactory.java similarity index 92% rename from pico/api/src/main/java/io/helidon/pico/api/CallingContextFactory.java rename to inject/api/src/main/java/io/helidon/inject/api/CallingContextFactory.java index 8167033a463..0a4790d219b 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/CallingContextFactory.java +++ b/inject/api/src/main/java/io/helidon/inject/api/CallingContextFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Objects; import java.util.Optional; @@ -57,7 +57,7 @@ public static void globalCallingContext(CallingContext callingContext, * * @param force forces the creation of the calling context even when debug is disabled * @return a new calling context if there is an indication that debug mode is enabled, or if the force flag is set - * @see io.helidon.pico.api.PicoServicesConfig#debug() + * @see InjectionServicesConfig#debug() */ public static Optional create(boolean force) { Optional optBuilder = createBuilder(force); @@ -71,12 +71,12 @@ public static Optional create(boolean force) { * * @param force forces the creation of the calling context even when debug is disabled * @return a new calling context builder if there is an indication that debug mode is enabled, or if the force flag is set - * @see io.helidon.pico.api.PicoServicesConfig#debug() + * @see InjectionServicesConfig#debug() */ public static Optional createBuilder(boolean force) { - if (force || PicoServices.picoServices() - .map(PicoServices::config) - .map(PicoServicesConfig::shouldDebug) + if (force || InjectionServices.injectionServices() + .map(InjectionServices::config) + .map(InjectionServicesConfig::shouldDebug) .orElse(false)) { return Optional.of(CallingContext.builder() diff --git a/pico/api/src/main/java/io/helidon/pico/api/ClassNamed.java b/inject/api/src/main/java/io/helidon/inject/api/ClassNamed.java similarity index 97% rename from pico/api/src/main/java/io/helidon/pico/api/ClassNamed.java rename to inject/api/src/main/java/io/helidon/inject/api/ClassNamed.java index c2d93583ea2..aa1a7f33eb7 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ClassNamed.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ClassNamed.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/pico/api/src/main/java/io/helidon/pico/api/CommonQualifiers.java b/inject/api/src/main/java/io/helidon/inject/api/CommonQualifiers.java similarity index 97% rename from pico/api/src/main/java/io/helidon/pico/api/CommonQualifiers.java rename to inject/api/src/main/java/io/helidon/inject/api/CommonQualifiers.java index bc808f80672..d03eddcd6ef 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/CommonQualifiers.java +++ b/inject/api/src/main/java/io/helidon/inject/api/CommonQualifiers.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import io.helidon.common.types.TypeName; diff --git a/pico/api/src/main/java/io/helidon/pico/api/ContextualServiceQueryBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ContextualServiceQueryBlueprint.java similarity index 93% rename from pico/api/src/main/java/io/helidon/pico/api/ContextualServiceQueryBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ContextualServiceQueryBlueprint.java index ba041dec041..fe87a82f44b 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ContextualServiceQueryBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ContextualServiceQueryBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Objects; import java.util.Optional; @@ -32,7 +32,7 @@ interface ContextualServiceQueryBlueprint { /** - * The criteria to use for the lookup into {@link io.helidon.pico.api.Services}. + * The criteria to use for the lookup into {@link Services}. * * @return the service info criteria */ diff --git a/pico/api/src/main/java/io/helidon/pico/api/Contract.java b/inject/api/src/main/java/io/helidon/inject/api/Contract.java similarity index 82% rename from pico/api/src/main/java/io/helidon/pico/api/Contract.java rename to inject/api/src/main/java/io/helidon/inject/api/Contract.java index 5c4da62adf1..9d7c0928bed 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Contract.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Contract.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.lang.annotation.Documented; import java.lang.annotation.Retention; @@ -24,7 +24,7 @@ /** * The {@code Contract} annotation is used to relay significance to the type that it annotates. While remaining optional in its * use, it is typically placed on an interface definition to signify that the given type can be used for lookup in the - * {@link io.helidon.pico.api.Services} registry, and be eligible for injection via standard {@code @Inject}. + * {@link Services} registry, and be eligible for injection via standard {@code @Inject}. * While normally placed on interface types, it can also be placed on abstract and concrete class as well. The main point is that * a {@code Contract} is the focal point for service lookup and injection. *

    @@ -32,8 +32,8 @@ * using {@link ExternalContracts} instead - this annotation can be placed on the implementation class implementing the given * {@code Contract} interface(s). * - * @see io.helidon.pico.api.ServiceInfo#contractsImplemented() - * @see io.helidon.pico.api.ServiceInfo#externalContractsImplemented() + * @see ServiceInfo#contractsImplemented() + * @see ServiceInfo#externalContractsImplemented() */ @Documented @Retention(RetentionPolicy.CLASS) diff --git a/pico/api/src/main/java/io/helidon/pico/api/DeActivationRequestBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/DeActivationRequestBlueprint.java similarity index 85% rename from pico/api/src/main/java/io/helidon/pico/api/DeActivationRequestBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/DeActivationRequestBlueprint.java index 48337c8e8f2..96d2ecd0c0d 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/DeActivationRequestBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DeActivationRequestBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; /** - * Request to deactivate a {@link io.helidon.pico.api.ServiceProvider}. + * Request to deactivate a {@link ServiceProvider}. */ @Prototype.Blueprint interface DeActivationRequestBlueprint { diff --git a/pico/api/src/main/java/io/helidon/pico/api/DeActivator.java b/inject/api/src/main/java/io/helidon/inject/api/DeActivator.java similarity index 93% rename from pico/api/src/main/java/io/helidon/pico/api/DeActivator.java rename to inject/api/src/main/java/io/helidon/inject/api/DeActivator.java index b9ba31e4821..07314510d4f 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/DeActivator.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DeActivator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * DeActivators are responsible for lifecycle, transitioning a {@link ServiceProvider} through its diff --git a/pico/api/src/main/java/io/helidon/pico/api/DependenciesInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/DependenciesInfoBlueprint.java similarity index 93% rename from pico/api/src/main/java/io/helidon/pico/api/DependenciesInfoBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/DependenciesInfoBlueprint.java index 980f1b96755..c4988dacf57 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/DependenciesInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DependenciesInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.List; import java.util.Map; @@ -29,7 +29,7 @@ /** * Represents a per {@link ServiceInfo} mapping of {@link DependencyInfo}'s. These are typically assigned to a - * {@link ServiceProvider} via compile-time code generation within the Pico framework. + * {@link ServiceProvider} via compile-time code generation within the Injection framework. */ @Prototype.Blueprint interface DependenciesInfoBlueprint { @@ -39,7 +39,7 @@ interface DependenciesInfoBlueprint { * @return map from the service info to its dependencies */ @Prototype.Singular("serviceInfoDependency") - Map> serviceInfoDependencies(); + Map> serviceInfoDependencies(); /** * Optionally, the service type name aggregating {@link #allDependencies()}. diff --git a/pico/api/src/main/java/io/helidon/pico/api/DependencyInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoBlueprint.java similarity index 89% rename from pico/api/src/main/java/io/helidon/pico/api/DependencyInfoBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/DependencyInfoBlueprint.java index f242ca5614a..6e9c37d3103 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/DependencyInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; import java.util.Set; @@ -52,7 +52,7 @@ interface DependencyInfoBlueprint { Set injectionPointDependencies(); /** - * The {@link io.helidon.pico.api.ServiceProvider} that this dependency is optional resolved and bound to. All dependencies + * The {@link ServiceProvider} that this dependency is optional resolved and bound to. All dependencies * from {@link #injectionPointDependencies()} will be bound to this resolution. * * @return the optional resolved and bounded service provider diff --git a/pico/api/src/main/java/io/helidon/pico/api/DependencyInfoComparator.java b/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoComparator.java similarity index 94% rename from pico/api/src/main/java/io/helidon/pico/api/DependencyInfoComparator.java rename to inject/api/src/main/java/io/helidon/inject/api/DependencyInfoComparator.java index fa4e34483d2..14879deb273 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/DependencyInfoComparator.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoComparator.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.io.Serializable; import java.util.Comparator; /** - * Comparator appropriate for {@link io.helidon.pico.api.DependencyInfo}. + * Comparator appropriate for {@link DependencyInfo}. */ public class DependencyInfoComparator implements java.util.Comparator, Serializable { private static final Comparator INSTANCE = new DependencyInfoComparator(); diff --git a/pico/api/src/main/java/io/helidon/pico/api/ElementInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ElementInfoBlueprint.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/ElementInfoBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ElementInfoBlueprint.java index 55766ce2746..a572aeda3aa 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ElementInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ElementInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; import java.util.Set; diff --git a/pico/api/src/main/java/io/helidon/pico/api/ElementKind.java b/inject/api/src/main/java/io/helidon/inject/api/ElementKind.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/ElementKind.java rename to inject/api/src/main/java/io/helidon/inject/api/ElementKind.java index ea160a2d908..51946ec8623 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ElementKind.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ElementKind.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * The kind of injection target. diff --git a/pico/api/src/main/java/io/helidon/pico/api/Event.java b/inject/api/src/main/java/io/helidon/inject/api/Event.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/Event.java rename to inject/api/src/main/java/io/helidon/inject/api/Event.java index 79f1a77f98a..95d4e758669 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Event.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Event.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * A lifecycle activation event. diff --git a/pico/api/src/main/java/io/helidon/pico/api/ExternalContracts.java b/inject/api/src/main/java/io/helidon/inject/api/ExternalContracts.java similarity index 94% rename from pico/api/src/main/java/io/helidon/pico/api/ExternalContracts.java rename to inject/api/src/main/java/io/helidon/inject/api/ExternalContracts.java index 3b5fb0f9da4..1cfc422b49f 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ExternalContracts.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ExternalContracts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/pico/api/src/main/java/io/helidon/pico/api/Helidon.java b/inject/api/src/main/java/io/helidon/inject/api/Helidon.java similarity index 91% rename from pico/api/src/main/java/io/helidon/pico/api/Helidon.java rename to inject/api/src/main/java/io/helidon/inject/api/Helidon.java index 29f767db057..4dd98d572d7 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Helidon.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Helidon.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -59,7 +59,7 @@ public static Services serviceRegistry() { } try { READ_LOCK.lock(); - return PicoServices.realizedServices(); + return InjectionServices.realizedServices(); } finally { READ_LOCK.unlock(); } @@ -97,8 +97,8 @@ private static void registryInit(boolean bootServices) { .config(bootstrapConfig) .build(); - PicoServices.globalBootstrap(bootstrap); - Services services = PicoServices.realizedServices(); + InjectionServices.globalBootstrap(bootstrap); + Services services = InjectionServices.realizedServices(); if (!explicitConfig) { GlobalConfig.config(() -> services.lookup(Config.class).get(), true); @@ -121,13 +121,13 @@ private static void basicInit() { } } - private static final class ResettableHandler extends PicoServicesHolder { + private static final class ResettableHandler extends InjectionServicesHolder { @Deprecated private ResettableHandler() { } private static void registerReset() { - PicoServicesHolder.addResettable(Helidon::reset); + InjectionServicesHolder.addResettable(Helidon::reset); } } } diff --git a/pico/api/src/main/java/io/helidon/pico/api/PicoException.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionException.java similarity index 63% rename from pico/api/src/main/java/io/helidon/pico/api/PicoException.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectionException.java index 07c93668b5b..41bc5203d0f 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/PicoException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,34 +14,34 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** - * A general exception indicating that something failed related to Pico. + * A general exception indicating that something failed related to Injection. * - * @see PicoServiceProviderException - * @see InjectionException + * @see InjectionServiceProviderException + * @see ServiceProviderInjectionException * @see InvocationException */ -public class PicoException extends RuntimeException { +public class InjectionException extends RuntimeException { /** - * A general purpose exception from Pico. + * A general purpose exception from the Injection Framework. * * @param msg the message */ - public PicoException(String msg) { + public InjectionException(String msg) { super(msg); } /** - * A general purpose exception from Pico. + * A general purpose exception from the Injection framework. * * @param msg the message * @param cause the root cause */ - public PicoException(String msg, - Throwable cause) { + public InjectionException(String msg, + Throwable cause) { super(msg, cause); } diff --git a/pico/api/src/main/java/io/helidon/pico/api/InjectionPointInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointInfoBlueprint.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/InjectionPointInfoBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectionPointInfoBlueprint.java index abb0c62187b..f098185e970 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InjectionPointInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; diff --git a/pico/api/src/main/java/io/helidon/pico/api/InjectionPointProvider.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointProvider.java similarity index 80% rename from pico/api/src/main/java/io/helidon/pico/api/InjectionPointProvider.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectionPointProvider.java index 2c8d4f609af..9529ac8e7d3 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InjectionPointProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.List; import java.util.Optional; @@ -28,7 +28,7 @@ * create)". *

    * The ordering of services, and the preferred service itself, is determined by the same as documented for - * {@link io.helidon.pico.api.Services}. + * {@link Services}. * * @param the type that the provider produces */ @@ -38,11 +38,11 @@ public interface InjectionPointProvider extends Provider { * Get (or create) an instance of this service type using default/empty criteria and context. * * @return the best service provider matching the criteria - * @throws PicoException if resolution fails to resolve a match + * @throws InjectionException if resolution fails to resolve a match */ @Override default T get() { - return first(PicoServices.SERVICE_QUERY_REQUIRED) + return first(InjectionServices.SERVICE_QUERY_REQUIRED) .orElseThrow(this::couldNotFindMatch); } @@ -52,7 +52,7 @@ default T get() { * * @param query the service query * @return the best service provider matching the criteria - * @throws io.helidon.pico.api.PicoException if expected=true and resolution fails to resolve a match + * @throws InjectionException if expected=true and resolution fails to resolve a match */ Optional first(ContextualServiceQuery query); @@ -67,11 +67,11 @@ default List list(ContextualServiceQuery query) { return first(query).map(List::of).orElseGet(List::of); } - private PicoException couldNotFindMatch() { + private InjectionException couldNotFindMatch() { if (this instanceof ServiceProvider) { - return new PicoServiceProviderException("Expected to find a match", (ServiceProvider) this); + return new InjectionServiceProviderException("Expected to find a match", (ServiceProvider) this); } - return new PicoException("Expected to find a match for " + this); + return new InjectionException("Expected to find a match for " + this); } } diff --git a/pico/api/src/main/java/io/helidon/pico/api/PicoServiceProviderException.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java similarity index 65% rename from pico/api/src/main/java/io/helidon/pico/api/PicoServiceProviderException.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java index b6df356c862..3a11123052f 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/PicoServiceProviderException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Objects; import java.util.Optional; /** - * An exception relative to a {@link io.helidon.pico.api.ServiceProvider}. + * An exception relative to a {@link ServiceProvider}. */ -public class PicoServiceProviderException extends PicoException { +public class InjectionServiceProviderException extends InjectionException { /** * The service provider this exception pertains. @@ -30,55 +30,55 @@ public class PicoServiceProviderException extends PicoException { private final ServiceProvider serviceProvider; /** - * A general purpose exception from Pico. + * A general purpose exception from the Injection framework. * * @param msg the message */ - public PicoServiceProviderException(String msg) { + public InjectionServiceProviderException(String msg) { super(msg); this.serviceProvider = null; } /** - * A general purpose exception from Pico. + * A general purpose exception from the Injection framework. * * @param msg the message * @param cause the root cause */ - public PicoServiceProviderException(String msg, - Throwable cause) { + public InjectionServiceProviderException(String msg, + Throwable cause) { super(msg, cause); - if (cause instanceof PicoServiceProviderException picoExc) { - this.serviceProvider = picoExc.serviceProvider().orElse(null); + if (cause instanceof InjectionServiceProviderException exc) { + this.serviceProvider = exc.serviceProvider().orElse(null); } else { this.serviceProvider = null; } } /** - * A general purpose exception from Pico. + * A general purpose exception from the Injection framework. * * @param msg the message * @param serviceProvider the service provider */ - public PicoServiceProviderException(String msg, - ServiceProvider serviceProvider) { + public InjectionServiceProviderException(String msg, + ServiceProvider serviceProvider) { super(msg); Objects.requireNonNull(serviceProvider); this.serviceProvider = serviceProvider; } /** - * A general purpose exception from Pico. + * A general purpose exception from the Injection framework. * * @param msg the message * @param cause the root cause * @param serviceProvider the service provider */ - public PicoServiceProviderException(String msg, - Throwable cause, - ServiceProvider serviceProvider) { + public InjectionServiceProviderException(String msg, + Throwable cause, + ServiceProvider serviceProvider) { super(msg, cause); Objects.requireNonNull(serviceProvider); this.serviceProvider = serviceProvider; diff --git a/pico/api/src/main/java/io/helidon/pico/api/PicoServices.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java similarity index 72% rename from pico/api/src/main/java/io/helidon/pico/api/PicoServices.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java index 7218e82a2d8..e3a2fc7f609 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/PicoServices.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Map; import java.util.Objects; @@ -24,21 +24,21 @@ import io.helidon.common.types.TypeName; /** - * Abstract factory for all services provided by a single Helidon Pico provider implementation. + * Abstract factory for all services provided by a single Helidon Injection provider implementation. * An implementation of this interface must minimally supply a "services registry" - see {@link #services()}. *

    - * The global singleton instance is accessed via {@link #picoServices()}. Note that optionally one can provide a - * primordial bootstrap configuration to the {@code Pico} services provider. One must establish any bootstrap instance - * prior to the first call to {@link #picoServices()} as it will use a default configuration if not explicitly set. Once + * The global singleton instance is accessed via {@link #injectionServices()}. Note that optionally one can provide a + * primordial bootstrap configuration to the {@code Injection} services provider. One must establish any bootstrap instance + * prior to the first call to {@link #injectionServices()} as it will use a default configuration if not explicitly set. Once * the bootstrap has been set it cannot be changed for the lifespan of the JVM. */ -public interface PicoServices { +public interface InjectionServices { /** - * Tag for putting Pico tooling, processing, and runtime into debug mode. - * @see io.helidon.pico.api.PicoServices#config() - * @see io.helidon.pico.api.PicoServicesConfig#shouldDebug() + * Tag for putting Injection tooling, processing, and runtime into debug mode. + * @see InjectionServices#config() + * @see InjectionServicesConfig#shouldDebug() */ - String TAG_DEBUG = "pico.debug"; + String TAG_DEBUG = "inject.debug"; /** @@ -60,14 +60,14 @@ public interface PicoServices { * @return whether to debug */ static boolean isDebugEnabled() { - return picoServices() - .map(PicoServices::config) - .map(PicoServicesConfig::shouldDebug) - .orElseGet(() -> Boolean.getBoolean(PicoServices.TAG_DEBUG)); + return injectionServices() + .map(InjectionServices::config) + .map(InjectionServicesConfig::shouldDebug) + .orElseGet(() -> Boolean.getBoolean(InjectionServices.TAG_DEBUG)); } /** - * Returns the {@link io.helidon.pico.api.Bootstrap} configuration instance that was used to initialize this instance. + * Returns the {@link Bootstrap} configuration instance that was used to initialize this instance. * * @return the bootstrap configuration instance */ @@ -80,7 +80,7 @@ static boolean isDebugEnabled() { * @see #globalBootstrap(Bootstrap) */ static Optional globalBootstrap() { - return PicoServicesHolder.bootstrap(false); + return InjectionServicesHolder.bootstrap(false); } /** @@ -90,11 +90,11 @@ static Optional globalBootstrap() { */ static Bootstrap realizedGlobalBootStrap() { Optional bootstrap = globalBootstrap(); - return bootstrap.orElseGet(() -> PicoServicesHolder.bootstrap(true).orElseThrow()); + return bootstrap.orElseGet(() -> InjectionServicesHolder.bootstrap(true).orElseThrow()); } /** - * Sets the primordial bootstrap configuration that will supply {@link #picoServices()} during global + * Sets the primordial bootstrap configuration that will supply {@link #injectionServices()} during global * singleton initialization. * * @param bootstrap the primordial global bootstrap configuration @@ -102,46 +102,46 @@ static Bootstrap realizedGlobalBootStrap() { */ static void globalBootstrap(Bootstrap bootstrap) { Objects.requireNonNull(bootstrap); - PicoServicesHolder.bootstrap(bootstrap); + InjectionServicesHolder.bootstrap(bootstrap); } /** - * Get {@link PicoServices} instance if available. The highest {@link io.helidon.common.Weighted} service will be loaded + * Get {@link InjectionServices} instance if available. The highest {@link io.helidon.common.Weighted} service will be loaded * and returned. Remember to optionally configure any primordial {@link Bootstrap} configuration prior to the - * first call to get {@code PicoServices}. + * first call to get {@code InjectionServices}. * - * @return the Pico services instance + * @return the services instance */ - static Optional picoServices() { - return PicoServicesHolder.picoServices(); + static Optional injectionServices() { + return InjectionServicesHolder.injectionServices(); } /** - * Short-cut for the following code block. During the first invocation the {@link io.helidon.pico.api.Services} registry + * Short-cut for the following code block. During the first invocation the {@link Services} registry * will be initialized. * *

          * {@code
    -     *   return picoServices().orElseThrow().services();
    +     *   return injectionServices().orElseThrow().services();
          * }
          * 
    * * @return the services instance */ static Services realizedServices() { - return picoServices().orElseThrow().services(); + return injectionServices().orElseThrow().services(); } /** - * Similar to {@link #services()}, but here if Pico is not available or the services registry has not yet been initialized - * then this method will return {@code Optional.empty()}. This is convenience for users who conditionally want to use Pico's + * Similar to {@link #services()}, but here if Injection is not available or the services registry has not yet been initialized + * then this method will return {@code Optional.empty()}. This is convenience for users who conditionally want to use Injection's * service registry if it is currently available and in active use, but if not do alternative processing or allocations * directly, etc. * * @return the services instance if it has already been activated and initialized, empty otherwise */ static Optional unrealizedServices() { - return picoServices() + return injectionServices() .flatMap(it -> it.services(false)); } @@ -168,7 +168,7 @@ default Services services() { * * @return the config */ - PicoServicesConfig config(); + InjectionServicesConfig config(); /** * Optionally, the injector. @@ -184,7 +184,7 @@ default Services services() { *

    * If the service provider does not support shutdown an empty is returned. *

    - * The default reference implementation for Pico will return a map of all service types that were deactivated to any + * The default reference implementation for Injection will return a map of all service types that were deactivated to any * throwable that was observed during that services shutdown sequence. *

    * The order in which services are deactivated is dependent upon whether the {@link #activationLog()} is available. @@ -214,16 +214,16 @@ default Services services() { Optional metrics(); /** - * Optionally, the set of {@link io.helidon.pico.api.Services} lookup criteria that were recorded. This is only available if - * {@link PicoServicesConfig#serviceLookupCaching()} is enabled. + * Optionally, the set of {@link Services} lookup criteria that were recorded. This is only available if + * {@link InjectionServicesConfig#serviceLookupCaching()} is enabled. * * @return the lookup criteria recorded, or empty if not available */ Optional> lookups(); /** - * Will create an activation request either to {@link io.helidon.pico.api.Phase#ACTIVE} or limited to any - * {@link io.helidon.pico.api.Bootstrap#limitRuntimePhase()} specified. + * Will create an activation request either to {@link Phase#ACTIVE} or limited to any + * {@link Bootstrap#limitRuntimePhase()} specified. * * @return the activation request */ @@ -237,7 +237,7 @@ static ActivationRequest createActivationRequestDefault() { * @return the terminal phase for activation */ static Phase terminalActivationPhase() { - Optional globalBootstrap = PicoServices.globalBootstrap(); + Optional globalBootstrap = InjectionServices.globalBootstrap(); if (globalBootstrap.isPresent()) { Optional limitPhase = globalBootstrap.get().limitRuntimePhase(); return limitPhase.orElse(Phase.ACTIVE); diff --git a/pico/api/src/main/java/io/helidon/pico/api/PicoServicesConfigBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java similarity index 85% rename from pico/api/src/main/java/io/helidon/pico/api/PicoServicesConfigBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java index 9ffcd2c04f4..f93bb2c7ddd 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/PicoServicesConfigBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.time.Duration; import java.util.Optional; @@ -24,16 +24,16 @@ import io.helidon.config.metadata.ConfiguredOption; /** - * This is the configuration that the Pico service provider uses internally. + * This is the configuration that the Injection service provider uses internally. *

    * If left as-is a default configuration instance will be used with default values provided herein. Callers can - * optionally configure values by providing a {@link Bootstrap#config()} prior to Pico startup. The configuration provided - * will be used, and tunable configuration must be located under the key {@code pico} within the provided configuration + * optionally configure values by providing a {@link Bootstrap#config()} prior to Injection startup. The configuration provided + * will be used, and tunable configuration must be located under the key {@code inject} within the provided configuration * element. */ @Prototype.Blueprint -@Configured(root = true, prefix = "pico") -interface PicoServicesConfigBlueprint { +@Configured(root = true, prefix = "inject") +interface InjectionServicesConfigBlueprint { /** * The provider implementation name. * @@ -84,7 +84,7 @@ interface PicoServicesConfigBlueprint { /** * Flag indicating whether the services registry permits dynamic behavior. The default - * implementation of Pico supports dynamic (see {@link #supportsDynamic()}), but does not permit it by default. + * implementation of Injection supports dynamic (see {@link #supportsDynamic()}), but does not permit it by default. * * @return the flag indicating whether the services registry supports dynamic updates of the service registry */ @@ -94,17 +94,16 @@ interface PicoServicesConfigBlueprint { /** * Flag indicating whether the services registry supports dynamic behavior. Note that * if the provider does not support this flag then permitting it via {@link #permitsDynamic()} will have no affect. The - * default - * implementation of Pico supports dynamic, but does not permit it by default. + * default implementation of Injection supports dynamic, but does not permit it by default. * - * @return the flag indicating whether the services registry supports dynamic updates of the service registry post Pico + * @return the flag indicating whether the services registry supports dynamic updates of the service registry post * startup */ @ConfiguredOption("true") boolean supportsDynamic(); /** - * Flag indicating whether reflection is permitted. The default implementation of Pico + * Flag indicating whether reflection is permitted. The default implementation of Injection * supports reflection at compile-time only, and is not controlled by this flag directly. * * @return the flag indicating whether the provider is permitted to use reflection for normal runtime usage @@ -114,8 +113,8 @@ interface PicoServicesConfigBlueprint { /** * Flag indicating whether the reflection is supported. Note that if the provider does not support this - * flag then permitting it via {@link #permitsReflection()} will have no affect. The default implementation of Pico supports - * reflection only during compile-time operations using the Pico maven-plugin. + * flag then permitting it via {@link #permitsReflection()} will have no affect. The default implementation of Injection supports + * reflection only during compile-time operations using the Injection maven-plugin. * * @return the flag indicating whether reflection is supported during runtime operations */ @@ -123,27 +122,26 @@ interface PicoServicesConfigBlueprint { boolean supportsReflection(); /** - * Flag indicating whether compile-time generated {@link Application}'s should be used at Pico's startup initialization. + * Flag indicating whether compile-time generated {@link Application}'s should be used at Injection's startup initialization. * Setting * this value to false will have no affect if the underlying provider does not support compile-time generation via * {@link #supportsCompileTime()}. * * @return the flag indicating whether the provider is permitted to use Application generated code from compile-time - * @see io.helidon.pico.api.Application - * @see io.helidon.pico.api.Activator + * @see Application + * @see Activator */ @ConfiguredOption("true") boolean usesCompileTimeApplications(); /** - * Flag indicating whether compile-time generated {@link io.helidon.pico.api.ModuleComponent}'s should be used at Pico's - * startup + * Flag indicating whether compile-time generated {@link ModuleComponent}'s should be used at Injection's startup * initialization. Setting this value to false will have no affect if the underlying provider does not support compile-time * generation via {@link #supportsCompileTime()}. * * @return the flag indicating whether the provider is permitted to use Application generated code from compile-time * @see ModuleComponent - * @see io.helidon.pico.api.Activator + * @see Activator */ @ConfiguredOption("true") boolean usesCompileTimeModules(); @@ -199,7 +197,7 @@ interface PicoServicesConfigBlueprint { /** * Whether debug is enabled. - * Defaults to false, can be overridden using system property {@link io.helidon.pico.api.PicoServices#TAG_DEBUG}. + * Defaults to false, can be overridden using system property {@link InjectionServices#TAG_DEBUG}. * * @return if debug should be enabled */ @@ -212,6 +210,6 @@ interface PicoServicesConfigBlueprint { * @return whether to debug */ default boolean shouldDebug() { - return debug().orElseGet(() -> Boolean.getBoolean(PicoServices.TAG_DEBUG)); + return debug().orElseGet(() -> Boolean.getBoolean(InjectionServices.TAG_DEBUG)); } } diff --git a/pico/api/src/main/java/io/helidon/pico/api/PicoServicesHolder.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java similarity index 75% rename from pico/api/src/main/java/io/helidon/pico/api/PicoServicesHolder.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java index 376f88e19db..60d1ce1c760 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/PicoServicesHolder.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.ArrayList; import java.util.List; @@ -26,18 +26,18 @@ import java.util.concurrent.locks.ReentrantLock; import io.helidon.common.HelidonServiceLoader; -import io.helidon.pico.spi.PicoServicesProvider; +import io.helidon.inject.spi.InjectionServicesProvider; /** - * The holder for the globally active {@link PicoServices} singleton instance, as well as its associated - * {@link io.helidon.pico.api.Bootstrap} primordial configuration. + * The holder for the globally active {@link InjectionServices} singleton instance, as well as its associated + * {@link Bootstrap} primordial configuration. */ // exposed in the testing module as non deprecated -public abstract class PicoServicesHolder { +public abstract class InjectionServicesHolder { /** * Helpful hint to give developers needing to see more debug info. */ - public static final String DEBUG_HINT = "use the (-D and/or -A) tag 'pico.debug=true' to see full trace output."; + public static final String DEBUG_HINT = "use the (-D and/or -A) tag 'inject.debug=true' to see full trace output."; private static final AtomicReference BOOTSTRAP = new AtomicReference<>(); private static final AtomicReference INSTANCE = new AtomicReference<>(); @@ -47,29 +47,29 @@ public abstract class PicoServicesHolder { /** * Default Constructor. * - * @deprecated use {@link PicoServices#picoServices()} or {@link PicoServices#globalBootstrap()}. + * @deprecated use {@link InjectionServices#injectionServices()} or {@link InjectionServices#globalBootstrap()}. */ // exposed in the testing module as non deprecated @Deprecated - protected PicoServicesHolder() { + protected InjectionServicesHolder() { } /** - * Returns the global Pico services instance. The returned service instance will be initialized with any bootstrap + * Returns the global Injection services instance. The returned service instance will be initialized with any bootstrap * configuration that was previously established. * - * @return the loaded global pico services instance + * @return the loaded global services instance */ - static Optional picoServices() { + static Optional injectionServices() { if (INSTANCE.get() == null) { INSTANCE.compareAndSet(null, new ProviderAndServicesTuple(load())); - if (INSTANCE.get().picoServices == null) { - System.getLogger(PicoServices.class.getName()) + if (INSTANCE.get().injectionServices == null) { + System.getLogger(InjectionServices.class.getName()) .log(System.Logger.Level.WARNING, - "Pico runtime services not detected on the classpath"); + "Injection runtime services not detected on the classpath"); } } - return Optional.ofNullable(INSTANCE.get().picoServices); + return Optional.ofNullable(INSTANCE.get().injectionServices); } /** @@ -162,9 +162,9 @@ static String prettyPrintStackTraceOf(StackTraceElement[] trace) { return String.join("\n", stackTraceOf(trace)); } - private static Optional load() { - return HelidonServiceLoader.create(ServiceLoader.load(PicoServicesProvider.class, - PicoServicesProvider.class.getClassLoader())) + private static Optional load() { + return HelidonServiceLoader.create(ServiceLoader.load(InjectionServicesProvider.class, + InjectionServicesProvider.class.getClassLoader())) .asList() .stream() .findFirst(); @@ -172,22 +172,22 @@ private static Optional load() { // we need to keep the provider and the instance the provider creates together as one entity private static class ProviderAndServicesTuple { - private final PicoServicesProvider provider; - private final PicoServices picoServices; + private final InjectionServicesProvider provider; + private final InjectionServices injectionServices; - private ProviderAndServicesTuple(Optional provider) { + private ProviderAndServicesTuple(Optional provider) { this.provider = provider.orElse(null); - this.picoServices = provider.isPresent() + this.injectionServices = provider.isPresent() ? this.provider.services(bootstrap(true) - .orElseThrow(() -> new PicoException("Failed to assign bootstrap"))) + .orElseThrow(() -> new InjectionException("Failed to assign bootstrap"))) : null; } private void reset() { if (provider instanceof Resettable) { ((Resettable) provider).reset(true); - } else if (picoServices instanceof Resettable) { - ((Resettable) picoServices).reset(true); + } else if (injectionServices instanceof Resettable) { + ((Resettable) injectionServices).reset(true); } } } diff --git a/pico/api/src/main/java/io/helidon/pico/api/Injector.java b/inject/api/src/main/java/io/helidon/inject/api/Injector.java similarity index 81% rename from pico/api/src/main/java/io/helidon/pico/api/Injector.java rename to inject/api/src/main/java/io/helidon/inject/api/Injector.java index 25c31fa1841..ff0948e5a75 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Injector.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Injector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Used to perform programmatic activation and injection. *

    - * Note that the reference implementation of Pico only performs non-reflective, compile-time generation of service activators + * Note that the reference implementation of Injection only performs non-reflective, compile-time generation of service activators * for services that it manages. This Injector contract is mainly provided in order to allow other library extension * implementations to extend the model to perform other types of injection point resolution. */ public interface Injector { /** - * The strategy the injector should attempt to apply. The reference implementation for Pico provider only handles + * The strategy the injector should attempt to apply. The reference implementation for Injection provider only handles * {@link Injector.Strategy#ACTIVATOR} type. */ enum Strategy { @@ -37,8 +37,8 @@ enum Strategy { ACTIVATOR, /** - * Reflection based implies runtime injection strategy. Note: This is available for other 3rd parties of Pico that choose - * to use reflection as a strategy. + * Reflection based implies runtime injection strategy. Note: This is available for other 3rd parties of Injection that + * choose to use reflection as a strategy. */ REFLECTION, @@ -57,11 +57,11 @@ enum Strategy { * @param opts the injector options * @param the managed service type * @return the result of the activation - * @throws io.helidon.pico.api.PicoServiceProviderException if an injection or activation problem occurs + * @throws InjectionServiceProviderException if an injection or activation problem occurs * @see Activator */ ActivationResult activateInject(T serviceOrServiceProvider, - InjectorOptions opts) throws PicoServiceProviderException; + InjectorOptions opts) throws InjectionServiceProviderException; /** * Called to deactivate a managed service or service provider, putting it into {@link Phase#DESTROYED}. @@ -72,10 +72,10 @@ ActivationResult activateInject(T serviceOrServiceProvider, * @param opts the injector options * @param the managed service type * @return the result of the deactivation - * @throws io.helidon.pico.api.PicoServiceProviderException if a problem occurs + * @throws InjectionServiceProviderException if a problem occurs * @see DeActivator */ ActivationResult deactivate(T serviceOrServiceProvider, - InjectorOptions opts) throws PicoServiceProviderException; + InjectorOptions opts) throws InjectionServiceProviderException; } diff --git a/pico/api/src/main/java/io/helidon/pico/api/InjectorOptionsBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InjectorOptionsBlueprint.java similarity index 86% rename from pico/api/src/main/java/io/helidon/pico/api/InjectorOptionsBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/InjectorOptionsBlueprint.java index f8c988032d7..e981e4eca5e 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InjectorOptionsBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectorOptionsBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; @@ -27,7 +27,7 @@ @Prototype.Blueprint(builderInterceptor = InjectorOptionsBlueprint.Interceptor.class) interface InjectorOptionsBlueprint { /** - * The strategy the injector should apply. The default is {@link io.helidon.pico.api.Injector.Strategy#ANY}. + * The strategy the injector should apply. The default is {@link Injector.Strategy#ANY}. * * @return the injector strategy to use */ @@ -35,7 +35,7 @@ interface InjectorOptionsBlueprint { Injector.Strategy strategy(); /** - * Optionally, customized activator options to use for the {@link io.helidon.pico.api.Activator}. + * Optionally, customized activator options to use for the {@link Activator}. * * @return activator options, or leave blank to use defaults */ @@ -52,7 +52,7 @@ class Interceptor implements Prototype.BuilderInterceptor intercept(InjectorOptions.BuilderBase target) { if (target.activationRequest() == null) { - target.activationRequest(PicoServices.createActivationRequestDefault()); + target.activationRequest(InjectionServices.createActivationRequestDefault()); } return target; } diff --git a/pico/api/src/main/java/io/helidon/pico/api/Intercepted.java b/inject/api/src/main/java/io/helidon/inject/api/Intercepted.java similarity index 90% rename from pico/api/src/main/java/io/helidon/pico/api/Intercepted.java rename to inject/api/src/main/java/io/helidon/inject/api/Intercepted.java index 1f5124459b0..acfcafb83bf 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Intercepted.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Intercepted.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.lang.annotation.Documented; import java.lang.annotation.Inherited; @@ -27,7 +27,7 @@ /** * Indicates that type identified by {@link #value()} is being intercepted. * - * @see io.helidon.pico.api.Interceptor + * @see Interceptor */ @Documented @Retention(RetentionPolicy.CLASS) diff --git a/pico/api/src/main/java/io/helidon/pico/api/InterceptedTrigger.java b/inject/api/src/main/java/io/helidon/inject/api/InterceptedTrigger.java similarity index 85% rename from pico/api/src/main/java/io/helidon/pico/api/InterceptedTrigger.java rename to inject/api/src/main/java/io/helidon/inject/api/InterceptedTrigger.java index 1fcdfaedecc..086a90db79d 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InterceptedTrigger.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InterceptedTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -25,8 +25,8 @@ /** * Meta-annotation for an annotation that will trigger services annotated with it to become intercepted. * - * @see io.helidon.pico.api.Interceptor - * @see io.helidon.pico.api.Intercepted + * @see Interceptor + * @see Intercepted */ @Documented @Retention(RetentionPolicy.CLASS) diff --git a/pico/api/src/main/java/io/helidon/pico/api/Interceptor.java b/inject/api/src/main/java/io/helidon/inject/api/Interceptor.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/Interceptor.java rename to inject/api/src/main/java/io/helidon/inject/api/Interceptor.java index 84e6e989e06..9d8bbeb641e 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Interceptor.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Interceptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Implementors of this contract must be {@link jakarta.inject.Named} according to the {@link Intercepted} diff --git a/pico/api/src/main/java/io/helidon/pico/api/InternalBootstrapBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InternalBootstrapBlueprint.java similarity index 86% rename from pico/api/src/main/java/io/helidon/pico/api/InternalBootstrapBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/InternalBootstrapBlueprint.java index 19ad97430fe..3b4698b6d93 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InternalBootstrapBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InternalBootstrapBlueprint.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; import io.helidon.builder.api.Prototype; /** - * Internal bootstrap is what we store when {@link io.helidon.pico.api.PicoServices#globalBootstrap(Bootstrap)} is used. + * Internal bootstrap is what we store when {@link InjectionServices#globalBootstrap(Bootstrap)} is used. */ @Prototype.Blueprint(builderInterceptor = InternalBootstrapBlueprint.BuilderInterceptor.class) interface InternalBootstrapBlueprint { @@ -34,7 +34,7 @@ interface InternalBootstrapBlueprint { Optional bootStrap(); /** - * Only populated when {@link io.helidon.pico.api.PicoServices#TAG_DEBUG} is set. + * Only populated when {@link InjectionServices#TAG_DEBUG} is set. * * @return the calling context */ diff --git a/pico/api/src/main/java/io/helidon/pico/api/InvocationContextBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InvocationContextBlueprint.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/InvocationContextBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/InvocationContextBlueprint.java index 8a839a4608a..172e83ffdbf 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InvocationContextBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InvocationContextBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.List; import java.util.Map; diff --git a/pico/api/src/main/java/io/helidon/pico/api/InvocationException.java b/inject/api/src/main/java/io/helidon/inject/api/InvocationException.java similarity index 94% rename from pico/api/src/main/java/io/helidon/pico/api/InvocationException.java rename to inject/api/src/main/java/io/helidon/inject/api/InvocationException.java index 416c59890a0..6d176ff5b28 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InvocationException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InvocationException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Wraps any checked exceptions that are thrown during the {@link Interceptor} invocations. */ -public class InvocationException extends PicoServiceProviderException { +public class InvocationException extends InjectionServiceProviderException { /** * Tracks whether the target being intercepted was called once successfully - meaning that the target was called and it diff --git a/pico/api/src/main/java/io/helidon/pico/api/MetricsBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/MetricsBlueprint.java similarity index 90% rename from pico/api/src/main/java/io/helidon/pico/api/MetricsBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/MetricsBlueprint.java index d0ec9d59861..a94068226a3 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/MetricsBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/MetricsBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; import io.helidon.builder.api.Prototype; /** - * Pico Metrics. + * Metrics. */ @Prototype.Blueprint interface MetricsBlueprint { @@ -44,7 +44,7 @@ interface MetricsBlueprint { * The total number of {@code Services::lookup()} calls that were attempted against the lookup cache. This will be empty * if caching is disabled. * - * @see io.helidon.pico.api.PicoServicesConfig + * @see InjectionServicesConfig * @return cache lookup count */ Optional cacheLookupCount(); diff --git a/pico/api/src/main/java/io/helidon/pico/api/ModuleComponent.java b/inject/api/src/main/java/io/helidon/inject/api/ModuleComponent.java similarity index 93% rename from pico/api/src/main/java/io/helidon/pico/api/ModuleComponent.java rename to inject/api/src/main/java/io/helidon/inject/api/ModuleComponent.java index 01586f50a29..c5a657547aa 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ModuleComponent.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ModuleComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; diff --git a/pico/api/src/main/java/io/helidon/pico/api/OptionallyNamed.java b/inject/api/src/main/java/io/helidon/inject/api/OptionallyNamed.java similarity index 91% rename from pico/api/src/main/java/io/helidon/pico/api/OptionallyNamed.java rename to inject/api/src/main/java/io/helidon/inject/api/OptionallyNamed.java index 17b5ada893e..61165c9c7f7 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/OptionallyNamed.java +++ b/inject/api/src/main/java/io/helidon/inject/api/OptionallyNamed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; diff --git a/pico/api/src/main/java/io/helidon/pico/api/Phase.java b/inject/api/src/main/java/io/helidon/inject/api/Phase.java similarity index 95% rename from pico/api/src/main/java/io/helidon/pico/api/Phase.java rename to inject/api/src/main/java/io/helidon/inject/api/Phase.java index d9940b396f3..148b31cbc69 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Phase.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Phase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Forms a progression of full activation and deactivation. @@ -100,7 +100,7 @@ public enum Phase { * Determines whether this phase passes the gate for whether deactivation (PreDestroy) can be called. * * @return true if this phase is eligible to be included in shutdown processing - * @see PicoServices#shutdown() + * @see InjectionServices#shutdown() */ public boolean eligibleForDeactivation() { return eligibleForDeactivation; diff --git a/pico/api/src/main/java/io/helidon/pico/api/PostConstructMethod.java b/inject/api/src/main/java/io/helidon/inject/api/PostConstructMethod.java similarity index 90% rename from pico/api/src/main/java/io/helidon/pico/api/PostConstructMethod.java rename to inject/api/src/main/java/io/helidon/inject/api/PostConstructMethod.java index b1a7a7138f3..704a7b2df4a 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/PostConstructMethod.java +++ b/inject/api/src/main/java/io/helidon/inject/api/PostConstructMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Represents the {@link jakarta.annotation.PostConstruct} method. diff --git a/pico/api/src/main/java/io/helidon/pico/api/PreDestroyMethod.java b/inject/api/src/main/java/io/helidon/inject/api/PreDestroyMethod.java similarity index 90% rename from pico/api/src/main/java/io/helidon/pico/api/PreDestroyMethod.java rename to inject/api/src/main/java/io/helidon/inject/api/PreDestroyMethod.java index f86844e74b8..c8df0b5d44d 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/PreDestroyMethod.java +++ b/inject/api/src/main/java/io/helidon/inject/api/PreDestroyMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Represents the {@link jakarta.annotation.PreDestroy} method. diff --git a/pico/api/src/main/java/io/helidon/pico/api/QualifierBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java similarity index 98% rename from pico/api/src/main/java/io/helidon/pico/api/QualifierBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java index 673bd76fb42..fa65aad1dea 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/QualifierBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.HashMap; import java.util.Map; diff --git a/pico/api/src/main/java/io/helidon/pico/api/Qualifiers.java b/inject/api/src/main/java/io/helidon/inject/api/Qualifiers.java similarity index 98% rename from pico/api/src/main/java/io/helidon/pico/api/Qualifiers.java rename to inject/api/src/main/java/io/helidon/inject/api/Qualifiers.java index f6a604b3220..5380ec12859 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Qualifiers.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Qualifiers.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Collection; import java.util.Set; diff --git a/pico/api/src/main/java/io/helidon/pico/api/Resettable.java b/inject/api/src/main/java/io/helidon/inject/api/Resettable.java similarity index 91% rename from pico/api/src/main/java/io/helidon/pico/api/Resettable.java rename to inject/api/src/main/java/io/helidon/inject/api/Resettable.java index d433a66a208..880f72ebbc0 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Resettable.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Resettable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Implementors of this contract are capable of resetting the state of itself (i.e., clears cache, log entries, etc.). diff --git a/pico/api/src/main/java/io/helidon/pico/api/RunLevel.java b/inject/api/src/main/java/io/helidon/inject/api/RunLevel.java similarity index 92% rename from pico/api/src/main/java/io/helidon/pico/api/RunLevel.java rename to inject/api/src/main/java/io/helidon/inject/api/RunLevel.java index 1ea54ee2512..e51bbe46c30 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/RunLevel.java +++ b/inject/api/src/main/java/io/helidon/inject/api/RunLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.lang.annotation.Documented; import java.lang.annotation.Retention; @@ -24,7 +24,7 @@ import static java.lang.annotation.ElementType.TYPE; /** - * Indicates the desired startup sequence for a service class. This is not used internally by Pico, but is available as a + * Indicates the desired startup sequence for a service class. This is not used internally by Injection, but is available as a * convenience to the caller in support for a specific startup sequence for service activations. */ @Documented diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceBinder.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceBinder.java similarity index 91% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceBinder.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceBinder.java index 48acbd9f18b..865043ece6f 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceBinder.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceBinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Responsible for binding service providers to the service registry. diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBasicsBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBasicsBlueprint.java similarity index 92% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBasicsBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBasicsBlueprint.java index 39f60b3a9d6..5e0ae9399e0 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBasicsBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBasicsBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; import java.util.Set; @@ -33,11 +33,11 @@ interface ServiceInfoBasicsBlueprint { /** - * Default weight for any internal Pico service component. It is defined to be + * Default weight for any internal Injection service component. It is defined to be * {@link io.helidon.common.Weighted#DEFAULT_WEIGHT} {@code - 1} in order to allow any other service implementation to * naturally have a higher weight (since it will use the {@code DEFAULT_WEIGHT} unless explicitly overridden. */ - double DEFAULT_PICO_WEIGHT = Weighted.DEFAULT_WEIGHT - 1; + double DEFAULT_INJECT_WEIGHT = Weighted.DEFAULT_WEIGHT - 1; /** * The managed service implementation {@link Class}. @@ -65,7 +65,7 @@ interface ServiceInfoBasicsBlueprint { /** * The managed services advertised types (i.e., typically its interfaces). * - * @see io.helidon.pico.api.ExternalContracts + * @see ExternalContracts * @return the service contracts implemented */ @Prototype.Singular("contractImplemented") diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBlueprint.java similarity index 97% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBlueprint.java index f3887fc3c5b..0e36179ef93 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Objects; import java.util.Optional; @@ -38,7 +38,7 @@ interface ServiceInfoBlueprint extends ServiceInfoBasicsBlueprint, ServiceInfoBa * {@link #contractsImplemented()}. External contracts are from other modules other than the module containing * the implementation typically. * - * @see io.helidon.pico.api.ExternalContracts + * @see ExternalContracts * @return the service external contracts implemented */ @Prototype.Singular("externalContractImplemented") @@ -70,7 +70,7 @@ interface ServiceInfoBlueprint extends ServiceInfoBasicsBlueprint, ServiceInfoBa // when we split ServiceInfo into ServiceInfoCriteria. Sometimes we need ServiceInfo.matches(criteria), and other times // ServiceInfoCriteria.matches(criteria). default boolean matches(ServiceInfoCriteria criteria) { - if (criteria == PicoServices.EMPTY_CRITERIA) { + if (criteria == InjectionServices.EMPTY_CRITERIA) { return true; } diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBuildInterceptor.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBuildInterceptor.java similarity index 97% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBuildInterceptor.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBuildInterceptor.java index 4774aae4388..16113b13876 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoBuildInterceptor.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBuildInterceptor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import io.helidon.builder.api.Prototype; diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoCriteriaBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoCriteriaBlueprint.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceInfoCriteriaBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceInfoCriteriaBlueprint.java index f4f7ab653a3..fd4792ffc26 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceInfoCriteriaBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoCriteriaBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Objects; import java.util.Optional; @@ -60,7 +60,7 @@ interface ServiceInfoCriteriaBlueprint { /** * The managed services advertised types (i.e., typically its interfaces). * - * @see io.helidon.pico.api.ExternalContracts + * @see ExternalContracts * @return the service contracts implemented */ @Prototype.Singular("contractImplemented") @@ -85,7 +85,7 @@ interface ServiceInfoCriteriaBlueprint { * {@link #contractsImplemented()}. External contracts are from other modules other than the module containing * the implementation typically. * - * @see io.helidon.pico.api.ExternalContracts + * @see ExternalContracts * @return the service external contracts implemented */ @Prototype.Singular("externalContractImplemented") @@ -145,7 +145,7 @@ && matches(runLevel(), criteria.runLevel()) * @return true if the criteria provided matches this instance from only the contracts point of view */ default boolean matchesContracts(ServiceInfoCriteriaBlueprint criteria) { - if (criteria == PicoServices.EMPTY_CRITERIA) { + if (criteria == InjectionServices.EMPTY_CRITERIA) { return true; } diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceInjectionPlanBinder.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInjectionPlanBinder.java similarity index 97% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceInjectionPlanBinder.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceInjectionPlanBinder.java index e000b9bc3c2..3c5c8b8434d 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceInjectionPlanBinder.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInjectionPlanBinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Responsible for registering the injection plan to the services in the service registry. diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceProvider.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProvider.java similarity index 96% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceProvider.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceProvider.java index 9e750ffe67a..cbc0b5778e2 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; @@ -112,7 +112,7 @@ public interface ServiceProvider extends InjectionPointProvider, Weighted Optional preDestroyMethod(); /** - * The agent/instance to be used for binding this service provider to the pico application that was code generated. + * The agent/instance to be used for binding this service provider to the injectable application that was code generated. * * @return the service provider that should be used for binding, or empty if this provider does not support binding * @see ModuleComponent diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceProviderBindable.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderBindable.java similarity index 83% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceProviderBindable.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceProviderBindable.java index fc8c2335b3d..c18cc1b6d78 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceProviderBindable.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderBindable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Optional; /** - * An extension to {@link ServiceProvider} that allows for startup binding from a {@code Pico$$Application}, - * and thereby works in conjunction with the {@link ServiceBinder} during pico service registry + * An extension to {@link ServiceProvider} that allows for startup binding from a {@code Injection$$Application}, + * and thereby works in conjunction with the {@link ServiceBinder} during injection service registry * initialization. *

    * The only guarantee the provider implementation has is ensuring that {@link ModuleComponent} instances - * are bound to the pico services instances, as well as informed on the module name. + * are bound to the Services instances, as well as informed on the module name. *

    * Generally this class should be called internally by the framework, and typically occurs only during initialization sequences. * @@ -109,21 +109,21 @@ default void rootProvider(ServiceProvider rootProvider) { } /** - * Returns the previously assigned {@link PicoServices} instance. + * Returns the previously assigned {@link InjectionServices} instance. * - * @return the previously assigned pico services instance, or empty if never assigned + * @return the previously assigned injection services instance, or empty if never assigned * - * @see #picoServices(Optional) + * @see #injectionServices(Optional) */ - Optional picoServices(); + Optional injectionServices(); /** * Assigns the services instance this provider is bound to. A service provider can be associated with 0..1 services instance. - * If not set, the service provider should use {@link PicoServices#picoServices()} to ascertain the instance. + * If not set, the service provider should use {@link InjectionServices#injectionServices()} to ascertain the instance. * - * @param picoServices the pico services instance, or empty to clear any active binding + * @param injectionServices the injection services instance, or empty to clear any active binding */ - void picoServices(Optional picoServices); + void injectionServices(Optional injectionServices); /** * The binder can be provided by the service provider to deterministically set the injection plan at compile-time, and diff --git a/pico/api/src/main/java/io/helidon/pico/api/InjectionException.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java similarity index 74% rename from pico/api/src/main/java/io/helidon/pico/api/InjectionException.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java index da22e6391de..e9657a108fb 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/InjectionException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.Objects; import java.util.Optional; @@ -23,12 +23,12 @@ * Represents an injection exception. These might be thrown either at compile time or at runtime depending upon how the * application is built. */ -public class InjectionException extends PicoServiceProviderException { +public class ServiceProviderInjectionException extends InjectionServiceProviderException { /** * The optional activation log (configure to enabled). * - * @see PicoServicesConfig#activationLogs() + * @see InjectionServicesConfig#activationLogs() */ private ActivationLog activationLog; @@ -37,7 +37,7 @@ public class InjectionException extends PicoServiceProviderException { * * @param msg the message */ - public InjectionException(String msg) { + public ServiceProviderInjectionException(String msg) { super(msg); } @@ -48,9 +48,9 @@ public InjectionException(String msg) { * @param cause the root cause * @param serviceProvider the service provider */ - public InjectionException(String msg, - Throwable cause, - ServiceProvider serviceProvider) { + public ServiceProviderInjectionException(String msg, + Throwable cause, + ServiceProvider serviceProvider) { super(msg, cause, serviceProvider); } @@ -60,8 +60,8 @@ public InjectionException(String msg, * @param msg the message * @param serviceProvider the service provider */ - public InjectionException(String msg, - ServiceProvider serviceProvider) { + public ServiceProviderInjectionException(String msg, + ServiceProvider serviceProvider) { super(msg, serviceProvider); } @@ -80,7 +80,7 @@ public Optional activationLog() { * @param log the activation log * @return this exception instance */ - public InjectionException activationLog(ActivationLog log) { + public ServiceProviderInjectionException activationLog(ActivationLog log) { this.activationLog = Objects.requireNonNull(log); return this; } diff --git a/pico/api/src/main/java/io/helidon/pico/api/ServiceProviderProvider.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderProvider.java similarity index 95% rename from pico/api/src/main/java/io/helidon/pico/api/ServiceProviderProvider.java rename to inject/api/src/main/java/io/helidon/inject/api/ServiceProviderProvider.java index 627a3f724db..b524d01a1ad 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/ServiceProviderProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.List; import java.util.Map; diff --git a/pico/api/src/main/java/io/helidon/pico/api/Services.java b/inject/api/src/main/java/io/helidon/inject/api/Services.java similarity index 86% rename from pico/api/src/main/java/io/helidon/pico/api/Services.java rename to inject/api/src/main/java/io/helidon/inject/api/Services.java index 7223500da92..5e733b29211 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Services.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Services.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.List; import java.util.Optional; @@ -26,15 +26,15 @@ * application, along with the contracts (i.e., interfaces) they advertise, the qualifiers that optionally describe them, and oll * of each services' dependencies on other service contracts, etc. *

    - * Collectively these service instances are considered "the managed service instances" under Pico. A {@link ServiceProvider} + * Collectively these service instances are considered "the managed service instances" under Injection. A {@link ServiceProvider} * wrapper * provides lifecycle management on the underlying service instances that each provider "manages" in terms of activation, scoping, - * etc. The service providers are typically created during compile-time processing when the Pico APT processor is applied to your + * etc. The service providers are typically created during compile-time processing when the Injection APT processor is applied to your * module (i.e., any service annotated using {@link jakarta.inject.Singleton}, * {@link Contract}, {@link jakarta.inject.Inject}, etc.) during compile time. Additionally, they can be built - * using the Pico maven-plugin. Note also that the maven-plugin can be used to "compute" your applications entire DI model + * using the Injection maven-plugin. Note also that the maven-plugin can be used to "compute" your applications entire DI model * at compile time, generating an {@link Application} class that will be used at startup when found by the - * Pico framework. + * Injection framework. *

    * This Services interface exposes a read-only set of methods providing access to these "managed service" providers, and available * via one of the lookup methods provided. Once you resolve the service provider(s), the service provider can be activated by @@ -44,10 +44,11 @@ * activation chaining, it is recommended to that users strive to use {@link jakarta.inject.Provider} injection whenever possible. * Provider injection (a) breaks long activation chains from occurring by deferring activation until when those services are * really - * needed, and (b) breaks circular references that lead to {@link InjectionException} during activation (i.e., + * needed, and (b) breaks circular references that lead to {@link ServiceProviderInjectionException} during activation (i.e., * service A injects B, and service B injects A). *

    - * The services are ranked according to the provider's comparator. Pico will rank according to a strategy that first looks for + * The services are ranked according to the provider's comparator. The Injection framework will rank according to a strategy that + * first looks for * {@link io.helidon.common.Weighted}, then {@link jakarta.annotation.Priority}, and finally by the alphabetic ordering according * to the type name (package and class canonical name). */ @@ -59,11 +60,11 @@ public interface Services { * @param type the type to find * @param the type of the service * @return the best service provider matching the criteria - * @throws io.helidon.pico.api.PicoException if resolution fails to resolve a match + * @throws InjectionException if resolution fails to resolve a match */ default ServiceProvider lookup(Class type) { return lookupFirst(type, true) - .orElseThrow(() -> new PicoException("There are no service providers for service of type " + type.getName())); + .orElseThrow(() -> new InjectionException("There are no service providers for service of type " + type.getName())); } /** @@ -74,12 +75,12 @@ default ServiceProvider lookup(Class type) { * @param name the name for the service * @param the type of the service * @return the best service provider matching the criteria - * @throws io.helidon.pico.api.PicoException if resolution fails to resolve a match + * @throws InjectionException if resolution fails to resolve a match */ default ServiceProvider lookup(Class type, String name) { return lookupFirst(type, name, true) - .orElseThrow(() -> new PicoException("There are no service providers for service of type " + type.getName())); + .orElseThrow(() -> new InjectionException("There are no service providers for service of type " + type.getName())); } /** @@ -90,7 +91,7 @@ default ServiceProvider lookup(Class type, * @param expected indicates whether the provider should throw if a match is not found * @param the type of the service * @return the best service provider matching the criteria, or {@code empty} if (@code expected = false) and no match found - * @throws io.helidon.pico.api.PicoException if expected=true and resolution fails to resolve a match + * @throws InjectionException if expected=true and resolution fails to resolve a match */ Optional> lookupFirst(Class type, boolean expected); @@ -104,7 +105,7 @@ Optional> lookupFirst(Class type, * @param expected indicates whether the provider should throw if a match is not found * @param the type of the service * @return the best service provider matching the criteria, or {@code empty} if (@code expected = false) and no match found - * @throws io.helidon.pico.api.PicoException if expected=true and resolution fails to resolve a match + * @throws InjectionException if expected=true and resolution fails to resolve a match */ Optional> lookupFirst(Class type, String name, @@ -115,7 +116,7 @@ Optional> lookupFirst(Class type, * * @param criteria the criteria to find * @return the best service provider - * @throws io.helidon.pico.api.PicoException if resolution fails to resolve a match + * @throws InjectionException if resolution fails to resolve a match */ default ServiceProvider lookup(ServiceInfoCriteria criteria) { return lookupFirst(criteria, true).orElseThrow(); @@ -127,7 +128,7 @@ default ServiceProvider lookup(ServiceInfoCriteria criteria) { * @param criteria the criteria to find * @param expected indicates whether the provider should throw if a match is not found * @return the best service provider matching the criteria, or {@code empty} if (@code expected = false) and no match found - * @throws io.helidon.pico.api.PicoException if expected=true and resolution fails to resolve a match + * @throws InjectionException if expected=true and resolution fails to resolve a match */ Optional> lookupFirst(ServiceInfoCriteria criteria, boolean expected); @@ -139,7 +140,7 @@ Optional> lookupFirst(ServiceInfoCriteria criteria, * @param criteria the criteria to find * @param expected indicates whether the provider should throw if a match is not found * @return the best service provider matching the criteria, or {@code empty} if (@code expected = false) and no match found - * @throws io.helidon.pico.api.PicoException if expected=true and resolution fails to resolve a match + * @throws InjectionException if expected=true and resolution fails to resolve a match * @param type of the service */ @SuppressWarnings({"unchecked", "rawtypes"}) @@ -160,7 +161,7 @@ default Optional> lookupFirst(Class contract, ServiceI * * @param criteria the criteria to find * @return the best service provider matching the criteria - * @throws io.helidon.pico.api.PicoException if resolution fails to resolve a match + * @throws InjectionException if resolution fails to resolve a match */ default ServiceProvider lookupFirst(ServiceInfoCriteria criteria) { return lookupFirst(criteria, true).orElseThrow(); @@ -177,7 +178,7 @@ default ServiceProvider lookupFirst(ServiceInfoCriteria criteria) { * @param type the type criteria to find * @param the type of the service * @return the best service provider matching the criteria - * @throws io.helidon.pico.api.PicoException if resolution fails to resolve a match + * @throws InjectionException if resolution fails to resolve a match */ default ServiceProvider lookupFirst(Class type) { return lookupFirst(type, true).orElseThrow(); @@ -234,7 +235,7 @@ List> lookupAll(ServiceInfoCriteria criteria, * * @param ctx the injection point context to use to filter the services to what qualifies for this injection point * @return the qualifying services relative to the given context - * @see PicoServicesConfig#supportsContextualLookup() + * @see InjectionServicesConfig#supportsContextualLookup() */ default Services contextualServices(InjectionPointInfo ctx) { return this; diff --git a/pico/api/src/main/java/io/helidon/pico/api/Startable.java b/inject/api/src/main/java/io/helidon/inject/api/Startable.java similarity index 94% rename from pico/api/src/main/java/io/helidon/pico/api/Startable.java rename to inject/api/src/main/java/io/helidon/inject/api/Startable.java index 33352f6c596..5fc846aecf1 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/Startable.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Startable.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; /** * Some components may require start when Helidon is bootstrapped, such as WebServer (to open server sockets). @@ -25,7 +25,7 @@ * {@link jakarta.annotation.PostConstruct} - where we create a fully configured instance) is different from its start * transition (such as opening sockets, connecting to remote messaging queues, streams, topics, etc.). * - * @see io.helidon.pico.api.Helidon#start() + * @see Helidon#start() */ @Contract public interface Startable { diff --git a/pico/api/src/main/java/io/helidon/pico/api/package-info.java b/inject/api/src/main/java/io/helidon/inject/api/package-info.java similarity index 53% rename from pico/api/src/main/java/io/helidon/pico/api/package-info.java rename to inject/api/src/main/java/io/helidon/inject/api/package-info.java index 09c94eb65f4..32d16507709 100644 --- a/pico/api/src/main/java/io/helidon/pico/api/package-info.java +++ b/inject/api/src/main/java/io/helidon/inject/api/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,13 @@ */ /** - * The Pico API provide these annotation types that are typically used at compile time - * to assign special meaning to the type. It is used in conjunction with Helidon tooling (see the {@code pico-processor} and - * {@code pico-maven-plugin} modules) to create and validate the DI module at compile time. + * The Helidon Injection API provide these annotation types that are typically used at compile time + * to assign special meaning to the type. It is used in conjunction with Helidon tooling (see the {@code injection processor} and + * injectio {@code maven-plugin} modules) to create and validate the DI module at compile time. *

      - *
    • {@link io.helidon.pico.api.Contract} - signifies that the type can be used for lookup in the service registry.
    • - *
    • {@link io.helidon.pico.api.ExternalContracts} - same as Contract, but applied to the implementation class instead.
    • - *
    • {@link io.helidon.pico.api.RunLevel} - ascribes meaning for when the service should start.
    • + *
    • {@link io.helidon.inject.api.Contract} - signifies that the type can be used for lookup in the service registry.
    • + *
    • {@link io.helidon.inject.api.ExternalContracts} - same as Contract, but applied to the implementation class instead.
    • + *
    • {@link io.helidon.inject.api.RunLevel} - ascribes meaning for when the service should start.
    • *
    * Also note that the set of annotations from both the {@code jakarta.inject} and {@code jakarta.annotation} modules are the * primary way to annotate your DI model types. @@ -29,8 +29,8 @@ * Other types from the API are less commonly used, but are still made available for situations where programmatic access * is required or desirable in some way. The two most common types for entry into this part of the API are shown below. *
      - *
    • {@link io.helidon.pico.api.PicoServices} - suite of services that are typically delivered by the Pico provider.
    • - *
    • {@link io.helidon.pico.api.Services} - the services registry, which is one such service from this suite.
    • + *
    • {@link io.helidon.inject.api.InjectionServices} - suite of services that are typically delivered by the Injection provider.
    • + *
    • {@link io.helidon.inject.api.Services} - the services registry, which is one such service from this suite.
    • *
    */ -package io.helidon.pico.api; +package io.helidon.inject.api; diff --git a/pico/api/src/main/java/io/helidon/pico/spi/InjectionPlanBlueprint.java b/inject/api/src/main/java/io/helidon/inject/spi/InjectionPlanBlueprint.java similarity index 91% rename from pico/api/src/main/java/io/helidon/pico/spi/InjectionPlanBlueprint.java rename to inject/api/src/main/java/io/helidon/inject/spi/InjectionPlanBlueprint.java index 05c1b9e0a4b..7cc2b4eeaa9 100644 --- a/pico/api/src/main/java/io/helidon/pico/spi/InjectionPlanBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/spi/InjectionPlanBlueprint.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.spi; +package io.helidon.inject.spi; import java.util.List; import java.util.Optional; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.ServiceProvider; /** - * Represents the injection plan targeting a given {@link io.helidon.pico.api.ServiceProvider}. + * Represents the injection plan targeting a given {@link io.helidon.inject.api.ServiceProvider}. */ @Prototype.Blueprint interface InjectionPlanBlueprint { @@ -41,7 +41,7 @@ interface InjectionPlanBlueprint { * * @return the injection point info for this element */ - io.helidon.pico.api.InjectionPointInfo injectionPointInfo(); + io.helidon.inject.api.InjectionPointInfo injectionPointInfo(); /** * The list of service providers that are qualified to satisfy the given injection point for this service provider. diff --git a/pico/api/src/main/java/io/helidon/pico/spi/InjectionResolver.java b/inject/api/src/main/java/io/helidon/inject/spi/InjectionResolver.java similarity index 83% rename from pico/api/src/main/java/io/helidon/pico/spi/InjectionResolver.java rename to inject/api/src/main/java/io/helidon/inject/spi/InjectionResolver.java index 4eb65604592..0ff7127a83e 100644 --- a/pico/api/src/main/java/io/helidon/pico/spi/InjectionResolver.java +++ b/inject/api/src/main/java/io/helidon/inject/spi/InjectionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.spi; +package io.helidon.inject.spi; import java.util.Optional; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceProvider; /** * Implementors of this contract can assist with resolving injection points. @@ -36,13 +36,13 @@ public interface InjectionResolver { * Phase 2 (resolveIps=true) is during actual resolution, and typically comes during the service activation lifecycle. * * @param ipInfo the injection point being resolved - * @param picoServices the pico services + * @param injectionServices the services registry * @param serviceProvider the service provider this pertains to * @param resolveIps flag indicating whether injection points should be resolved * @return the resolution for the plan or the injection point, or empty if unable to resolve the injection point context */ Optional resolve(InjectionPointInfo ipInfo, - PicoServices picoServices, + InjectionServices injectionServices, ServiceProvider serviceProvider, boolean resolveIps); diff --git a/pico/api/src/main/java/io/helidon/pico/spi/PicoServicesProvider.java b/inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java similarity index 59% rename from pico/api/src/main/java/io/helidon/pico/spi/PicoServicesProvider.java rename to inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java index 24101edafef..76fd1ecba78 100644 --- a/pico/api/src/main/java/io/helidon/pico/spi/PicoServicesProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,23 +14,23 @@ * limitations under the License. */ -package io.helidon.pico.spi; +package io.helidon.inject.spi; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; /** - * Java {@link java.util.ServiceLoader} provider interface to find implementation of {@link io.helidon.pico.api.PicoServices}. + * Java {@link java.util.ServiceLoader} provider interface to find implementation of {@link InjectionServices}. */ -public interface PicoServicesProvider { +public interface InjectionServicesProvider { /** - * Provide the {@code Pico} Services implementation given the provided primordial {@link io.helidon.pico.api.Bootstrap} + * Provide the {@code Injection} Services implementation given the provided primordial {@link Bootstrap} * configuration instance. * * @param bootstrap the primordial bootstrap configuration - * @return pico services instance configured with the provided bootstrap instance + * @return services instance configured with the provided bootstrap instance */ - PicoServices services(Bootstrap bootstrap); + InjectionServices services(Bootstrap bootstrap); } diff --git a/pico/api/src/main/java/io/helidon/pico/spi/package-info.java b/inject/api/src/main/java/io/helidon/inject/spi/package-info.java similarity index 84% rename from pico/api/src/main/java/io/helidon/pico/spi/package-info.java rename to inject/api/src/main/java/io/helidon/inject/spi/package-info.java index 4b49b7ae31f..a3950aba365 100644 --- a/pico/api/src/main/java/io/helidon/pico/spi/package-info.java +++ b/inject/api/src/main/java/io/helidon/inject/spi/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,6 @@ */ /** - * Pico SPI. + * Injection SPI. */ -package io.helidon.pico.spi; +package io.helidon.inject.spi; diff --git a/pico/api/src/main/java/module-info.java b/inject/api/src/main/java/module-info.java similarity index 81% rename from pico/api/src/main/java/module-info.java rename to inject/api/src/main/java/module-info.java index 94b0d333ee7..7a4e7923271 100644 --- a/pico/api/src/main/java/module-info.java +++ b/inject/api/src/main/java/module-info.java @@ -14,10 +14,12 @@ * limitations under the License. */ +import io.helidon.inject.spi.InjectionServicesProvider; + /** - * Pico API module. + * Injection API module. */ -module io.helidon.pico.api { +module io.helidon.inject.api { requires jakarta.inject; requires io.helidon.common.types; requires io.helidon.common; @@ -27,8 +29,8 @@ requires static jakarta.annotation; requires io.helidon.logging.common; - exports io.helidon.pico.api; - exports io.helidon.pico.spi; + exports io.helidon.inject.api; + exports io.helidon.inject.spi; - uses io.helidon.pico.spi.PicoServicesProvider; + uses InjectionServicesProvider; } diff --git a/pico/api/src/test/java/io/helidon/pico/api/PicoServicesTest.java b/inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java similarity index 58% rename from pico/api/src/test/java/io/helidon/pico/api/PicoServicesTest.java rename to inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java index f2231719b9f..0919c239b9c 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/PicoServicesTest.java +++ b/inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; -import io.helidon.pico.api.testsubjects.PicoServices2; +import io.helidon.inject.api.testsubjects.InjectionServices2; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -31,42 +31,42 @@ import static org.junit.jupiter.api.Assertions.assertThrows; /** - * PicoServices tests. + * Injection services tests. */ -class PicoServicesTest { +class InjectionServicesTest { @BeforeEach @AfterEach void reset() { - PicoServicesHolder.reset(); + InjectionServicesHolder.reset(); } /** * Test basic loader. */ @Test - void testGetPicoServices() { - assertThat(PicoServices.globalBootstrap(), optionalEmpty()); + void testGetInjectionServices() { + assertThat(InjectionServices.globalBootstrap(), optionalEmpty()); Bootstrap bootstrap = Bootstrap.builder().build(); - PicoServices.globalBootstrap(bootstrap); - assertThat(PicoServices.globalBootstrap().orElseThrow(), sameInstance(bootstrap)); + InjectionServices.globalBootstrap(bootstrap); + assertThat(InjectionServices.globalBootstrap().orElseThrow(), sameInstance(bootstrap)); - IllegalStateException e = assertThrows(IllegalStateException.class, () -> PicoServices.globalBootstrap(bootstrap)); + IllegalStateException e = assertThrows(IllegalStateException.class, () -> InjectionServices.globalBootstrap(bootstrap)); assertThat(e.getMessage(), equalTo("The bootstrap has already been set - " - + "use the (-D and/or -A) tag 'pico.debug=true' to see full trace output.")); + + "use the (-D and/or -A) tag 'inject.debug=true' to see full trace output.")); - PicoServices picoServices = PicoServices.picoServices().orElseThrow(); - assertThat(picoServices, notNullValue()); - assertThat(picoServices, instanceOf(PicoServices2.class)); - assertThat(picoServices, sameInstance(PicoServices.picoServices().orElseThrow())); + InjectionServices injectionServices = InjectionServices.injectionServices().orElseThrow(); + assertThat(injectionServices, notNullValue()); + assertThat(injectionServices, instanceOf(InjectionServices2.class)); + assertThat(injectionServices, sameInstance(InjectionServices.injectionServices().orElseThrow())); - assertThat(picoServices.bootstrap(), sameInstance(bootstrap)); + assertThat(injectionServices.bootstrap(), sameInstance(bootstrap)); } @Test void unrealizedServices() { - assertThat(PicoServices.unrealizedServices(), optionalEmpty()); + assertThat(InjectionServices.unrealizedServices(), optionalEmpty()); } } diff --git a/pico/api/src/test/java/io/helidon/pico/api/PriorityAndServiceTypeComparatorTest.java b/inject/api/src/test/java/io/helidon/inject/api/PriorityAndServiceTypeComparatorTest.java similarity index 82% rename from pico/api/src/test/java/io/helidon/pico/api/PriorityAndServiceTypeComparatorTest.java rename to inject/api/src/test/java/io/helidon/inject/api/PriorityAndServiceTypeComparatorTest.java index bc908d23737..943f57a1ca3 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/PriorityAndServiceTypeComparatorTest.java +++ b/inject/api/src/test/java/io/helidon/inject/api/PriorityAndServiceTypeComparatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.util.ArrayList; import java.util.Comparator; @@ -22,9 +22,9 @@ import io.helidon.common.Weighted; import io.helidon.common.Weights; -import io.helidon.pico.api.testsubjects.PicoServices1Provider; -import io.helidon.pico.api.testsubjects.PicoServices2Provider; -import io.helidon.pico.api.testsubjects.PicoServices3Provider; +import io.helidon.inject.api.testsubjects.InjectionServices2Provider; +import io.helidon.inject.api.testsubjects.InjectionServices3Provider; +import io.helidon.inject.api.testsubjects.InjectionServices1Provider; import org.junit.jupiter.api.Test; @@ -35,7 +35,7 @@ import static org.hamcrest.Matchers.lessThan; /** - * Ensure the weights comparator from common works the way we expect it to. Sanity test for Pico... + * Ensure the weights comparator from common works the way we expect it to. Sanity test for Injection. */ class PriorityAndServiceTypeComparatorTest { @@ -71,13 +71,13 @@ void ordering() { assertThat(comparator.compare(null, new JustAClass()), is(greaterThan(0))); assertThat(comparator.compare(new JustAClass(), null), is(lessThan(0))); - var list = new ArrayList<>(List.of(new PicoServices1Provider(), - new PicoServices2Provider(), - new PicoServices3Provider())); + var list = new ArrayList<>(List.of(new InjectionServices1Provider(), + new InjectionServices2Provider(), + new InjectionServices3Provider())); list.sort(comparator); - assertThat(list.get(0), instanceOf(PicoServices2Provider.class)); - assertThat(list.get(1), instanceOf(PicoServices3Provider.class)); - assertThat(list.get(2), instanceOf(PicoServices1Provider.class)); + assertThat(list.get(0), instanceOf(InjectionServices2Provider.class)); + assertThat(list.get(1), instanceOf(InjectionServices3Provider.class)); + assertThat(list.get(2), instanceOf(InjectionServices1Provider.class)); } static class DefaultWeight implements Weighted { diff --git a/pico/api/src/test/java/io/helidon/pico/api/QualifierTest.java b/inject/api/src/test/java/io/helidon/inject/api/QualifierTest.java similarity index 97% rename from pico/api/src/test/java/io/helidon/pico/api/QualifierTest.java rename to inject/api/src/test/java/io/helidon/inject/api/QualifierTest.java index e1e54b974b8..834e6285ac7 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/QualifierTest.java +++ b/inject/api/src/test/java/io/helidon/inject/api/QualifierTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import io.helidon.common.types.Annotation; @@ -41,7 +41,7 @@ void buildAndCompare() { is(0)); } - @Named("io.helidon.pico.api.DefaultQualifierTest") + @Named("io.helidon.inject.api.DefaultQualifierTest") @ClassNamed(QualifierTest.class) @Test public void createClassNamed() throws Exception { diff --git a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/AbstractPicoServices.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java similarity index 71% rename from pico/api/src/test/java/io/helidon/pico/api/testsubjects/AbstractPicoServices.java rename to inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java index 9b93fbe589b..9c920b4a9b5 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/AbstractPicoServices.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,26 +14,26 @@ * limitations under the License. */ -package io.helidon.pico.api.testsubjects; +package io.helidon.inject.api.testsubjects; import java.util.Map; import java.util.Optional; import java.util.Set; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ActivationLog; -import io.helidon.pico.api.ActivationResult; -import io.helidon.pico.api.Injector; -import io.helidon.pico.api.Metrics; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesConfig; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.ActivationLog; +import io.helidon.inject.api.ActivationResult; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Injector; +import io.helidon.inject.api.Metrics; +import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.Services; -abstract class AbstractPicoServices implements PicoServices { +abstract class AbstractInjectionServices implements InjectionServices { @Override - public PicoServicesConfig config() { + public InjectionServicesConfig config() { return null; } diff --git a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java similarity index 70% rename from pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1.java rename to inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java index 332d8d30744..891ee3809b2 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.api.testsubjects; +package io.helidon.inject.api.testsubjects; import java.util.Objects; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServicesConfig; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServicesConfig; -class PicoServices1 extends AbstractPicoServices { +class InjectionServices1 extends AbstractInjectionServices { private final Bootstrap bootstrap; - PicoServices1(Bootstrap bootstrap) { + InjectionServices1(Bootstrap bootstrap) { this.bootstrap = Objects.requireNonNull(bootstrap); } @@ -34,7 +34,7 @@ public Bootstrap bootstrap() { } @Override - public PicoServicesConfig config() { + public InjectionServicesConfig config() { return null; } diff --git a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1Provider.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java similarity index 59% rename from pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1Provider.java rename to inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java index e1626c813d0..199b6eb1e71 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices1Provider.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.api.testsubjects; +package io.helidon.inject.api.testsubjects; import io.helidon.common.Weight; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.spi.PicoServicesProvider; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.spi.InjectionServicesProvider; @Weight(1) -public class PicoServices1Provider implements PicoServicesProvider { +public class InjectionServices1Provider implements InjectionServicesProvider { @Override - public PicoServices services(Bootstrap bootstrap) { - return new PicoServices1(bootstrap); + public InjectionServices services(Bootstrap bootstrap) { + return new InjectionServices1(bootstrap); } } diff --git a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java similarity index 75% rename from pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3.java rename to inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java index 35d8aa6e406..f448b3c883f 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.api.testsubjects; +package io.helidon.inject.api.testsubjects; import java.util.Objects; -import io.helidon.pico.api.Bootstrap; +import io.helidon.inject.api.Bootstrap; -class PicoServices3 extends AbstractPicoServices { +public class InjectionServices2 extends AbstractInjectionServices { private final Bootstrap bootstrap; - PicoServices3(Bootstrap bootstrap) { + InjectionServices2(Bootstrap bootstrap) { this.bootstrap = Objects.requireNonNull(bootstrap); } diff --git a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2Provider.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java similarity index 59% rename from pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2Provider.java rename to inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java index c6bf5efe47d..222fc4e9124 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2Provider.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.api.testsubjects; +package io.helidon.inject.api.testsubjects; import io.helidon.common.Weight; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.spi.PicoServicesProvider; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.spi.InjectionServicesProvider; @Weight(20) -public class PicoServices2Provider implements PicoServicesProvider { +public class InjectionServices2Provider implements InjectionServicesProvider { @Override - public PicoServices services(Bootstrap bootstrap) { - return new PicoServices2(bootstrap); + public InjectionServices services(Bootstrap bootstrap) { + return new InjectionServices2(bootstrap); } } diff --git a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java similarity index 76% rename from pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2.java rename to inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java index 02f822f59d0..bfd909da038 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices2.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.api.testsubjects; +package io.helidon.inject.api.testsubjects; import java.util.Objects; -import io.helidon.pico.api.Bootstrap; +import io.helidon.inject.api.Bootstrap; -public class PicoServices2 extends AbstractPicoServices { +class InjectionServices3 extends AbstractInjectionServices { private final Bootstrap bootstrap; - PicoServices2(Bootstrap bootstrap) { + InjectionServices3(Bootstrap bootstrap) { this.bootstrap = Objects.requireNonNull(bootstrap); } diff --git a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3Provider.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java similarity index 59% rename from pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3Provider.java rename to inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java index 8e5c756268e..b216b03923b 100644 --- a/pico/api/src/test/java/io/helidon/pico/api/testsubjects/PicoServices3Provider.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.api.testsubjects; +package io.helidon.inject.api.testsubjects; import io.helidon.common.Weight; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.spi.PicoServicesProvider; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.spi.InjectionServicesProvider; @Weight(3) -public class PicoServices3Provider implements PicoServicesProvider { +public class InjectionServices3Provider implements InjectionServicesProvider { @Override - public PicoServices services(Bootstrap bootstrap) { - return new PicoServices3(bootstrap); + public InjectionServices services(Bootstrap bootstrap) { + return new InjectionServices3(bootstrap); } } diff --git a/pico/api/src/test/resources/META-INF/services/io.helidon.pico.spi.PicoServicesProvider b/inject/api/src/test/resources/META-INF/services/io.helidon.inject.spi.InjectionServicesProvider similarity index 76% rename from pico/api/src/test/resources/META-INF/services/io.helidon.pico.spi.PicoServicesProvider rename to inject/api/src/test/resources/META-INF/services/io.helidon.inject.spi.InjectionServicesProvider index 0c99f74be7c..a5f0fde425e 100644 --- a/pico/api/src/test/resources/META-INF/services/io.helidon.pico.spi.PicoServicesProvider +++ b/inject/api/src/test/resources/META-INF/services/io.helidon.inject.spi.InjectionServicesProvider @@ -13,6 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -io.helidon.pico.api.testsubjects.PicoServices1Provider -io.helidon.pico.api.testsubjects.PicoServices2Provider -io.helidon.pico.api.testsubjects.PicoServices3Provider +io.helidon.inject.api.testsubjects.InjectionServices1Provider +io.helidon.inject.api.testsubjects.InjectionServices2Provider +io.helidon.inject.api.testsubjects.InjectionServices3Provider diff --git a/pico/configdriven/README.md b/inject/configdriven/README.md similarity index 68% rename from pico/configdriven/README.md rename to inject/configdriven/README.md index 4b091df4746..c01957fe14a 100644 --- a/pico/configdriven/README.md +++ b/inject/configdriven/README.md @@ -1,6 +1,6 @@ # Config-driven -This is a specialization of the [Pico](../)'s that is based upon Helidon's [configuration](../../config) subsystem, and adds support for something called config-driven services using the [@ConfigDriven](./api/src/main/java/io/helidon/pico/configdriven/api/ConfigDriven.java) annotation. When applied to a target service interface it will allow developers to use a higher level aggregation for their application configuration, and then allow the configuration to drive activation of services in the Pico Framework. The [@ConfigBean](./api/src/main/java/io/helidon/pico/configdriven/api/ConfigBean.java) annotation can be used to customize behavior of a type that acts as a config-bean. +This is a specialization of the [Injection](../)'s that is based upon Helidon's [configuration](../../config) subsystem, and adds support for something called config-driven services using the [@ConfigDriven](./api/src/main/java/io/helidon/inject/configdriven/api/ConfigDriven.java) annotation. When applied to a target service interface it will allow developers to use a higher level aggregation for their application configuration, and then allow the configuration to drive activation of services in the Helidon Injection Framework. The [@ConfigBean](./api/src/main/java/io/helidon/inject/configdriven/api/ConfigBean.java) annotation can be used to customize behavior of a type that acts as a config-bean. See the user documentation for more information. @@ -27,4 +27,3 @@ The expectation is that config-beans are created using `helidon-builder-processo Any service annotated with `@ConfigBean(ConfigBean.class)` is a config-driven service. Such a service will be added to service registry FOR EACH config bean instance that is discovered from configuration. For repeatable types, each instance has a name obtained from configuration (either the configuration node, or a `name` property), as a `Named` qualifier. - diff --git a/pico/configdriven/api/pom.xml b/inject/configdriven/api/pom.xml similarity index 87% rename from pico/configdriven/api/pom.xml rename to inject/configdriven/api/pom.xml index 76d75592659..44a6173a88a 100644 --- a/pico/configdriven/api/pom.xml +++ b/inject/configdriven/api/pom.xml @@ -21,20 +21,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.configdriven - helidon-pico-configdriven-project + io.helidon.inject.configdriven + helidon-inject-configdriven-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-configdriven-api - Helidon Pico Config-Driven ConfiguredBy + helidon-inject-configdriven-api + Helidon Injection Config-Driven ConfiguredBy - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api io.helidon.common diff --git a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigBean.java b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigBean.java similarity index 95% rename from pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigBean.java rename to inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigBean.java index f7309cce077..54b4c6ef324 100644 --- a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigBean.java +++ b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.api; +package io.helidon.inject.configdriven.api; import java.lang.annotation.Documented; import java.lang.annotation.Retention; @@ -50,7 +50,7 @@ * instances will be permitted. *

    * Note: this attribute is dynamic in nature, and therefore cannot be validated at compile time. All violations found to this - * policy will be observed during PicoServices activation. + * policy will be observed during Services activation. *

    * The default value is {@code false}. * diff --git a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigBeanFactory.java b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigBeanFactory.java similarity index 92% rename from pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigBeanFactory.java rename to inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigBeanFactory.java index 7ddf5437e69..a989fe50322 100644 --- a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigBeanFactory.java +++ b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigBeanFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.api; +package io.helidon.inject.configdriven.api; import java.util.List; @@ -22,7 +22,7 @@ /** * Used from generated code. - * Represents the required information to handle config beans, either from {@link io.helidon.pico.configdriven.api.ConfigBean} + * Represents the required information to handle config beans, either from {@link ConfigBean} * annotation, or from other means. * * @param type of the config bean diff --git a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigDriven.java b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigDriven.java similarity index 98% rename from pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigDriven.java rename to inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigDriven.java index df9ea4ea07b..6f4de956873 100644 --- a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/ConfigDriven.java +++ b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/ConfigDriven.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.api; +package io.helidon.inject.configdriven.api; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/NamedInstance.java b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/NamedInstance.java similarity index 96% rename from pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/NamedInstance.java rename to inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/NamedInstance.java index cc68d196194..96e41c2fbff 100644 --- a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/NamedInstance.java +++ b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/NamedInstance.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.api; +package io.helidon.inject.configdriven.api; /** * Instance, that can be (possibly) named. diff --git a/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/package-info.java b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/package-info.java new file mode 100644 index 00000000000..82374f5e676 --- /dev/null +++ b/inject/configdriven/api/src/main/java/io/helidon/inject/configdriven/api/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Injection Config-Driven API. + */ +package io.helidon.inject.configdriven.api; diff --git a/pico/configdriven/api/src/main/java/module-info.java b/inject/configdriven/api/src/main/java/module-info.java similarity index 78% rename from pico/configdriven/api/src/main/java/module-info.java rename to inject/configdriven/api/src/main/java/module-info.java index 562312bf88b..0de3c92716d 100644 --- a/pico/configdriven/api/src/main/java/module-info.java +++ b/inject/configdriven/api/src/main/java/module-info.java @@ -15,13 +15,13 @@ */ /** - * Helidon Pico Config-Driven ConfiguredBy API Module. + * Helidon Injection Config-Driven ConfiguredBy API Module. */ -module io.helidon.pico.configdriven.api { +module io.helidon.inject.configdriven.api { requires static jakarta.inject; - requires io.helidon.pico.api; + requires io.helidon.inject.api; requires io.helidon.common.config; - exports io.helidon.pico.configdriven.api; + exports io.helidon.inject.configdriven.api; } diff --git a/pico/configdriven/pom.xml b/inject/configdriven/pom.xml similarity index 81% rename from pico/configdriven/pom.xml rename to inject/configdriven/pom.xml index fa942c432d2..28c053ef786 100644 --- a/pico/configdriven/pom.xml +++ b/inject/configdriven/pom.xml @@ -21,16 +21,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - io.helidon.pico.configdriven - helidon-pico-configdriven-project - Helidon Pico Config-Driven Project + io.helidon.inject.configdriven + helidon-inject-configdriven-project + Helidon Injection Config-Driven Project pom diff --git a/pico/configdriven/processor/README.md b/inject/configdriven/processor/README.md similarity index 88% rename from pico/configdriven/processor/README.md rename to inject/configdriven/processor/README.md index b0740e24486..a33fde950c6 100644 --- a/pico/configdriven/processor/README.md +++ b/inject/configdriven/processor/README.md @@ -1,3 +1,3 @@ -# pico-configdriven-processor +# inject-configdriven-processor This module should typically should be used at compile-time on the APT classpath. Also note that even though it is called processor it is not technically a processor, but rather a BuilderCreator extension to the base Builder processor. diff --git a/pico/configdriven/processor/pom.xml b/inject/configdriven/processor/pom.xml similarity index 83% rename from pico/configdriven/processor/pom.xml rename to inject/configdriven/processor/pom.xml index c68e3934258..976430bf64f 100644 --- a/pico/configdriven/processor/pom.xml +++ b/inject/configdriven/processor/pom.xml @@ -21,20 +21,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.configdriven - helidon-pico-configdriven-project + io.helidon.inject.configdriven + helidon-inject-configdriven-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-configdriven-processor - Helidon Pico Config-Driven Processor + helidon-inject-configdriven-processor + Helidon Injection Config-Driven Processor - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor io.helidon.common.processor diff --git a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigBean.java b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigBean.java similarity index 98% rename from pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigBean.java rename to inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigBean.java index 4332e12ee75..b7f16164809 100644 --- a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigBean.java +++ b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.processor; +package io.helidon.inject.configdriven.processor; import java.util.Optional; diff --git a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigBeanAnnotation.java b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigBeanAnnotation.java similarity index 92% rename from pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigBeanAnnotation.java rename to inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigBeanAnnotation.java index c760c8ee81c..4c853345d98 100644 --- a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigBeanAnnotation.java +++ b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigBeanAnnotation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.processor; +package io.helidon.inject.configdriven.processor; import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; @@ -22,7 +22,7 @@ record ConfigBeanAnnotation(boolean repeatable, boolean atLeastOne, boolean wantDefault) { - static final String TYPE_NAME = "io.helidon.pico.configdriven.api.ConfigBean"; + static final String TYPE_NAME = "io.helidon.inject.configdriven.api.ConfigBean"; static final TypeName TYPE = TypeName.create(TYPE_NAME); static ConfigBeanAnnotation create(TypeInfo typeInfo) { diff --git a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigDrivenAnnotation.java b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigDrivenAnnotation.java similarity index 91% rename from pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigDrivenAnnotation.java rename to inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigDrivenAnnotation.java index 824ec4ee5a9..318d5c71724 100644 --- a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigDrivenAnnotation.java +++ b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigDrivenAnnotation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.processor; +package io.helidon.inject.configdriven.processor; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeInfo; @@ -22,7 +22,7 @@ record ConfigDrivenAnnotation(TypeName configBeanType, boolean activateByDefault) { - static final String TYPE_NAME = "io.helidon.pico.configdriven.api.ConfigDriven"; + static final String TYPE_NAME = "io.helidon.inject.configdriven.api.ConfigDriven"; static final TypeName TYPE = TypeName.create(TYPE_NAME); static ConfigDrivenAnnotation create(TypeInfo typeInfo) { diff --git a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigDrivenProcessor.java b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigDrivenProcessor.java similarity index 94% rename from pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigDrivenProcessor.java rename to inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigDrivenProcessor.java index d16d2993ffb..23da696b04a 100644 --- a/pico/configdriven/processor/src/main/java/io/helidon/pico/configdriven/processor/ConfigDrivenProcessor.java +++ b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/ConfigDrivenProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.processor; +package io.helidon.inject.configdriven.processor; import java.util.Collection; import java.util.HashSet; @@ -28,16 +28,16 @@ import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.processor.PicoAnnotationProcessor; -import io.helidon.pico.tools.ServicesToProcess; +import io.helidon.inject.processor.InjectionAnnotationProcessor; +import io.helidon.inject.tools.ServicesToProcess; /** * Annotation processor implementation to handle types annotated with {@code ConfigDriven}. */ -public class ConfigDrivenProcessor extends PicoAnnotationProcessor { +public class ConfigDrivenProcessor extends InjectionAnnotationProcessor { private static final TypeName CONFIG_DRIVEN_BASE = TypeName.create( - "io.helidon.pico.configdriven.runtime.ConfigDrivenServiceProviderBase"); - private static final TypeName NAMED_INSTANCE = TypeName.create("io.helidon.pico.configdriven.api.NamedInstance"); + "io.helidon.inject.configdriven.runtime.ConfigDrivenServiceProviderBase"); + private static final TypeName NAMED_INSTANCE = TypeName.create("io.helidon.inject.configdriven.api.NamedInstance"); /** * Required constructor for a service loaded via {@link java.util.ServiceLoader}. @@ -183,9 +183,9 @@ private String generateCreateConfigBeans(ConfigBean configBean, TypeName namedIn .append(configBean.configPrefix()) .append("\\\"\");"); } else if (wantDefault) { - method.append("\t\t\treturn List.of(new io.helidon.pico.configdriven.api.NamedInstance<>(") + method.append("\t\t\treturn List.of(new io.helidon.inject.configdriven.api.NamedInstance<>(") .append(configBean.typeName().fqName()) - .append(".create(io.helidon.common.config.Config.empty()), io.helidon.pico.configdriven.api.NamedInstance" + .append(".create(io.helidon.common.config.Config.empty()), io.helidon.inject.configdriven.api.NamedInstance" + ".DEFAULT_NAME));\n"); } else { method.append("\t\t\treturn List.of();\n"); diff --git a/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/package-info.java b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/package-info.java new file mode 100644 index 00000000000..7c3b5577155 --- /dev/null +++ b/inject/configdriven/processor/src/main/java/io/helidon/inject/configdriven/processor/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Injection Config-Driven processor. + */ +package io.helidon.inject.configdriven.processor; diff --git a/pico/configdriven/processor/src/main/java/module-info.java b/inject/configdriven/processor/src/main/java/module-info.java similarity index 75% rename from pico/configdriven/processor/src/main/java/module-info.java rename to inject/configdriven/processor/src/main/java/module-info.java index ace0a37a45b..10ec958ef26 100644 --- a/pico/configdriven/processor/src/main/java/module-info.java +++ b/inject/configdriven/processor/src/main/java/module-info.java @@ -15,18 +15,18 @@ */ /** - * Helidon Pico ConfiguredBy Processor module. + * Helidon Inject ConfiguredBy Processor module. */ -module io.helidon.pico.configdriven.processor { +module io.helidon.inject.configdriven.processor { requires java.compiler; requires io.helidon.common; requires io.helidon.common.types; requires io.helidon.common.processor; - requires io.helidon.pico.processor; + requires io.helidon.inject.processor; - exports io.helidon.pico.configdriven.processor; + exports io.helidon.inject.configdriven.processor; provides javax.annotation.processing.Processor with - io.helidon.pico.configdriven.processor.ConfigDrivenProcessor; + io.helidon.inject.configdriven.processor.ConfigDrivenProcessor; } diff --git a/inject/configdriven/runtime/README.md b/inject/configdriven/runtime/README.md new file mode 100644 index 00000000000..689908043b9 --- /dev/null +++ b/inject/configdriven/runtime/README.md @@ -0,0 +1,3 @@ +# inject-configdriven-runtime + +This module should typically be used by anyone needing Helidon Injection's Config-Driven Services at runtime. diff --git a/pico/configdriven/runtime/pom.xml b/inject/configdriven/runtime/pom.xml similarity index 85% rename from pico/configdriven/runtime/pom.xml rename to inject/configdriven/runtime/pom.xml index 1051d1e198a..b1fd5c8c410 100644 --- a/pico/configdriven/runtime/pom.xml +++ b/inject/configdriven/runtime/pom.xml @@ -21,28 +21,28 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.configdriven - helidon-pico-configdriven-project + io.helidon.inject.configdriven + helidon-inject-configdriven-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-configdriven-runtime - Helidon Pico Config-Driven Runtime Services + helidon-inject-configdriven-runtime + Helidon Injection Config-Driven Runtime Services - io.helidon.pico.configdriven - helidon-pico-configdriven-api + io.helidon.inject.configdriven + helidon-inject-configdriven-api io.helidon.config helidon-config - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime jakarta.inject @@ -59,8 +59,8 @@ provided - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test diff --git a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigBeanRegistry.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigBeanRegistry.java similarity index 77% rename from pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigBeanRegistry.java rename to inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigBeanRegistry.java index 6fd633bdf73..f0d3c3eb3ae 100644 --- a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigBeanRegistry.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigBeanRegistry.java @@ -14,15 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.runtime; +package io.helidon.inject.configdriven.runtime; import java.util.List; import java.util.Map; -import io.helidon.pico.configdriven.api.NamedInstance; +import io.helidon.inject.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.NamedInstance; /** - * Manages the set of active {@link io.helidon.pico.configdriven.api.ConfigBean}'s, along with whether the application is + * Manages the set of active {@link ConfigBean}'s, along with whether the application is * configured to support dynamic aspects (i.e., dynamic in content, dynamic in lifecycle, etc.). */ public interface ConfigBeanRegistry { @@ -36,8 +37,8 @@ static ConfigBeanRegistry instance() { } /** - * The config bean registry is initialized as part of Pico's initialization, which happens when the service registry - * is initialized and bound. + * The config bean registry is initialized as part of Helidon Injection's initialization, which happens when the service + * registry is initialized and bound. * * @return true if the config bean registry has been initialized */ diff --git a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigBeanRegistryImpl.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigBeanRegistryImpl.java similarity index 88% rename from pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigBeanRegistryImpl.java rename to inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigBeanRegistryImpl.java index c74505d4bfa..73260f74457 100644 --- a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigBeanRegistryImpl.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigBeanRegistryImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.runtime; +package io.helidon.inject.configdriven.runtime; import java.util.ArrayList; import java.util.LinkedHashSet; @@ -29,15 +29,16 @@ import io.helidon.common.LazyValue; import io.helidon.common.config.Config; import io.helidon.common.config.ConfigException; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesHolder; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.configdriven.api.ConfigBeanFactory; -import io.helidon.pico.configdriven.api.NamedInstance; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesHolder; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBeanFactory; +import io.helidon.inject.configdriven.api.NamedInstance; /** * The default implementation for {@link ConfigBeanRegistry}. @@ -71,7 +72,7 @@ public Map, List>> allConfigBeans() { @Override public boolean reset(boolean deep) { - System.Logger.Level level = (isInitialized() && PicoServices.isDebugEnabled()) + System.Logger.Level level = (isInitialized() && InjectionServices.isDebugEnabled()) ? System.Logger.Level.INFO : System.Logger.Level.DEBUG; LOGGER.log(level, "Resetting"); configBeanFactories.clear(); @@ -92,10 +93,10 @@ public boolean ready() { /** * Binds a {@link ConfiguredServiceProvider} to the - * {@link io.helidon.pico.configdriven.api.ConfigBean} annotation it is configured by. + * {@link ConfigBean} annotation it is configured by. * * @param configuredServiceProvider the configured service provider - * @param configuredByQualifier the qualifier associated with the {@link io.helidon.pico.configdriven.api.ConfigBean} + * @param configuredByQualifier the qualifier associated with the {@link ConfigBean} * @throws io.helidon.config.ConfigException if the bind operation encountered an error */ void bind(ConfiguredServiceProvider configuredServiceProvider, @@ -139,7 +140,7 @@ void initialize() { return; } - Config config = PicoServices.realizedGlobalBootStrap().config().orElse(null); + Config config = InjectionServices.realizedGlobalBootStrap().config().orElse(null); if (config == null) { LOGGER.log(System.Logger.Level.WARNING, "Unable to initialize - there is no config to read - be sure to initialize " @@ -153,7 +154,7 @@ void initialize() { // we are now ready and initialized initialized.countDown(); } catch (Throwable t) { - PicoException e = new PicoServiceProviderException("Error while initializing config bean registry", t); + InjectionException e = new InjectionServiceProviderException("Error while initializing config bean registry", t); LOGGER.log(System.Logger.Level.ERROR, e.getMessage(), e); reset(true); throw e; @@ -203,13 +204,13 @@ private void initialize(Config rootConfiguration) { } } - private static final class ResettableHandler extends PicoServicesHolder { + private static final class ResettableHandler extends InjectionServicesHolder { @Deprecated private ResettableHandler() { } private static void addRegistry(Resettable resettable) { - PicoServicesHolder.addResettable(resettable); + InjectionServicesHolder.addResettable(resettable); } } } diff --git a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigDrivenServiceProviderBase.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigDrivenServiceProviderBase.java similarity index 91% rename from pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigDrivenServiceProviderBase.java rename to inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigDrivenServiceProviderBase.java index 4797d9fe07a..104e0a8207e 100644 --- a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/ConfigDrivenServiceProviderBase.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigDrivenServiceProviderBase.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.runtime; +package io.helidon.inject.configdriven.runtime; import java.util.ArrayList; import java.util.List; @@ -33,30 +33,30 @@ import io.helidon.common.types.Annotation; import io.helidon.common.types.Annotations; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.CallingContext; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.Event; -import io.helidon.pico.api.InjectionException; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderBindable; -import io.helidon.pico.api.ServiceProviderProvider; -import io.helidon.pico.configdriven.api.ConfigDriven; -import io.helidon.pico.configdriven.api.NamedInstance; -import io.helidon.pico.runtime.AbstractServiceProvider; -import io.helidon.pico.spi.InjectionResolver; - -import static io.helidon.pico.api.CommonQualifiers.WILDCARD_NAMED; -import static io.helidon.pico.configdriven.runtime.ConfigDrivenUtils.hasValue; -import static io.helidon.pico.configdriven.runtime.ConfigDrivenUtils.isBlank; -import static io.helidon.pico.runtime.PicoExceptions.toErrorMessage; +import io.helidon.inject.api.CallingContext; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.Event; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.ServiceProviderInjectionException; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.api.ServiceProviderProvider; +import io.helidon.inject.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.NamedInstance; +import io.helidon.inject.runtime.AbstractServiceProvider; +import io.helidon.inject.spi.InjectionResolver; + +import static io.helidon.inject.api.CommonQualifiers.WILDCARD_NAMED; +import static io.helidon.inject.configdriven.runtime.ConfigDrivenUtils.hasValue; +import static io.helidon.inject.configdriven.runtime.ConfigDrivenUtils.isBlank; +import static io.helidon.inject.runtime.InjectionExceptions.toErrorMessage; /** * Abstract base for any config-driven-service. @@ -77,7 +77,7 @@ public abstract class ConfigDrivenServiceProviderBase extends AbstractSer private final AtomicReference> rootProvider = new AtomicReference<>(); private final AtomicBoolean initialized = new AtomicBoolean(); private final AtomicReference initializationCallingContext - = new AtomicReference<>(); // used only when we are in pico.debug mode + = new AtomicReference<>(); // used only when we are in inject.debug mode // map of name to config driven service provider (non-root) private final Map> managedConfiguredServicesMap = new ConcurrentHashMap<>(); @@ -139,7 +139,7 @@ public void rootProvider(ServiceProvider root) { } @Override - public void picoServices(Optional picoServices) { + public void injectionServices(Optional injectionServices) { assertIsInitializing(); assertIsRootProvider(true, false); @@ -164,7 +164,7 @@ public void picoServices(Optional picoServices) { } } // do this as the last thing, so our ancestor does not think we are already initialized when overwriting service info - super.picoServices(picoServices); + super.injectionServices(injectionServices); } @Override @@ -195,7 +195,7 @@ public void onPhaseEvent(Event event, if (isRootProvider() && drivesActivation()) { ContextualServiceQuery query = ContextualServiceQuery - .builder().serviceInfoCriteria(PicoServices.EMPTY_CRITERIA) + .builder().serviceInfoCriteria(InjectionServices.EMPTY_CRITERIA) .build(); maybeActivate(query); } @@ -211,7 +211,7 @@ && drivesActivation()) { // note that all responsibilities to resolve is delegated to the root provider @Override public Optional resolve(InjectionPointInfo ipInfo, - PicoServices picoServices, + InjectionServices injectionServices, ServiceProvider serviceProvider, boolean resolveIps) { if (resolveIps) { @@ -230,7 +230,7 @@ public Optional resolve(InjectionPointInfo ipInfo, // if we are here then we are asking for a config bean for ourselves, or a slave/managed instance if (!dep.qualifiers().isEmpty()) { - throw new InjectionException("cannot use qualifiers while injecting config beans for self", this); + throw new ServiceProviderInjectionException("cannot use qualifiers while injecting config beans for self", this); } if (isRootProvider()) { @@ -517,14 +517,14 @@ protected void assertIsRootProvider(boolean isRootProvider, boolean expectSet) { boolean set = this.isRootProvider.compareAndSet(null, isRootProvider); if (!set && expectSet) { - throw new PicoServiceProviderException(description() + " was already initialized", null, this); + throw new InjectionServiceProviderException(description() + " was already initialized", null, this); } assert (!isRootProvider || rootProvider.get() == null); } /** * Return true if this service is driven to activation during startup (and provided it has some config). - * See {@link io.helidon.pico.configdriven.api.ConfigDriven#activateByDefault()}. + * See {@link ConfigDriven#activateByDefault()}. * * @return true if this service is driven to activation during startup */ @@ -537,7 +537,7 @@ void assertInitialized() { assertIsInitializing(); assert ( !drivesActivation() - || isAlreadyAtTargetPhase(PicoServices.terminalActivationPhase()) + || isAlreadyAtTargetPhase(InjectionServices.terminalActivationPhase()) || managedConfiguredServicesMap.isEmpty()); this.initialized.set(true); } @@ -547,13 +547,13 @@ void assertIsInitializing() { CallingContext callingContext = initializationCallingContext.get(); String desc = description() + " was previously initialized"; String msg = (callingContext == null) ? toErrorMessage(desc) : toErrorMessage(callingContext, desc); - throw new PicoServiceProviderException(msg, this); + throw new InjectionServiceProviderException(msg, this); } } void assertIsInitialized() { if (!initialized.get()) { - throw new PicoServiceProviderException(description() + " was expected to be initialized", this); + throw new InjectionServiceProviderException(description() + " was expected to be initialized", this); } } @@ -626,7 +626,7 @@ private void activateConfigDrivenServices() { private void innerActivate() { // this may go into a wait state if other threads are trying to also initialize at the same time - expected behavior ContextualServiceQuery query = ContextualServiceQuery - .builder().serviceInfoCriteria(PicoServices.EMPTY_CRITERIA) + .builder().serviceInfoCriteria(InjectionServices.EMPTY_CRITERIA) .build(); Optional service = maybeActivate(query); // triggers the post-construct if (service.isPresent() && LOGGER.isLoggable(System.Logger.Level.DEBUG)) { @@ -655,7 +655,7 @@ private void innerPreActivateManagedService(ConfigDrivenServiceProviderBase the type of this service provider manages * @param the type of config beans that this service is configured by diff --git a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/NameComparator.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/NameComparator.java similarity index 92% rename from pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/NameComparator.java rename to inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/NameComparator.java index ce49d627a1f..5fcb431eb2d 100644 --- a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/NameComparator.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/NameComparator.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.runtime; +package io.helidon.inject.configdriven.runtime; import java.util.Comparator; -import io.helidon.pico.configdriven.api.NamedInstance; +import io.helidon.inject.configdriven.api.NamedInstance; /** * Comparator of config bean names, {@value NamedInstance#DEFAULT_NAME} is always first. diff --git a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/UnconfiguredServiceProvider.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/UnconfiguredServiceProvider.java similarity index 86% rename from pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/UnconfiguredServiceProvider.java rename to inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/UnconfiguredServiceProvider.java index aa24a3a12ea..e3134214163 100644 --- a/pico/configdriven/runtime/src/main/java/io/helidon/pico/configdriven/runtime/UnconfiguredServiceProvider.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/UnconfiguredServiceProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.runtime; +package io.helidon.inject.configdriven.runtime; import java.util.List; import java.util.Map; @@ -22,14 +22,14 @@ import java.util.Optional; import io.helidon.common.config.Config; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceProviderBindable; -import io.helidon.pico.configdriven.api.NamedInstance; -import io.helidon.pico.runtime.PicoInjectionPlan; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.configdriven.api.NamedInstance; +import io.helidon.inject.runtime.HeldionInjectionPlan; /** * Used by root service providers when there are no services that have been configured. @@ -74,8 +74,8 @@ public DependenciesInfo dependencies() { } @Override - public Optional picoServices() { - return delegate.picoServices(); + public Optional injectionServices() { + return delegate.injectionServices(); } @Override @@ -115,7 +115,7 @@ public Class serviceType() { } @Override - public Map getOrCreateInjectionPlan(boolean resolveIps) { + public Map getOrCreateInjectionPlan(boolean resolveIps) { return super.getOrCreateInjectionPlan(resolveIps); } diff --git a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/package-info.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/package-info.java similarity index 88% rename from examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/package-info.java rename to inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/package-info.java index 117b5eef258..8e7c96a276e 100644 --- a/examples/pico/providers/src/main/java/io/helidon/examples/pico/providers/package-info.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/package-info.java @@ -15,6 +15,6 @@ */ /** - * Examples of providers in Pico. + * Config-driven Services API. */ -package io.helidon.examples.pico.providers; +package io.helidon.inject.configdriven.runtime; diff --git a/pico/configdriven/runtime/src/main/java/module-info.java b/inject/configdriven/runtime/src/main/java/module-info.java similarity index 75% rename from pico/configdriven/runtime/src/main/java/module-info.java rename to inject/configdriven/runtime/src/main/java/module-info.java index 586820b436d..665bb908ffb 100644 --- a/pico/configdriven/runtime/src/main/java/module-info.java +++ b/inject/configdriven/runtime/src/main/java/module-info.java @@ -15,20 +15,20 @@ */ /** - * Pico Config-Driven Services Module. + * Injection Config-Driven Services Module. */ -module io.helidon.pico.configdriven.runtime { +module io.helidon.inject.configdriven.runtime { requires static jakarta.inject; requires static jakarta.annotation; requires static io.helidon.config.metadata; // required for compilation of generated types - requires transitive io.helidon.pico.configdriven.api; + requires transitive io.helidon.inject.configdriven.api; requires transitive io.helidon.builder.api; requires transitive io.helidon.common.types; requires transitive io.helidon.config; - requires transitive io.helidon.pico.api; - requires transitive io.helidon.pico.runtime; + requires transitive io.helidon.inject.api; + requires transitive io.helidon.inject.runtime; - exports io.helidon.pico.configdriven.runtime; + exports io.helidon.inject.configdriven.runtime; } diff --git a/pico/configdriven/tests/config/pom.xml b/inject/configdriven/tests/config/pom.xml similarity index 82% rename from pico/configdriven/tests/config/pom.xml rename to inject/configdriven/tests/config/pom.xml index efd3ff92305..bb756b4d177 100644 --- a/pico/configdriven/tests/config/pom.xml +++ b/inject/configdriven/tests/config/pom.xml @@ -19,15 +19,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.configdriven.tests - helidon-pico-configdriven-tests-project + io.helidon.inject.configdriven.tests + helidon-inject-configdriven-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-configdriven-tests-config - Helidon Pico ConfigDriven Tests Config + helidon-inject-configdriven-tests-config + Helidon Injection ConfigDriven Tests Config Test builder with configuration @@ -54,19 +54,19 @@ provided - io.helidon.pico.configdriven - helidon-pico-configdriven-api + io.helidon.inject.configdriven + helidon-inject-configdriven-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime true - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime true @@ -110,8 +110,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} @@ -123,8 +123,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/EnumRelatedConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/EnumRelatedConfigBlueprint.java similarity index 95% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/EnumRelatedConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/EnumRelatedConfigBlueprint.java index 97acbd78b56..ccf34f5d523 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/EnumRelatedConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/EnumRelatedConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.List; import java.util.Map; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeClientAuth.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeClientAuth.java similarity index 95% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeClientAuth.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeClientAuth.java index aac60ac2fa4..35b87bb7fb4 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeClientAuth.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeClientAuth.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; /** * Indicates whether the server requires authentication of tbe client by the certificate. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeComponentTracingConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeComponentTracingConfigBlueprint.java similarity index 96% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeComponentTracingConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeComponentTracingConfigBlueprint.java index 8e1d5456613..69efdb6c957 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeComponentTracingConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeComponentTracingConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Map; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeKeyConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeKeyConfigBlueprint.java similarity index 97% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeKeyConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeKeyConfigBlueprint.java index 4abce4de508..c7649d1da0c 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeKeyConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeKeyConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.security.PrivateKey; import java.security.PublicKey; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeKeystoreConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeKeystoreConfigBlueprint.java similarity index 96% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeKeystoreConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeKeystoreConfigBlueprint.java index d2f63fbbd5e..9b60b50e809 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeKeystoreConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeKeystoreConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.List; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeNettyClientAuth.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeNettyClientAuth.java similarity index 93% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeNettyClientAuth.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeNettyClientAuth.java index 8eb0913afdc..71c0ab2e620 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeNettyClientAuth.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeNettyClientAuth.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; public enum FakeNettyClientAuth { NONE, diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakePathTracingConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakePathTracingConfigBlueprint.java similarity index 96% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakePathTracingConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakePathTracingConfigBlueprint.java index a9153d297d7..c5c6c135668 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakePathTracingConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakePathTracingConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.List; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeRoutingConfig.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeRoutingConfig.java similarity index 93% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeRoutingConfig.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeRoutingConfig.java index a8a2551e1ea..6bc24da01b3 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeRoutingConfig.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeRoutingConfig.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; /** * aka Routing. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeServerConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeServerConfigBlueprint.java similarity index 98% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeServerConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeServerConfigBlueprint.java index 57b5ad2d664..6015d039fc0 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeServerConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeServerConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.time.Duration; import java.util.Map; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeServerLifecycle.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeServerLifecycle.java similarity index 93% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeServerLifecycle.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeServerLifecycle.java index 34727a055e4..5fa14369902 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeServerLifecycle.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeServerLifecycle.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; /** * aka ServerLifecycle. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSocketConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSocketConfigBlueprint.java similarity index 95% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSocketConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSocketConfigBlueprint.java index 7fd93d03cf6..7307397b26d 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSocketConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSocketConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Optional; @@ -89,7 +89,7 @@ interface FakeSocketConfigBlueprint { int receiveBufferSize(); /** - * Return a {@link io.helidon.pico.configdriven.tests.config.FakeWebServerTlsConfig} containing server TLS configuration + * Return a {@link FakeWebServerTlsConfig} containing server TLS configuration * . When empty {@link java.util.Optional} is returned * no TLS should be configured. * diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSpanLogTracingConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSpanLogTracingConfigBlueprint.java similarity index 94% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSpanLogTracingConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSpanLogTracingConfigBlueprint.java index 8cae3207d2a..1ac411ae0ed 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSpanLogTracingConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSpanLogTracingConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSpanTracingConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSpanTracingConfigBlueprint.java similarity index 96% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSpanTracingConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSpanTracingConfigBlueprint.java index 8cd787e9e1f..768e04623fb 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeSpanTracingConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeSpanTracingConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Map; import java.util.Optional; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTlsWSNotDrivenByCB.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTlsWSNotDrivenByCB.java similarity index 93% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTlsWSNotDrivenByCB.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTlsWSNotDrivenByCB.java index 3e9dca7a2ba..07c41ae6e42 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTlsWSNotDrivenByCB.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTlsWSNotDrivenByCB.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Objects; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTraceableConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTraceableConfigBlueprint.java similarity index 96% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTraceableConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTraceableConfigBlueprint.java index d839d6307ef..82a4e0ccfb1 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTraceableConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTraceableConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Optional; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTracer.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTracer.java similarity index 93% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTracer.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTracer.java index 774d61f82ae..7eba63c65fa 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTracer.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTracer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; /** * Tracer abstraction. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTracingConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTracingConfigBlueprint.java similarity index 96% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTracingConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTracingConfigBlueprint.java index c93085035e9..6c7a3a77ea8 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeTracingConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeTracingConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Map; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServer.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServer.java similarity index 93% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServer.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServer.java index 8c7b153c053..a6d4ef0dba1 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServer.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServer.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Objects; import java.util.Optional; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerContract.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerContract.java similarity index 92% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerContract.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerContract.java index 60c94742dbc..618453903a3 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerContract.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerContract.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * For Testing. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerNotDrivenAndHavingConfiguredByOverrides.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerNotDrivenAndHavingConfiguredByOverrides.java similarity index 90% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerNotDrivenAndHavingConfiguredByOverrides.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerNotDrivenAndHavingConfiguredByOverrides.java index d904b992398..9d6bbb7bd4b 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerNotDrivenAndHavingConfiguredByOverrides.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerNotDrivenAndHavingConfiguredByOverrides.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Optional; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.inject.Inject; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerTlsConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerTlsConfigBlueprint.java similarity index 95% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerTlsConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerTlsConfigBlueprint.java index 6a68b1e8ef7..7e2ff96bef4 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/FakeWebServerTlsConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/FakeWebServerTlsConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.security.SecureRandom; import java.util.List; @@ -28,7 +28,7 @@ import io.helidon.common.LazyValue; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; /** * aka WebServerTls. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/SSLContextConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/SSLContextConfigBlueprint.java similarity index 95% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/SSLContextConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/SSLContextConfigBlueprint.java index f03f555151a..e74e548afa5 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/SSLContextConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/SSLContextConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Random; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestClientConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestClientConfigBlueprint.java similarity index 92% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestClientConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestClientConfigBlueprint.java index 1c120fb91d5..6ddf5e55e69 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestClientConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestClientConfigBlueprint.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Map; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; /** * For testing purpose. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestCommonConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestCommonConfigBlueprint.java similarity index 96% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestCommonConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestCommonConfigBlueprint.java index 47e9532aafd..8e63a9783c2 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestCommonConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestCommonConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.List; diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestServerConfigBlueprint.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestServerConfigBlueprint.java similarity index 92% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestServerConfigBlueprint.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestServerConfigBlueprint.java index 286da0fe788..32b15f7c719 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/TestServerConfigBlueprint.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/TestServerConfigBlueprint.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Optional; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; /** * For testing purpose. diff --git a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/package-info.java b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/package-info.java similarity index 92% rename from pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/package-info.java rename to inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/package-info.java index 269d48acf8e..9432cafeee9 100644 --- a/pico/configdriven/tests/config/src/main/java/io/helidon/pico/configdriven/tests/config/package-info.java +++ b/inject/configdriven/tests/config/src/main/java/io/helidon/inject/configdriven/tests/config/package-info.java @@ -17,4 +17,4 @@ /** * ConfigBean test subjects. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; diff --git a/pico/configdriven/tests/config/src/main/java/module-info.java b/inject/configdriven/tests/config/src/main/java/module-info.java similarity index 80% rename from pico/configdriven/tests/config/src/main/java/module-info.java rename to inject/configdriven/tests/config/src/main/java/module-info.java index 30c4d0f401f..c92effe5cb6 100644 --- a/pico/configdriven/tests/config/src/main/java/module-info.java +++ b/inject/configdriven/tests/config/src/main/java/module-info.java @@ -24,10 +24,10 @@ requires io.helidon.common; requires io.helidon.common.config; requires io.helidon.builder.api; - requires io.helidon.pico.configdriven.api; - requires io.helidon.pico.api; - requires static io.helidon.pico.runtime; - requires static io.helidon.pico.configdriven.runtime; + requires io.helidon.inject.configdriven.api; + requires io.helidon.inject.api; + requires static io.helidon.inject.runtime; + requires static io.helidon.inject.configdriven.runtime; - exports io.helidon.pico.configdriven.tests.config; + exports io.helidon.inject.configdriven.tests.config; } diff --git a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/AbstractConfigBeanTest.java b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/AbstractConfigBeanTest.java similarity index 97% rename from pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/AbstractConfigBeanTest.java rename to inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/AbstractConfigBeanTest.java index f7100566aea..39e3e4ad0f5 100644 --- a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/AbstractConfigBeanTest.java +++ b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/AbstractConfigBeanTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Map; diff --git a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/BasicConfigBeanTest.java b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/BasicConfigBeanTest.java similarity index 99% rename from pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/BasicConfigBeanTest.java rename to inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/BasicConfigBeanTest.java index 485d411f663..b66e8fe4462 100644 --- a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/BasicConfigBeanTest.java +++ b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/BasicConfigBeanTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.List; import java.util.Map; diff --git a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/EnumRelatedConfigBeanTest.java b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/EnumRelatedConfigBeanTest.java similarity index 97% rename from pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/EnumRelatedConfigBeanTest.java rename to inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/EnumRelatedConfigBeanTest.java index 7013f613dab..aab72eb3938 100644 --- a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/EnumRelatedConfigBeanTest.java +++ b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/EnumRelatedConfigBeanTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.List; import java.util.Set; diff --git a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/NestedConfigBeanTest.java b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/NestedConfigBeanTest.java similarity index 98% rename from pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/NestedConfigBeanTest.java rename to inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/NestedConfigBeanTest.java index eea88daa829..20b47f34ac5 100644 --- a/pico/configdriven/tests/config/src/test/java/io/helidon/pico/configdriven/tests/config/NestedConfigBeanTest.java +++ b/inject/configdriven/tests/config/src/test/java/io/helidon/inject/configdriven/tests/config/NestedConfigBeanTest.java @@ -14,13 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.tests.config; +package io.helidon.inject.configdriven.tests.config; import java.util.Collection; import java.util.Objects; import io.helidon.common.config.Config; -import io.helidon.common.testing.junit5.OptionalMatcher; import io.helidon.config.ConfigSources; import io.helidon.config.yaml.YamlConfigParser; diff --git a/pico/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoNamedSockets.yaml b/inject/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoNamedSockets.yaml similarity index 100% rename from pico/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoNamedSockets.yaml rename to inject/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoNamedSockets.yaml diff --git a/pico/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoUnnamedSockets.yaml b/inject/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoUnnamedSockets.yaml similarity index 100% rename from pico/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoUnnamedSockets.yaml rename to inject/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/FakeServerConfigPlusTwoUnnamedSockets.yaml diff --git a/pico/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/basic-config-bean-test.yaml b/inject/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/basic-config-bean-test.yaml similarity index 100% rename from pico/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/basic-config-bean-test.yaml rename to inject/configdriven/tests/config/src/test/resources/io/helidon/builder/config/test/basic-config-bean-test.yaml diff --git a/inject/configdriven/tests/configuredby-application/README.md b/inject/configdriven/tests/configuredby-application/README.md new file mode 100644 index 00000000000..5b0e7930f67 --- /dev/null +++ b/inject/configdriven/tests/configuredby-application/README.md @@ -0,0 +1,3 @@ +# inject-configdriven-test-configuredby-application + +Tests for full ConfiguredBy-generated service types, in combination with the DI model calculated at compile time using the inject-maven-plugin instead of calculated at runtime as is the case with inject-configdriven-test-configuredby. diff --git a/pico/configdriven/tests/configuredby-application/pom.xml b/inject/configdriven/tests/configuredby-application/pom.xml similarity index 78% rename from pico/configdriven/tests/configuredby-application/pom.xml rename to inject/configdriven/tests/configuredby-application/pom.xml index 010771fd744..71f641a9a12 100644 --- a/pico/configdriven/tests/configuredby-application/pom.xml +++ b/inject/configdriven/tests/configuredby-application/pom.xml @@ -19,15 +19,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.configdriven.tests - helidon-pico-configdriven-tests-project + io.helidon.inject.configdriven.tests + helidon-inject-configdriven-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-configdriven-tests-configuredby-application - Helidon Pico Config-Driven ConfiguredBy Appl Tests + helidon-inject-configdriven-tests-configuredby-application + Helidon Injection Config-Driven ConfiguredBy Appl Tests the same tests as test-configuredby, but instead using the maven application generation in order to calc di plan at compile-time @@ -42,12 +42,12 @@ - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime - io.helidon.pico.configdriven.tests - helidon-pico-configdriven-tests-configuredby + io.helidon.inject.configdriven.tests + helidon-inject-configdriven-tests-configuredby ${helidon.version} @@ -66,8 +66,8 @@ test - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test @@ -97,15 +97,15 @@ maven-compiler-plugin - -Apico.debug=${pico.debug} - -Apico.application.pre.create=true - -Apico.mapApplicationToSingletonScope=true + -Ainject.debug=${inject.debug} + -Ainject.application.pre.create=true + -Ainject.mapApplicationToSingletonScope=true true - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} @@ -122,15 +122,15 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin ${helidon.version} @@ -151,9 +151,9 @@ - -Apico.debug=${pico.debug} - -Apico.autoAddNonContractInterfaces=true - -Apico.application.pre.create=true + -Ainject.debug=${inject.debug} + -Ainject.autoAddNonContractInterfaces=true + -Ainject.application.pre.create=true NAMED diff --git a/pico/configdriven/tests/configuredby-application/src/main/java/io/helidon/pico/configdriven/configuredby/application/test/ASimpleRunLevelService.java b/inject/configdriven/tests/configuredby-application/src/main/java/io/helidon/inject/configdriven/configuredby/application/test/ASimpleRunLevelService.java similarity index 89% rename from pico/configdriven/tests/configuredby-application/src/main/java/io/helidon/pico/configdriven/configuredby/application/test/ASimpleRunLevelService.java rename to inject/configdriven/tests/configuredby-application/src/main/java/io/helidon/inject/configdriven/configuredby/application/test/ASimpleRunLevelService.java index 31afdc890a0..badd7ad8b28 100644 --- a/pico/configdriven/tests/configuredby-application/src/main/java/io/helidon/pico/configdriven/configuredby/application/test/ASimpleRunLevelService.java +++ b/inject/configdriven/tests/configuredby-application/src/main/java/io/helidon/inject/configdriven/configuredby/application/test/ASimpleRunLevelService.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.application.test; +package io.helidon.inject.configdriven.configuredby.application.test; import java.util.List; import java.util.Objects; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.configdriven.configuredby.test.ASingletonServiceContract; -import io.helidon.pico.configdriven.tests.config.FakeWebServerContract; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.configdriven.configuredby.test.ASingletonServiceContract; +import io.helidon.inject.configdriven.tests.config.FakeWebServerContract; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico/configdriven/configuredby/test/ApplicationConfigBeanTest.java b/inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject/configdriven/configuredby/test/ApplicationConfigBeanTest.java similarity index 93% rename from pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico/configdriven/configuredby/test/ApplicationConfigBeanTest.java rename to inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject/configdriven/configuredby/test/ApplicationConfigBeanTest.java index df39a8598c9..6755d6afdac 100644 --- a/pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico/configdriven/configuredby/test/ApplicationConfigBeanTest.java +++ b/inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject/configdriven/configuredby/test/ApplicationConfigBeanTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; /** * Designed to re-run the same tests from base, but using the application-created DI model instead. diff --git a/pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico/configdriven/configuredby/test/ApplicationConfiguredByTest.java b/inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject/configdriven/configuredby/test/ApplicationConfiguredByTest.java similarity index 79% rename from pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico/configdriven/configuredby/test/ApplicationConfiguredByTest.java rename to inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject/configdriven/configuredby/test/ApplicationConfiguredByTest.java index ab0f42db71a..ce986f48afc 100644 --- a/pico/configdriven/tests/configuredby-application/src/test/java/io/helidon/pico/configdriven/configuredby/test/ApplicationConfiguredByTest.java +++ b/inject/configdriven/tests/configuredby-application/src/test/java/io/helidon/inject/configdriven/configuredby/test/ApplicationConfiguredByTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; import java.util.LinkedHashSet; import java.util.List; @@ -22,12 +22,13 @@ import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Metrics; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.configdriven.configuredby.application.test.ASimpleRunLevelService; +import io.helidon.inject.api.Metrics; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.configdriven.configuredby.application.test.ASimpleRunLevelService; +import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -50,8 +51,8 @@ void verifyMinimalLookups() { .disableSystemPropertiesSource() .build()); - Metrics metrics = picoServices.metrics().orElseThrow(); - Set criteriaSearchLog = picoServices.lookups().orElseThrow(); + Metrics metrics = injectionServices.metrics().orElseThrow(); + Set criteriaSearchLog = injectionServices.lookups().orElseThrow(); Set contractSearchLog = criteriaSearchLog.stream() .flatMap(it -> it.contractsImplemented().stream()) .collect(Collectors.toCollection(LinkedHashSet::new)); @@ -69,11 +70,11 @@ void verifyMinimalLookups() { searchLog, containsInAnyOrder( // config beans are always looked up - TypeName.create("io.helidon.pico.configdriven.tests.config.FakeServerConfig"), + TypeName.create("io.helidon.inject.configdriven.tests.config.FakeServerConfig"), // tracer doesn't really exist, so it is looked up out of best-effort (as an optional injection dep) - TypeName.create("io.helidon.pico.configdriven.tests.config.FakeTracer"), + TypeName.create("io.helidon.inject.configdriven.tests.config.FakeTracer"), // ZImpl is intercepted - TypeName.create("io.helidon.pico.configdriven.interceptor.test.ZImpl") + TypeName.create("io.helidon.inject.configdriven.interceptor.test.ZImpl") )); assertThat("lookup log: " + criteriaSearchLog, metrics.lookupCount().orElseThrow(), @@ -87,11 +88,11 @@ public void startupAndShutdownRunLevelServices() { .disableSystemPropertiesSource() .build()); - Metrics metrics = picoServices.metrics().orElseThrow(); + Metrics metrics = injectionServices.metrics().orElseThrow(); int startingLookupCount = metrics.lookupCount().orElseThrow(); - assertThat(ASimpleRunLevelService.getPostConstructCount(), - is(0)); + MatcherAssert.assertThat(ASimpleRunLevelService.getPostConstructCount(), + is(0)); assertThat(ASimpleRunLevelService.getPreDestroyCount(), is(0)); @@ -104,7 +105,7 @@ public void startupAndShutdownRunLevelServices() { contains(ASimpleRunLevelService.class.getSimpleName() + ":INIT")); startups.forEach(ServiceProvider::get); - metrics = picoServices.metrics().orElseThrow(); + metrics = injectionServices.metrics().orElseThrow(); int endingLookupCount = metrics.lookupCount().orElseThrow(); assertThat(endingLookupCount - startingLookupCount, is(1)); @@ -114,7 +115,7 @@ public void startupAndShutdownRunLevelServices() { assertThat(ASimpleRunLevelService.getPreDestroyCount(), is(0)); - picoServices.shutdown(); + injectionServices.shutdown(); assertThat(ASimpleRunLevelService.getPostConstructCount(), is(1)); assertThat(ASimpleRunLevelService.getPreDestroyCount(), diff --git a/pico/configdriven/tests/configuredby/README.md b/inject/configdriven/tests/configuredby/README.md similarity index 60% rename from pico/configdriven/tests/configuredby/README.md rename to inject/configdriven/tests/configuredby/README.md index 7491a3e36b0..7b31e3abba0 100644 --- a/pico/configdriven/tests/configuredby/README.md +++ b/inject/configdriven/tests/configuredby/README.md @@ -1,3 +1,3 @@ -# pico-configdriven-test-configuredby +# inject-configdriven-test-configuredby Tests for full ConfiguredBy-generated service types. diff --git a/pico/configdriven/tests/configuredby/pom.xml b/inject/configdriven/tests/configuredby/pom.xml similarity index 79% rename from pico/configdriven/tests/configuredby/pom.xml rename to inject/configdriven/tests/configuredby/pom.xml index 4d5e1be1f32..1267a383b64 100644 --- a/pico/configdriven/tests/configuredby/pom.xml +++ b/inject/configdriven/tests/configuredby/pom.xml @@ -19,21 +19,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.configdriven.tests - helidon-pico-configdriven-tests-project + io.helidon.inject.configdriven.tests + helidon-inject-configdriven-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-configdriven-tests-configuredby - Helidon Pico Config-Driven ConfiguredBy Svcs Tests + helidon-inject-configdriven-tests-configuredby + Helidon Injection Config-Driven ConfiguredBy Svcs Tests tests the fuller config-driven services (i.e., full config not just common and with config-driven services) - io.helidon.pico.configdriven.tests - helidon-pico-configdriven-tests-config + io.helidon.inject.configdriven.tests + helidon-inject-configdriven-tests-config ${helidon.version} @@ -41,8 +41,8 @@ helidon-builder-api - io.helidon.pico.configdriven - helidon-pico-configdriven-api + io.helidon.inject.configdriven + helidon-inject-configdriven-api io.helidon.config @@ -58,8 +58,8 @@ true - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime jakarta.inject @@ -72,8 +72,8 @@ provided - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor provided true @@ -83,8 +83,8 @@ compile - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing compile @@ -114,13 +114,13 @@ maven-compiler-plugin - -Apico.autoAddNonContractInterfaces=true + -Ainject.autoAddNonContractInterfaces=true true - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} @@ -137,8 +137,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonConfigBeanBlueprint.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonConfigBeanBlueprint.java similarity index 88% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonConfigBeanBlueprint.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonConfigBeanBlueprint.java index a97e6abd6b4..6931feb3f9e 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonConfigBeanBlueprint.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonConfigBeanBlueprint.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; @ConfigBean(wantDefault = true, atLeastOne = true) @Configured(root = true) diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonService.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonService.java similarity index 92% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonService.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonService.java index ee222bd5f16..f1aa6c6aa15 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonService.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonService.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonServiceContract.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonServiceContract.java similarity index 92% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonServiceContract.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonServiceContract.java index 14ef72956ba..b0289c2398c 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/ASingletonServiceContract.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/ASingletonServiceContract.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; /** * For Testing. diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractConfigBeanTest.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractConfigBeanTest.java similarity index 96% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractConfigBeanTest.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractConfigBeanTest.java index cff85dde488..9dbbf7ed575 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractConfigBeanTest.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractConfigBeanTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; import java.util.List; import java.util.Map; @@ -22,8 +22,8 @@ import io.helidon.common.Errors; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.configdriven.tests.config.TestClientConfig; -import io.helidon.pico.configdriven.tests.config.TestServerConfig; +import io.helidon.inject.configdriven.tests.config.TestClientConfig; +import io.helidon.inject.configdriven.tests.config.TestServerConfig; import org.junit.jupiter.api.Test; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractConfiguredByTest.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractConfiguredByTest.java similarity index 82% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractConfiguredByTest.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractConfiguredByTest.java index 950c336d61b..303cc6bd4a6 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractConfiguredByTest.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractConfiguredByTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; import java.util.List; import java.util.Map; @@ -24,27 +24,27 @@ import io.helidon.config.Config; import io.helidon.config.ConfigSources; import io.helidon.config.MapConfigSource; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.configdriven.api.ConfigDriven; -import io.helidon.pico.configdriven.api.NamedInstance; -import io.helidon.pico.configdriven.runtime.ConfigBeanRegistry; -import io.helidon.pico.configdriven.tests.config.FakeServerConfig; -import io.helidon.pico.configdriven.tests.config.FakeTlsWSNotDrivenByCB; -import io.helidon.pico.configdriven.tests.config.FakeWebServer; -import io.helidon.pico.configdriven.tests.config.FakeWebServerContract; -import io.helidon.pico.testing.PicoTestingSupport; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.NamedInstance; +import io.helidon.inject.configdriven.runtime.ConfigBeanRegistry; +import io.helidon.inject.configdriven.tests.config.FakeServerConfig; +import io.helidon.inject.configdriven.tests.config.FakeTlsWSNotDrivenByCB; +import io.helidon.inject.configdriven.tests.config.FakeWebServer; +import io.helidon.inject.configdriven.tests.config.FakeWebServerContract; +import io.helidon.inject.testing.InjectionTestingSupport; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; @@ -55,13 +55,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows; /** - * Tests for {@link io.helidon.pico.configdriven.api.ConfigDriven}. + * Tests for {@link ConfigDriven}. */ public abstract class AbstractConfiguredByTest { protected static final String FAKE_SOCKET_CONFIG = "sockets"; protected static final String FAKE_SERVER_CONFIG = "fake-server"; - protected PicoServices picoServices; + protected InjectionServices injectionServices; protected Services services; @BeforeAll @@ -72,21 +72,21 @@ static void initialStateChecks() { @AfterAll static void tearDown() { - PicoTestingSupport.resetAll(); + InjectionTestingSupport.resetAll(); } protected void resetWith(Config config) { - PicoTestingSupport.resetAll(); - this.picoServices = testableServices(config); - this.services = picoServices.services(); + InjectionTestingSupport.resetAll(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } public MapConfigSource.Builder createBasicTestingConfigSource() { return ConfigSources.create( Map.of( - "pico.permits-dynamic", "true", - "pico.activation-logs", "true", - "pico.service-lookup-caching", "true" + "inject.permits-dynamic", "true", + "inject.activation-logs", "true", + "inject.service-lookup-caching", "true" ), "config-basic"); } @@ -170,7 +170,7 @@ void testRegistry() { contains("FakeTlsWSNotDrivenByCB{root}:PENDING")); ServiceProvider fakeTlsProvider = list.get(0); - PicoServiceProviderException e = assertThrows(PicoServiceProviderException.class, fakeTlsProvider::get); + InjectionServiceProviderException e = assertThrows(InjectionServiceProviderException.class, fakeTlsProvider::get); assertThat("There is no configuration, so cannot activate this service", e.getMessage(), equalTo("Expected to find a match: service provider: FakeTlsWSNotDrivenByCB{root}:PENDING")); @@ -188,7 +188,7 @@ void testRegistry() { void testShutdown(FakeWebServer fakeWebServer) { assertThat(fakeWebServer.isRunning(), is(true)); - picoServices.shutdown(); + injectionServices.shutdown(); assertThat(fakeWebServer.isRunning(), is(false)); } diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractServiceBase.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractServiceBase.java similarity index 95% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractServiceBase.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractServiceBase.java index fcd239a0913..35cafb4cb70 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/AbstractServiceBase.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/AbstractServiceBase.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; import java.util.concurrent.atomic.AtomicInteger; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeConfiguredServiceWithAnAbstractBase.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeConfiguredServiceWithAnAbstractBase.java similarity index 90% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeConfiguredServiceWithAnAbstractBase.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeConfiguredServiceWithAnAbstractBase.java index 57af16726ff..da07a4876a1 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeConfiguredServiceWithAnAbstractBase.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeConfiguredServiceWithAnAbstractBase.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.inject.Inject; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeServiceConfigBlueprint.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeServiceConfigBlueprint.java similarity index 93% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeServiceConfigBlueprint.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeServiceConfigBlueprint.java index fbe7c7cbd4f..f8b8ec936d3 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeServiceConfigBlueprint.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeServiceConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeServiceInterface.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeServiceInterface.java similarity index 92% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeServiceInterface.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeServiceInterface.java index ed3b760c331..8a7732ff514 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/SomeServiceInterface.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/SomeServiceInterface.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; public interface SomeServiceInterface { diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/package-info.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/package-info.java similarity index 91% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/package-info.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/package-info.java index c77b57f7169..ce8c48009fb 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/test/package-info.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/test/package-info.java @@ -17,4 +17,4 @@ /** * For testing. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/Async.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/Async.java similarity index 88% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/Async.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/Async.java index 0948b940007..aa5f1a164cf 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/Async.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/Async.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.yaml.test; +package io.helidon.inject.configdriven.configuredby.yaml.test; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.inject.Inject; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/AsyncConfigBlueprint.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/AsyncConfigBlueprint.java similarity index 86% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/AsyncConfigBlueprint.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/AsyncConfigBlueprint.java index 6b1ab857b3c..57926e96760 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/AsyncConfigBlueprint.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/AsyncConfigBlueprint.java @@ -14,14 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.yaml.test; - -import java.util.Optional; +package io.helidon.inject.configdriven.configuredby.yaml.test; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; @ConfigBean(repeatable = true) @Configured(root = true, prefix = "ft.asyncs") diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/BulkheadConfigBlueprint.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/BulkheadConfigBlueprint.java similarity index 88% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/BulkheadConfigBlueprint.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/BulkheadConfigBlueprint.java index 5adeedd16b3..83f2225b777 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/BulkheadConfigBlueprint.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/BulkheadConfigBlueprint.java @@ -14,12 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.yaml.test; +package io.helidon.inject.configdriven.configuredby.yaml.test; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; @Configured(root = true, prefix = "ft.bulkheads") @Prototype.Blueprint diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/ServerConfigBlueprint.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/ServerConfigBlueprint.java similarity index 93% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/ServerConfigBlueprint.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/ServerConfigBlueprint.java index c4ba893aaed..267ddc669a0 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/ServerConfigBlueprint.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/ServerConfigBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.yaml.test; +package io.helidon.inject.configdriven.configuredby.yaml.test; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; diff --git a/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/package-info.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/package-info.java new file mode 100644 index 00000000000..b287b5e4e95 --- /dev/null +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/configuredby/yaml/test/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Injection ConfiguredBy tests driven testing from the {@code application.yaml} config under test/resources. + */ +package io.helidon.inject.configdriven.configuredby.yaml.test; diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/IZ.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/IZ.java similarity index 87% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/IZ.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/IZ.java index acd721c69ea..97b6cf6ffa5 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/IZ.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/IZ.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.interceptor.test; +package io.helidon.inject.configdriven.interceptor.test; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; @Contract public interface IZ { diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/TestInterceptorTrigger.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/TestInterceptorTrigger.java similarity index 88% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/TestInterceptorTrigger.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/TestInterceptorTrigger.java index eee04527325..dcb6510a2de 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/TestInterceptorTrigger.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/TestInterceptorTrigger.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.interceptor.test; +package io.helidon.inject.configdriven.interceptor.test; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import io.helidon.pico.api.InterceptedTrigger; +import io.helidon.inject.api.InterceptedTrigger; @InterceptedTrigger @Retention(RetentionPolicy.CLASS) diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/ZImpl.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/ZImpl.java similarity index 86% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/ZImpl.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/ZImpl.java index 29fa30c20a7..d413cf5b099 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/ZImpl.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/ZImpl.java @@ -14,18 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.interceptor.test; +package io.helidon.inject.configdriven.interceptor.test; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; -import io.helidon.pico.configdriven.tests.config.FakeWebServer; +import io.helidon.inject.api.InterceptedTrigger; +import io.helidon.inject.configdriven.tests.config.FakeWebServer; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; /** - * This test case is applying {@link io.helidon.pico.api.InterceptorBasedAnno} (an {@link io.helidon.pico.api.InterceptedTrigger}) + * This test case is applying {@link io.helidon.inject.api.InterceptorBasedAnno} (an {@link InterceptedTrigger}) * on this class directly. Since it is a config-driven service it is forced to used the interface based approach to interceptors. */ // TODO: https://github.com/helidon-io/helidon/issues/6542 diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/ZImplConfigBlueprint.java b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/ZImplConfigBlueprint.java similarity index 89% rename from pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/ZImplConfigBlueprint.java rename to inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/ZImplConfigBlueprint.java index 6e20a090301..0d88c80583f 100644 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/interceptor/test/ZImplConfigBlueprint.java +++ b/inject/configdriven/tests/configuredby/src/main/java/io/helidon/inject/configdriven/interceptor/test/ZImplConfigBlueprint.java @@ -14,11 +14,10 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.interceptor.test; +package io.helidon.inject.configdriven.interceptor.test; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; -import io.helidon.pico.configdriven.api.ConfigBean; /** * Drives {@link ZImpl} activation. diff --git a/pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/test/ConfiguredByTest.java b/inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/test/ConfiguredByTest.java similarity index 92% rename from pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/test/ConfiguredByTest.java rename to inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/test/ConfiguredByTest.java index 1ef2f1c7f69..a62691b4291 100644 --- a/pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/test/ConfiguredByTest.java +++ b/inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/test/ConfiguredByTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; import java.util.List; import java.util.Map; @@ -23,10 +23,10 @@ import io.helidon.config.Config; import io.helidon.config.ConfigSources; import io.helidon.config.MapConfigSource; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.configdriven.api.NamedInstance; -import io.helidon.pico.configdriven.configuredby.yaml.test.Async; -import io.helidon.pico.configdriven.runtime.ConfigBeanRegistry; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.configdriven.api.NamedInstance; +import io.helidon.inject.configdriven.configuredby.yaml.test.Async; +import io.helidon.inject.configdriven.runtime.ConfigBeanRegistry; import org.junit.jupiter.api.Test; diff --git a/pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/test/DefaultConfigBeanTest.java b/inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/test/DefaultConfigBeanTest.java similarity index 92% rename from pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/test/DefaultConfigBeanTest.java rename to inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/test/DefaultConfigBeanTest.java index 75b71cb9c18..8c3045d843a 100644 --- a/pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/test/DefaultConfigBeanTest.java +++ b/inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/test/DefaultConfigBeanTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.test; +package io.helidon.inject.configdriven.configuredby.test; /** * Executes the tests from the base. diff --git a/pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/yaml/test/NamedConfiguredByTest.java b/inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/yaml/test/NamedConfiguredByTest.java similarity index 77% rename from pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/yaml/test/NamedConfiguredByTest.java rename to inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/yaml/test/NamedConfiguredByTest.java index b7ea2f91fbe..99c2bf98058 100644 --- a/pico/configdriven/tests/configuredby/src/test/java/io/helidon/pico/configdriven/configuredby/yaml/test/NamedConfiguredByTest.java +++ b/inject/configdriven/tests/configuredby/src/test/java/io/helidon/inject/configdriven/configuredby/yaml/test/NamedConfiguredByTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.configdriven.configuredby.yaml.test; +package io.helidon.inject.configdriven.configuredby.yaml.test; import java.util.List; import java.util.Map; @@ -24,25 +24,25 @@ import io.helidon.config.Config; import io.helidon.config.ConfigSources; import io.helidon.config.yaml.YamlConfigParser; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Services; -import io.helidon.pico.configdriven.api.NamedInstance; -import io.helidon.pico.configdriven.runtime.ConfigBeanRegistry; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Services; +import io.helidon.inject.configdriven.api.NamedInstance; +import io.helidon.inject.configdriven.runtime.ConfigBeanRegistry; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; class NamedConfiguredByTest { - PicoServices picoServices; + InjectionServices injectionServices; Services services; @BeforeAll @@ -58,13 +58,13 @@ static void tearDown() { void resetWith(Config config) { resetAll(); - this.picoServices = testableServices(config); - this.services = picoServices.services(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @BeforeEach void setup() { - Optional existingBootstrap = PicoServices.globalBootstrap(); + Optional existingBootstrap = InjectionServices.globalBootstrap(); assertThat(existingBootstrap, OptionalMatcher.optionalEmpty()); Config config = Config.builder() diff --git a/pico/configdriven/tests/configuredby/src/test/resources/application.yaml b/inject/configdriven/tests/configuredby/src/test/resources/application.yaml similarity index 98% rename from pico/configdriven/tests/configuredby/src/test/resources/application.yaml rename to inject/configdriven/tests/configuredby/src/test/resources/application.yaml index 8d4e82348a1..dcea557cf3a 100644 --- a/pico/configdriven/tests/configuredby/src/test/resources/application.yaml +++ b/inject/configdriven/tests/configuredby/src/test/resources/application.yaml @@ -14,7 +14,7 @@ # limitations under the License. # -pico: +inject: permits-dynamic: true server: diff --git a/pico/configdriven/tests/pom.xml b/inject/configdriven/tests/pom.xml similarity index 83% rename from pico/configdriven/tests/pom.xml rename to inject/configdriven/tests/pom.xml index eacb6fcebe1..c64cba7ea76 100644 --- a/pico/configdriven/tests/pom.xml +++ b/inject/configdriven/tests/pom.xml @@ -21,8 +21,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.configdriven - helidon-pico-configdriven-project + io.helidon.inject.configdriven + helidon-inject-configdriven-project 4.0.0-SNAPSHOT ../pom.xml @@ -37,9 +37,9 @@ true - io.helidon.pico.configdriven.tests - helidon-pico-configdriven-tests-project - Helidon Pico Config-Driven Tests Project + io.helidon.inject.configdriven.tests + helidon-inject-configdriven-tests-project + Helidon Injection Config-Driven Tests Project pom diff --git a/inject/maven-plugin/README.md b/inject/maven-plugin/README.md new file mode 100644 index 00000000000..9df010f2199 --- /dev/null +++ b/inject/maven-plugin/README.md @@ -0,0 +1,105 @@ +# inject-maven-plugin +A collection of maven plugins for Injection-based applications that provides several features including options to: + +1. Validate the entirety of dependency graph across all modules. The application-create plugin would be applied in the same pom.xml + that would otherwise assemble your application for deployment. This module would be expected to have compile-time references to + each module that contributes to your application holistically + +2. After the model has been validated, the application-create plugin will code-generate the service provider "Activators", "Modules", and "Application" into the + final assembly that will be used at runtime to satisfy every injection point for the entire application without the need for reflection at runtime. This can be thought conceptually as a "linking phase" for your native application/image. + +3. Creating Injection modules from external jars and packages using the . + +--- + +Q: Is this maven plugin required for your Injection-based application to work? + +Answer 1: No, but it is recommended. Strictly speaking the main code generation occurs using the annotation processor, and the output from that processor is fully functional at runtime. However, without the use of this plugin your application's dependency model will not be validation nor will it be linked/bound/burned into your final application image. It will still work fine and Injection will handle this case, but your application is not as optimal from a runtime performance perspective. + +Answer 2: Yes, but only if you do not have access to the service implementation types, and are unable to apply the annotation processor on those types at compile time. Note, however, that Injection can still work without the maven processor in cases where you have possession to rebuild the service classes, but get the interfaces from an external module. In this later case, the ExternalContracts interfaces can be used on the service implementation classes. + +--- + +## Usage + +The following are the maven Mojo's that are available to use. Each can be used for either the src/main or src/test. + +example usage: +```pom.xml + + io.helidon.inject + helidon-inject-maven-plugin + ${helidon.version} + + + + external-module-create + + + + compile + compile + + application-create + + + + + + io.helidon.inject.examples.logger.common + + ALL + + +``` + +### application-create +This goal is used to trigger the creation of the Injection$$Application for your module (which typically is found in the final assembly jar module for your application). The usage of this also triggers the validation and integrity checks for your entire application's DI model, and will fail-fast at compilation time if any issue is detected (e.g., a non-Optional @Inject is found on a contract type having no concrete service implementations, etc.). Assuming there are no issues found during application creation - each of your service implementations will be listed inside the injectionApplication, and it will include the literal DI resolution plan for each of your services. This can also be very useful for visualization and debugging purposes besides being optimal from a runtime performance perspective. + +Also note that Helidon Injection strives to ensure your application stays as deterministic as possible (as shown by the Injection$$Application/i> generated class). But when the jakarta.inject.Provider type is used within your application then some of that deterministic behavior goes away. This is due to how Provider<>'s work since the implementation for the Provider (i.e., your application logic) "owns" the behavior for what actual concrete type that are created by it, along with the scope/cardinality for those instances. These instances are then delivered (as potentially injectable services) into other dependent services. In this way Helidon Injection is simply acting as a broker and delivery mechanism between your Provider<> implementation(s) and the consumer that are using those service instances as injection points, etc. This is not meant to scare ore even dissuade you from using Provider<>, but merely to inform you that some of the deterministic behavior goes away under these circumstances using Provider instead of another Scope type like @Singleton. In many/most cases this is completely normal and acceptable. As a precaution, however, Helidon Injection chose to fail-fast at application creation time if your application is found to use jakarta.inject.Provider. You will then need to provide a strategy/configuration in your pom.xml file to permit these types of usages. There are options to allow ALL providers (as shown in the above example), or the strategy can be dictated on a case-by-case basis. See the javadoc for [AbstractApplicationCreatorMojo](src/main/java/io/helidon/inject/maven/plugin/AbstractApplicationCreatorMojo.java) for details. + +### external-module-create +This goal is used to trigger the creation of the supporting set of DI classes for an external jar/module - typically created without since it lacked having the Injection annotation processor during compilation. In this scenario, and to use this option then first be sure that the dependent module is a maven compile-time dependency in your module. After that then simply state the name of the package(s) to scan and produce the supporting DI classes (e.g., "io.helidon.inject.examples.logger.common" in the above example) in the pom.xml and then target/generated-sources/inject should be generated accordingly. + +The example from above cover the basics for generation. There are one more advanced option that is available here that we'd like to cover. The below was taken from the [test-tck-jsr330 pom.xml](../tests/tck-jsr330/pom.xml): + +```pom.xml + + + -Ainject.debug=true + -Ainject.autoAddNonContractInterfaces=true + + + org.atinject.tck.auto + org.atinject.tck.auto.accessories + + true + + + org.atinject.tck.auto.accessories.SpareTire + + + jakarta.inject.Named + spare + + + + + org.atinject.tck.auto.DriversSeat + + + org.atinject.tck.auto.Drivers + + + + + +``` + +Here we can see additional DI constructs, specifically two Qualifiers, are being augmented into the DI declaration model for the 3rd party jar. We can also see the option used to treat all service type interfaces as Contracts. + +## TestApplication +When the maven plugin creates an application for src/main/java sources, a Injection$$Application will be created for compile-time dependencies involved in the DI set of services. But when src/test/java sources are compiled, a Injection$$TestApplication will be created for test-type dependencies involved in the test-side DI set of services of your application. + +## Best Practices +Only one Injection$$Application should typically be in your module classpath. And in production applications there should never be any test service types or a Injection$$TestApplication, etc. diff --git a/pico/maven-plugin/etc/spotbugs/exclude.xml b/inject/maven-plugin/etc/spotbugs/exclude.xml similarity index 76% rename from pico/maven-plugin/etc/spotbugs/exclude.xml rename to inject/maven-plugin/etc/spotbugs/exclude.xml index 16cb0be5924..aff67c8c0d4 100644 --- a/pico/maven-plugin/etc/spotbugs/exclude.xml +++ b/inject/maven-plugin/etc/spotbugs/exclude.xml @@ -24,39 +24,39 @@ - + - + - + - + - + - + - + diff --git a/pico/maven-plugin/pom.xml b/inject/maven-plugin/pom.xml similarity index 93% rename from pico/maven-plugin/pom.xml rename to inject/maven-plugin/pom.xml index c38f3bd6464..6e506b221d4 100644 --- a/pico/maven-plugin/pom.xml +++ b/inject/maven-plugin/pom.xml @@ -20,15 +20,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-maven-plugin - Helidon Pico Maven Plugin + helidon-inject-maven-plugin + Helidon Injection Maven Plugin maven-plugin @@ -79,13 +79,13 @@ - io.helidon.pico - helidon-pico-tools + io.helidon.inject + helidon-inject-tools - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime io.helidon.builder diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractApplicationCreatorMojo.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/AbstractApplicationCreatorMojo.java similarity index 81% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractApplicationCreatorMojo.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/AbstractApplicationCreatorMojo.java index 116a9019251..b91e7e91a0e 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractApplicationCreatorMojo.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/AbstractApplicationCreatorMojo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.io.File; import java.net.URLClassLoader; @@ -32,74 +32,71 @@ import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.CallingContext; -import io.helidon.pico.api.CallingContextFactory; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.runtime.ServiceBinderDefault; -import io.helidon.pico.tools.AbstractFilerMessager; -import io.helidon.pico.tools.ActivatorCreatorCodeGen; -import io.helidon.pico.tools.ApplicationCreatorCodeGen; -import io.helidon.pico.tools.ApplicationCreatorConfigOptions; -import io.helidon.pico.tools.ApplicationCreatorRequest; -import io.helidon.pico.tools.ApplicationCreatorResponse; -import io.helidon.pico.tools.CodeGenFiler; -import io.helidon.pico.tools.CodeGenPaths; -import io.helidon.pico.tools.CompilerOptions; -import io.helidon.pico.tools.ModuleInfoDescriptor; -import io.helidon.pico.tools.PermittedProviderType; -import io.helidon.pico.tools.ToolsException; -import io.helidon.pico.tools.spi.ApplicationCreator; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.CallingContext; +import io.helidon.inject.api.CallingContextFactory; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.runtime.ServiceBinderDefault; +import io.helidon.inject.tools.AbstractFilerMessager; +import io.helidon.inject.tools.ActivatorCreatorCodeGen; +import io.helidon.inject.tools.ApplicationCreatorCodeGen; +import io.helidon.inject.tools.ApplicationCreatorConfigOptions; +import io.helidon.inject.tools.ApplicationCreatorRequest; +import io.helidon.inject.tools.ApplicationCreatorResponse; +import io.helidon.inject.tools.CodeGenFiler; +import io.helidon.inject.tools.CodeGenPaths; +import io.helidon.inject.tools.CompilerOptions; +import io.helidon.inject.tools.ModuleInfoDescriptor; +import io.helidon.inject.tools.PermittedProviderType; +import io.helidon.inject.tools.ToolsException; +import io.helidon.inject.tools.spi.ApplicationCreator; import org.apache.maven.model.Build; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; -import static io.helidon.pico.api.CallingContextFactory.globalCallingContext; -import static io.helidon.pico.maven.plugin.MavenPluginUtils.applicationCreator; -import static io.helidon.pico.maven.plugin.MavenPluginUtils.hasValue; -import static io.helidon.pico.maven.plugin.MavenPluginUtils.picoServices; -import static io.helidon.pico.maven.plugin.MavenPluginUtils.toDescriptions; -import static io.helidon.pico.runtime.PicoExceptions.toErrorMessage; -import static io.helidon.pico.tools.ModuleUtils.REAL_MODULE_INFO_JAVA_NAME; -import static io.helidon.pico.tools.ModuleUtils.isUnnamedModuleName; -import static io.helidon.pico.tools.ModuleUtils.toBasePath; -import static io.helidon.pico.tools.ModuleUtils.toSuggestedModuleName; +import static io.helidon.inject.api.CallingContextFactory.globalCallingContext; +import static io.helidon.inject.runtime.InjectionExceptions.toErrorMessage; +import static io.helidon.inject.tools.ModuleUtils.REAL_MODULE_INFO_JAVA_NAME; +import static io.helidon.inject.tools.ModuleUtils.isUnnamedModuleName; +import static io.helidon.inject.tools.ModuleUtils.toBasePath; +import static io.helidon.inject.tools.ModuleUtils.toSuggestedModuleName; import static java.util.Optional.ofNullable; /** - * Abstract base for the {@code Pico maven-plugin} responsible for creating {@code Application} and Test {@code Application}'s. + * Abstract base for the Injection {@code maven-plugin} responsible for creating {@code Application} and Test {@code Application}'s. * - * @see io.helidon.pico.api.Application - * @see io.helidon.pico.tools.ApplicationCreatorConfigOptions + * @see Application + * @see ApplicationCreatorConfigOptions */ @SuppressWarnings({"unused", "FieldCanBeLocal"}) public abstract class AbstractApplicationCreatorMojo extends AbstractCreatorMojo { /** * The approach for handling providers. - * See {@link io.helidon.pico.tools.ApplicationCreatorConfigOptions#permittedProviderTypes()}. + * See {@link ApplicationCreatorConfigOptions#permittedProviderTypes()}. */ - @Parameter(property = "pico.permitted.provider.types", readonly = true) + @Parameter(property = "inject.permitted.provider.types", readonly = true) private String permittedProviderTypes; private PermittedProviderType permittedProviderType; /** * Sets the named types permitted for providers, assuming use of - * {@link io.helidon.pico.tools.PermittedProviderType#NAMED}. + * {@link PermittedProviderType#NAMED}. */ - @Parameter(property = "pico.permitted.provider.type.names", readonly = true) + @Parameter(property = "inject.permitted.provider.type.names", readonly = true) private List permittedProviderTypeNames; /** * Sets the named qualifier types permitted for providers, assuming use of - * {@link io.helidon.pico.tools.PermittedProviderType#NAMED}. + * {@link PermittedProviderType#NAMED}. */ - @Parameter(property = "pico.permitted.provider.qualifier.type.names", readonly = true) + @Parameter(property = "inject.permitted.provider.qualifier.type.names", readonly = true) private List permittedProviderQualifierTypeNames; /** @@ -114,7 +111,7 @@ static ToolsException noModuleFoundError() { } static ToolsException noModuleFoundError(String moduleName) { - return new ToolsException("No Pico module named '" + moduleName + return new ToolsException("No Injection module named '" + moduleName + "' was found in the current module - was APT run?"); } @@ -248,25 +245,25 @@ protected void innerExecute() { try { Thread.currentThread().setContextClassLoader(loader); - PicoServices picoServices = picoServices(false); - if (picoServices.config().usesCompileTimeApplications()) { + InjectionServices injectionServices = MavenPluginUtils.injectionServices(false); + if (injectionServices.config().usesCompileTimeApplications()) { String desc = "Should not be using 'application' bindings"; String msg = (callCtx == null) ? toErrorMessage(desc) : toErrorMessage(callCtx, desc); throw new IllegalStateException(msg); } - Services services = picoServices.services(); + Services services = injectionServices.services(); - // get the application creator only after pico services were initialized (we need to ignore any existing apps) - ApplicationCreator creator = applicationCreator(); + // get the application creator only after services are initialized (we need to ignore any existing apps) + ApplicationCreator creator = MavenPluginUtils.applicationCreator(); List> allModules = services .lookupAll(ServiceInfoCriteria.builder() .addContractImplemented(ModuleComponent.class) .build()); - if (PicoServices.isDebugEnabled()) { - getLog().info("processing modules: " + toDescriptions(allModules)); + if (InjectionServices.isDebugEnabled()) { + getLog().info("processing modules: " + MavenPluginUtils.toDescriptions(allModules)); } else { - getLog().debug("processing modules: " + toDescriptions(allModules)); + getLog().debug("processing modules: " + MavenPluginUtils.toDescriptions(allModules)); } if (allModules.isEmpty()) { warn("No modules to process"); @@ -334,7 +331,7 @@ protected void innerExecute() { .throwIfError(isFailOnError()) .generator(getClass().getName()) .templateName(getTemplateName()); - if (hasValue(moduleName)) { + if (MavenPluginUtils.hasValue(moduleName)) { reqBuilder.moduleName(moduleName); } else if (!isUnnamedModuleName(moduleInfoModuleName)) { reqBuilder.moduleName(moduleInfoModuleName); @@ -350,7 +347,7 @@ protected void innerExecute() { getLog().error("failed to process", res.error().orElse(null)); } } catch (Exception e) { - throw new ToolsException("An error occurred creating the Pico Application in " + getClass().getName(), e); + throw new ToolsException("An error occurred creating the Application in " + getClass().getName(), e); } finally { Thread.currentThread().setContextClassLoader(prev); } @@ -389,7 +386,7 @@ void warn(String msg) { String desc = "no modules to process"; String ctxMsg = (callCtx == null) ? toErrorMessage(desc) : toErrorMessage(callCtx, desc); ToolsException e = new ToolsException(ctxMsg); - if (PicoServices.isDebugEnabled()) { + if (InjectionServices.isDebugEnabled()) { getLog().warn(e.getMessage(), e); } else { getLog().warn(e.getMessage()); diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractCreatorMojo.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/AbstractCreatorMojo.java similarity index 88% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractCreatorMojo.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/AbstractCreatorMojo.java index 738ced07c88..e1a5c366cae 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/AbstractCreatorMojo.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/AbstractCreatorMojo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.io.File; import java.nio.file.Path; @@ -24,16 +24,16 @@ import java.util.Optional; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.tools.AbstractCreator; -import io.helidon.pico.tools.Messager; -import io.helidon.pico.tools.ModuleInfoDescriptor; -import io.helidon.pico.tools.ModuleUtils; -import io.helidon.pico.tools.Options; -import io.helidon.pico.tools.TemplateHelper; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.tools.AbstractCreator; +import io.helidon.inject.tools.Messager; +import io.helidon.inject.tools.ModuleInfoDescriptor; +import io.helidon.inject.tools.ModuleUtils; +import io.helidon.inject.tools.Options; +import io.helidon.inject.tools.TemplateHelper; +import io.helidon.inject.tools.ToolsException; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.AbstractMojo; @@ -41,10 +41,10 @@ import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; -import static io.helidon.pico.tools.ModuleUtils.toSuggestedGeneratedPackageName; +import static io.helidon.inject.tools.ModuleUtils.toSuggestedGeneratedPackageName; /** - * Abstract base for all pico creator mojo's. + * Abstract base for all creator mojo's. */ @SuppressWarnings({"unused", "FieldCanBeLocal", "FieldMayBeFinal"}) public abstract class AbstractCreatorMojo extends AbstractMojo { @@ -58,24 +58,24 @@ public abstract class AbstractCreatorMojo extends AbstractMojo { /** * Tag controlling whether we fail on error. */ - static final String TAG_FAIL_ON_ERROR = "pico.failOnError"; + static final String TAG_FAIL_ON_ERROR = "inject.failOnError"; /** * Tag controlling whether we fail on warnings. */ - static final String TAG_FAIL_ON_WARNING = "pico.failOnWarning"; + static final String TAG_FAIL_ON_WARNING = "inject.failOnWarning"; - static final String TAG_PACKAGE_NAME = "pico.package.name"; + static final String TAG_PACKAGE_NAME = "inject.package.name"; /** - * The file name written to ./target/pico/ to track the last package name generated for this application. + * The file name written to ./target/inject/ to track the last package name generated for this application. * This application package name is what we fall back to for the application name and the module name if not otherwise * specified directly. */ protected static final String APPLICATION_PACKAGE_FILE_NAME = ModuleUtils.APPLICATION_PACKAGE_FILE_NAME; // ---------------------------------------------------------------------- - // Pico Configurables + // Configurables // ---------------------------------------------------------------------- /** @@ -157,9 +157,9 @@ public abstract class AbstractCreatorMojo extends AbstractMojo { /** * Sets the debug flag. - * See {@link io.helidon.pico.api.PicoServices#TAG_DEBUG}. + * See {@link InjectionServices#TAG_DEBUG}. */ - @Parameter(property = PicoServices.TAG_DEBUG, readonly = true) + @Parameter(property = InjectionServices.TAG_DEBUG, readonly = true) private boolean isDebugEnabled; /** @@ -191,8 +191,8 @@ protected File getProjectBuildTargetDir() { * * @return the scratch directory */ - protected File getPicoScratchDir() { - return new File(getProjectBuildTargetDir(), "pico"); + protected File getInjectScratchDir() { + return new File(getProjectBuildTargetDir(), "inject"); } /** @@ -248,7 +248,7 @@ public void execute() throws MojoExecutionException { getLog().info("Finishing " + getClass().getName() + " for " + getProject()); MavenPluginUtils.resetAll(); } catch (Throwable t) { - MojoExecutionException me = new MojoExecutionException("Pico Maven plugin execution failed", t); + MojoExecutionException me = new MojoExecutionException("Injection maven-plugin execution failed", t); getLog().error(me.getMessage(), t); throw me; } finally { @@ -282,9 +282,9 @@ protected String determinePackageName(Optional> packageName = moduleSp.serviceInfo().serviceTypeName().packageName(); } else { if (descriptor == null) { - packageName = toSuggestedGeneratedPackageName(typeNames, "pico"); + packageName = toSuggestedGeneratedPackageName(typeNames, "inject"); } else { - packageName = toSuggestedGeneratedPackageName(typeNames, "pico", descriptor); + packageName = toSuggestedGeneratedPackageName(typeNames, "inject", descriptor); } } } @@ -308,7 +308,7 @@ protected String determinePackageName(Optional> * @return the app package name that was loaded */ protected Optional loadAppPackageName() { - return ModuleUtils.loadAppPackageName(getPicoScratchDir().toPath()); + return ModuleUtils.loadAppPackageName(getInjectScratchDir().toPath()); } /** @@ -317,11 +317,11 @@ protected Optional loadAppPackageName() { * @param packageName the package name */ protected void saveAppPackageName(String packageName) { - ModuleUtils.saveAppPackageName(getPicoScratchDir().toPath(), packageName); + ModuleUtils.saveAppPackageName(getInjectScratchDir().toPath(), packageName); } /** - * Gated/controlled by the {@link io.helidon.pico.maven.plugin.TrafficCop}. + * Gated/controlled by the {@link TrafficCop}. * * @throws MojoExecutionException if any mojo problems occur */ diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ApplicationCreatorMojo.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ApplicationCreatorMojo.java similarity index 84% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ApplicationCreatorMojo.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ApplicationCreatorMojo.java index 4517528b664..cdd46308aca 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ApplicationCreatorMojo.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ApplicationCreatorMojo.java @@ -14,11 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.io.File; -import io.helidon.pico.tools.ApplicationCreatorDefault; +import io.helidon.inject.api.Application; +import io.helidon.inject.tools.spi.ApplicationCreator; +import io.helidon.inject.tools.ApplicationCreatorDefault; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -26,7 +28,7 @@ import org.apache.maven.plugins.annotations.ResolutionScope; /** - * A mojo wrapper to {@link io.helidon.pico.tools.spi.ApplicationCreator}. + * A mojo wrapper to {@link ApplicationCreator}. */ @Mojo(name = "application-create", defaultPhase = LifecyclePhase.COMPILE, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE) @@ -34,10 +36,10 @@ public class ApplicationCreatorMojo extends AbstractApplicationCreatorMojo { /** - * The classname to use for the Pico {@link io.helidon.pico.api.Application} class. + * The classname to use for the {@link Application} class. * If not found the classname will be inferred. */ - @Parameter(property = "pico.application.class.name", readonly = true) + @Parameter(property = "inject.application.class.name", readonly = true) private String className; /** diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExecHandler.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExecHandler.java similarity index 97% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExecHandler.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExecHandler.java index a7d028060c4..4a7302c8ebe 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExecHandler.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExecHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.io.Closeable; import java.io.IOException; @@ -25,7 +25,7 @@ import java.util.function.Function; import java.util.function.Supplier; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.ToolsException; /** * Delegates a functional invocation to be run within the context of a provided ClassLoader. diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExecutableClassLoader.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExecutableClassLoader.java similarity index 95% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExecutableClassLoader.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExecutableClassLoader.java index 413b2aa641b..cd0b2bd48be 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExecutableClassLoader.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExecutableClassLoader.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.net.MalformedURLException; import java.net.URL; @@ -24,7 +24,7 @@ import java.util.Collection; import java.util.List; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.ToolsException; /** * Responsible for creating a spi classlaoder using a child-first delegation strategy that can diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExternalModuleCreatorMojo.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExternalModuleCreatorMojo.java similarity index 87% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExternalModuleCreatorMojo.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExternalModuleCreatorMojo.java index 134d6038231..323b5ba5f4f 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ExternalModuleCreatorMojo.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ExternalModuleCreatorMojo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.io.File; import java.net.URLClassLoader; @@ -25,17 +25,19 @@ import java.util.Optional; import java.util.Set; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.tools.AbstractFilerMessager; -import io.helidon.pico.tools.ActivatorCreatorConfigOptions; -import io.helidon.pico.tools.ActivatorCreatorRequest; -import io.helidon.pico.tools.ActivatorCreatorResponse; -import io.helidon.pico.tools.CodeGenFiler; -import io.helidon.pico.tools.CodeGenPaths; -import io.helidon.pico.tools.ExternalModuleCreatorRequest; -import io.helidon.pico.tools.ExternalModuleCreatorResponse; -import io.helidon.pico.tools.spi.ActivatorCreator; -import io.helidon.pico.tools.spi.ExternalModuleCreator; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.tools.AbstractFilerMessager; +import io.helidon.inject.tools.ActivatorCreatorConfigOptions; +import io.helidon.inject.tools.ActivatorCreatorRequest; +import io.helidon.inject.tools.ActivatorCreatorResponse; +import io.helidon.inject.tools.CodeGenFiler; +import io.helidon.inject.tools.CodeGenPaths; +import io.helidon.inject.tools.ExternalModuleCreatorRequest; +import io.helidon.inject.tools.ExternalModuleCreatorResponse; +import io.helidon.inject.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.spi.ExternalModuleCreator; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -43,11 +45,11 @@ import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; -import static io.helidon.pico.maven.plugin.MavenPluginUtils.activatorCreator; -import static io.helidon.pico.maven.plugin.MavenPluginUtils.externalModuleCreator; +import static io.helidon.inject.maven.plugin.MavenPluginUtils.activatorCreator; +import static io.helidon.inject.maven.plugin.MavenPluginUtils.externalModuleCreator; /** - * Responsible for creating pico {@link io.helidon.pico.api.Activator}'s and a {@link io.helidon.pico.api.ModuleComponent} + * Responsible for creating {@link Activator}'s and a {@link ModuleComponent} * wrapping a set of packages from an external third-party jar. */ @Mojo(name = "external-module-create", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true, @@ -92,13 +94,13 @@ public class ExternalModuleCreatorMojo extends AbstractCreatorMojo { /** * Establishes whether strict jsr-330 compliance is in effect. */ - @Parameter(name = "supportsJsr330Strict", property = "pico.supports-jsr330.strict") + @Parameter(name = "supportsJsr330Strict", property = "inject.supports-jsr330.strict") private boolean supportsJsr330Strict; /** * Specify where to place generated source files created by annotation processing. */ - @Parameter(defaultValue = "${project.build.directory}/generated-sources/pico") + @Parameter(defaultValue = "${project.build.directory}/generated-sources/inject") private File generatedSourcesDirectory; /** diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/IsolatedThreadGroup.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/IsolatedThreadGroup.java similarity index 98% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/IsolatedThreadGroup.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/IsolatedThreadGroup.java index a4193b6bd0f..ef77b437b8e 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/IsolatedThreadGroup.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/IsolatedThreadGroup.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.io.Closeable; import java.util.ArrayList; @@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.ToolsException; /** * a ThreadGroup to isolate execution and collect exceptions. diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/MavenPluginUtils.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/MavenPluginUtils.java similarity index 72% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/MavenPluginUtils.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/MavenPluginUtils.java index 1493f6b0c4e..10503d29375 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/MavenPluginUtils.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/MavenPluginUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.util.Collection; import java.util.List; @@ -27,33 +27,34 @@ import io.helidon.common.LazyValue; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesHolder; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.configdriven.runtime.ConfigBeanRegistry; -import io.helidon.pico.tools.spi.ActivatorCreator; -import io.helidon.pico.tools.spi.ApplicationCreator; -import io.helidon.pico.tools.spi.ExternalModuleCreator; +import io.helidon.inject.api.Services; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.InjectionServicesHolder; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.configdriven.runtime.ConfigBeanRegistry; +import io.helidon.inject.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.spi.ApplicationCreator; +import io.helidon.inject.tools.spi.ExternalModuleCreator; final class MavenPluginUtils { private MavenPluginUtils() { } /** - * Returns a {@link io.helidon.pico.api.Services} registry that forces application loading to be disabled. + * Returns a {@link Services} registry that forces application loading to be disabled. * - * @return pico services + * @return injection services */ - static PicoServices picoServices(boolean wantApps) { + static InjectionServices injectionServices(boolean wantApps) { resetAll(); return lazyCreate(basicConfig(wantApps)).get(); } /** - * Resets all internal Pico configuration instances, JVM global singletons, service registries, etc. + * Resets all internal Injection configuration instances, JVM global singletons, service registries, etc. */ static void resetAll() { Internal.reset(); @@ -102,29 +103,29 @@ static boolean hasValue(String val) { return (val != null && !val.isBlank()); } - static LazyValue lazyCreate(Config config) { + static LazyValue lazyCreate(Config config) { return LazyValue.create(() -> { - PicoServices.globalBootstrap(Bootstrap.builder() + InjectionServices.globalBootstrap(Bootstrap.builder() .config(config) .limitRuntimePhase(Phase.GATHERING_DEPENDENCIES) .build()); - return PicoServices.picoServices().orElseThrow(); + return InjectionServices.injectionServices().orElseThrow(); }); } static Config basicConfig(boolean apps) { return Config.builder(ConfigSources.create( - Map.of("pico.permits-dynamic", "true", - "pico.uses-compile-time-applications", String.valueOf(apps)), + Map.of("inject.permits-dynamic", "true", + "inject.uses-compile-time-applications", String.valueOf(apps)), "config-1")) .disableEnvironmentVariablesSource() .disableSystemPropertiesSource() .build(); } - private static class Internal extends PicoServicesHolder { + private static class Internal extends InjectionServicesHolder { public static void reset() { - PicoServicesHolder.reset(); + InjectionServicesHolder.reset(); ConfigBeanRegistry cbr = ConfigBeanRegistry.instance(); if (cbr instanceof Resettable resettable) { resettable.reset(true); diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/QualifierConfig.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/QualifierConfig.java similarity index 97% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/QualifierConfig.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/QualifierConfig.java index 50212c03fef..3d96e0ffcbc 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/QualifierConfig.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/QualifierConfig.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.util.Map; import java.util.Objects; @@ -22,7 +22,7 @@ import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Qualifier; +import io.helidon.inject.api.Qualifier; /** * Used by {@link ExternalModuleCreatorMojo}, and here in this package due to maven diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ServiceTypeQualifiers.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ServiceTypeQualifiers.java similarity index 94% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ServiceTypeQualifiers.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ServiceTypeQualifiers.java index 3e8f174202f..25be0ec6b22 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/ServiceTypeQualifiers.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ServiceTypeQualifiers.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.util.LinkedHashSet; import java.util.List; @@ -22,7 +22,7 @@ import java.util.Objects; import java.util.Set; -import io.helidon.pico.api.Qualifier; +import io.helidon.inject.api.Qualifier; import org.apache.maven.plugins.annotations.Parameter; diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/TestApplicationCreatorMojo.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/TestApplicationCreatorMojo.java similarity index 79% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/TestApplicationCreatorMojo.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/TestApplicationCreatorMojo.java index 5465d3e1628..25bd8a30876 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/TestApplicationCreatorMojo.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/TestApplicationCreatorMojo.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.io.File; import java.net.URLClassLoader; @@ -24,10 +24,12 @@ import java.util.Set; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.tools.spi.ApplicationCreator; import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Build; @@ -37,15 +39,15 @@ import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; -import static io.helidon.pico.maven.plugin.MavenPluginUtils.picoServices; -import static io.helidon.pico.tools.ApplicationCreatorDefault.APPLICATION_NAME_SUFFIX; -import static io.helidon.pico.tools.ApplicationCreatorDefault.NAME_PREFIX; -import static io.helidon.pico.tools.ApplicationCreatorDefault.upperFirstChar; -import static io.helidon.pico.tools.ModuleUtils.toBasePath; -import static io.helidon.pico.tools.ModuleUtils.toSuggestedModuleName; +import static io.helidon.inject.maven.plugin.MavenPluginUtils.injectionServices; +import static io.helidon.inject.tools.ApplicationCreatorDefault.APPLICATION_NAME_SUFFIX; +import static io.helidon.inject.tools.ApplicationCreatorDefault.NAME_PREFIX; +import static io.helidon.inject.tools.ApplicationCreatorDefault.upperFirstChar; +import static io.helidon.inject.tools.ModuleUtils.toBasePath; +import static io.helidon.inject.tools.ModuleUtils.toSuggestedModuleName; /** - * A mojo wrapper to {@link io.helidon.pico.tools.spi.ApplicationCreator} for test specific types. + * A mojo wrapper to {@link ApplicationCreator} for test specific types. */ @Mojo(name = "test-application-create", defaultPhase = LifecyclePhase.TEST_COMPILE, threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST) @@ -53,10 +55,10 @@ public class TestApplicationCreatorMojo extends AbstractApplicationCreatorMojo { /** - * The classname to use for the Pico {@link io.helidon.pico.api.Application} test class. + * The classname to use for the {@link Application} test class. * If not found the classname will be inferred. */ - @Parameter(property = "io.helidon.pico.application.class.name", readonly = true + @Parameter(property = "io.helidon.inject.application.class.name", readonly = true // note: the default value handling doesn't work here for "$$"!! // defaultValue = DefaultApplicationCreator.APPLICATION_NAME ) @@ -144,9 +146,9 @@ Set getServiceTypeNamesForExclusion() { try { Thread.currentThread().setContextClassLoader(loader); - PicoServices picoServices = picoServices(false); - assert (!picoServices.config().usesCompileTimeApplications()); - Services services = picoServices.services(); + InjectionServices injectionServices = injectionServices(false); + assert (!injectionServices.config().usesCompileTimeApplications()); + Services services = injectionServices.services(); // retrieves all the services in the registry List> allServices = services diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/TrafficCop.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/TrafficCop.java similarity index 89% rename from pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/TrafficCop.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/TrafficCop.java index 514bd382811..6c75001660e 100644 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/TrafficCop.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/TrafficCop.java @@ -14,18 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.maven.plugin; +package io.helidon.inject.maven.plugin; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicBoolean; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.ToolsException; /** * maven-plugins will be called on the same JVM on different mojo instances when maven is run in parallel mode. If you didn't know * this then you know it now. ;-) *

    - * Since pico is designed in traditional microprofile patterns - the JVM is the container for one app - this is a problem. So to + * Since the framework is designed in traditional microprofile patterns - the JVM is the container for one app - this is a problem. + * In order to * compensate for this, we apply a traffic cop to effectively serialize access to the mojo execute() method so that only one can * run at a time. The code is negligible in terms of performance, and still allows for parallel builds to occur. */ diff --git a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/package-info.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/package-info.java similarity index 87% rename from examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/package-info.java rename to inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/package-info.java index a337af36d05..0dad536d79e 100644 --- a/examples/pico/interceptors/src/main/java/io/helidon/examples/pico/interceptors/package-info.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/package-info.java @@ -15,6 +15,6 @@ */ /** - * Examples of Intercepted services in Pico. + * Internal tooling for the injection maven-plugin. */ -package io.helidon.examples.pico.interceptors; +package io.helidon.inject.maven.plugin; diff --git a/pico/maven-plugin/src/main/java/module-info.java b/inject/maven-plugin/src/main/java/module-info.java similarity index 69% rename from pico/maven-plugin/src/main/java/module-info.java rename to inject/maven-plugin/src/main/java/module-info.java index d079624712e..4a6a257ae14 100644 --- a/pico/maven-plugin/src/main/java/module-info.java +++ b/inject/maven-plugin/src/main/java/module-info.java @@ -15,23 +15,23 @@ */ /** - * Pico maven-plugin module. + * Injection maven-plugin module. */ -module io.helidon.pico.maven.plugin { +module io.helidon.inject.maven.plugin { requires maven.plugin.annotations; requires maven.plugin.api; requires maven.project; requires maven.artifact; requires maven.model; requires io.helidon.builder.api; - requires io.helidon.pico.configdriven.runtime; + requires io.helidon.inject.configdriven.runtime; requires io.helidon.common; requires io.helidon.config; - requires transitive io.helidon.pico.tools; + requires transitive io.helidon.inject.tools; - exports io.helidon.pico.maven.plugin; + exports io.helidon.inject.maven.plugin; - uses io.helidon.pico.tools.spi.ActivatorCreator; - uses io.helidon.pico.tools.spi.ApplicationCreator; - uses io.helidon.pico.tools.spi.ExternalModuleCreator; + uses io.helidon.inject.tools.spi.ActivatorCreator; + uses io.helidon.inject.tools.spi.ApplicationCreator; + uses io.helidon.inject.tools.spi.ExternalModuleCreator; } diff --git a/pico/pom.xml b/inject/pom.xml similarity index 86% rename from pico/pom.xml rename to inject/pom.xml index f38562407da..b10307a353e 100644 --- a/pico/pom.xml +++ b/inject/pom.xml @@ -29,15 +29,15 @@ ../pom.xml - io.helidon.pico - helidon-pico-project - Helidon Pico Project + io.helidon.inject + helidon-inject-project + Helidon Injection Project pom - - true + + true diff --git a/pico/processor/README.md b/inject/processor/README.md similarity index 80% rename from pico/processor/README.md rename to inject/processor/README.md index d24de5c9edd..5328707f2cc 100644 --- a/pico/processor/README.md +++ b/inject/processor/README.md @@ -1,6 +1,6 @@ -# pico-processor +# inject-processor -This module provides *compile-time only* annotation processing, and is designed to look for javax/jakarta inject type annotations to then code-generate supporting DI activator source artifacts in support for your injection points and dependency model. It leverages the [tools module](../tools/README.md) to perform the necessary code generation when Pico annotations are found. +This module provides *compile-time only* annotation processing, and is designed to look for javax/jakarta inject type annotations to then code-generate supporting DI activator source artifacts in support for your injection points and dependency model. It leverages the [tools module](../tools/README.md) to perform the necessary code generation when Injection annotations are found. ## Usage @@ -13,8 +13,8 @@ In your pom.xml, add this plugin to be run as part of the compilation phase: true - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} diff --git a/pico/processor/etc/spotbugs/exclude.xml b/inject/processor/etc/spotbugs/exclude.xml similarity index 79% rename from pico/processor/etc/spotbugs/exclude.xml rename to inject/processor/etc/spotbugs/exclude.xml index 0ad17e3a215..3c9897deaac 100644 --- a/pico/processor/etc/spotbugs/exclude.xml +++ b/inject/processor/etc/spotbugs/exclude.xml @@ -24,17 +24,17 @@ - + - + - - + + diff --git a/pico/processor/pom.xml b/inject/processor/pom.xml similarity index 89% rename from pico/processor/pom.xml rename to inject/processor/pom.xml index b169e273579..babf3fc7f45 100644 --- a/pico/processor/pom.xml +++ b/inject/processor/pom.xml @@ -21,15 +21,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-processor - Helidon Pico Processor + helidon-inject-processor + Helidon Injection Processor etc/spotbugs/exclude.xml @@ -37,8 +37,8 @@ - io.helidon.pico - helidon-pico-tools + io.helidon.inject + helidon-inject-tools org.junit.jupiter diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/ActiveProcessorUtils.java b/inject/processor/src/main/java/io/helidon/inject/processor/ActiveProcessorUtils.java similarity index 95% rename from pico/processor/src/main/java/io/helidon/pico/processor/ActiveProcessorUtils.java rename to inject/processor/src/main/java/io/helidon/inject/processor/ActiveProcessorUtils.java index 2d90bef1503..990738d626e 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/ActiveProcessorUtils.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/ActiveProcessorUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.io.File; import java.net.URI; @@ -36,15 +36,15 @@ import io.helidon.common.processor.TypeInfoFactory; import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.tools.Messager; -import io.helidon.pico.tools.ModuleInfoDescriptor; -import io.helidon.pico.tools.ModuleInfoOrdering; -import io.helidon.pico.tools.Options; -import io.helidon.pico.tools.ServicesToProcess; +import io.helidon.inject.tools.Messager; +import io.helidon.inject.tools.ModuleInfoDescriptor; +import io.helidon.inject.tools.ModuleInfoOrdering; +import io.helidon.inject.tools.Options; +import io.helidon.inject.tools.ServicesToProcess; -import static io.helidon.pico.processor.GeneralProcessorUtils.toPath; -import static io.helidon.pico.tools.ModuleUtils.REAL_MODULE_INFO_JAVA_NAME; -import static io.helidon.pico.tools.ModuleUtils.inferSourceOrTest; +import static io.helidon.inject.processor.GeneralProcessorUtils.toPath; +import static io.helidon.inject.tools.ModuleUtils.REAL_MODULE_INFO_JAVA_NAME; +import static io.helidon.inject.tools.ModuleUtils.inferSourceOrTest; /** * Carries methods that are relative only during active APT processing. diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/BaseAnnotationProcessor.java b/inject/processor/src/main/java/io/helidon/inject/processor/BaseAnnotationProcessor.java similarity index 95% rename from pico/processor/src/main/java/io/helidon/pico/processor/BaseAnnotationProcessor.java rename to inject/processor/src/main/java/io/helidon/inject/processor/BaseAnnotationProcessor.java index fdf366ee080..3bbca4d04c0 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/BaseAnnotationProcessor.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/BaseAnnotationProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.Objects; import java.util.Optional; @@ -28,7 +28,7 @@ import io.helidon.common.types.TypeName; /** - * Abstract base for all Helidon Pico annotation processing. + * Abstract base for all Helidon annotation processing. */ abstract class BaseAnnotationProcessor extends AbstractProcessor { private final System.Logger logger = System.getLogger(getClass().getName()); diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/CreatorHandler.java b/inject/processor/src/main/java/io/helidon/inject/processor/CreatorHandler.java similarity index 81% rename from pico/processor/src/main/java/io/helidon/pico/processor/CreatorHandler.java rename to inject/processor/src/main/java/io/helidon/inject/processor/CreatorHandler.java index c69fbc010e8..0b91db679fb 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/CreatorHandler.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/CreatorHandler.java @@ -14,22 +14,22 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.Objects; import javax.annotation.processing.ProcessingEnvironment; import io.helidon.common.types.TypeName; -import io.helidon.pico.tools.AbstractFilerMessager; -import io.helidon.pico.tools.ActivatorCreatorProvider; -import io.helidon.pico.tools.ActivatorCreatorRequest; -import io.helidon.pico.tools.ActivatorCreatorResponse; -import io.helidon.pico.tools.CodeGenFiler; -import io.helidon.pico.tools.CodeGenInterceptorRequest; -import io.helidon.pico.tools.InterceptorCreatorResponse; -import io.helidon.pico.tools.Messager; -import io.helidon.pico.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.AbstractFilerMessager; +import io.helidon.inject.tools.ActivatorCreatorProvider; +import io.helidon.inject.tools.ActivatorCreatorRequest; +import io.helidon.inject.tools.ActivatorCreatorResponse; +import io.helidon.inject.tools.CodeGenFiler; +import io.helidon.inject.tools.CodeGenInterceptorRequest; +import io.helidon.inject.tools.InterceptorCreatorResponse; +import io.helidon.inject.tools.Messager; +import io.helidon.inject.tools.spi.ActivatorCreator; /** * Provides wrapping of the {@link ActivatorCreator}}. diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/CustomAnnotationProcessor.java b/inject/processor/src/main/java/io/helidon/inject/processor/CustomAnnotationProcessor.java similarity index 91% rename from pico/processor/src/main/java/io/helidon/pico/processor/CustomAnnotationProcessor.java rename to inject/processor/src/main/java/io/helidon/inject/processor/CustomAnnotationProcessor.java index 9930b1791b8..e025ac269df 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/CustomAnnotationProcessor.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/CustomAnnotationProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.ArrayList; import java.util.Collection; @@ -41,24 +41,23 @@ import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.tools.AbstractFilerMessager; -import io.helidon.pico.tools.CodeGenFiler; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.CustomAnnotationTemplateResponses; -import io.helidon.pico.tools.ToolsException; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.tools.AbstractFilerMessager; +import io.helidon.inject.tools.CodeGenFiler; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.CustomAnnotationTemplateResponses; +import io.helidon.inject.tools.ToolsException; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; -import static io.helidon.pico.processor.ActiveProcessorUtils.MAYBE_ANNOTATIONS_CLAIMED_BY_THIS_PROCESSOR; -import static io.helidon.pico.processor.GeneralProcessorUtils.hasValue; -import static io.helidon.pico.processor.GeneralProcessorUtils.rootStackTraceElementOf; -import static io.helidon.pico.tools.TypeTools.isStatic; -import static io.helidon.pico.tools.TypeTools.toAccess; -import static io.helidon.pico.tools.TypeTools.toFilePath; +import static io.helidon.inject.processor.GeneralProcessorUtils.hasValue; +import static io.helidon.inject.processor.GeneralProcessorUtils.rootStackTraceElementOf; +import static io.helidon.inject.tools.TypeTools.isStatic; +import static io.helidon.inject.tools.TypeTools.toAccess; +import static io.helidon.inject.tools.TypeTools.toFilePath; /** - * Processor for all {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator}'s. + * Processor for all {@link CustomAnnotationTemplateCreator}'s. */ public class CustomAnnotationProcessor extends BaseAnnotationProcessor { private static final Map> PRODUCERS_BY_ANNOTATION = new ConcurrentHashMap<>(); @@ -124,7 +123,7 @@ public boolean process(Set annotations, } } - return MAYBE_ANNOTATIONS_CLAIMED_BY_THIS_PROCESSOR; + return ActiveProcessorUtils.MAYBE_ANNOTATIONS_CLAIMED_BY_THIS_PROCESSOR; } catch (Throwable t) { utils().error(getClass().getSimpleName() + " error during processing; " + t + " @ " + rootStackTraceElementOf(t), t); diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/GeneralProcessorUtils.java b/inject/processor/src/main/java/io/helidon/inject/processor/GeneralProcessorUtils.java similarity index 95% rename from pico/processor/src/main/java/io/helidon/pico/processor/GeneralProcessorUtils.java rename to inject/processor/src/main/java/io/helidon/inject/processor/GeneralProcessorUtils.java index 771389e855f..5ef8d78afc3 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/GeneralProcessorUtils.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/GeneralProcessorUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.net.URI; import java.nio.file.Path; @@ -32,13 +32,13 @@ import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.tools.Options; -import io.helidon.pico.tools.TypeNames; -import io.helidon.pico.tools.TypeTools; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.tools.Options; +import io.helidon.inject.tools.TypeNames; +import io.helidon.inject.tools.TypeTools; /** * Carries static methods that are agnostic to the active processing environment. @@ -264,8 +264,8 @@ public static boolean isProviderType(TypeName typeName) { return ( name.equals(TypeNames.JAKARTA_PROVIDER) || name.equals(TypeNames.JAVAX_PROVIDER) - || name.equals(TypeNames.PICO_INJECTION_POINT_PROVIDER) - || TypeNames.PICO_SERVICE_PROVIDER.equals(name)); + || name.equals(TypeNames.INJECTION_POINT_PROVIDER) + || TypeNames.INJECTION_SERVICE_PROVIDER.equals(name)); } /** diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/GenericTemplateCreatorDefault.java b/inject/processor/src/main/java/io/helidon/inject/processor/GenericTemplateCreatorDefault.java similarity index 91% rename from pico/processor/src/main/java/io/helidon/pico/processor/GenericTemplateCreatorDefault.java rename to inject/processor/src/main/java/io/helidon/inject/processor/GenericTemplateCreatorDefault.java index d3ed0cf97e9..1079ce8dbdd 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/GenericTemplateCreatorDefault.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/GenericTemplateCreatorDefault.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.HashMap; import java.util.Map; @@ -23,13 +23,13 @@ import io.helidon.common.processor.TypeFactory; import io.helidon.common.types.TypeName; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.GenericTemplateCreator; -import io.helidon.pico.tools.GenericTemplateCreatorRequest; -import io.helidon.pico.tools.Messager; -import io.helidon.pico.tools.TemplateHelper; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.GenericTemplateCreator; +import io.helidon.inject.tools.GenericTemplateCreatorRequest; +import io.helidon.inject.tools.Messager; +import io.helidon.inject.tools.TemplateHelper; +import io.helidon.inject.tools.ToolsException; /** * Default implementation for {@link GenericTemplateCreator}. @@ -77,7 +77,7 @@ public Optional create(GenericTemplateCreatorR } /** - * Returns the template that will rely on a resource lookup of resources/pico/{templateProfile}/{templateName}. + * Returns the template that will rely on a resource lookup of resources/inject/{templateProfile}/{templateName}. * Note: This will only work for non-module based usages, and therefore is not recommended for general use. * * @param templateProfile the template profile to apply (must be exported by the spi provider module; "default" is reserved diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/PicoAnnotationProcessor.java b/inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java similarity index 90% rename from pico/processor/src/main/java/io/helidon/pico/processor/PicoAnnotationProcessor.java rename to inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java index be3e64b7c8d..695002b7cd4 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/PicoAnnotationProcessor.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.io.IOException; import java.nio.file.Path; @@ -49,62 +49,61 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.Activator; -import io.helidon.pico.api.Contract; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.ExternalContracts; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.processor.spi.PicoAnnotationProcessorObserver; -import io.helidon.pico.runtime.Dependencies; -import io.helidon.pico.tools.ActivatorCreatorCodeGen; -import io.helidon.pico.tools.ActivatorCreatorConfigOptions; -import io.helidon.pico.tools.ActivatorCreatorDefault; -import io.helidon.pico.tools.ActivatorCreatorRequest; -import io.helidon.pico.tools.ActivatorCreatorResponse; -import io.helidon.pico.tools.InterceptionPlan; -import io.helidon.pico.tools.InterceptorCreatorProvider; -import io.helidon.pico.tools.Options; -import io.helidon.pico.tools.ServicesToProcess; -import io.helidon.pico.tools.ToolsException; -import io.helidon.pico.tools.TypeNames; -import io.helidon.pico.tools.spi.ActivatorCreator; -import io.helidon.pico.tools.spi.InterceptorCreator; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.ExternalContracts; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver; +import io.helidon.inject.runtime.Dependencies; +import io.helidon.inject.tools.ActivatorCreatorCodeGen; +import io.helidon.inject.tools.ActivatorCreatorConfigOptions; +import io.helidon.inject.tools.ActivatorCreatorDefault; +import io.helidon.inject.tools.ActivatorCreatorRequest; +import io.helidon.inject.tools.ActivatorCreatorResponse; +import io.helidon.inject.tools.InterceptionPlan; +import io.helidon.inject.tools.InterceptorCreatorProvider; +import io.helidon.inject.tools.Options; +import io.helidon.inject.tools.ServicesToProcess; +import io.helidon.inject.tools.ToolsException; +import io.helidon.inject.tools.TypeNames; +import io.helidon.inject.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.spi.InterceptorCreator; import static io.helidon.common.processor.TypeInfoFactory.createTypedElementInfoFromElement; import static io.helidon.common.processor.TypeInfoFactory.isBuiltInJavaType; -import static io.helidon.pico.processor.ActiveProcessorUtils.MAYBE_ANNOTATIONS_CLAIMED_BY_THIS_PROCESSOR; -import static io.helidon.pico.processor.GeneralProcessorUtils.isProviderType; -import static io.helidon.pico.processor.GeneralProcessorUtils.rootStackTraceElementOf; -import static io.helidon.pico.processor.GeneralProcessorUtils.toBasicServiceInfo; -import static io.helidon.pico.processor.GeneralProcessorUtils.toPostConstructMethod; -import static io.helidon.pico.processor.GeneralProcessorUtils.toPreDestroyMethod; -import static io.helidon.pico.processor.GeneralProcessorUtils.toQualifiers; -import static io.helidon.pico.processor.GeneralProcessorUtils.toRunLevel; -import static io.helidon.pico.processor.GeneralProcessorUtils.toScopeNames; -import static io.helidon.pico.processor.GeneralProcessorUtils.toServiceTypeHierarchy; -import static io.helidon.pico.processor.GeneralProcessorUtils.toWeight; -import static io.helidon.pico.processor.ProcessingTracker.DEFAULT_SCRATCH_FILE_NAME; -import static io.helidon.pico.tools.CodeGenFiler.scratchClassOutputPath; -import static io.helidon.pico.tools.CodeGenFiler.targetClassOutputPath; -import static io.helidon.pico.tools.TypeTools.toAccess; +import static io.helidon.inject.processor.GeneralProcessorUtils.isProviderType; +import static io.helidon.inject.processor.GeneralProcessorUtils.rootStackTraceElementOf; +import static io.helidon.inject.processor.GeneralProcessorUtils.toBasicServiceInfo; +import static io.helidon.inject.processor.GeneralProcessorUtils.toPostConstructMethod; +import static io.helidon.inject.processor.GeneralProcessorUtils.toPreDestroyMethod; +import static io.helidon.inject.processor.GeneralProcessorUtils.toQualifiers; +import static io.helidon.inject.processor.GeneralProcessorUtils.toRunLevel; +import static io.helidon.inject.processor.GeneralProcessorUtils.toScopeNames; +import static io.helidon.inject.processor.GeneralProcessorUtils.toServiceTypeHierarchy; +import static io.helidon.inject.processor.GeneralProcessorUtils.toWeight; +import static io.helidon.inject.tools.CodeGenFiler.scratchClassOutputPath; +import static io.helidon.inject.tools.CodeGenFiler.targetClassOutputPath; +import static io.helidon.inject.tools.TypeTools.toAccess; import static java.util.Objects.requireNonNull; /** - * An annotation processor that will find everything needing to be processed related to core Pico conde generation. + * An annotation processor that will find everything needing to be processed related to core code generation. */ -public class PicoAnnotationProcessor extends BaseAnnotationProcessor { +public class InjectionAnnotationProcessor extends BaseAnnotationProcessor { private static final Set SUPPORTED_SERVICE_CLASS_TARGET_ANNOTATIONS = Set.of( TypeNames.JAKARTA_SINGLETON, TypeNames.JAVAX_SINGLETON, TypeNames.JAKARTA_APPLICATION_SCOPED, TypeNames.JAVAX_APPLICATION_SCOPED, - TypeNames.PICO_EXTERNAL_CONTRACTS, - TypeNames.PICO_INTERCEPTED); + TypeNames.EXTERNAL_CONTRACTS, + TypeNames.INTERCEPTED); private static final Set SUPPORTED_CONTRACT_CLASS_TARGET_ANNOTATIONS = Set.of( - TypeNames.PICO_CONTRACT); + TypeNames.CONTRACT); private static final Set SUPPORTED_ELEMENT_TARGET_ANNOTATIONS = Set.of( TypeNames.JAKARTA_INJECT, TypeNames.JAVAX_INJECT, @@ -130,7 +129,7 @@ public class PicoAnnotationProcessor extends BaseAnnotationProcessor { * @deprecated this is a Java ServiceLoader implementation and the constructor should not be used directly */ @Deprecated - public PicoAnnotationProcessor() { + public InjectionAnnotationProcessor() { } /** @@ -138,9 +137,9 @@ public PicoAnnotationProcessor() { * * @param disableBaseProcessing set to true to disable base processing */ - protected PicoAnnotationProcessor(boolean disableBaseProcessing) { + protected InjectionAnnotationProcessor(boolean disableBaseProcessing) { if (disableBaseProcessing) { - PicoAnnotationProcessor.disableBaseProcessing = true; + InjectionAnnotationProcessor.disableBaseProcessing = true; } } @@ -166,7 +165,7 @@ public final boolean process(Set annotations, RoundEnvironment roundEnv) { Thread thread = Thread.currentThread(); ClassLoader previousClassloader = thread.getContextClassLoader(); - thread.setContextClassLoader(PicoAnnotationProcessor.class.getClassLoader()); + thread.setContextClassLoader(InjectionAnnotationProcessor.class.getClassLoader()); // we want everything to execute in the classloader of this type, so service loaders // use the classpath of the annotation processor, and not some "random" classloader, such as a maven one @@ -181,7 +180,7 @@ protected boolean doProcess(Set annotations, RoundEnvironment roundEnv) { utils().roundEnv(roundEnv); - if (disableBaseProcessing && getClass() == PicoAnnotationProcessor.class) { + if (disableBaseProcessing && getClass() == InjectionAnnotationProcessor.class) { return false; } @@ -211,7 +210,7 @@ protected boolean doProcess(Set annotations, alreadyProcessed.clear(); } - return MAYBE_ANNOTATIONS_CLAIMED_BY_THIS_PROCESSOR; + return ActiveProcessorUtils.MAYBE_ANNOTATIONS_CLAIMED_BY_THIS_PROCESSOR; } catch (Throwable t) { ToolsException exc = new ToolsException("Error while processing: " + t + " @ " + rootStackTraceElementOf(t) @@ -266,7 +265,7 @@ protected Set supportedElementTargetAnnotations() { } /** - * Code generate these {@link io.helidon.pico.api.Activator}'s ad {@link io.helidon.pico.api.ModuleComponent}'s. + * Code generate these {@link Activator}'s ad {@link ModuleComponent}'s. * * @param services the services to code generate * @throws ToolsException if there is problem code generating sources or resources @@ -316,7 +315,7 @@ protected void doFiler(ServicesToProcess services) { /** * These are all of the elements (methods, constructors, methods) that are "interesting" (i.e., has {@code @Inject}, etc.). * - * @param elementsOfInterest the elements that are eligible for some form of Pico processing + * @param elementsOfInterest the elements that are eligible for some form of Injection processing */ protected void validate(Collection elementsOfInterest) { validatePerClass( @@ -339,7 +338,7 @@ protected void validate(Collection elementsOfInterest) { && it.hasAnnotation(TypeNames.JAKARTA_PRE_DESTROY_TYPE)); validatePerClass( elementsOfInterest, - "Pico does not currently support static or private elements", + "Injection does not currently support static or private elements", 0, (it) -> it.modifiers().contains(TypeValues.MODIFIER_PRIVATE) || it.modifiers().contains(TypeValues.MODIFIER_STATIC)); @@ -359,12 +358,12 @@ protected Set interceptAndValidate(Collection typesToCreateA * Called to process a single service that will eventually be code generated. The default implementation will take the * provided service {@link TypeInfo} and translate that into the {@link ServicesToProcess} instance. Eventually, the * {@link ServicesToProcess} instance will be fed as request inputs to one or more of the creators (e.g., - * {@link io.helidon.pico.tools.spi.ActivatorCreator}, {@link io.helidon.pico.tools.spi.InterceptorCreator}, etc.). + * {@link ActivatorCreator}, {@link InterceptorCreator}, etc.). * * @param services the services to process builder * @param service the service type info to process right now * @param serviceTypeNamesToCodeGenerate the entire set of types that are planned to be code-generated - * @param allElementsOfInterest all of the elements of interest that pico "knows" about + * @param allElementsOfInterest all of the elements of interest that injection services "knows" about */ protected void process(ServicesToProcess services, TypeInfo service, @@ -377,12 +376,12 @@ protected void process(ServicesToProcess services, } /** - * Processes the basic Pico service type - its contracts, run level, weight, dependencies, etc. + * Processes the basic Injection service type - its contracts, run level, weight, dependencies, etc. * * @param services the services to process builder * @param service the service type info to process right now * @param serviceTypeNamesToCodeGenerate the entire set of types that are planned to be code-generated - * @param allElementsOfInterest all of the elements of interest that pico "knows" about + * @param allElementsOfInterest all of the elements of interest that injection "knows" about */ @SuppressWarnings("unused") protected void processBasics(ServicesToProcess services, @@ -407,7 +406,7 @@ protected void processBasics(ServicesToProcess services, .build()); } else { // otherwise extends AbstractServiceProvider with the correct type - services.addParentServiceType(serviceTypeName, TypeName.builder(TypeNames.PICO_ABSTRACT_SERVICE_PROVIDER_TYPE) + services.addParentServiceType(serviceTypeName, TypeName.builder(TypeNames.ABSTRACT_SERVICE_PROVIDER_TYPE) .addTypeArgument(serviceTypeName) .build()); } @@ -442,7 +441,7 @@ protected Set serviceDefiningAnnotations() { * @param services the services to process builder * @param service the service type info to process right now * @param serviceTypeNamesToCodeGenerate the entire set of types that are planned to be code-generated - * @param allElementsOfInterest all of the elements of interest that pico "knows" about + * @param allElementsOfInterest all of the elements of interest that injection "knows" about */ @SuppressWarnings("unused") protected void processExtensions(ServicesToProcess services, @@ -527,16 +526,16 @@ private static Set toModifierNames(Set names) { return names.stream().map(String::toLowerCase).collect(Collectors.toSet()); } - private static ServiceLoader observerLoader() { + private static ServiceLoader observerLoader() { try { // note: it is important to use this class' CL since maven will not give us the "right" one. return ServiceLoader.load( - PicoAnnotationProcessorObserver.class, PicoAnnotationProcessorObserver.class.getClassLoader()); + InjectionAnnotationProcessorObserver.class, InjectionAnnotationProcessorObserver.class.getClassLoader()); } catch (ServiceConfigurationError e) { // see issue #6261 - running inside the IDE? // this version will use the thread ctx classloader - System.getLogger(PicoAnnotationProcessorObserver.class.getName()).log(System.Logger.Level.WARNING, e.getMessage(), e); - return ServiceLoader.load(PicoAnnotationProcessorObserver.class); + System.getLogger(InjectionAnnotationProcessorObserver.class.getName()).log(System.Logger.Level.WARNING, e.getMessage(), e); + return ServiceLoader.load(InjectionAnnotationProcessorObserver.class); } } @@ -590,7 +589,7 @@ private Optional findServiceProviderInHierarchy(TypeInfo classInfo, // already processed return Optional.empty(); } - if (TypeNames.PICO_SERVICE_PROVIDER_TYPE.equals(interfaceInfo.typeName())) { + if (TypeNames.SERVICE_PROVIDER_TYPE.equals(interfaceInfo.typeName())) { // yes! return Optional.of(classInfo.typeName()); } @@ -626,7 +625,7 @@ private void validatePerClass(Collection elementsOfInterest, * @param services the services to process builder * @param service the service type info to process right now * @param serviceTypeNamesToCodeGenerate the entire set of types that are planned to be code-generated - * @param allElementsOfInterest all of the elements of interest that pico "knows" about + * @param allElementsOfInterest all of the elements of interest that injectio "knows" about */ @SuppressWarnings("unused") private void processInterceptors(ServicesToProcess services, @@ -729,7 +728,7 @@ private void gatherContracts(Set contracts, TypeName genericProviderTypeName = fqProviderTypeName.genericTypeName(); externalContracts.add(genericProviderTypeName); filterModuleName(typeInfo.moduleNameOf(genericProviderTypeName)).ifPresent(externalModuleNamesRequired::add); - if (genericProviderTypeName.name().equals(TypeNames.PICO_INJECTION_POINT_PROVIDER)) { + if (genericProviderTypeName.name().equals(TypeNames.INJECTION_POINT_PROVIDER)) { TypeName jakartaProviderTypeName = TypeName.create(TypeNames.JAKARTA_PROVIDER); externalContracts.add(jakartaProviderTypeName); filterModuleName(typeInfo.moduleNameOf(jakartaProviderTypeName)).ifPresent(externalModuleNamesRequired::add); @@ -886,7 +885,7 @@ private void gatherTypeInfosToProcessInThisModule(Map result } private void notifyObservers() { - List observers = HelidonServiceLoader.create(observerLoader()).asList(); + List observers = HelidonServiceLoader.create(observerLoader()).asList(); if (!observers.isEmpty()) { ProcessingEvent event = ProcessingEvent.builder() .processingEnvironment(processingEnv) @@ -897,7 +896,7 @@ private void notifyObservers() { } private Path trackerStatePath() { - return scratchClassOutputPath(targetClassOutputPath(processingEnv.getFiler())).resolve(DEFAULT_SCRATCH_FILE_NAME); + return scratchClassOutputPath(targetClassOutputPath(processingEnv.getFiler())).resolve(ProcessingTracker.DEFAULT_SCRATCH_FILE_NAME); } } diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/MessagerToLogAdapter.java b/inject/processor/src/main/java/io/helidon/inject/processor/MessagerToLogAdapter.java similarity index 95% rename from pico/processor/src/main/java/io/helidon/pico/processor/MessagerToLogAdapter.java rename to inject/processor/src/main/java/io/helidon/inject/processor/MessagerToLogAdapter.java index fd3e528c3da..23f876b76cd 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/MessagerToLogAdapter.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/MessagerToLogAdapter.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; -import io.helidon.pico.tools.Messager; +import io.helidon.inject.tools.Messager; class MessagerToLogAdapter implements Messager { diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/ProcessingEventBlueprint.java b/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingEventBlueprint.java similarity index 87% rename from pico/processor/src/main/java/io/helidon/pico/processor/ProcessingEventBlueprint.java rename to inject/processor/src/main/java/io/helidon/inject/processor/ProcessingEventBlueprint.java index ce79b1343e9..f6deaba787c 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/ProcessingEventBlueprint.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingEventBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.Optional; import java.util.Set; @@ -23,9 +23,10 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypedElementInfo; +import io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver; /** - * Attributes that can be observed via {@link io.helidon.pico.processor.spi.PicoAnnotationProcessorObserver}. + * Attributes that can be observed via {@link InjectionAnnotationProcessorObserver}. */ @Prototype.Blueprint interface ProcessingEventBlueprint { @@ -42,7 +43,7 @@ interface ProcessingEventBlueprint { * processing. The set of processed elements are subject to change in the future. The implementor is therefore encouraged * to not make assumptions about the set of elements that are in this set. * - * @return the set of injectable elements, and any other elements of interest to the pico APT + * @return the set of injectable elements, and any other elements of interest to the APT */ Set elementsOfInterest(); diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/ProcessingTracker.java b/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingTracker.java similarity index 92% rename from pico/processor/src/main/java/io/helidon/pico/processor/ProcessingTracker.java rename to inject/processor/src/main/java/io/helidon/inject/processor/ProcessingTracker.java index 3bad1593ac2..04ad21309b2 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/ProcessingTracker.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingTracker.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.io.File; import java.io.IOException; @@ -30,7 +30,8 @@ import javax.annotation.processing.ProcessingEnvironment; import javax.lang.model.element.TypeElement; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.tools.ToolsException; /** * This class adds persistent tracking (typically under ./target/XXX) to allow seamless full and/or incremental processing of @@ -40,12 +41,12 @@ * For example, when incremental processing occurs, the elements passed to process in all rounds will just be a subset of * all of the annotated services since the compiler (from the IDE) only recompiles the files that have been changed. This is * typically different from how maven invokes compilation (doing a full compile where all types will be seen in the round). The - * {@link PicoAnnotationProcessor}, for example, would see this reduced subset of types in the round and would otherwise have - * created a {@link io.helidon.pico.api.ModuleComponent} only representative of the reduced subset of classes. This would be + * {@link InjectionAnnotationProcessor}, for example, would see this reduced subset of types in the round and would otherwise have + * created a {@link ModuleComponent} only representative of the reduced subset of classes. This would be * incorrect and lead to an invalid module component source file to have been generated. *

    * We use this tracker to persist the list of generated activators much in the same way that - * {@code META-INF/services} are tracked. A target scratch directory (i.e., target/pico in this case) is used instead - in order + * {@code META-INF/services} are tracked. A target scratch directory (i.e., target/inject in this case) is used instead - in order * to keep it out of the build jar. *

    * Usage: @@ -56,7 +57,7 @@ *

  • {@link #close()} - during final lifecycle of the APT in order to persist state to be (re)written out to disk
  • * * - * @see PicoAnnotationProcessor + * @see InjectionAnnotationProcessor */ class ProcessingTracker implements AutoCloseable { static final String DEFAULT_SCRATCH_FILE_NAME = "activators.lst"; diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/UnsupportedConstructsProcessor.java b/inject/processor/src/main/java/io/helidon/inject/processor/UnsupportedConstructsProcessor.java similarity index 96% rename from pico/processor/src/main/java/io/helidon/pico/processor/UnsupportedConstructsProcessor.java rename to inject/processor/src/main/java/io/helidon/inject/processor/UnsupportedConstructsProcessor.java index 1b11a39790d..beadf9fa78d 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/UnsupportedConstructsProcessor.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/UnsupportedConstructsProcessor.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.Set; import java.util.stream.Collectors; @@ -26,11 +26,11 @@ import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic; -import io.helidon.pico.tools.Options; -import io.helidon.pico.tools.TypeNames; +import io.helidon.inject.tools.Options; +import io.helidon.inject.tools.TypeNames; /** - * When used will recognize constructs that are explicitly known to be unsupported in Pico's reference implementation. + * When used will recognize constructs that are explicitly known to be unsupported in Injection's reference implementation. * Examples include: *
      *
    • {@code jakarta.annotation.ManagedBean} and "javax.annotation.ManagedBean" @@ -115,7 +115,7 @@ public boolean process(Set annotations, return false; } - String msg = "This module contains unsupported annotations for Pico " + String msg = "This module contains unsupported annotations for Injection " + " to process: " + annotationTypeNames + ".\n"; if (annotationTypeNames.contains(TypeNames.JAKARTA_APPLICATION_SCOPED) || annotationTypeNames.contains(TypeNames.JAVAX_APPLICATION_SCOPED)) { diff --git a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/package-info.java b/inject/processor/src/main/java/io/helidon/inject/processor/package-info.java similarity index 86% rename from examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/package-info.java rename to inject/processor/src/main/java/io/helidon/inject/processor/package-info.java index 0b5b1906098..e564d4db0fc 100644 --- a/examples/pico/configdriven/src/main/java/io/helidon/examples/pico/configdriven/package-info.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/package-info.java @@ -15,6 +15,6 @@ */ /** - * Examples of Config-Driven Services in Pico. + * Injection Annotation Processors and supporting types. */ -package io.helidon.examples.pico.configdriven; +package io.helidon.inject.processor; diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/spi/PicoAnnotationProcessorObserver.java b/inject/processor/src/main/java/io/helidon/inject/processor/spi/InjectionAnnotationProcessorObserver.java similarity index 70% rename from pico/processor/src/main/java/io/helidon/pico/processor/spi/PicoAnnotationProcessorObserver.java rename to inject/processor/src/main/java/io/helidon/inject/processor/spi/InjectionAnnotationProcessorObserver.java index 880ed0c859c..c3f5e65c341 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/spi/PicoAnnotationProcessorObserver.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/spi/InjectionAnnotationProcessorObserver.java @@ -14,18 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.processor.spi; +package io.helidon.inject.processor.spi; -import io.helidon.pico.processor.ProcessingEvent; +import io.helidon.inject.processor.InjectionAnnotationProcessor; +import io.helidon.inject.processor.ProcessingEvent; /** - * Implementations of these are service-loaded by the {@link io.helidon.pico.processor.PicoAnnotationProcessor}, and will be + * Implementations of these are service-loaded by the {@link InjectionAnnotationProcessor}, and will be * called to be able to observe processing events. */ -public interface PicoAnnotationProcessorObserver { +public interface InjectionAnnotationProcessorObserver { /** - * Called after a processing event that occurred in the {@link io.helidon.pico.processor.PicoAnnotationProcessor}. + * Called after a processing event that occurred in the {@link InjectionAnnotationProcessor}. * * @param event the event */ diff --git a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/package-info.java b/inject/processor/src/main/java/io/helidon/inject/processor/spi/package-info.java similarity index 89% rename from pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/package-info.java rename to inject/processor/src/main/java/io/helidon/inject/processor/spi/package-info.java index 88460e64de3..96cb69e3520 100644 --- a/pico/configdriven/api/src/main/java/io/helidon/pico/configdriven/api/package-info.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/spi/package-info.java @@ -15,6 +15,6 @@ */ /** - * Pico Config-Driven API. + * Injection APT SPI package. */ -package io.helidon.pico.configdriven.api; +package io.helidon.inject.processor.spi; diff --git a/pico/processor/src/main/java/module-info.java b/inject/processor/src/main/java/module-info.java similarity index 57% rename from pico/processor/src/main/java/module-info.java rename to inject/processor/src/main/java/module-info.java index 45a8d00c299..08ac599605f 100644 --- a/pico/processor/src/main/java/module-info.java +++ b/inject/processor/src/main/java/module-info.java @@ -15,25 +15,25 @@ */ /** - * Pico Annotation Processor module. + * Injection Annotation Processor module. */ -module io.helidon.pico.processor { +module io.helidon.inject.processor { requires transitive java.compiler; requires io.helidon.common; requires io.helidon.common.processor; - requires transitive io.helidon.pico.tools; + requires transitive io.helidon.inject.tools; requires io.helidon.builder.api; - exports io.helidon.pico.processor; - exports io.helidon.pico.processor.spi; + exports io.helidon.inject.processor; + exports io.helidon.inject.processor.spi; - uses io.helidon.pico.processor.spi.PicoAnnotationProcessorObserver; - uses io.helidon.pico.tools.spi.InterceptorCreator; - uses io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; + uses io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver; + uses io.helidon.inject.tools.spi.InterceptorCreator; + uses io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; provides javax.annotation.processing.Processor with - io.helidon.pico.processor.CustomAnnotationProcessor, - io.helidon.pico.processor.UnsupportedConstructsProcessor, - io.helidon.pico.processor.PicoAnnotationProcessor; + io.helidon.inject.processor.CustomAnnotationProcessor, + io.helidon.inject.processor.UnsupportedConstructsProcessor, + io.helidon.inject.processor.InjectionAnnotationProcessor; } diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/CustomAnnotationProcessorTest.java b/inject/processor/src/test/java/io/helidon/inject/processor/CustomAnnotationProcessorTest.java similarity index 81% rename from pico/processor/src/test/java/io/helidon/pico/processor/CustomAnnotationProcessorTest.java rename to inject/processor/src/test/java/io/helidon/inject/processor/CustomAnnotationProcessorTest.java index 1e2d5e530e4..8fc7ceffbbd 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/CustomAnnotationProcessorTest.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/CustomAnnotationProcessorTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.List; import java.util.Set; @@ -26,20 +26,20 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.processor.testsubjects.BasicEndpoint; -import io.helidon.pico.processor.testsubjects.ExtensibleGET; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.processor.testsubjects.BasicEndpoint; +import io.helidon.inject.processor.testsubjects.ExtensibleGET; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; +import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; import static io.helidon.common.types.TypeName.create; -import static io.helidon.pico.processor.TestUtils.loadStringFromResource; -import static io.helidon.pico.tools.TypeTools.createAnnotationListFromAnnotations; +import static io.helidon.inject.tools.TypeTools.createAnnotationListFromAnnotations; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; @@ -98,14 +98,14 @@ void extensibleGET() { CustomAnnotationTemplateResponse res = processor.process(producers.iterator().next(), req); assertThat(res.request().annoTypeName().name(), equalTo(ExtensibleGET.class.getName())); TypeName generatedTypeName = - TypeName.create("io.helidon.pico.processor.testsubjects.BasicEndpoint_ExtensibleGET_itWorks"); + TypeName.create("io.helidon.inject.processor.testsubjects.BasicEndpoint_ExtensibleGET_itWorks"); assertThat(res.generatedSourceCode(), hasKey(generatedTypeName)); assertThat(res.toString(), res.generatedSourceCode().size(), is(1)); String generatedSource = res.generatedSourceCode().get(generatedTypeName); - assertThat(generatedSource, - equalTo(loadStringFromResource("expected/BasicEndpoint_ExtensibleGET._java_"))); + MatcherAssert.assertThat(generatedSource, + equalTo(TestUtils.loadStringFromResource("expected/BasicEndpoint_ExtensibleGET._java_"))); } } diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/ExtensibleGetTemplateProducer.java b/inject/processor/src/test/java/io/helidon/inject/processor/ExtensibleGetTemplateProducer.java similarity index 86% rename from pico/processor/src/test/java/io/helidon/pico/processor/ExtensibleGetTemplateProducer.java rename to inject/processor/src/test/java/io/helidon/inject/processor/ExtensibleGetTemplateProducer.java index d29e352fc9d..d20629eecb6 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/ExtensibleGetTemplateProducer.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/ExtensibleGetTemplateProducer.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.Optional; import java.util.Set; import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.GenericTemplateCreatorRequest; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.GenericTemplateCreatorRequest; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * For Testing (service loaded). @@ -45,7 +45,7 @@ public ExtensibleGetTemplateProducer() { @Override public Set annoTypes() { - return Set.of("io.helidon.pico.processor.testsubjects.ExtensibleGET"); + return Set.of("io.helidon.inject.processor.testsubjects.ExtensibleGET"); } @Override diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/ProcessingTrackerTest.java b/inject/processor/src/test/java/io/helidon/inject/processor/ProcessingTrackerTest.java similarity index 99% rename from pico/processor/src/test/java/io/helidon/pico/processor/ProcessingTrackerTest.java rename to inject/processor/src/test/java/io/helidon/inject/processor/ProcessingTrackerTest.java index c06928094eb..6a3583fe6d1 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/ProcessingTrackerTest.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/ProcessingTrackerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.util.List; diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/TestUtils.java b/inject/processor/src/test/java/io/helidon/inject/processor/TestUtils.java similarity index 94% rename from pico/processor/src/test/java/io/helidon/pico/processor/TestUtils.java rename to inject/processor/src/test/java/io/helidon/inject/processor/TestUtils.java index 0b1d10fae8d..525727f1c59 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/TestUtils.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/TestUtils.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; import java.io.InputStream; import java.nio.charset.StandardCharsets; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.ToolsException; /** * Testing utilities. diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/package-info.java b/inject/processor/src/test/java/io/helidon/inject/processor/package-info.java similarity index 94% rename from pico/processor/src/test/java/io/helidon/pico/processor/package-info.java rename to inject/processor/src/test/java/io/helidon/inject/processor/package-info.java index 374e7aad665..1db287a74a4 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/package-info.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/package-info.java @@ -17,4 +17,4 @@ /** * Annotation processing testing related types. */ -package io.helidon.pico.processor; +package io.helidon.inject.processor; diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/BasicEndpoint.java b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/BasicEndpoint.java similarity index 89% rename from pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/BasicEndpoint.java rename to inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/BasicEndpoint.java index 211d7733924..7fcc7222f5f 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/BasicEndpoint.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/BasicEndpoint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor.testsubjects; +package io.helidon.inject.processor.testsubjects; import jakarta.inject.Singleton; @@ -33,13 +33,13 @@ public class BasicEndpoint { */ @ExtensibleGET public String itWorks(String header) { - return "Pico Works!"; + return "Injection Works!"; } @ExtensibleGET @BasicPath("/whatever/*") public String itWorks2() { - return "Pico Works 2!"; + return "Injection Works 2!"; } } diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/BasicPath.java b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/BasicPath.java similarity index 95% rename from pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/BasicPath.java rename to inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/BasicPath.java index 55ca80a060b..16d53d64036 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/BasicPath.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/BasicPath.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor.testsubjects; +package io.helidon.inject.processor.testsubjects; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/ExtensibleGET.java b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/ExtensibleGET.java similarity index 94% rename from pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/ExtensibleGET.java rename to inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/ExtensibleGET.java index c1212d19b6b..ac827398185 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/ExtensibleGET.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/ExtensibleGET.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.processor.testsubjects; +package io.helidon.inject.processor.testsubjects; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/package-info.java b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/package-info.java similarity index 93% rename from pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/package-info.java rename to inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/package-info.java index 158a34b783e..38ce041f652 100644 --- a/pico/processor/src/test/java/io/helidon/pico/processor/testsubjects/package-info.java +++ b/inject/processor/src/test/java/io/helidon/inject/processor/testsubjects/package-info.java @@ -17,4 +17,4 @@ /** * Test subjects for annotation processing. */ -package io.helidon.pico.processor.testsubjects; +package io.helidon.inject.processor.testsubjects; diff --git a/inject/processor/src/test/resources/META-INF/services/io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator b/inject/processor/src/test/resources/META-INF/services/io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator new file mode 100644 index 00000000000..1d6ade5a78d --- /dev/null +++ b/inject/processor/src/test/resources/META-INF/services/io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator @@ -0,0 +1 @@ +io.helidon.inject.processor.ExtensibleGetTemplateProducer diff --git a/pico/processor/src/test/resources/expected/BasicEndpoint_ExtensibleGET._java_ b/inject/processor/src/test/resources/expected/BasicEndpoint_ExtensibleGET._java_ similarity index 65% rename from pico/processor/src/test/resources/expected/BasicEndpoint_ExtensibleGET._java_ rename to inject/processor/src/test/resources/expected/BasicEndpoint_ExtensibleGET._java_ index b49f8ada14b..1f049604476 100644 --- a/pico/processor/src/test/resources/expected/BasicEndpoint_ExtensibleGET._java_ +++ b/inject/processor/src/test/resources/expected/BasicEndpoint_ExtensibleGET._java_ @@ -1,4 +1,4 @@ -package io.helidon.pico.processor.testsubjects; +package io.helidon.inject.processor.testsubjects; import io.helidon.common.Weight; import io.helidon.common.Weighted; @@ -8,9 +8,9 @@ import jakarta.inject.Named; import jakarta.inject.Provider; import jakarta.inject.Singleton; -@io.helidon.common.Generated(value = "io.helidon.pico.processor.ExtensibleGetTemplateProducer", trigger = "io.helidon.pico.processor.testsubjects.BasicEndpoint") +@io.helidon.common.Generated(value = "io.helidon.inject.processor.ExtensibleGetTemplateProducer", trigger = "io.helidon.inject.processor.testsubjects.BasicEndpoint") @Singleton -@Named("io.helidon.pico.processor.testsubjects.ExtensibleGET") +@Named("io.helidon.inject.processor.testsubjects.ExtensibleGET") @Weight(100.0) public class BasicEndpoint_ExtensibleGET_itWorks { private final Provider target; diff --git a/pico/processor/src/test/resources/templates/pico/nima/extensible-get.hbs b/inject/processor/src/test/resources/templates/inject/nima/extensible-get.hbs similarity index 100% rename from pico/processor/src/test/resources/templates/pico/nima/extensible-get.hbs rename to inject/processor/src/test/resources/templates/inject/nima/extensible-get.hbs diff --git a/inject/runtime/README.md b/inject/runtime/README.md new file mode 100644 index 00000000000..aadc77e53e7 --- /dev/null +++ b/inject/runtime/README.md @@ -0,0 +1,3 @@ +# inject-runtime + +This module represents the main runtime support for default [Injection API/SPI](../inject) services implementation. diff --git a/pico/runtime/pom.xml b/inject/runtime/pom.xml similarity index 91% rename from pico/runtime/pom.xml rename to inject/runtime/pom.xml index 5be492dc3e4..d20b1c6bb90 100644 --- a/pico/runtime/pom.xml +++ b/inject/runtime/pom.xml @@ -20,15 +20,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-runtime - Helidon Pico Runtime Services + helidon-inject-runtime + Helidon Injection Runtime Services @@ -36,8 +36,8 @@ helidon - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api jakarta.inject diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/AbstractServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java similarity index 82% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/AbstractServiceProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java index b814b312f02..5acce8f2eca 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/AbstractServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Arrays; import java.util.Collections; @@ -32,42 +32,40 @@ import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ActivationLog; -import io.helidon.pico.api.ActivationLogEntry; -import io.helidon.pico.api.ActivationPhaseReceiver; -import io.helidon.pico.api.ActivationRequest; -import io.helidon.pico.api.ActivationResult; -import io.helidon.pico.api.ActivationStatus; -import io.helidon.pico.api.Activator; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.DeActivationRequest; -import io.helidon.pico.api.DeActivator; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.Event; -import io.helidon.pico.api.InjectionException; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesConfig; -import io.helidon.pico.api.PostConstructMethod; -import io.helidon.pico.api.PreDestroyMethod; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceInjectionPlanBinder; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderBindable; -import io.helidon.pico.spi.InjectionResolver; +import io.helidon.inject.api.ActivationLog; +import io.helidon.inject.api.ActivationLogEntry; +import io.helidon.inject.api.ActivationPhaseReceiver; +import io.helidon.inject.api.ActivationRequest; +import io.helidon.inject.api.ActivationResult; +import io.helidon.inject.api.ActivationStatus; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.DeActivationRequest; +import io.helidon.inject.api.DeActivator; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.Event; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.api.ServiceProviderInjectionException; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.PostConstructMethod; +import io.helidon.inject.api.PreDestroyMethod; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceInjectionPlanBinder; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.spi.InjectionResolver; import jakarta.inject.Provider; -import static io.helidon.pico.runtime.ServiceUtils.isQualifiedInjectionTarget; - /** - * Abstract base implementation for {@link io.helidon.pico.api.ServiceProviderBindable}, which represents the basics for regular - * Singleton, ApplicationScoped, Provider, and ServiceProvider based managed services. All Pico code-generated services will + * Abstract base implementation for {@link ServiceProviderBindable}, which represents the basics for regular + * Singleton, ApplicationScoped, Provider, and ServiceProvider based managed services. All code-generated services will * extend from this abstract base class. * * @param the type of the service this provider manages @@ -85,11 +83,11 @@ public abstract class AbstractServiceProvider private final AtomicReference serviceRef = new AtomicReference<>(); private Phase phase; private long lastActivationThreadId; - private PicoServices picoServices; + private InjectionServices injectionServices; private ActivationLog log; private ServiceInfo serviceInfo; private DependenciesInfo dependencies; - private Map injectionPlan; + private Map injectionPlan; private ServiceProvider interceptor; private boolean thisIsAnInterceptor; @@ -106,26 +104,26 @@ protected AbstractServiceProvider() { * @param instance the managed service instance * @param phase the current phase * @param serviceInfo the service info - * @param picoServices the pico services instance + * @param injectionServices the services instance */ protected AbstractServiceProvider(T instance, Phase phase, ServiceInfo serviceInfo, - PicoServices picoServices) { + InjectionServices injectionServices) { this(); if (instance != null) { this.serviceRef.set(instance); this.phase = (phase != null) ? phase : Phase.ACTIVE; } this.serviceInfo = ServiceInfo.builder(serviceInfo).build(); - this.picoServices = Objects.requireNonNull(picoServices); - this.log = picoServices.activationLog().orElseThrow(); + this.injectionServices = Objects.requireNonNull(injectionServices); + this.log = injectionServices.activationLog().orElseThrow(); onInitialized(); } /** * Will test and downcast the passed service provider to an instance of - * {@link io.helidon.pico.runtime.AbstractServiceProvider}. + * {@link AbstractServiceProvider}. * * @param sp the service provider * @param expected is the result expected to be present @@ -195,23 +193,23 @@ public Phase currentActivationPhase() { } @Override - public Optional picoServices() { - return Optional.ofNullable(picoServices); + public Optional injectionServices() { + return Optional.ofNullable(injectionServices); } - PicoServices requiredPicoServices() { - return picoServices() - .orElseThrow(() -> new PicoServiceProviderException(description() - + ": picoServices should have been previously set", - this)); + InjectionServices requiredInjectionServices() { + return injectionServices() + .orElseThrow(() -> new InjectionServiceProviderException(description() + + ": injectionServices should have been previously set", + this)); } @Override - public void picoServices(Optional picoServices) { - if (picoServices.isPresent() + public void injectionServices(Optional injectionServices) { + if (injectionServices.isPresent() || serviceRef.get() != null) { - PicoServices current = this.picoServices; - if (picoServices.orElse(null) == current) { + InjectionServices current = this.injectionServices; + if (injectionServices.orElse(null) == current) { return; } @@ -224,9 +222,9 @@ public void picoServices(Optional picoServices) { } } - this.picoServices = picoServices.orElse(null); + this.injectionServices = injectionServices.orElse(null); this.phase = Phase.INIT; - if (this.picoServices != null) { + if (this.injectionServices != null) { onInitialized(); } } @@ -321,8 +319,8 @@ public String name(boolean simple) { @Override public T get() { - return first(PicoServices.SERVICE_QUERY_REQUIRED) - .orElseThrow(() -> new PicoServiceProviderException("Expected to find a match", this)); + return first(InjectionServices.SERVICE_QUERY_REQUIRED) + .orElseThrow(() -> new InjectionServiceProviderException("Expected to find a match", this)); } @SuppressWarnings("unchecked") @@ -346,12 +344,12 @@ public Optional first(ContextualServiceQuery ctx) { } if (ctx.expected() && instance == null) { - throw new PicoServiceProviderException("Expected to find a match: " + ctx, this); + throw new InjectionServiceProviderException("Expected to find a match: " + ctx, this); } return Optional.ofNullable(instance); } - } catch (InjectionException ie) { + } catch (ServiceProviderInjectionException ie) { throw ie; } catch (Throwable t) { logger().log(System.Logger.Level.ERROR, "unable to activate: " + getClass().getName(), t); @@ -391,7 +389,7 @@ public List list(ContextualServiceQuery ctx) { return instances; } - } catch (InjectionException ie) { + } catch (ServiceProviderInjectionException ie) { throw ie; } catch (Throwable t) { throw unableToActivate(t); @@ -498,7 +496,7 @@ public Optional injectionPlanBinder() { } })); - ConcurrentHashMap injectionPlan = new ConcurrentHashMap<>(); + ConcurrentHashMap injectionPlan = new ConcurrentHashMap<>(); AbstractServiceProvider self = AbstractServiceProvider.this; ServiceInjectionPlanBinder.Binder result = new ServiceInjectionPlanBinder.Binder() { private InjectionPointInfo ipInfo; @@ -506,7 +504,7 @@ public Optional injectionPlanBinder() { @Override public ServiceInjectionPlanBinder.Binder bind(String id, ServiceProvider serviceProvider) { - PicoInjectionPlan plan = createBuilder(id) + HeldionInjectionPlan plan = createBuilder(id) .injectionPointQualifiedServiceProviders(List.of(bind(serviceProvider))) .build(); Object prev = injectionPlan.put(id, plan); @@ -517,7 +515,7 @@ public ServiceInjectionPlanBinder.Binder bind(String id, @Override public ServiceInjectionPlanBinder.Binder bindMany(String id, ServiceProvider... serviceProviders) { - PicoInjectionPlan plan = createBuilder(id) + HeldionInjectionPlan plan = createBuilder(id) .injectionPointQualifiedServiceProviders(bind(Arrays.asList(serviceProviders))) .build(); Object prev = injectionPlan.put(id, plan); @@ -542,8 +540,8 @@ public ServiceInjectionPlanBinder.Binder resolvedBind(String id, .id(id) .dependencyToServiceInfo(serviceInfo); Object resolved = Objects.requireNonNull( - resolver.resolve(ipInfo, requiredPicoServices(), AbstractServiceProvider.this, false)); - PicoInjectionPlan plan = createBuilder(id) + resolver.resolve(ipInfo, requiredInjectionServices(), AbstractServiceProvider.this, false)); + HeldionInjectionPlan plan = createBuilder(id) .unqualifiedProviders(List.of(resolved)) .resolved(false) .build(); @@ -551,20 +549,20 @@ public ServiceInjectionPlanBinder.Binder resolvedBind(String id, assert (prev == null); return this; } catch (Exception e) { - throw new PicoServiceProviderException("Failed to process: " + id, e, AbstractServiceProvider.this); + throw new InjectionServiceProviderException("Failed to process: " + id, e, AbstractServiceProvider.this); } } @Override public void commit() { if (!idToIpInfo.isEmpty()) { - throw new InjectionException("Missing injection bindings for " + throw new ServiceProviderInjectionException("Missing injection bindings for " + idToIpInfo + " in " + this, null, self); } if ((self.injectionPlan != null) && !self.injectionPlan.equals(injectionPlan)) { - throw new InjectionException("Injection plan has already been bound for " + this, null, self); + throw new ServiceProviderInjectionException("Injection plan has already been bound for " + this, null, self); } self.injectionPlan = injectionPlan; } @@ -581,15 +579,15 @@ private List> bind(List> rawList) { private InjectionPointInfo safeGetIpInfo(String id) { InjectionPointInfo ipInfo = idToIpInfo.remove(id); if (ipInfo == null) { - throw new InjectionException("Expected to find a dependency for '" + id + "' from " + throw new ServiceProviderInjectionException("Expected to find a dependency for '" + id + "' from " + this + " in " + idToIpInfo, null, self); } return ipInfo; } - private PicoInjectionPlan.Builder createBuilder(String id) { + private HeldionInjectionPlan.Builder createBuilder(String id) { ipInfo = safeGetIpInfo(id); - return PicoInjectionPlan.builder() + return HeldionInjectionPlan.builder() .injectionPointInfo(ipInfo) .serviceProvider(self); } @@ -604,7 +602,7 @@ private PicoInjectionPlan.Builder createBuilder(String id) { * @param resolveIps true if the injection points should also be activated/resolved. * @return the injection plan */ - public Map getOrCreateInjectionPlan(boolean resolveIps) { + public Map getOrCreateInjectionPlan(boolean resolveIps) { if (this.injectionPlan != null) { return this.injectionPlan; } @@ -613,8 +611,8 @@ public Map getOrCreateInjectionPlan(boolean resolveIp dependencies(dependencies()); } - Map plan = DefaultInjectionPlans - .createInjectionPlans(requiredPicoServices(), this, dependencies, resolveIps, logger()); + Map plan = DefaultInjectionPlans + .createInjectionPlans(requiredInjectionServices(), this, dependencies, resolveIps, logger()); assert (this.injectionPlan == null); this.injectionPlan = Objects.requireNonNull(plan); @@ -630,8 +628,9 @@ public boolean reset(boolean deep) { didAcquire = activationSemaphore.tryAcquire(1, TimeUnit.MILLISECONDS); if (service != null) { - System.Logger.Level level = (PicoServices.picoServices().map(PicoServices::config) - .map(PicoServicesConfig::shouldDebug) + System.Logger.Level level = ( + InjectionServices.injectionServices().map(InjectionServices::config) + .map(InjectionServicesConfig::shouldDebug) .orElse(false)) ? System.Logger.Level.INFO : System.Logger.Level.DEBUG; logger().log(level, "Resetting " + this); @@ -649,7 +648,7 @@ public boolean reset(boolean deep) { if (deep) { injectionPlan = null; interceptor = null; - picoServices = null; + injectionServices = null; serviceRef.set(null); phase = Phase.INIT; @@ -657,9 +656,9 @@ public boolean reset(boolean deep) { } } catch (Exception e) { if (didAcquire) { - throw new PicoServiceProviderException("Unable to reset", e, this); + throw new InjectionServiceProviderException("Unable to reset", e, this); } else { - throw new PicoServiceProviderException("Unable to reset during activation", e, this); + throw new InjectionServiceProviderException("Unable to reset during activation", e, this); } } finally { if (didAcquire) { @@ -692,8 +691,8 @@ public ActivationResult deactivate(DeActivationRequest req) { .build(); } - PicoServices picoServices = requiredPicoServices(); - PicoServicesConfig cfg = picoServices.config(); + InjectionServices injectionServices = requiredInjectionServices(); + InjectionServicesConfig cfg = injectionServices.config(); // if we are here then we are not yet at the ultimate target phase, and we either have to activate or deactivate LogEntryAndResult logEntryAndResult = createLogEntryAndResult(Phase.DESTROYED); @@ -705,7 +704,7 @@ public ActivationResult deactivate(DeActivationRequest req) { if (!activationSemaphore.tryAcquire(cfg.activationDeadlockDetectionTimeout().toMillis(), TimeUnit.MILLISECONDS)) { // if we couldn't grab the semaphore than we (or someone else) is busy activating this services, or // we deadlocked. - InjectionException e = timedOutDeActivationInjectionError(logEntryAndResult.logEntry); + ServiceProviderInjectionException e = timedOutDeActivationInjectionError(logEntryAndResult.logEntry); onFailedFinish(logEntryAndResult, e, req.throwIfError()); return logEntryAndResult.activationResult.build(); } @@ -720,7 +719,7 @@ public ActivationResult deactivate(DeActivationRequest req) { } onFinished(logEntryAndResult); } catch (Throwable t) { - InjectionException e = interruptedPreActivationInjectionError(logEntryAndResult.logEntry, t); + ServiceProviderInjectionException e = interruptedPreActivationInjectionError(logEntryAndResult.logEntry, t); onFailedFinish(logEntryAndResult, e, req.throwIfError()); } finally { if (didAcquire) { @@ -740,7 +739,7 @@ protected void onFinalShutdown() { this.injectionPlan = null; this.phase = Phase.DESTROYED; this.serviceRef.set(null); - this.picoServices = null; + this.injectionServices = null; this.log = null; } @@ -750,7 +749,7 @@ protected void onFinalShutdown() { * @param logEntryAndResult the log entry holding the result * @param t the error that was observed * @param throwOnError the flag indicating whether we should throw on error - * @see #onFinished(io.helidon.pico.runtime.AbstractServiceProvider.LogEntryAndResult) + * @see #onFinished(AbstractServiceProvider.LogEntryAndResult) */ protected void onFailedFinish(LogEntryAndResult logEntryAndResult, Throwable t, @@ -775,7 +774,7 @@ protected System.Logger logger() { */ protected void serviceInfo(ServiceInfo serviceInfo) { Objects.requireNonNull(serviceInfo); - if (this.picoServices != null && this.serviceInfo != null) { + if (this.injectionServices != null && this.serviceInfo != null) { throw alreadyInitialized(); } this.serviceInfo = serviceInfo; @@ -838,8 +837,8 @@ protected Optional serviceRef() { * @return the activation log */ protected Optional activationLog() { - if (log == null && picoServices != null) { - log = picoServices.activationLog().orElse(DefaultActivationLog.createUnretainedLog(logger())); + if (log == null && injectionServices != null) { + log = injectionServices.activationLog().orElse(DefaultActivationLog.createUnretainedLog(logger())); } return Optional.ofNullable(log); } @@ -870,7 +869,7 @@ protected Optional maybeActivate(ContextualServiceQuery ctx) { if (serviceOrProvider == null || Phase.ACTIVE != currentActivationPhase()) { - ActivationRequest req = PicoServices.createActivationRequestDefault(); + ActivationRequest req = InjectionServices.createActivationRequestDefault(); ActivationResult res = activate(req); if (res.failure()) { if (ctx.expected()) { @@ -888,7 +887,7 @@ protected Optional maybeActivate(ContextualServiceQuery ctx) { } return Optional.ofNullable(serviceOrProvider); - } catch (InjectionException ie) { + } catch (ServiceProviderInjectionException ie) { throw ie; } catch (Throwable t) { throw unableToActivate(t); @@ -899,7 +898,7 @@ protected Optional maybeActivate(ContextualServiceQuery ctx) { * Called on a successful finish of activation. * * @param logEntryAndResult the record holding the result - * @see #onFailedFinish(io.helidon.pico.runtime.AbstractServiceProvider.LogEntryAndResult, Throwable, boolean) + * @see #onFailedFinish(AbstractServiceProvider.LogEntryAndResult, Throwable, boolean) */ protected void onFinished(LogEntryAndResult logEntryAndResult) { // NOP @@ -924,13 +923,13 @@ protected void doConstructing(LogEntryAndResult logEntryAndResult) { * * @param resolvedDeps the resolved dependencies * @return the newly created managed service - * @throws InjectionException since this is a base method for what is expected to be a code-generated derived + * @throws ServiceProviderInjectionException since this is a base method for what is expected to be a code-generated derived * {@link Activator} then this method will throw an exception if the derived class does not * implement this method as it * normally should */ protected T createServiceProvider(Map resolvedDeps) { - InjectionException e = new InjectionException("Don't know how to create an instance of " + serviceInfo() + ServiceProviderInjectionException e = new ServiceProviderInjectionException("Don't know how to create an instance of " + serviceInfo() + ". Was the Activator generated?", this); activationLog().ifPresent(e::activationLog); throw e; @@ -976,7 +975,7 @@ protected void doInjectingMethods(Object target, } /** - * Called during the {@link io.helidon.pico.api.PostConstructMethod} process. + * Called during the {@link PostConstructMethod} process. * * @param logEntryAndResult the entry holding the result */ @@ -992,7 +991,7 @@ protected void doPostConstructing(LogEntryAndResult logEntryAndResult) { } /** - * Called during the {@link io.helidon.pico.api.PreDestroyMethod} process. + * Called during the {@link PreDestroyMethod} process. * * @param logEntryAndResult the entry holding the result */ @@ -1008,7 +1007,7 @@ protected void doPreDestroying(LogEntryAndResult logEntryAndResult) { } /** - * Called after the {@link io.helidon.pico.api.PreDestroyMethod} process. + * Called after the {@link PreDestroyMethod} process. * * @param logEntryAndResult the entry holding the result */ @@ -1026,8 +1025,8 @@ protected void doDestroying(LogEntryAndResult logEntryAndResult) { * @param ctx the context * @return the injection exception */ - protected InjectionException expectedQualifiedServiceError(ContextualServiceQuery ctx) { - InjectionException e = new InjectionException("Expected to return a non-null instance for: " + ctx.injectionPointInfo() + protected ServiceProviderInjectionException expectedQualifiedServiceError(ContextualServiceQuery ctx) { + ServiceProviderInjectionException e = new ServiceProviderInjectionException("Expected to return a non-null instance for: " + ctx.injectionPointInfo() + "; with criteria matching: " + ctx.serviceInfoCriteria(), this); activationLog().ifPresent(e::activationLog); return e; @@ -1074,7 +1073,7 @@ protected void startTransitionCurrentActivationPhase(LogEntryAndResult logEntryA onPhaseEvent(Event.STARTING, this.phase); } - Map resolveDependencies(Map mutablePlans) { + Map resolveDependencies(Map mutablePlans) { Map result = new LinkedHashMap<>(); Map.copyOf(mutablePlans).forEach((key, value) -> { @@ -1098,7 +1097,7 @@ Map resolveDependencies(Map mutablePl if (value.resolved().isEmpty()) { // update the original plans map to properly reflect the resolved value - mutablePlans.put(key, PicoInjectionPlan.builder(value) + mutablePlans.put(key, HeldionInjectionPlan.builder(value) .wasResolved(true) .update(builder -> { if (resolved != null) { @@ -1120,16 +1119,16 @@ void onFailedFinish(LogEntryAndResult logEntryAndResult, Throwable t, boolean throwOnError, Optional log) { - InjectionException e; + ServiceProviderInjectionException e; ActivationLogEntry.Builder res = logEntryAndResult.logEntry; Throwable prev = res.error().orElse(null); - if (prev == null || !(t instanceof InjectionException)) { + if (prev == null || !(t instanceof ServiceProviderInjectionException)) { String msg = (t != null && t.getMessage() != null) ? t.getMessage() : "Failed to complete operation"; - e = new InjectionException(msg, t, this); + e = new ServiceProviderInjectionException(msg, t, this); log.ifPresent(e::activationLog); } else { - e = (InjectionException) t; + e = (ServiceProviderInjectionException) t; } res.error(e); @@ -1159,7 +1158,7 @@ void finishedTransitionCurrentActivationPhase(LogEntryAndResult logEntryAndResul // if we are here then we are not yet at the ultimate target phase, and we either have to activate or deactivate private LogEntryAndResult preambleActivate(ActivationRequest req) { - assert (picoServices != null) : "not initialized"; + assert (injectionServices != null) : "not initialized"; LogEntryAndResult logEntryAndResult = createLogEntryAndResult(req.targetPhase()); req.injectionPoint().ifPresent(logEntryAndResult.logEntry::injectionPoint); @@ -1172,7 +1171,7 @@ private LogEntryAndResult preambleActivate(ActivationRequest req) { return logEntryAndResult; } - PicoServicesConfig cfg = picoServices.config(); + InjectionServicesConfig cfg = injectionServices.config(); boolean didAcquire = false; try { // let's wait a bit on the semaphore until we read timeout (probably detecting a deadlock situation) @@ -1201,7 +1200,7 @@ private LogEntryAndResult preambleActivate(ActivationRequest req) { activationSemaphore.release(); } - InjectionException e = interruptedPreActivationInjectionError(logEntryAndResult.logEntry, t); + ServiceProviderInjectionException e = interruptedPreActivationInjectionError(logEntryAndResult.logEntry, t); onFailedFinish(logEntryAndResult, e, req.throwIfError()); } @@ -1221,7 +1220,7 @@ private void doStartingLifecycle(LogEntryAndResult logEntryAndResult) { private void doGatheringDependencies(LogEntryAndResult logEntryAndResult) { startTransitionCurrentActivationPhase(logEntryAndResult, Phase.GATHERING_DEPENDENCIES); - Map plans = Objects.requireNonNull(getOrCreateInjectionPlan(false)); + Map plans = Objects.requireNonNull(getOrCreateInjectionPlan(false)); Map deps = resolveDependencies(plans); if (!deps.isEmpty()) { logEntryAndResult.activationResult.resolvedDependencies(deps); @@ -1232,7 +1231,7 @@ private void doGatheringDependencies(LogEntryAndResult logEntryAndResult) { } @SuppressWarnings("unchecked") - private Object resolveOptional(PicoInjectionPlan plan, + private Object resolveOptional(HeldionInjectionPlan plan, Object resolved) { if (!plan.injectionPointInfo().optionalWrapped() && resolved instanceof Optional) { return ((Optional) resolved).orElse(null); @@ -1241,7 +1240,7 @@ private Object resolveOptional(PicoInjectionPlan plan, } private void doInjecting(LogEntryAndResult logEntryAndResult) { - if (!isQualifiedInjectionTarget(this)) { + if (!ServiceUtils.isQualifiedInjectionTarget(this)) { startAndFinishTransitionCurrentActivationPhase(logEntryAndResult, Phase.INJECTING); return; } @@ -1262,7 +1261,7 @@ private void doInjecting(LogEntryAndResult logEntryAndResult) { doInjectingFields(target, deps, injections, forServiceType); doInjectingMethods(target, deps, injections, forServiceType); } catch (Throwable t) { - throw new InjectionException("Failed to activate/inject: " + this + throw new ServiceProviderInjectionException("Failed to activate/inject: " + this + "; dependency map was: " + deps, t, this); } }); @@ -1278,61 +1277,61 @@ private void doActivationActive(LogEntryAndResult logEntryAndResult) { startAndFinishTransitionCurrentActivationPhase(logEntryAndResult, Phase.ACTIVE); } - private InjectionException recursiveActivationInjectionError(ActivationLogEntry.Builder entry) { + private ServiceProviderInjectionException recursiveActivationInjectionError(ActivationLogEntry.Builder entry) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - InjectionException e = new InjectionException("A circular dependency found during activation of " + targetServiceProvider, - targetServiceProvider); + ServiceProviderInjectionException e = new ServiceProviderInjectionException("A circular dependency found during activation of " + targetServiceProvider, + targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); return e; } - private InjectionException timedOutActivationInjectionError(ActivationLogEntry.Builder entry) { + private ServiceProviderInjectionException timedOutActivationInjectionError(ActivationLogEntry.Builder entry) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - InjectionException e = new InjectionException("Timed out during activation of " + targetServiceProvider, - targetServiceProvider); + ServiceProviderInjectionException e = new ServiceProviderInjectionException("Timed out during activation of " + targetServiceProvider, + targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); return e; } - private InjectionException timedOutDeActivationInjectionError(ActivationLogEntry.Builder entry) { + private ServiceProviderInjectionException timedOutDeActivationInjectionError(ActivationLogEntry.Builder entry) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - InjectionException e = new InjectionException("Timed out during deactivation of " + targetServiceProvider, - targetServiceProvider); + ServiceProviderInjectionException e = new ServiceProviderInjectionException("Timed out during deactivation of " + targetServiceProvider, + targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); return e; } - private InjectionException interruptedPreActivationInjectionError(ActivationLogEntry.Builder entry, - Throwable cause) { + private ServiceProviderInjectionException interruptedPreActivationInjectionError(ActivationLogEntry.Builder entry, + Throwable cause) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - InjectionException e = new InjectionException("A circular dependency found during activation of " + targetServiceProvider, - cause, targetServiceProvider); + ServiceProviderInjectionException e = new ServiceProviderInjectionException("A circular dependency found during activation of " + targetServiceProvider, + cause, targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); return e; } - private InjectionException managedServiceInstanceShouldHaveBeenSetException() { - InjectionException e = new InjectionException("This managed service instance expected to have been set", this); + private ServiceProviderInjectionException managedServiceInstanceShouldHaveBeenSetException() { + ServiceProviderInjectionException e = new ServiceProviderInjectionException("This managed service instance expected to have been set", this); activationLog().ifPresent(e::activationLog); return e; } - private InjectionException activationFailed(ActivationResult res) { - InjectionException e = new InjectionException("Activation failed: " + res, this); + private ServiceProviderInjectionException activationFailed(ActivationResult res) { + ServiceProviderInjectionException e = new ServiceProviderInjectionException("Activation failed: " + res, this); activationLog().ifPresent(e::activationLog); return e; } - private PicoServiceProviderException unableToActivate(Throwable cause) { - return new PicoServiceProviderException("Unable to activate: " + getClass().getName(), cause, this); + private InjectionServiceProviderException unableToActivate(Throwable cause) { + return new InjectionServiceProviderException("Unable to activate: " + getClass().getName(), cause, this); } - private PicoServiceProviderException alreadyInitialized() { - throw new PicoServiceProviderException("Already initialized", this); + private InjectionServiceProviderException alreadyInitialized() { + throw new InjectionServiceProviderException("Already initialized", this); } private void logMultiDefInjectionNote(String id, @@ -1355,7 +1354,7 @@ private void logMultiDefInjectionNote(String id, /** * Represents a result of a phase transition. * - * @see #createLogEntryAndResult(io.helidon.pico.api.Phase) + * @see #createLogEntryAndResult(Phase) */ // note that for one result, there may be N logEntry records we will build and write to the log protected static class LogEntryAndResult /* implements Cloneable*/ { diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/BoundedServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/BoundedServiceProvider.java similarity index 90% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/BoundedServiceProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/BoundedServiceProvider.java index 1723adce9d0..ee700b5c1a9 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/BoundedServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/BoundedServiceProvider.java @@ -14,24 +14,24 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.List; import java.util.Objects; import java.util.Optional; import io.helidon.common.LazyValue; -import io.helidon.pico.api.Activator; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.DeActivator; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PostConstructMethod; -import io.helidon.pico.api.PreDestroyMethod; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderBindable; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.DeActivator; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.PostConstructMethod; +import io.helidon.inject.api.PreDestroyMethod; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderBindable; /** * A service provider that is bound to a particular injection point context. diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultActivationLog.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultActivationLog.java similarity index 85% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultActivationLog.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultActivationLog.java index a0a8ed62b0e..4caa8ec75b1 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultActivationLog.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultActivationLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.lang.System.Logger; import java.util.List; @@ -22,12 +22,12 @@ import java.util.Optional; import java.util.concurrent.CopyOnWriteArrayList; -import io.helidon.pico.api.ActivationLog; -import io.helidon.pico.api.ActivationLogEntry; -import io.helidon.pico.api.ActivationLogQuery; +import io.helidon.inject.api.ActivationLog; +import io.helidon.inject.api.ActivationLogEntry; +import io.helidon.inject.api.ActivationLogQuery; /** - * The default reference implementation of {@link io.helidon.pico.api.ActivationLog} and {@link io.helidon.pico.ActivationLogQuery}. + * The default reference implementation of {@link ActivationLog} and {@link io.helidon.inject.ActivationLogQuery}. */ class DefaultActivationLog implements ActivationLog, ActivationLogQuery { private final List log; @@ -44,7 +44,7 @@ private DefaultActivationLog(List log, /** * Create a retained activation log that tee's to the provided logger. A retained log is capable of supporting - * {@link io.helidon.pico.api.ActivationLogQuery}. + * {@link ActivationLogQuery}. * * @param logger the logger to use * @return the created activity log @@ -55,7 +55,7 @@ static DefaultActivationLog createRetainedLog(Logger logger) { /** * Create an unretained activation log that simply logs to the provided logger. An unretained log is not capable of - * supporting {@link io.helidon.pico.api.ActivationLogQuery}. + * supporting {@link ActivationLogQuery}. * * @param logger the logger to use * @return the created activity log diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjectionPlanBinder.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlanBinder.java similarity index 78% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjectionPlanBinder.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlanBinder.java index 2366bd61a9a..e1fd3b10abb 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjectionPlanBinder.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlanBinder.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Optional; -import io.helidon.pico.api.ServiceInjectionPlanBinder; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderBindable; +import io.helidon.inject.api.ServiceInjectionPlanBinder; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderBindable; class DefaultInjectionPlanBinder implements ServiceInjectionPlanBinder, ServiceInjectionPlanBinder.Binder { @@ -38,12 +38,12 @@ public Binder bindTo(ServiceProvider untrustedSp) { Optional binder = (bindable.isPresent()) ? bindable.get().injectionPlanBinder() : Optional.empty(); if (binder.isEmpty()) { // basically this means this service will not support compile-time injection - DefaultPicoServices.LOGGER.log(System.Logger.Level.WARNING, - "service provider is not capable of being bound to injection points: " + serviceProvider); + DefaultInjectionServices.LOGGER.log(System.Logger.Level.WARNING, + "service provider is not capable of being bound to injection points: " + serviceProvider); return this; } else { - if (DefaultPicoServices.LOGGER.isLoggable(System.Logger.Level.DEBUG)) { - DefaultPicoServices.LOGGER.log(System.Logger.Level.DEBUG, "binding injection plan to " + binder.get()); + if (DefaultInjectionServices.LOGGER.isLoggable(System.Logger.Level.DEBUG)) { + DefaultInjectionServices.LOGGER.log(System.Logger.Level.DEBUG, "binding injection plan to " + binder.get()); } } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjectionPlans.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java similarity index 81% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjectionPlans.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java index e1089cf5f90..b6bb7fe2769 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjectionPlans.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.ArrayList; import java.util.Collection; @@ -27,24 +27,24 @@ import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.DependencyInfo; -import io.helidon.pico.api.InjectionException; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesConfig; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderBindable; -import io.helidon.pico.api.ServiceProviderProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.spi.InjectionResolver; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.DependencyInfo; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.ServiceProviderInjectionException; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.api.ServiceProviderProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.spi.InjectionResolver; class DefaultInjectionPlans { private static final TypeName INTERCEPTOR = TypeName.create(Interceptor.class); @@ -57,19 +57,19 @@ private DefaultInjectionPlans() { /** * Converts the inputs to an injection plans for the given service provider. * - * @param picoServices pico services + * @param injectionServices injection services * @param self the reference to the service provider associated with this plan * @param dependencies the dependencies * @param resolveIps flag indicating whether injection points should be resolved * @param logger the logger to use for any logging * @return the injection plan per element identity belonging to the service provider */ - static Map createInjectionPlans(PicoServices picoServices, - ServiceProvider self, - DependenciesInfo dependencies, - boolean resolveIps, - System.Logger logger) { - Map result = new LinkedHashMap<>(); + static Map createInjectionPlans(InjectionServices injectionServices, + ServiceProvider self, + DependenciesInfo dependencies, + boolean resolveIps, + System.Logger logger) { + Map result = new LinkedHashMap<>(); if (dependencies.allDependencies().isEmpty()) { return result; } @@ -77,9 +77,9 @@ static Map createInjectionPlans(PicoServices picoServ dependencies.allDependencies() .forEach(dep -> { try { - accumulate(dep, result, picoServices, self, resolveIps, logger); + accumulate(dep, result, injectionServices, self, resolveIps, logger); } catch (Exception e) { - throw new PicoServiceProviderException("An error occurred creating the injection plan", e, self); + throw new InjectionServiceProviderException("An error occurred creating the injection plan", e, self); } }); @@ -88,12 +88,12 @@ static Map createInjectionPlans(PicoServices picoServ /** * Special case where we have qualifiers on the criteria, but we should still allow any - * {@link io.helidon.pico.api.InjectionPointProvider} match regardless, since it will be the ultimate determining agent + * {@link InjectionPointProvider} match regardless, since it will be the ultimate determining agent * to use the dependency info - not the services registry default logic. * * @param services the services registry * @param depTo the dependency with the qualifiers - * @return a list of {@link io.helidon.pico.api.InjectionPointProvider}s that can handle the contracts requested + * @return a list of {@link InjectionPointProvider}s that can handle the contracts requested */ static List> injectionPointProvidersFor(Services services, ServiceInfoCriteria depTo) { @@ -161,10 +161,10 @@ static Object resolve(ServiceProvider self, List> serviceProviders, System.Logger logger) { if (ipInfo.staticDeclaration()) { - throw new InjectionException(ipInfo + ": static is not supported", null, self); + throw new ServiceProviderInjectionException(ipInfo + ": static is not supported", null, self); } if (ipInfo.access() == AccessModifier.PRIVATE) { - throw new InjectionException(ipInfo + ": private is not supported", null, self); + throw new ServiceProviderInjectionException(ipInfo + ": private is not supported", null, self); } try { @@ -174,18 +174,18 @@ static Object resolve(ServiceProvider self, if (ipInfo.listWrapped()) { if (ipInfo.optionalWrapped()) { - throw new InjectionException("Optional + List injection is not supported for " + throw new ServiceProviderInjectionException("Optional + List injection is not supported for " + ipInfo.serviceTypeName() + "." + ipInfo.elementName()); } if (serviceProviders.isEmpty()) { if (!allowNullableInjectionPoint(ipInfo)) { - throw new InjectionException("Expected to resolve a service appropriate for " + throw new ServiceProviderInjectionException("Expected to resolve a service appropriate for " + ipInfo.serviceTypeName() + "." + ipInfo.elementName(), - DefaultServices + DefaultServices .resolutionBasedInjectionError( ipInfo.dependencyToServiceInfo()), - self); + self); } else { return serviceProviders; } @@ -202,10 +202,10 @@ static Object resolve(ServiceProvider self, if (ipInfo.optionalWrapped()) { return Optional.empty(); } else { - throw new InjectionException("Expected to resolve a service appropriate for " + throw new ServiceProviderInjectionException("Expected to resolve a service appropriate for " + ipInfo.serviceTypeName() + "." + ipInfo.elementName(), - DefaultServices.resolutionBasedInjectionError(ipInfo.dependencyToServiceInfo()), - self); + DefaultServices.resolutionBasedInjectionError(ipInfo.dependencyToServiceInfo()), + self); } } else { // "standard" case @@ -232,7 +232,7 @@ static Object resolve(ServiceProvider self, try { optVal = Objects.requireNonNull( serviceProvider.first(ContextualServiceQuery.create(ipInfo, false))); - } catch (InjectionException e) { + } catch (ServiceProviderInjectionException e) { logger.log(System.Logger.Level.WARNING, e.getMessage(), e); optVal = Optional.empty(); } @@ -243,7 +243,7 @@ static Object resolve(ServiceProvider self, Optional first = serviceProvider.first(query); return first.orElse(null); } - } catch (InjectionException ie) { + } catch (ServiceProviderInjectionException ie) { throw ie; } catch (Throwable t) { throw expectedToResolveCriteria(ipInfo, t, self); @@ -254,15 +254,15 @@ static Object resolve(ServiceProvider self, @SuppressWarnings("unchecked") private static void accumulate(DependencyInfo dep, - Map result, - PicoServices picoServices, + Map result, + InjectionServices injectionServices, ServiceProvider self, boolean resolveIps, System.Logger logger) { ServiceInfo selfInfo = self.serviceInfo(); ServiceInfoCriteria depTo = toCriteria(dep, self, selfInfo); - Services services = picoServices.services(); - PicoServicesConfig cfg = picoServices.config(); + Services services = injectionServices.services(); + InjectionServicesConfig cfg = injectionServices.config(); boolean isPrivateSupported = cfg.supportsJsr330Privates(); boolean isStaticSupported = cfg.supportsJsr330Statics(); @@ -275,12 +275,12 @@ private static void accumulate(DependencyInfo dep, String id = ipInfo.id(); if (!result.containsKey(id)) { Object resolved = ((InjectionResolver) self) - .resolve(ipInfo, picoServices, self, resolveIps) + .resolve(ipInfo, injectionServices, self, resolveIps) .orElse(null); Object target = (resolved instanceof Optional) ? ((Optional) resolved).orElse(null) : resolved; if (target != null) { - PicoInjectionPlan.Builder planBuilder = PicoInjectionPlan.builder() + HeldionInjectionPlan.Builder planBuilder = HeldionInjectionPlan.builder() .serviceProvider(self) .injectionPointInfo(ipInfo) .injectionPointQualifiedServiceProviders(toIpQualified(target)) @@ -299,7 +299,7 @@ private static void accumulate(DependencyInfo dep, } } - PicoInjectionPlan plan = planBuilder.build(); + HeldionInjectionPlan plan = planBuilder.build(); Object prev = result.put(id, plan); assert (prev == null) : ipInfo; } @@ -340,7 +340,7 @@ private static void accumulate(DependencyInfo dep, throw DefaultServices.resolutionBasedInjectionError( ipInfo.dependencyToServiceInfo()); } - PicoInjectionPlan plan = PicoInjectionPlan.builder() + HeldionInjectionPlan plan = HeldionInjectionPlan.builder() .injectionPointInfo(ipInfo) .injectionPointQualifiedServiceProviders(serviceProviders) .serviceProvider(self) @@ -440,14 +440,14 @@ private static List toEligibleInjectionRefs(InjectionPointInfo ipInfo, return result; } - private static InjectionException expectedToResolveCriteria(InjectionPointInfo ipInfo, - Throwable cause, - ServiceProvider self) { + private static ServiceProviderInjectionException expectedToResolveCriteria(InjectionPointInfo ipInfo, + Throwable cause, + ServiceProvider self) { String msg = (cause == null) ? "Expected" : "Failed"; - return new InjectionException(msg + " to resolve a service instance appropriate for '" + return new ServiceProviderInjectionException(msg + " to resolve a service instance appropriate for '" + ipInfo.serviceTypeName() + "." + ipInfo.elementName() + "' with criteria = '" + ipInfo.dependencyToServiceInfo(), - cause, self); + cause, self); } } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServices.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java similarity index 87% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServices.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java index 08e78a5ab3a..e3615e31d86 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServices.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.ArrayList; import java.util.Collection; @@ -38,36 +38,36 @@ import io.helidon.common.config.Config; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ActivationLog; -import io.helidon.pico.api.ActivationLogEntry; -import io.helidon.pico.api.ActivationLogQuery; -import io.helidon.pico.api.ActivationPhaseReceiver; -import io.helidon.pico.api.ActivationResult; -import io.helidon.pico.api.ActivationStatus; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.CallingContext; -import io.helidon.pico.api.CallingContextFactory; -import io.helidon.pico.api.Event; -import io.helidon.pico.api.Injector; -import io.helidon.pico.api.InjectorOptions; -import io.helidon.pico.api.Metrics; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesConfig; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; - -import static io.helidon.pico.runtime.DefaultPicoServicesConfig.PROVIDER; +import io.helidon.inject.api.ActivationLog; +import io.helidon.inject.api.ActivationLogEntry; +import io.helidon.inject.api.ActivationLogQuery; +import io.helidon.inject.api.ActivationPhaseReceiver; +import io.helidon.inject.api.ActivationResult; +import io.helidon.inject.api.ActivationStatus; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.CallingContext; +import io.helidon.inject.api.CallingContextFactory; +import io.helidon.inject.api.Event; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.api.Injector; +import io.helidon.inject.api.InjectorOptions; +import io.helidon.inject.api.Metrics; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; + +import static io.helidon.inject.runtime.DefaultInjectionServicesConfig.PROVIDER; /** - * The default implementation for {@link PicoServices}. + * The default implementation for {@link InjectionServices}. */ -class DefaultPicoServices implements PicoServices, Resettable { - static final System.Logger LOGGER = System.getLogger(DefaultPicoServices.class.getName()); +class DefaultInjectionServices implements InjectionServices, Resettable { + static final System.Logger LOGGER = System.getLogger(DefaultInjectionServices.class.getName()); private final AtomicBoolean initializingServicesStarted = new AtomicBoolean(false); private final AtomicBoolean initializingServicesFinished = new AtomicBoolean(false); @@ -76,7 +76,7 @@ class DefaultPicoServices implements PicoServices, Resettable { private final AtomicReference> moduleList = new AtomicReference<>(); private final AtomicReference> applicationList = new AtomicReference<>(); private final Bootstrap bootstrap; - private final PicoServicesConfig cfg; + private final InjectionServicesConfig cfg; private final boolean isGlobal; private final DefaultActivationLog log; private final State state = State.create(Phase.INIT); @@ -88,13 +88,14 @@ class DefaultPicoServices implements PicoServices, Resettable { * @param bootstrap the bootstrap configuration * @param global flag indicating whether this is the global con */ - DefaultPicoServices(Bootstrap bootstrap, - boolean global) { + DefaultInjectionServices(Bootstrap bootstrap, + boolean global) { this.bootstrap = bootstrap; - this.cfg = io.helidon.pico.api.PicoServicesConfig.builder() + this.cfg = InjectionServicesConfig.builder() .providerName(PROVIDER) - .providerVersion(Versions.CURRENT_PICO_VERSION) - .config(bootstrap.config().orElseGet(Config::empty).get("pico")) + .providerVersion(Versions.CURRENT_INJECT_VERSION) + .config(bootstrap.config().orElseGet(Config::empty) + .get("inject")) .build(); this.isGlobal = global; this.log = cfg.activationLogs() @@ -108,7 +109,7 @@ public Bootstrap bootstrap() { } @Override - public PicoServicesConfig config() { + public InjectionServicesConfig config() { return cfg; } @@ -158,10 +159,10 @@ public Optional services(boolean initialize) { } catch (Throwable t) { state.lastError(t); initializingServicesStarted.set(false); - if (t instanceof PicoException) { - throw (PicoException) t; + if (t instanceof InjectionException) { + throw (InjectionException) t; } else { - throw new PicoException("Failed to initialize: " + t.getMessage(), t); + throw new InjectionException("Failed to initialize: " + t.getMessage(), t); } } finally { state.finished(true); @@ -171,7 +172,7 @@ public Optional services(boolean initialize) { DefaultServices thisServices = services.get(); if (thisServices == null) { - throw new PicoException("Must reset() after shutdown()"); + throw new InjectionException("Must reset() after shutdown()"); } return Optional.of(thisServices); } @@ -190,7 +191,7 @@ public Optional> shutdown() { } @Override - // note that this is typically only called during testing, and also in the pico-maven-plugin + // note that this is typically only called during testing, and also in the injection maven-plugin public boolean reset(boolean deep) { try { assertNotInitializing(); @@ -224,14 +225,14 @@ public boolean reset(boolean deep) { return result; } catch (Exception e) { - throw new PicoException("Failed to reset (state=" + state + throw new InjectionException("Failed to reset (state=" + state + ", isInitialized=" + isInitialized() + ", isInitializing=" + isInitializing() + ")", e); } } /** - * Returns true if Pico is in the midst of initialization. + * Returns true if Injection is in the midst of initialization. * * @return true if initialization is underway */ @@ -240,7 +241,7 @@ public boolean isInitializing() { } /** - * Returns true if Pico was initialized. + * Returns true if Injection was initialized. * * @return true if already initialized */ @@ -249,14 +250,14 @@ public boolean isInitialized() { } private Map doShutdown(DefaultServices services, - State state) { + State state) { long start = System.currentTimeMillis(); ThreadFactory threadFactory = r -> { Thread thread = new Thread(r); thread.setDaemon(false); thread.setPriority(Thread.MAX_PRIORITY); - thread.setName("pico-shutdown-" + System.currentTimeMillis()); + thread.setName("injection-shutdown-" + System.currentTimeMillis()); return thread; }; @@ -269,7 +270,7 @@ private Map doShutdown(DefaultServices services, } catch (Throwable t) { finish = System.currentTimeMillis(); errorLog("Error detected during shutdown (elapsed = " + (finish - start) + " ms)", t); - throw new PicoException("Error detected during shutdown", t); + throw new InjectionException("Error detected during shutdown", t); } finally { state.finished(true); finish = System.currentTimeMillis(); @@ -284,8 +285,8 @@ private void assertNotInitializing() { + isBinding + ", initializingServicesFinished=" + initializingServicesFinished + ")"; String msg = (initializationCallingContext == null) - ? PicoExceptions.toErrorMessage(desc) : PicoExceptions.toErrorMessage(initializationCallingContext, desc); - throw new PicoException(msg); + ? InjectionExceptions.toErrorMessage(desc) : InjectionExceptions.toErrorMessage(initializationCallingContext, desc); + throw new InjectionException(msg); } } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesConfig.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesConfig.java similarity index 58% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesConfig.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesConfig.java index e4a4f3fab21..fc61b44380f 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesConfig.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesConfig.java @@ -14,25 +14,28 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; + +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServicesConfig; /** - * The default reference implementation {@link io.helidon.pico.api.PicoServicesConfig}. + * The default reference implementation {@link InjectionServicesConfig}. *

      - * It is strongly suggested that any {@link io.helidon.pico.api.Bootstrap} configuration is established prior to initializing + * It is strongly suggested that any {@link Bootstrap} configuration is established prior to initializing * this instance, since the results will vary once any bootstrap configuration is globally set. */ -class DefaultPicoServicesConfig { +class DefaultInjectionServicesConfig { static final String PROVIDER = "oracle"; - private DefaultPicoServicesConfig() { + private DefaultInjectionServicesConfig() { } - static io.helidon.pico.api.PicoServicesConfig.Builder createDefaultConfigBuilder() { - return io.helidon.pico.api.PicoServicesConfig.builder() + static InjectionServicesConfig.Builder createDefaultConfigBuilder() { + return InjectionServicesConfig.builder() .providerName(PROVIDER) - .providerVersion(Versions.CURRENT_PICO_VERSION); + .providerVersion(Versions.CURRENT_INJECT_VERSION); } } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java similarity index 63% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java index f0e7b88e3a5..8985e3a2486 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultPicoServicesProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,32 +14,32 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; import io.helidon.common.Weight; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.spi.PicoServicesProvider; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.spi.InjectionServicesProvider; import jakarta.inject.Singleton; -import static io.helidon.pico.api.ServiceInfoBasics.DEFAULT_PICO_WEIGHT; +import static io.helidon.inject.api.ServiceInfoBasics.DEFAULT_INJECT_WEIGHT; /** - * The default implementation for {@link io.helidon.pico.spi.PicoServicesProvider}. + * The default implementation for {@link InjectionServicesProvider}. * The first instance created (or first after calling deep {@link #reset}) will be the global services instance. The global * instance will track the set of loaded modules and applications that are loaded by this JVM. * - * @see io.helidon.pico.api.PicoServices#picoServices() + * @see InjectionServices#injectionServices() */ @Singleton -@Weight(DEFAULT_PICO_WEIGHT) -public class DefaultPicoServicesProvider implements PicoServicesProvider, Resettable { - private static final AtomicReference INSTANCE = new AtomicReference<>(); +@Weight(DEFAULT_INJECT_WEIGHT) +public class DefaultInjectionServicesProvider implements InjectionServicesProvider, Resettable { + private static final AtomicReference INSTANCE = new AtomicReference<>(); /** * Service loader based constructor. @@ -47,14 +47,14 @@ public class DefaultPicoServicesProvider implements PicoServicesProvider, Resett * @deprecated this is a Java ServiceLoader implementation and the constructor should not be used directly */ @Deprecated - public DefaultPicoServicesProvider() { + public DefaultInjectionServicesProvider() { } @Override - public PicoServices services(Bootstrap bootstrap) { + public InjectionServices services(Bootstrap bootstrap) { Objects.requireNonNull(bootstrap); if (INSTANCE.get() == null) { - DefaultPicoServices global = new DefaultPicoServices(bootstrap, true); + DefaultInjectionServices global = new DefaultInjectionServices(bootstrap, true); INSTANCE.compareAndSet(null, global); } @@ -64,12 +64,12 @@ public PicoServices services(Bootstrap bootstrap) { } // not the global one - return new DefaultPicoServices(bootstrap, false); + return new DefaultInjectionServices(bootstrap, false); } @Override public boolean reset(boolean deep) { - DefaultPicoServices services = INSTANCE.get(); + DefaultInjectionServices services = INSTANCE.get(); boolean result = (services != null); if (services != null) { services.reset(deep); diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjector.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjector.java similarity index 84% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjector.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjector.java index 38d98609717..5fd3b160a07 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultInjector.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjector.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Objects; -import io.helidon.pico.api.ActivationResult; -import io.helidon.pico.api.Activator; -import io.helidon.pico.api.DeActivationRequest; -import io.helidon.pico.api.DeActivator; -import io.helidon.pico.api.Injector; -import io.helidon.pico.api.InjectorOptions; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.ActivationResult; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.DeActivationRequest; +import io.helidon.inject.api.DeActivator; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.Injector; +import io.helidon.inject.api.InjectorOptions; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.ServiceProvider; /** * Default reference implementation for the {@link Injector}. @@ -36,7 +36,7 @@ class DefaultInjector implements Injector { @Override @SuppressWarnings("unchecked") public ActivationResult activateInject(T serviceOrServiceProvider, - InjectorOptions opts) throws PicoServiceProviderException { + InjectorOptions opts) throws InjectionServiceProviderException { Objects.requireNonNull(serviceOrServiceProvider); Objects.requireNonNull(opts); @@ -64,7 +64,7 @@ public ActivationResult activateInject(T serviceOrServiceProvider, @Override @SuppressWarnings("unchecked") public ActivationResult deactivate(T serviceOrServiceProvider, - InjectorOptions opts) throws PicoServiceProviderException { + InjectorOptions opts) throws InjectionServiceProviderException { Objects.requireNonNull(serviceOrServiceProvider); Objects.requireNonNull(opts); @@ -96,8 +96,8 @@ private ActivationResult handleError(ActivationResult.Builder resultBuilder, InjectorOptions opts, String message, ServiceProvider serviceProvider) { - PicoException e = (serviceProvider == null) - ? new PicoException(message) : new PicoServiceProviderException(message, serviceProvider); + InjectionException e = (serviceProvider == null) + ? new InjectionException(message) : new InjectionServiceProviderException(message, serviceProvider); resultBuilder.error(e); if (opts.activationRequest().throwIfError()) { throw e; diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultServices.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultServices.java similarity index 80% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultServices.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultServices.java index 9dd05e5604e..60dcba75410 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/DefaultServices.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.ArrayList; import java.util.Collection; @@ -30,33 +30,31 @@ import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.CallingContext; -import io.helidon.pico.api.CallingContextFactory; -import io.helidon.pico.api.InjectionException; -import io.helidon.pico.api.Intercepted; -import io.helidon.pico.api.Metrics; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesConfig; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.api.ServiceBinder; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderBindable; -import io.helidon.pico.api.ServiceProviderProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.CallingContext; +import io.helidon.inject.api.CallingContextFactory; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.api.Intercepted; +import io.helidon.inject.api.Metrics; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.api.ServiceBinder; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.api.ServiceProviderInjectionException; +import io.helidon.inject.api.ServiceProviderProvider; +import io.helidon.inject.api.Services; import jakarta.inject.Provider; -import static io.helidon.pico.runtime.PicoExceptions.toErrorMessage; - /** - * The default reference implementation of {@link io.helidon.pico.api.Services}. + * The default reference implementation of {@link Services}. */ class DefaultServices implements Services, ServiceBinder, Resettable { private static final ServiceProviderComparator COMPARATOR = ServiceProviderComparator.create(); @@ -64,18 +62,18 @@ class DefaultServices implements Services, ServiceBinder, Resettable { private final ConcurrentHashMap> servicesByTypeName = new ConcurrentHashMap<>(); private final ConcurrentHashMap>> servicesByContract = new ConcurrentHashMap<>(); private final Map>> cache = new ConcurrentHashMap<>(); - private final PicoServicesConfig cfg; + private final InjectionServicesConfig cfg; private final AtomicInteger lookupCount = new AtomicInteger(); private final AtomicInteger cacheLookupCount = new AtomicInteger(); private final AtomicInteger cacheHitCount = new AtomicInteger(); - private volatile State stateWatchOnly; // we are watching and not mutating this state - owned by DefaultPicoServices + private volatile State stateWatchOnly; // we are watching and not mutating this state - owned by DefaultInjectionServices /** * The constructor taking a configuration. * * @param cfg the config */ - DefaultServices(PicoServicesConfig cfg) { + DefaultServices(InjectionServicesConfig cfg) { this.cfg = Objects.requireNonNull(cfg); } @@ -134,20 +132,20 @@ static boolean isIntercepted(ServiceProvider sp) { /** * First use weight, then use FQN of the service type name as the secondary comparator if weights are the same. * - * @return the pico comparator + * @return the comparator * @see ServiceProviderComparator */ static Comparator> serviceProviderComparator() { return COMPARATOR; } - static void assertPermitsDynamic(PicoServicesConfig cfg) { + static void assertPermitsDynamic(InjectionServicesConfig cfg) { if (!cfg.permitsDynamic()) { String desc = "Services are configured to prevent dynamic updates.\n" - + "Set config 'pico.permits-dynamic = true' to enable"; + + "Set config 'inject.permits-dynamic = true' to enable"; Optional callCtx = CallingContextFactory.create(false); - String msg = callCtx.map(callingContext -> toErrorMessage(callingContext, desc)) - .orElseGet(() -> toErrorMessage(desc)); + String msg = callCtx.map(callingContext -> InjectionExceptions.toErrorMessage(callingContext, desc)) + .orElseGet(() -> InjectionExceptions.toErrorMessage(desc)); throw new IllegalStateException(msg); } } @@ -158,16 +156,16 @@ static ServiceInfo toValidatedServiceInfo(ServiceProvider serviceProvider) { return info; } - static InjectionException serviceProviderAlreadyBoundInjectionError(ServiceProvider previous, - ServiceProvider sp) { - return new InjectionException("Service provider already bound to " + previous, null, sp); + static ServiceProviderInjectionException serviceProviderAlreadyBoundInjectionError(ServiceProvider previous, + ServiceProvider sp) { + return new ServiceProviderInjectionException("Service provider already bound to " + previous, null, sp); } - static InjectionException resolutionBasedInjectionError(ServiceInfoCriteria ctx) { - return new InjectionException("Expected to resolve a service matching " + ctx); + static ServiceProviderInjectionException resolutionBasedInjectionError(ServiceInfoCriteria ctx) { + return new ServiceProviderInjectionException("Expected to resolve a service matching " + ctx); } - static InjectionException resolutionBasedInjectionError(TypeName serviceTypeName) { + static ServiceProviderInjectionException resolutionBasedInjectionError(TypeName serviceTypeName) { return resolutionBasedInjectionError(ServiceInfoCriteria.builder().serviceTypeName(serviceTypeName).build()); } @@ -271,8 +269,8 @@ public void bind(ServiceProvider serviceProvider) { ServiceProvider previous = servicesByTypeName.putIfAbsent(serviceTypeName, serviceProvider); if (previous != null && previous != serviceProvider) { if (cfg.permitsDynamic()) { - DefaultPicoServices.LOGGER.log(System.Logger.Level.WARNING, - "overwriting " + previous + " with " + serviceProvider); + DefaultInjectionServices.LOGGER.log(System.Logger.Level.WARNING, + "overwriting " + previous + " with " + serviceProvider); servicesByTypeName.put(serviceTypeName, serviceProvider); } else { throw serviceProviderAlreadyBoundInjectionError(previous, serviceProvider); @@ -421,64 +419,64 @@ ServiceProvider serviceProviderFor(TypeName serviceTypeName) { List> allServiceProviders(boolean explode) { if (explode) { - return explodeFilterAndSort(servicesByTypeName.values(), PicoServices.EMPTY_CRITERIA, false); + return explodeFilterAndSort(servicesByTypeName.values(), InjectionServices.EMPTY_CRITERIA, false); } return new ArrayList<>(servicesByTypeName.values()); } - ServiceBinder createServiceBinder(PicoServices picoServices, + ServiceBinder createServiceBinder(InjectionServices injectionServices, DefaultServices services, String moduleName, boolean trusted) { - assert (picoServices.services() == services); - return ServiceBinderDefault.create(picoServices, moduleName, trusted); + assert (injectionServices.services() == services); + return ServiceBinderDefault.create(injectionServices, moduleName, trusted); } - void bind(PicoServices picoServices, + void bind(InjectionServices injectionServices, DefaultInjectionPlanBinder binder, Application app) { String appName = app.named().orElse(app.getClass().getName()); - boolean isLoggable = DefaultPicoServices.LOGGER.isLoggable(System.Logger.Level.INFO); + boolean isLoggable = DefaultInjectionServices.LOGGER.isLoggable(System.Logger.Level.INFO); if (isLoggable) { - DefaultPicoServices.LOGGER.log(System.Logger.Level.INFO, "starting binding application: " + appName); + DefaultInjectionServices.LOGGER.log(System.Logger.Level.INFO, "starting binding application: " + appName); } try { app.configure(binder); - bind(createServiceProvider(app, picoServices)); + bind(createServiceProvider(app, injectionServices)); if (isLoggable) { - DefaultPicoServices.LOGGER.log(System.Logger.Level.INFO, "finished binding application: " + appName); + DefaultInjectionServices.LOGGER.log(System.Logger.Level.INFO, "finished binding application: " + appName); } } catch (Exception e) { - throw new PicoException("Failed to process: " + app, e); + throw new InjectionException("Failed to process: " + app, e); } } - void bind(PicoServices picoServices, + void bind(InjectionServices injectionServices, ModuleComponent module, boolean initializing) { String moduleName = module.named().orElse(module.getClass().getName()); - boolean isLoggable = DefaultPicoServices.LOGGER.isLoggable(System.Logger.Level.TRACE); + boolean isLoggable = DefaultInjectionServices.LOGGER.isLoggable(System.Logger.Level.TRACE); if (isLoggable) { - DefaultPicoServices.LOGGER.log(System.Logger.Level.TRACE, "starting binding module: " + moduleName); + DefaultInjectionServices.LOGGER.log(System.Logger.Level.TRACE, "starting binding module: " + moduleName); } - ServiceBinder moduleServiceBinder = createServiceBinder(picoServices, this, moduleName, initializing); + ServiceBinder moduleServiceBinder = createServiceBinder(injectionServices, this, moduleName, initializing); module.configure(moduleServiceBinder); - bind(createServiceProvider(module, moduleName, picoServices)); + bind(createServiceProvider(module, moduleName, injectionServices)); if (isLoggable) { - DefaultPicoServices.LOGGER.log(System.Logger.Level.TRACE, "finished binding module: " + moduleName); + DefaultInjectionServices.LOGGER.log(System.Logger.Level.TRACE, "finished binding module: " + moduleName); } } private ServiceProvider createServiceProvider(ModuleComponent module, String moduleName, - PicoServices picoServices) { - return new PicoModuleServiceProvider(module, moduleName, picoServices); + InjectionServices injectionServices) { + return new InjectionModuleServiceProvider(module, moduleName, injectionServices); } private ServiceProvider createServiceProvider(Application app, - PicoServices picoServices) { - return new PicoApplicationServiceProvider(app, picoServices); + InjectionServices injectionServices) { + return new InjectionApplicationServiceProvider(app, injectionServices); } } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/Dependencies.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/Dependencies.java similarity index 97% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/Dependencies.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/Dependencies.java index f92b39fe590..4d45c7e0bbe 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/Dependencies.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/Dependencies.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.lang.annotation.Annotation; import java.util.Objects; @@ -22,17 +22,18 @@ import java.util.Set; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.DependencyInfo; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.DependencyInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; /** * This is the class the code-generator will target that will be used at runtime for a service provider to build up its - * dependencies expressed as {@link io.helidon.pico.api.DependenciesInfo}. + * dependencies expressed as {@link DependenciesInfo}. */ public class Dependencies { @@ -203,8 +204,7 @@ private static String toPackageName(TypeName typeName) { } /** - * The continuation builder. This is a specialized builder used within the generated Pico - * {@link io.helidon.pico.api.Activator}. + * The continuation builder. This is a specialized builder used within the generated {@link Activator}. * It is specialized in that it validates and decorates over the normal builder, and provides a more streamlined interface. */ public static class BuilderContinuation { diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoInjectionPlanBlueprint.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/HeldionInjectionPlanBlueprint.java similarity index 80% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/PicoInjectionPlanBlueprint.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/HeldionInjectionPlanBlueprint.java index d3735e0113e..2c3c56bb0f1 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoInjectionPlanBlueprint.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/HeldionInjectionPlanBlueprint.java @@ -14,21 +14,22 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.List; import io.helidon.builder.api.Prototype; -import io.helidon.pico.spi.InjectionPlan; +import io.helidon.inject.api.Application; +import io.helidon.inject.spi.InjectionPlan; /** * The injection plan for a given service provider and element belonging to that service provider. This plan can be created during - * compile-time, and then just loaded from the {@link io.helidon.pico.api.Application} during Pico bootstrap initialization, or it + * compile-time, and then just loaded from the {@link Application} during Injection bootstrap initialization, or it * can be produced during the same startup processing sequence if the Application was not found, or if it was not permitted to be * loaded. */ @Prototype.Blueprint -interface PicoInjectionPlanBlueprint extends InjectionPlan { +interface HeldionInjectionPlanBlueprint extends InjectionPlan { /** * The list of services/providers that are unqualified to satisfy the given injection point but were considered. diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/HelidonInjectionStartupProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionStartupProvider.java similarity index 88% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/HelidonInjectionStartupProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionStartupProvider.java index aba9becba9d..ec7a76c969a 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/HelidonInjectionStartupProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionStartupProvider.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; -import io.helidon.pico.api.Helidon; +import io.helidon.inject.api.Helidon; import io.helidon.spi.HelidonStartupProvider; /** * Service provider implementation, should only be used from {@link java.util.ServiceLoader}. - * See {@link io.helidon.pico.api.Helidon} type to discover programmatic API. + * See {@link Helidon} type to discover programmatic API. */ public class HelidonInjectionStartupProvider implements HelidonStartupProvider { /** diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoApplicationServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java similarity index 66% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/PicoApplicationServiceProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java index 29963bd7192..9cbeda54041 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoApplicationServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java @@ -14,22 +14,22 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfo; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfo; /** - * Basic {@link io.helidon.pico.api.Application} implementation. A Pico application is-a service provider also. + * Basic {@link Application} implementation. An application is-a service provider also. */ -class PicoApplicationServiceProvider extends AbstractServiceProvider { +class InjectionApplicationServiceProvider extends AbstractServiceProvider { - PicoApplicationServiceProvider(Application app, PicoServices picoServices) { - super(app, Phase.ACTIVE, createServiceInfo(app), picoServices); + InjectionApplicationServiceProvider(Application app, InjectionServices injectionServices) { + super(app, Phase.ACTIVE, createServiceInfo(app), injectionServices); serviceRef(app); } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoExceptions.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionExceptions.java similarity index 82% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/PicoExceptions.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionExceptions.java index 3f84577d712..4aad7c9427a 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoExceptions.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionExceptions.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Objects; -import io.helidon.pico.api.CallingContext; +import io.helidon.inject.api.CallingContext; -import static io.helidon.pico.api.PicoServicesHolder.DEBUG_HINT; +import static io.helidon.inject.api.InjectionServicesHolder.DEBUG_HINT; /** * Utility for exceptions with information about debugging. */ -public final class PicoExceptions { - private PicoExceptions() { +public final class InjectionExceptions { + private InjectionExceptions() { } /** @@ -46,11 +46,11 @@ public static String toErrorMessage(CallingContext callingContext, String msg) { /** * Convenience method for producing an error message that may involve advising the user to apply a debug mode. Use - * {@link #toErrorMessage(io.helidon.pico.api.CallingContext, String)} instead f a calling context is available. + * {@link #toErrorMessage(CallingContext, String)} instead f a calling context is available. * * @param msg the base message to display * @return the message appropriate for any exception being thrown - * @see #toErrorMessage(io.helidon.pico.api.CallingContext, String) + * @see #toErrorMessage(CallingContext, String) */ public static String toErrorMessage(String msg) { Objects.requireNonNull(msg); diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoModuleServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java similarity index 65% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/PicoModuleServiceProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java index d61430a5f81..c65902eeb64 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/PicoModuleServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java @@ -14,23 +14,23 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfo; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfo; /** - * Basic {@link ModuleComponent} implementation. A Pico module is-a service provider also. + * Basic {@link ModuleComponent} implementation. A ModuleComponent is-a service provider also. */ -class PicoModuleServiceProvider extends AbstractServiceProvider { +class InjectionModuleServiceProvider extends AbstractServiceProvider { - PicoModuleServiceProvider(ModuleComponent module, - String moduleName, - PicoServices picoServices) { - super(module, PicoServices.terminalActivationPhase(), createServiceInfo(module, moduleName), picoServices); + InjectionModuleServiceProvider(ModuleComponent module, + String moduleName, + InjectionServices injectionServices) { + super(module, InjectionServices.terminalActivationPhase(), createServiceInfo(module, moduleName), injectionServices); serviceRef(module); } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/InterceptedMethod.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/InterceptedMethod.java similarity index 93% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/InterceptedMethod.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/InterceptedMethod.java index 42a6b907508..c34560b2b1e 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/InterceptedMethod.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/InterceptedMethod.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.List; import java.util.Objects; @@ -23,15 +23,15 @@ import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.InvocationException; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.InvocationException; +import io.helidon.inject.api.ServiceProvider; import jakarta.inject.Provider; /** - * Base class, used in {@link io.helidon.pico.api.Interceptor} generated code. One of these instances will be created for each + * Base class, used in {@link Interceptor} generated code. One of these instances will be created for each * intercepted method. * * @param the intercepted type diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/Invocation.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/Invocation.java similarity index 94% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/Invocation.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/Invocation.java index 200af0eb890..a7d9821ee85 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/Invocation.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/Invocation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.ArrayList; import java.util.Collections; @@ -22,19 +22,19 @@ import java.util.Objects; import java.util.function.Function; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.InvocationException; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.InvocationException; +import io.helidon.inject.api.ServiceProvider; import jakarta.inject.Provider; /** * Handles the invocation of {@link Interceptor} methods. - * Note that upon a successful call to the {@link io.helidon.pico.api.Interceptor.Chain#proceed(Object[])} or to the ultimate + * Note that upon a successful call to the {@link Interceptor.Chain#proceed(Object[])} or to the ultimate * target, the invocation will be prevented from being executed again. * - * @see io.helidon.pico.api.InvocationContext + * @see InvocationContext * @param the invocation type */ public class Invocation implements Interceptor.Chain { diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/NonSingletonServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/NonSingletonServiceProvider.java similarity index 94% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/NonSingletonServiceProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/NonSingletonServiceProvider.java index 1c25d598d8f..14d3438bf44 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/NonSingletonServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/NonSingletonServiceProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.LinkedHashSet; import java.util.List; @@ -22,7 +22,7 @@ import java.util.Objects; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Phase; +import io.helidon.inject.api.Phase; /** * A provider that represents a non-singleton service. @@ -35,7 +35,7 @@ class NonSingletonServiceProvider extends AbstractServiceProvider { private NonSingletonServiceProvider(AbstractServiceProvider delegate) { this.delegate = delegate; - picoServices(delegate.picoServices()); + injectionServices(delegate.injectionServices()); serviceInfo(delegate.serviceInfo()); dependencies(delegate.dependencies()); } @@ -47,7 +47,7 @@ static T createAndActivate(AbstractServiceProvider delegate) { serviceProvider.startAndFinishTransitionCurrentActivationPhase(logEntryAndResult, Phase.ACTIVATION_STARTING); serviceProvider.startTransitionCurrentActivationPhase(logEntryAndResult, Phase.GATHERING_DEPENDENCIES); - Map plans = delegate.getOrCreateInjectionPlan(false); + Map plans = delegate.getOrCreateInjectionPlan(false); logEntryAndResult.activationResult().injectionPlans(plans); Map deps = delegate.resolveDependencies(plans); logEntryAndResult.activationResult().resolvedDependencies(deps); diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceBinderDefault.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceBinderDefault.java similarity index 66% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceBinderDefault.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceBinderDefault.java index d83ca26acb7..0ac5cdbe33a 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceBinderDefault.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceBinderDefault.java @@ -14,32 +14,32 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Objects; import java.util.Optional; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceBinder; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.ServiceProviderBindable; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.ServiceBinder; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.api.Services; /** * The default implementation for {@link ServiceBinder}. */ public class ServiceBinderDefault implements ServiceBinder { - private final PicoServices picoServices; + private final InjectionServices injectionServices; private final ServiceBinder serviceRegistry; private final String moduleName; private final boolean trusted; - private ServiceBinderDefault(PicoServices picoServices, + private ServiceBinderDefault(InjectionServices injectionServices, String moduleName, boolean trusted) { - this.picoServices = picoServices; - this.serviceRegistry = (ServiceBinder) picoServices.services(); + this.injectionServices = injectionServices; + this.serviceRegistry = (ServiceBinder) injectionServices.services(); this.moduleName = moduleName; this.trusted = trusted; } @@ -47,27 +47,27 @@ private ServiceBinderDefault(PicoServices picoServices, /** * Creates an instance of the default services binder. * - * @param picoServices the pico services instance + * @param injectionServices the services registry instance * @param moduleName the module name * @param trusted are we in trusted mode (typically only set during early initialization sequence) * @return the newly created service binder */ - public static ServiceBinderDefault create(PicoServices picoServices, + public static ServiceBinderDefault create(InjectionServices injectionServices, String moduleName, boolean trusted) { - Objects.requireNonNull(picoServices); + Objects.requireNonNull(injectionServices); Objects.requireNonNull(moduleName); - return new ServiceBinderDefault(picoServices, moduleName, trusted); + return new ServiceBinderDefault(injectionServices, moduleName, trusted); } @Override public void bind(ServiceProvider sp) { if (!trusted) { - DefaultServices.assertPermitsDynamic(picoServices.config()); + DefaultServices.assertPermitsDynamic(injectionServices.config()); } Optional> bindableSp = toBindableProvider(sp); - if (bindableSp.isPresent() && alreadyBoundToThisPicoServices(bindableSp.get(), picoServices)) { + if (bindableSp.isPresent() && alreadyBoundToThisInjectionServices(bindableSp.get(), injectionServices)) { return; } @@ -75,23 +75,23 @@ public void bind(ServiceProvider sp) { bindableSp.ifPresent(it -> it.moduleName(moduleName)); } - Services services = picoServices.services(); + Services services = injectionServices.services(); if (services instanceof DefaultServices && sp instanceof ServiceProviderBindable) { Phase currentPhase = ((DefaultServices) services).currentPhase(); if (currentPhase.ordinal() >= Phase.SERVICES_READY.ordinal()) { - // deferred binding (e.g., to allow PicoTestSupport to programmatically register/bind service providers - ((ServiceProviderBindable) sp).picoServices(Optional.of(picoServices)); + // deferred binding (e.g., to allow InjectionTestSupport to programmatically register/bind service providers + ((ServiceProviderBindable) sp).injectionServices(Optional.of(injectionServices)); } } serviceRegistry.bind(sp); - bindableSp.ifPresent(it -> it.picoServices(Optional.of(picoServices))); + bindableSp.ifPresent(it -> it.injectionServices(Optional.of(injectionServices))); } - private boolean alreadyBoundToThisPicoServices(ServiceProviderBindable serviceProvider, - PicoServices picoServices) { - PicoServices assigned = serviceProvider.picoServices().orElse(null); - return (assigned == picoServices); + private boolean alreadyBoundToThisInjectionServices(ServiceProviderBindable serviceProvider, + InjectionServices injectionServices) { + InjectionServices assigned = serviceProvider.injectionServices().orElse(null); + return (assigned == injectionServices); } /** diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceProviderComparator.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceProviderComparator.java similarity index 95% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceProviderComparator.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceProviderComparator.java index de906e6f898..59f7eb19a41 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceProviderComparator.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceProviderComparator.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.io.Serializable; import java.util.Comparator; import io.helidon.common.Weights; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceProvider; import jakarta.inject.Provider; diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceUtils.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceUtils.java similarity index 83% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceUtils.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceUtils.java index d9b75a29614..c9ba75bc82d 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/ServiceUtils.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/ServiceUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Collection; import java.util.List; @@ -23,13 +23,13 @@ import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceProvider; /** - * Public helpers around shared Pico services usages. + * Public helpers around shared services usages. */ public final class ServiceUtils { private static final TypeName MODULE_COMPONENT = TypeName.create(ModuleComponent.class); @@ -55,7 +55,7 @@ public static boolean isQualifiedInjectionTarget(ServiceProvider sp) { } /** - * Provides a {@link io.helidon.pico.api.ServiceProvider#description()}, falling back to {@link #toString()} on the passed + * Provides a {@link ServiceProvider#description()}, falling back to {@link #toString()} on the passed * provider argument. * * @param provider the provider @@ -73,7 +73,7 @@ public static String toDescription(Object provider) { } /** - * Provides a {@link io.helidon.pico.api.ServiceProvider#description()}, falling back to {@link #toString()} on the passed + * Provides a {@link ServiceProvider#description()}, falling back to {@link #toString()} on the passed * provider argument. * * @param coll the collection of providers diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/State.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/State.java similarity index 97% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/State.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/State.java index c0cd429e1ff..c8aff3c7665 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/State.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/State.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Objects; import java.util.concurrent.locks.ReentrantReadWriteLock; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.Resettable; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.Resettable; class State implements Resettable, Cloneable { private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/Versions.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/Versions.java similarity index 61% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/Versions.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/Versions.java index c26c21dc8e1..8b6b2b18c28 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/Versions.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/Versions.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; /** - * Keeps track of the Pico Interop Versions. + * Keeps track of the Injection Interop Versions. *

      - * Since Pico performs code-generation, each previously generated artifact version may need to be discoverable in order to - * determine interoperability with previous release versions. This class will only track version changes for anything that might + * Since Helidon Injection performs code-generation, each previously generated artifact version may need to be discoverable in order + * to determine interoperability with previous release versions. This class will only track version changes for anything that might * affect interoperability - it will not be rev'ed for general code enhancements and fixes. *

      * Please note that this version is completely independent of the Helidon version and other features and modules within Helidon. @@ -28,14 +28,14 @@ public class Versions { /** - * Version 1 - the initial release of Pico. + * Version 1 - the initial release of Injection. */ - public static final String PICO_VERSION_1 = "1"; + public static final String INJECT_VERSION_1 = "1"; /** - * The current release is {@link #PICO_VERSION_1}. + * The current release is {@link #INJECT_VERSION_1}. */ - public static final String CURRENT_PICO_VERSION = PICO_VERSION_1; + public static final String CURRENT_INJECT_VERSION = INJECT_VERSION_1; private Versions() { } diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/VoidServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/VoidServiceProvider.java similarity index 91% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/VoidServiceProvider.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/VoidServiceProvider.java index 658b0541af6..f02dad6ad10 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/VoidServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/VoidServiceProvider.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.List; import java.util.Map; import java.util.Optional; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceProvider; import jakarta.inject.Singleton; diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/package-info.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/package-info.java new file mode 100644 index 00000000000..aae2513ccad --- /dev/null +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Injection runtime services. + */ +package io.helidon.inject.runtime; diff --git a/pico/runtime/src/main/java/module-info.java b/inject/runtime/src/main/java/module-info.java similarity index 65% rename from pico/runtime/src/main/java/module-info.java rename to inject/runtime/src/main/java/module-info.java index 725f9efe1b2..d583d16d8e0 100644 --- a/pico/runtime/src/main/java/module-info.java +++ b/inject/runtime/src/main/java/module-info.java @@ -14,10 +14,13 @@ * limitations under the License. */ +import io.helidon.inject.runtime.DefaultInjectionServicesProvider; +import io.helidon.inject.spi.InjectionServicesProvider; + /** - * The Pico Runtime Services Module. + * The Injection Runtime Services module. */ -module io.helidon.pico.runtime { +module io.helidon.inject.runtime { requires static jakarta.inject; requires static jakarta.annotation; requires io.helidon.builder.api; @@ -25,17 +28,17 @@ requires transitive io.helidon.common.types; requires io.helidon.common; requires io.helidon.common.config; - requires transitive io.helidon.pico.api; + requires transitive io.helidon.inject.api; requires static io.helidon.config.metadata; requires io.helidon; - exports io.helidon.pico.runtime; + exports io.helidon.inject.runtime; - provides io.helidon.pico.spi.PicoServicesProvider - with io.helidon.pico.runtime.DefaultPicoServicesProvider; + provides InjectionServicesProvider + with DefaultInjectionServicesProvider; provides io.helidon.spi.HelidonStartupProvider - with io.helidon.pico.runtime.HelidonInjectionStartupProvider; + with io.helidon.inject.runtime.HelidonInjectionStartupProvider; - uses io.helidon.pico.api.ModuleComponent; - uses io.helidon.pico.api.Application; + uses io.helidon.inject.api.ModuleComponent; + uses io.helidon.inject.api.Application; } diff --git a/pico/runtime/src/test/java/io/helidon/pico/runtime/ControlBlueprint.java b/inject/runtime/src/test/java/io/helidon/inject/runtime/ControlBlueprint.java similarity index 96% rename from pico/runtime/src/test/java/io/helidon/pico/runtime/ControlBlueprint.java rename to inject/runtime/src/test/java/io/helidon/inject/runtime/ControlBlueprint.java index b2df33fd265..688258e5fe5 100644 --- a/pico/runtime/src/test/java/io/helidon/pico/runtime/ControlBlueprint.java +++ b/inject/runtime/src/test/java/io/helidon/inject/runtime/ControlBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Optional; diff --git a/pico/runtime/src/test/java/io/helidon/pico/runtime/DefaultActivationLogTest.java b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultActivationLogTest.java similarity index 92% rename from pico/runtime/src/test/java/io/helidon/pico/runtime/DefaultActivationLogTest.java rename to inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultActivationLogTest.java index 3b0e6849a9f..64b01f18ae3 100644 --- a/pico/runtime/src/test/java/io/helidon/pico/runtime/DefaultActivationLogTest.java +++ b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultActivationLogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; -import io.helidon.pico.api.ActivationLogEntry; +import io.helidon.inject.api.ActivationLogEntry; import org.junit.jupiter.api.Test; diff --git a/pico/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesConfigTest.java b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java similarity index 76% rename from pico/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesConfigTest.java rename to inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java index 47cbaab335b..e3eaa65c1ec 100644 --- a/pico/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesConfigTest.java +++ b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; -import io.helidon.pico.api.PicoServicesConfig; +import io.helidon.inject.api.InjectionServicesConfig; import org.junit.jupiter.api.Test; @@ -24,11 +24,11 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -class DefaultPicoServicesConfigTest { +class DefaultInjectionServicesConfigTest { @Test void testIt() { - PicoServicesConfig cfg = DefaultPicoServicesConfig.createDefaultConfigBuilder(); + InjectionServicesConfig cfg = DefaultInjectionServicesConfig.createDefaultConfigBuilder(); assertThat(cfg.providerName(), optionalValue(is("oracle"))); assertThat(cfg.providerVersion(), optionalValue(is("1"))); } diff --git a/pico/runtime/src/test/java/io/helidon/pico/runtime/InvocationTest.java b/inject/runtime/src/test/java/io/helidon/inject/runtime/InvocationTest.java similarity index 97% rename from pico/runtime/src/test/java/io/helidon/pico/runtime/InvocationTest.java rename to inject/runtime/src/test/java/io/helidon/inject/runtime/InvocationTest.java index 5bee87b9879..bb5eda08848 100644 --- a/pico/runtime/src/test/java/io/helidon/pico/runtime/InvocationTest.java +++ b/inject/runtime/src/test/java/io/helidon/inject/runtime/InvocationTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.ArrayList; import java.util.List; @@ -25,9 +25,9 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.InvocationException; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.InvocationException; import jakarta.inject.Provider; import org.junit.jupiter.api.Test; @@ -107,7 +107,7 @@ void illegalCallToInterceptorProceedTwice() { InvocationException e = assertThrows(InvocationException.class, () -> Invocation.createInvokeAndSupply(dummyCtx, fnc, args)); assertThat(e.getMessage(), - equalTo("Duplicate invocation, or unknown call type: io.helidon.pico.runtime.InvocationTest test")); + equalTo("Duplicate invocation, or unknown call type: io.helidon.inject.runtime.InvocationTest test")); assertThat(e.targetWasCalled(), is(true)); assertThat(first.callCount.get(), equalTo(1)); assertThat(first.proceedCount.get(), equalTo(2)); @@ -126,7 +126,7 @@ void illegalCallToTargetProceedTwice() { InvocationException e = assertThrows(InvocationException.class, () -> Invocation.createInvokeAndSupply(dummyCtx, fnc, args)); assertThat(e.getMessage(), - equalTo("Duplicate invocation, or unknown call type: io.helidon.pico.runtime.InvocationTest test")); + equalTo("Duplicate invocation, or unknown call type: io.helidon.inject.runtime.InvocationTest test")); assertThat(e.targetWasCalled(), is(true)); assertThat(first.callCount.get(), equalTo(1)); assertThat(first.proceedCount.get(), equalTo(1)); @@ -181,7 +181,7 @@ void exceptionThrownInInterceptorAfterReachingTarget() { InvocationException e = assertThrows(InvocationException.class, () -> Invocation.createInvokeAndSupply(dummyCtx, fnc, args)); assertThat(e.getMessage(), - equalTo("Duplicate invocation, or unknown call type: io.helidon.pico.runtime.InvocationTest test")); + equalTo("Duplicate invocation, or unknown call type: io.helidon.inject.runtime.InvocationTest test")); assertThat(e.targetWasCalled(), is(true)); assertThat(first.callCount.get(), equalTo(1)); assertThat(first.proceedCount.get(), equalTo(2)); diff --git a/pico/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java b/inject/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java similarity index 65% rename from pico/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java rename to inject/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java index 55958a5fe89..3ec647cc304 100644 --- a/pico/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java +++ b/inject/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; -import io.helidon.pico.api.PicoServicesHolder; +import io.helidon.inject.api.InjectionServicesHolder; /** - * Supporting helper utilities unit-testing Pico services. + * Supporting helper utilities unit-testing Injection services. */ -class SimplePicoTestingSupport { +class SimpleInjectionTestingSupport { /** - * Resets all internal Pico configuration instances, JVM global singletons, service registries, etc. + * Resets all internal Injection configuration instances, JVM global singletons, service registries, etc. */ static void resetAll() { Holder.reset(); @@ -32,9 +32,9 @@ static void resetAll() { @SuppressWarnings("deprecation") - private static class Holder extends PicoServicesHolder { + private static class Holder extends InjectionServicesHolder { public static void reset() { - PicoServicesHolder.reset(); + InjectionServicesHolder.reset(); } } diff --git a/pico/testing/pom.xml b/inject/testing/pom.xml similarity index 86% rename from pico/testing/pom.xml rename to inject/testing/pom.xml index 6cbb9626fef..4fa72b62652 100644 --- a/pico/testing/pom.xml +++ b/inject/testing/pom.xml @@ -20,15 +20,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-testing - Helidon Pico Testing Support + helidon-inject-testing + Helidon Injection Testing Support @@ -40,8 +40,8 @@ helidon-config - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime jakarta.inject diff --git a/pico/testing/src/main/java/io/helidon/pico/testing/PicoTestingSupport.java b/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java similarity index 58% rename from pico/testing/src/main/java/io/helidon/pico/testing/PicoTestingSupport.java rename to inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java index b583ae70ee7..65994d2a1ea 100644 --- a/pico/testing/src/main/java/io/helidon/pico/testing/PicoTestingSupport.java +++ b/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.testing; +package io.helidon.inject.testing; import java.util.Collection; import java.util.List; @@ -25,58 +25,61 @@ import io.helidon.common.LazyValue; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesHolder; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.runtime.ServiceBinderDefault; +import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.api.ServiceBinder; +import io.helidon.inject.api.Services; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesHolder; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.runtime.ServiceBinderDefault; /** - * Supporting helper utilities unit-testing Pico services. + * Supporting helper utilities unit-testing Injection Services. */ -public class PicoTestingSupport { - private static LazyValue instance = lazyCreate(basicTestableConfig()); +public class InjectionTestingSupport { + private static LazyValue instance = lazyCreate(basicTestableConfig()); - private PicoTestingSupport() { + private InjectionTestingSupport() { } /** - * Resets all internal Pico configuration instances, JVM global singletons, service registries, etc. + * Resets all internal configuration instances, JVM global singletons, service registries, etc. */ public static void resetAll() { Internal.reset(); } /** - * Provides a means to bind a service provider into the {@link io.helidon.pico.api.Services} registry. + * Provides a means to bind a service provider into the {@link Services} registry. * - * @param picoServices the pico services instance to bind into - * @param serviceProvider the service provider to bind - * @see io.helidon.pico.api.ServiceBinder + * @param injectionServices the services instance to bind into + * @param serviceProvider the service provider to bind + * @see ServiceBinder */ - public static void bind(PicoServices picoServices, + public static void bind(InjectionServices injectionServices, ServiceProvider serviceProvider) { - ServiceBinderDefault binder = ServiceBinderDefault.create(picoServices, PicoTestingSupport.class.getSimpleName(), true); + ServiceBinderDefault binder = ServiceBinderDefault.create(injectionServices, InjectionTestingSupport.class.getSimpleName(), true); binder.bind(serviceProvider); } /** - * Creates a {@link io.helidon.pico.api.PicoServices} interface more conducive to unit and integration testing. + * Creates a {@link InjectionServices} interface more conducive to unit and integration testing. * * @return testable services instance */ - public static PicoServices testableServices() { + public static InjectionServices testableServices() { return instance.get(); } /** - * Creates a {@link io.helidon.pico.api.PicoServices} interface more conducive to unit and integration testing. + * Creates a {@link InjectionServices} interface more conducive to unit and integration testing. * * @param config the config to use * @return testable services instance - * @see io.helidon.pico.api.PicoServicesConfig + * @see InjectionServicesConfig */ - public static PicoServices testableServices(Config config) { + public static InjectionServices testableServices(Config config) { return lazyCreate(config).get(); } @@ -88,8 +91,8 @@ public static PicoServices testableServices(Config config) { public static Config basicTestableConfig() { return Config.builder( ConfigSources.create( - Map.of("pico.permits-dynamic", "true", - "pico.service-lookup-caching", "true"), + Map.of("inject.permits-dynamic", "true", + "inject.service-lookup-caching", "true"), "config-1")) .disableEnvironmentVariablesSource() .disableSystemPropertiesSource() @@ -120,20 +123,20 @@ public static String toDescription(Object providerOrInstance) { * @return the description of the instance */ public static List toDescriptions(Collection coll) { - return coll.stream().map(PicoTestingSupport::toDescription).collect(Collectors.toList()); + return coll.stream().map(InjectionTestingSupport::toDescription).collect(Collectors.toList()); } - private static LazyValue lazyCreate(Config config) { + private static LazyValue lazyCreate(Config config) { return LazyValue.create(() -> { - PicoServices.globalBootstrap(Bootstrap.builder().config(config).build()); - return PicoServices.picoServices().orElseThrow(); + InjectionServices.globalBootstrap(Bootstrap.builder().config(config).build()); + return InjectionServices.injectionServices().orElseThrow(); }); } @SuppressWarnings("deprecation") - private static class Internal extends PicoServicesHolder { + private static class Internal extends InjectionServicesHolder { public static void reset() { - PicoServicesHolder.reset(); + InjectionServicesHolder.reset(); instance = lazyCreate(basicTestableConfig()); } } diff --git a/pico/testing/src/main/java/io/helidon/pico/testing/ReflectionBasedSingletonServiceProvider.java b/inject/testing/src/main/java/io/helidon/inject/testing/ReflectionBasedSingletonServiceProvider.java similarity index 82% rename from pico/testing/src/main/java/io/helidon/pico/testing/ReflectionBasedSingletonServiceProvider.java rename to inject/testing/src/main/java/io/helidon/inject/testing/ReflectionBasedSingletonServiceProvider.java index 60201ace8cb..732afdf9654 100644 --- a/pico/testing/src/main/java/io/helidon/pico/testing/ReflectionBasedSingletonServiceProvider.java +++ b/inject/testing/src/main/java/io/helidon/inject/testing/ReflectionBasedSingletonServiceProvider.java @@ -14,17 +14,21 @@ * limitations under the License. */ -package io.helidon.pico.testing; +package io.helidon.inject.testing; import java.lang.reflect.Constructor; import java.util.Map; import java.util.Objects; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.InjectionException; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.runtime.AbstractServiceProvider; +import io.helidon.inject.api.ServiceProviderInjectionException; +import io.helidon.inject.api.PostConstructMethod; +import io.helidon.inject.api.PreDestroyMethod; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.runtime.AbstractServiceProvider; /** * Creates a simple reflection based service provider - for testing purposes only! @@ -47,19 +51,19 @@ private ReflectionBasedSingletonServiceProvider(Class serviceType, *

    • The service type will be created reflectively, and will expect to have an empty constructor
    • *
    • The service type will not be able to provide its dependencies, nor will it be able to accept injection
    • *
    • The service type will not be able to participate in lifecycle - - * {@link io.helidon.pico.api.PostConstructMethod} or {@link io.helidon.pico.api.PreDestroyMethod}
    • + * {@link PostConstructMethod} or {@link PreDestroyMethod} * * Note: Generally it is encouraged for users to rely on the annotation processors and other built on compile-time * tooling to generate the appropriate service providers and modules. This method is an alternative to that * mechanism and therefore is discouraged from production use. This method is not used in normal processing by - * the reference pico provider implementation. + * the reference injection provider implementation. * * @param serviceType the service type * @param siBasics the service info basic descriptor, or null to generate a default (empty) placeholder * @param the class of the service type * * @return the service provider capable of being bound to the services registry - * @see io.helidon.pico.testing.PicoTestingSupport#bind(io.helidon.pico.api.PicoServices, io.helidon.pico.api.ServiceProvider) + * @see InjectionTestingSupport#bind(InjectionServices, ServiceProvider) */ public static ReflectionBasedSingletonServiceProvider create(Class serviceType, ServiceInfoBasics siBasics) { @@ -85,7 +89,7 @@ protected T createServiceProvider(Map deps) { ctor.setAccessible(true); return ctor.newInstance(); } catch (Exception e) { - throw new InjectionException("Failed to fully create instance: " + this, e, this); + throw new ServiceProviderInjectionException("Failed to fully create instance: " + this, e, this); } } diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/spi/package-info.java b/inject/testing/src/main/java/io/helidon/inject/testing/package-info.java similarity index 90% rename from pico/processor/src/main/java/io/helidon/pico/processor/spi/package-info.java rename to inject/testing/src/main/java/io/helidon/inject/testing/package-info.java index 228ed0c025c..b0503bf1166 100644 --- a/pico/processor/src/main/java/io/helidon/pico/processor/spi/package-info.java +++ b/inject/testing/src/main/java/io/helidon/inject/testing/package-info.java @@ -15,6 +15,6 @@ */ /** - * Pico APT SPI package. + * Injection testing support. */ -package io.helidon.pico.processor.spi; +package io.helidon.inject.testing; diff --git a/pico/testing/src/main/java/module-info.java b/inject/testing/src/main/java/module-info.java similarity index 82% rename from pico/testing/src/main/java/module-info.java rename to inject/testing/src/main/java/module-info.java index d93d305642b..a920d23ee3b 100644 --- a/pico/testing/src/main/java/module-info.java +++ b/inject/testing/src/main/java/module-info.java @@ -15,13 +15,13 @@ */ /** - * Pico Testing Support Module. + * Injection Testing Support module. */ -module io.helidon.pico.testing { +module io.helidon.inject.testing { requires io.helidon.builder.api; requires io.helidon.config; - requires transitive io.helidon.pico.runtime; + requires transitive io.helidon.inject.runtime; requires io.helidon.common.types; - exports io.helidon.pico.testing; + exports io.helidon.inject.testing; } diff --git a/pico/tests/runtime/pom.xml b/inject/tests/api/pom.xml similarity index 81% rename from pico/tests/runtime/pom.xml rename to inject/tests/api/pom.xml index e2f1adeb0bc..faf82d49d2a 100644 --- a/pico/tests/runtime/pom.xml +++ b/inject/tests/api/pom.xml @@ -21,23 +21,23 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.tests - helidon-pico-tests-project + io.helidon.inject.tests + helidon-inject-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-tests-runtime - Helidon Pico Tests Runtime + helidon-inject-tests-api + Helidon Injection Tests API - Test pico Runtime to remove dependency on Helidon Config, which did not allow us to have services in config + Test Injection API to remove dependency on Helidon Config, which did not allow us to have contracts in config. - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-api io.helidon.config diff --git a/pico/tests/api/src/test/java/io/helidon/pico/api/PicoServicesConfigTest.java b/inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java similarity index 74% rename from pico/tests/api/src/test/java/io/helidon/pico/api/PicoServicesConfigTest.java rename to inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java index aba99d79ef1..6397d687410 100644 --- a/pico/tests/api/src/test/java/io/helidon/pico/api/PicoServicesConfigTest.java +++ b/inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.api; +package io.helidon.inject.api; import java.time.Duration; import java.util.Map; @@ -32,19 +32,19 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -class PicoServicesConfigTest { +class InjectionServicesConfigTest { @AfterEach void reset() { - PicoServicesHolder.reset(); + InjectionServicesHolder.reset(); } /** - * This tests the default pico configuration. + * This tests the default injection configuration. */ @Test void withOutBootstrap() { - PicoServicesConfig cfg = PicoServicesConfig.create(); + InjectionServicesConfig cfg = InjectionServicesConfig.create(); assertThat(cfg.serviceLookupCaching(), equalTo(Boolean.FALSE)); assertThat(cfg.activationLogs(), equalTo(Boolean.FALSE)); assertThat(cfg.activationDeadlockDetectionTimeout(), equalTo(Duration.ofSeconds(10))); @@ -67,8 +67,8 @@ void withOutBootstrap() { @Test void withBootstrapWithoutConfig() { Bootstrap bootstrap = Bootstrap.builder().build(); - PicoServicesHolder.bootstrap(bootstrap); - assertThat(PicoServicesHolder.bootstrap(false), optionalPresent()); + InjectionServicesHolder.bootstrap(bootstrap); + assertThat(InjectionServicesHolder.bootstrap(false), optionalPresent()); // should be the same as if we had no bootstrap withOutBootstrap(); @@ -78,16 +78,16 @@ void withBootstrapWithoutConfig() { void withBootStrapConfig() { Config config = io.helidon.config.Config.builder( ConfigSources.create( - Map.of("pico.provider-name", "fake", - "pico.provider-version", "2.4", - "pico.service-lookup-caching", "true", - "pico.activation-logs", "true", - "pico.activation-deadlock-detection-timeout", "PT0.111S", - "pico.permits-dynamic", "true", - "pico.permits-reflection", "true", - "pico.uses-jsr330", "true", - "pico.uses-compile-time-applications", "false", - "pico.uses-compile-time-modules", "false" + Map.of("inject.provider-name", "fake", + "inject.provider-version", "2.4", + "inject.service-lookup-caching", "true", + "inject.activation-logs", "true", + "inject.activation-deadlock-detection-timeout", "PT0.111S", + "inject.permits-dynamic", "true", + "inject.permits-reflection", "true", + "inject.uses-jsr330", "true", + "inject.uses-compile-time-applications", "false", + "inject.uses-compile-time-modules", "false" ), "config-1")) .disableEnvironmentVariablesSource() .disableSystemPropertiesSource() @@ -95,10 +95,10 @@ void withBootStrapConfig() { Bootstrap bootstrap = Bootstrap.builder() .config(config) .build(); - PicoServicesHolder.bootstrap(bootstrap); - assertThat(PicoServicesHolder.bootstrap(false), optionalPresent()); + InjectionServicesHolder.bootstrap(bootstrap); + assertThat(InjectionServicesHolder.bootstrap(false), optionalPresent()); - PicoServicesConfig cfg = PicoServicesConfig.create(config.get("pico")); + InjectionServicesConfig cfg = InjectionServicesConfig.create(config.get("inject")); assertThat(cfg.serviceLookupCaching(), equalTo(Boolean.TRUE)); assertThat(cfg.activationLogs(), equalTo(Boolean.TRUE)); assertThat(cfg.activationDeadlockDetectionTimeout(), equalTo(Duration.ofMillis(111))); diff --git a/pico/tests/interception/pom.xml b/inject/tests/interception/pom.xml similarity index 80% rename from pico/tests/interception/pom.xml rename to inject/tests/interception/pom.xml index 0a440b29ccf..aba48b1033e 100644 --- a/pico/tests/interception/pom.xml +++ b/inject/tests/interception/pom.xml @@ -21,21 +21,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.tests - helidon-pico-tests-project + io.helidon.inject.tests + helidon-inject-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-tests-interception - Helidon Pico Test Interception - Test interception + helidon-inject-tests-interception + Helidon Injection Test Interception + Test interception. - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor true @@ -50,8 +50,8 @@ provided - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime org.junit.jupiter @@ -74,8 +74,8 @@ true - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Invocation.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Invocation.java similarity index 94% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Invocation.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Invocation.java index fb255bd9d23..e957b04242f 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Invocation.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Invocation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import java.util.Arrays; diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Modify.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Modify.java similarity index 91% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Modify.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Modify.java index cd78537b56c..81ff657d9d5 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Modify.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Modify.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import io.helidon.pico.api.InterceptedTrigger; +import io.helidon.inject.api.InterceptedTrigger; /** * Modify call. diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/ModifyingInterceptor.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/ModifyingInterceptor.java similarity index 90% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/ModifyingInterceptor.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/ModifyingInterceptor.java index 6c538a6c30d..811e6094943 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/ModifyingInterceptor.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/ModifyingInterceptor.java @@ -14,20 +14,20 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; import jakarta.inject.Named; import jakarta.inject.Singleton; -@Named("io.helidon.pico.tests.interception.Modify") +@Named("io.helidon.inject.tests.interception.Modify") @Singleton @Weight(Weighted.DEFAULT_WEIGHT + 50) class ModifyingInterceptor implements Interceptor { diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/OtherContract.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/OtherContract.java similarity index 92% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/OtherContract.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/OtherContract.java index 43281058b74..1d7dcf69b05 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/OtherContract.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/OtherContract.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; @Contract interface OtherContract { diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Repeat.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Repeat.java similarity index 91% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Repeat.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Repeat.java index df1bb81bd38..fbd8c1d356c 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Repeat.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Repeat.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import io.helidon.pico.api.InterceptedTrigger; +import io.helidon.inject.api.InterceptedTrigger; /** * Repeat the call twice. diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/RepeatingInterceptor.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/RepeatingInterceptor.java similarity index 89% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/RepeatingInterceptor.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/RepeatingInterceptor.java index 5f66ded6256..506b1e3c3ae 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/RepeatingInterceptor.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/RepeatingInterceptor.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.InvocationException; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.InvocationException; import jakarta.inject.Named; import jakarta.inject.Singleton; -@Named("io.helidon.pico.tests.interception.Repeat") +@Named("io.helidon.inject.tests.interception.Repeat") @Singleton class RepeatingInterceptor implements Interceptor { private static final AtomicReference LAST_CALL = new AtomicReference<>(); diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Return.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Return.java similarity index 91% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Return.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Return.java index 38d76e049b2..623d5a70b15 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/Return.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/Return.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -22,7 +22,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import io.helidon.pico.api.InterceptedTrigger; +import io.helidon.inject.api.InterceptedTrigger; /** * Return an explicit value (do not call target). diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/ReturningInterceptor.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/ReturningInterceptor.java similarity index 90% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/ReturningInterceptor.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/ReturningInterceptor.java index c4c90f9b9de..c338f0b1436 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/ReturningInterceptor.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/ReturningInterceptor.java @@ -14,20 +14,20 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; import jakarta.inject.Named; import jakarta.inject.Singleton; -@Named("io.helidon.pico.tests.interception.Return") +@Named("io.helidon.inject.tests.interception.Return") @Singleton @Weight(Weighted.DEFAULT_WEIGHT + 100) class ReturningInterceptor implements Interceptor { diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/TheOtherService.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/TheOtherService.java similarity index 97% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/TheOtherService.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/TheOtherService.java index f9863ab8f33..ef8a0279756 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/TheOtherService.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/TheOtherService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import jakarta.inject.Singleton; diff --git a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/TheService.java b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/TheService.java similarity index 97% rename from pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/TheService.java rename to inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/TheService.java index 4298e040622..73be46434be 100644 --- a/pico/tests/interception/src/main/java/io/helidon/pico/tests/interception/TheService.java +++ b/inject/tests/interception/src/main/java/io/helidon/inject/tests/interception/TheService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; import jakarta.inject.Singleton; diff --git a/pico/tests/interception/src/test/java/io/helidon/pico/tests/interception/InterceptionTest.java b/inject/tests/interception/src/test/java/io/helidon/inject/tests/interception/InterceptionTest.java similarity index 96% rename from pico/tests/interception/src/test/java/io/helidon/pico/tests/interception/InterceptionTest.java rename to inject/tests/interception/src/test/java/io/helidon/inject/tests/interception/InterceptionTest.java index f8afe65a608..216629abda1 100644 --- a/pico/tests/interception/src/test/java/io/helidon/pico/tests/interception/InterceptionTest.java +++ b/inject/tests/interception/src/test/java/io/helidon/inject/tests/interception/InterceptionTest.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; -import io.helidon.pico.api.InvocationException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.InvocationException; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Services; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -39,14 +39,14 @@ Repeating */ class InterceptionTest { - private static PicoServices picoServices; + private static InjectionServices injectionServices; private static Services services; private static TheService service; @BeforeAll static void init() { - picoServices = PicoServices.picoServices().orElseThrow(); - services = picoServices.services(); + injectionServices = InjectionServices.injectionServices().orElseThrow(); + services = injectionServices.services(); service = services.lookup(TheService.class).get(); assertAll( diff --git a/pico/tests/interception/src/test/java/io/helidon/pico/tests/interception/InterfaceInterceptionTest.java b/inject/tests/interception/src/test/java/io/helidon/inject/tests/interception/InterfaceInterceptionTest.java similarity index 96% rename from pico/tests/interception/src/test/java/io/helidon/pico/tests/interception/InterfaceInterceptionTest.java rename to inject/tests/interception/src/test/java/io/helidon/inject/tests/interception/InterfaceInterceptionTest.java index 18ed46391ec..31d5a2300b8 100644 --- a/pico/tests/interception/src/test/java/io/helidon/pico/tests/interception/InterfaceInterceptionTest.java +++ b/inject/tests/interception/src/test/java/io/helidon/inject/tests/interception/InterfaceInterceptionTest.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.interception; +package io.helidon.inject.tests.interception; -import io.helidon.pico.api.InvocationException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InvocationException; +import io.helidon.inject.api.Services; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -40,14 +40,14 @@ Repeating */ class InterfaceInterceptionTest { - private static PicoServices picoServices; + private static InjectionServices injectionServices; private static Services services; private static OtherContract service; @BeforeAll static void init() { - picoServices = PicoServices.picoServices().orElseThrow(); - services = picoServices.services(); + injectionServices = InjectionServices.injectionServices().orElseThrow(); + services = injectionServices.services(); service = services.lookup(OtherContract.class).get(); assertAll( diff --git a/pico/tests/pom.xml b/inject/tests/pom.xml similarity index 85% rename from pico/tests/pom.xml rename to inject/tests/pom.xml index d960b914e82..8311140fdc0 100644 --- a/pico/tests/pom.xml +++ b/inject/tests/pom.xml @@ -20,17 +20,17 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - io.helidon.pico.tests - helidon-pico-tests-project + io.helidon.inject.tests + helidon-inject-tests-project - Helidon Pico Tests Project + Helidon Injection Tests Project pom @@ -45,7 +45,7 @@ resources-plain - resources-pico + resources-inject tck-jsr330 interception api diff --git a/pico/tests/resources-pico/pom.xml b/inject/tests/resources-inject/pom.xml similarity index 65% rename from pico/tests/resources-pico/pom.xml rename to inject/tests/resources-inject/pom.xml index 7710e267348..4f52e657cd6 100644 --- a/pico/tests/resources-pico/pom.xml +++ b/inject/tests/resources-inject/pom.xml @@ -21,16 +21,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.tests - helidon-pico-tests-project + io.helidon.inject.tests + helidon-inject-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-tests-resources-pico - Helidon Pico Test Pico Resources - a jar that offers contracts and other artifacts and is a native Pico module (e.g., uses Pico APT) + helidon-inject-tests-resources-inject + Helidon Injection Test Injectable Resources + a jar that offers contracts and other artifacts and is a native injection module (e.g., uses injection APT). true @@ -47,20 +47,20 @@ provided - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor provided true - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin provided true - io.helidon.pico.tests - helidon-pico-tests-resources-plain + io.helidon.inject.tests + helidon-inject-tests-resources-plain ${helidon.version} @@ -74,12 +74,12 @@ provided - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test @@ -96,11 +96,11 @@ maven-compiler-plugin - -Apico.autoAddNonContractInterfaces=true - -Apico.allowListedInterceptorAnnotations=io.helidon.pico.tests.pico.interceptor.TestNamed - -Apico.application.pre.create=false - -Apico.mapApplicationToSingletonScope=true - -Apico.debug=${pico.debug} + -Ainject.autoAddNonContractInterfaces=true + -Ainject.allowListedInterceptorAnnotations=io.helidon.inject.tests.inject.interceptor.TestNamed + -Ainject.application.pre.create=false + -Ainject.mapApplicationToSingletonScope=true + -Ainject.debug=${inject.debug} @@ -108,8 +108,8 @@ true - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor ${helidon.version} @@ -118,16 +118,16 @@ ${version.lib.jakarta.cdi-api} - io.helidon.pico.tests - helidon-pico-tests-resources-plain + io.helidon.inject.tests + helidon-inject-tests-resources-plain ${helidon.version} - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin ${helidon.version} @@ -147,16 +147,16 @@ - -Apico.debug=${pico.debug} - -Apico.autoAddNonContractInterfaces=true - -Apico.application.pre.create=false + -Ainject.debug=${inject.debug} + -Ainject.autoAddNonContractInterfaces=true + -Ainject.application.pre.create=false NAMED - io.helidon.pico.tests.pico.provider.MyServices$MyConcreteClassContractPerRequestIPProvider - io.helidon.pico.tests.pico.provider.MyServices$MyConcreteClassContractPerRequestProvider - io.helidon.pico.tests.pico.ASerialProviderImpl - io.helidon.pico.tests.pico.tbox.impl.BladeProvider + io.helidon.inject.tests.inject.provider.MyServices$MyConcreteClassContractPerRequestIPProvider + io.helidon.inject.tests.inject.provider.MyServices$MyConcreteClassContractPerRequestProvider + io.helidon.inject.tests.inject.ASerialProviderImpl + io.helidon.inject.tests.inject.tbox.impl.BladeProvider diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/AContractWithNoServiceImplementations.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/AContractWithNoServiceImplementations.java similarity index 89% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/AContractWithNoServiceImplementations.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/AContractWithNoServiceImplementations.java index 66ddf6efe9c..abbaf9072b2 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/AContractWithNoServiceImplementations.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/AContractWithNoServiceImplementations.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; @Contract interface AContractWithNoServiceImplementations { diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ASerialProviderImpl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ASerialProviderImpl.java similarity index 95% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ASerialProviderImpl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ASerialProviderImpl.java index a88fecc741f..0472470e8c2 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ASerialProviderImpl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ASerialProviderImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import java.io.Serializable; import java.util.concurrent.atomic.AtomicInteger; @@ -26,7 +26,7 @@ import jakarta.inject.Singleton; /** - * Pico Testing. + * Testing. */ @Weight(Weighted.DEFAULT_WEIGHT + 100) @Singleton diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/AServiceUsingAContractWithNoServiceImplementations.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/AServiceUsingAContractWithNoServiceImplementations.java similarity index 96% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/AServiceUsingAContractWithNoServiceImplementations.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/AServiceUsingAContractWithNoServiceImplementations.java index 85c6db63d91..dae6cca5372 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/AServiceUsingAContractWithNoServiceImplementations.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/AServiceUsingAContractWithNoServiceImplementations.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import java.util.List; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ClassNamedX.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ClassNamedX.java similarity index 94% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ClassNamedX.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ClassNamedX.java index 1ae2796d2cb..e3351d10689 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ClassNamedX.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ClassNamedX.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; /** * For Testing. diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ClassNamedY.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ClassNamedY.java similarity index 94% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ClassNamedY.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ClassNamedY.java index 0572dd30201..ada45374422 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/ClassNamedY.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/ClassNamedY.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; /** * For Testing. diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/SomeOtherLocalNonContractInterface1.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/SomeOtherLocalNonContractInterface1.java similarity index 92% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/SomeOtherLocalNonContractInterface1.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/SomeOtherLocalNonContractInterface1.java index d1d504332f7..8ecc32c982d 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/SomeOtherLocalNonContractInterface1.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/SomeOtherLocalNonContractInterface1.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; /** - * Pico Testing. + * Testing. */ public interface SomeOtherLocalNonContractInterface1 { diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/Verification.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/Verification.java similarity index 97% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/Verification.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/Verification.java index deeb7509638..ccb5d23ec9b 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/Verification.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/Verification.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import java.util.List; import java.util.Objects; @@ -23,12 +23,12 @@ import jakarta.inject.Provider; /** - * Pico Testing. + * Testing. */ public abstract class Verification { /** - * Pico Testing. + * Testing. * * @param injectee injectee * @param tag tag @@ -58,7 +58,7 @@ public static void verifyInjected(Optional injectee, } /** - * Pico Testing. + * Testing. * * @param injectee injectee * @param tag tag @@ -94,7 +94,7 @@ public static void verifyInjected(Provider injectee, } /** - * Pico Testing. + * Testing. * * @param injectee injectee * @param tag tag diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/TestNamed.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/TestNamed.java similarity index 84% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/TestNamed.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/TestNamed.java index 6e7ac7adae7..9ff407bfdca 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/TestNamed.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/TestNamed.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.interceptor; +package io.helidon.inject.tests.inject.interceptor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import io.helidon.inject.api.InterceptedTrigger; + /** - * Used as an {@link io.helidon.pico.api.InterceptedTrigger} from the maven-plugin call (see pom.xml). + * Used as an {@link InterceptedTrigger} from the maven-plugin call (see pom.xml). */ //@InterceptedTrigger - intentional decision not to add this in order to avoid standard annotation processing. // it will instead be handled by the maven-plugin diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/XImpl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/XImpl.java similarity index 86% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/XImpl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/XImpl.java index b00128d05c0..27c50b25d53 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/XImpl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/XImpl.java @@ -14,25 +14,26 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.interceptor; +package io.helidon.inject.tests.inject.interceptor; import java.io.Closeable; import java.io.IOException; import java.util.Optional; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.ExternalContracts; -import io.helidon.pico.tests.pico.ClassNamedX; -import io.helidon.pico.tests.plain.interceptor.IA; -import io.helidon.pico.tests.plain.interceptor.IB; -import io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno; +import io.helidon.inject.api.InterceptedTrigger; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.ExternalContracts; +import io.helidon.inject.tests.inject.ClassNamedX; +import io.helidon.inject.tests.plain.interceptor.IA; +import io.helidon.inject.tests.plain.interceptor.IB; +import io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno; import jakarta.inject.Inject; import jakarta.inject.Named; import jakarta.inject.Singleton; /** - * This test case is applying {@link InterceptorBasedAnno} (an {@link io.helidon.pico.api.InterceptedTrigger}) using the no-arg + * This test case is applying {@link InterceptorBasedAnno} (an {@link InterceptedTrigger}) using the no-arg * constructor approach - all methods are intercepted. *

      * Also note that interception was triggered by the presence of the {@link TestNamed} and {@link InterceptorBasedAnno} triggers. diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/YImpl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/YImpl.java similarity index 85% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/YImpl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/YImpl.java index f09423ad305..8b37488da93 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/interceptor/YImpl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/interceptor/YImpl.java @@ -14,25 +14,26 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.interceptor; +package io.helidon.inject.tests.inject.interceptor; import java.io.Closeable; import java.io.IOException; import java.util.Optional; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.ExternalContracts; -import io.helidon.pico.tests.pico.ClassNamedY; -import io.helidon.pico.tests.plain.interceptor.IA; -import io.helidon.pico.tests.plain.interceptor.IB; -import io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno; +import io.helidon.inject.api.InterceptedTrigger; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.ExternalContracts; +import io.helidon.inject.tests.inject.ClassNamedY; +import io.helidon.inject.tests.plain.interceptor.IA; +import io.helidon.inject.tests.plain.interceptor.IB; +import io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno; import jakarta.inject.Inject; import jakarta.inject.Named; import jakarta.inject.Singleton; /** - * This test case is applying {@link InterceptorBasedAnno} (an {@link io.helidon.pico.api.InterceptedTrigger}) on only + * This test case is applying {@link InterceptorBasedAnno} (an {@link InterceptedTrigger}) on only * the {@link IB} interface. *

      * Also note that interception was triggered by the presence of the {@link InterceptorBasedAnno} trigger. diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/package-info.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/package-info.java similarity index 92% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/package-info.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/package-info.java index b8882068d9d..b2f12157da4 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/package-info.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/package-info.java @@ -15,6 +15,6 @@ */ /** - * Pico Testing. + * Testing. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/FakeConfig.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/FakeConfig.java similarity index 90% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/FakeConfig.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/FakeConfig.java index e4b4a2a162d..1877c9aa856 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/FakeConfig.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/FakeConfig.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.provider; +package io.helidon.inject.tests.inject.provider; import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.tests.pico.tbox.Preferred; +import io.helidon.inject.tests.inject.tbox.Preferred; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/FakeServer.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/FakeServer.java similarity index 90% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/FakeServer.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/FakeServer.java index a3141c6fd7c..ffacc4e0191 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/FakeServer.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/FakeServer.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.provider; +package io.helidon.inject.tests.inject.provider; -import io.helidon.pico.tests.pico.tbox.Preferred; +import io.helidon.inject.tests.inject.tbox.Preferred; import jakarta.inject.Inject; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/MyConcreteClassContract.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/MyConcreteClassContract.java similarity index 94% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/MyConcreteClassContract.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/MyConcreteClassContract.java index f7698c91854..8ff82080929 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/MyConcreteClassContract.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/MyConcreteClassContract.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.provider; +package io.helidon.inject.tests.inject.provider; public class MyConcreteClassContract { diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/MyServices.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/MyServices.java similarity index 93% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/MyServices.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/MyServices.java index b918cca630d..5ad3b101c89 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/provider/MyServices.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/provider/MyServices.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.provider; +package io.helidon.inject.tests.inject.provider; import java.util.Objects; import java.util.Optional; import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointProvider; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointProvider; import jakarta.annotation.PostConstruct; import jakarta.inject.Inject; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/Intercepted.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/Intercepted.java similarity index 94% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/Intercepted.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/Intercepted.java index d9a4679eed1..4f4c33ace21 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/Intercepted.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/Intercepted.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.stacking; +package io.helidon.inject.tests.inject.stacking; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; @Contract //@MyCompileTimeInheritableTestQualifier(value = "interface", extendedValue = "ev interface") diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/InterceptedImpl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/InterceptedImpl.java similarity index 94% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/InterceptedImpl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/InterceptedImpl.java index 60b123c90d3..cf81b190136 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/InterceptedImpl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/InterceptedImpl.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.stacking; +package io.helidon.inject.tests.inject.stacking; import java.util.Optional; import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.api.RunLevel; +import io.helidon.inject.api.RunLevel; import jakarta.inject.Inject; import jakarta.inject.Named; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/MostOuterInterceptedImpl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/MostOuterInterceptedImpl.java similarity index 95% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/MostOuterInterceptedImpl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/MostOuterInterceptedImpl.java index 8bfd1c1f0a6..018fa8265ae 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/MostOuterInterceptedImpl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/MostOuterInterceptedImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.stacking; +package io.helidon.inject.tests.inject.stacking; import java.util.Optional; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/OuterInterceptedImpl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/OuterInterceptedImpl.java similarity index 95% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/OuterInterceptedImpl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/OuterInterceptedImpl.java index 301fe3bc73b..faf2ef45c6c 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/stacking/OuterInterceptedImpl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/stacking/OuterInterceptedImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.stacking; +package io.helidon.inject.tests.inject.stacking; import java.util.Optional; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/AbstractBlade.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/AbstractBlade.java similarity index 89% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/AbstractBlade.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/AbstractBlade.java index a478a72bbb1..845fabf4119 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/AbstractBlade.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/AbstractBlade.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; -import io.helidon.pico.api.OptionallyNamed; +import io.helidon.inject.api.OptionallyNamed; import jakarta.inject.Inject; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/AbstractSaw.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/AbstractSaw.java similarity index 96% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/AbstractSaw.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/AbstractSaw.java index 97f77fa8c54..d190a0dd0a1 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/AbstractSaw.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/AbstractSaw.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; import java.util.List; import java.util.Optional; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.tests.pico.Verification; -import io.helidon.pico.tests.pico.tbox.impl.DullBlade; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.tests.inject.tbox.impl.DullBlade; +import io.helidon.inject.tests.inject.Verification; import jakarta.inject.Inject; import jakarta.inject.Provider; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Awl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Awl.java similarity index 87% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Awl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Awl.java index 87ef5b993d2..5703628aa13 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Awl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Awl.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** - * Pico Testing. + * Testing. */ @Contract public interface Awl extends Tool { diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Hammer.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Hammer.java similarity index 84% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Hammer.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Hammer.java index d45883927fc..829285dd1d4 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Hammer.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Hammer.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; -import io.helidon.pico.api.Contract; -import io.helidon.pico.api.OptionallyNamed; +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.OptionallyNamed; /** - * Pico Testing. + * Testing. */ @Contract public interface Hammer extends Tool, OptionallyNamed { diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Lubricant.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Lubricant.java similarity index 92% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Lubricant.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Lubricant.java index 0b727e6b81f..b28e40826f0 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Lubricant.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Lubricant.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; /** - * Pico Testing. + * Testing. */ // @Singleton -- intentionally not declared to be a contract public interface Lubricant { diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Preferred.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Preferred.java similarity index 94% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Preferred.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Preferred.java index c1e58b08a7a..8f3b80ea0ce 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Preferred.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Preferred.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; import java.lang.annotation.Documented; import java.lang.annotation.Retention; @@ -31,7 +31,7 @@ public @interface Preferred { /** - * Pico Testing. + * Testing. * * @return for testing */ diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/TableSaw.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/TableSaw.java similarity index 96% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/TableSaw.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/TableSaw.java index 0db831fe916..9cba413c263 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/TableSaw.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/TableSaw.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; import java.util.List; import java.util.Optional; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.tests.pico.tbox.impl.CoarseBlade; -import io.helidon.pico.tests.pico.tbox.impl.DullBlade; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.tests.inject.tbox.impl.CoarseBlade; +import io.helidon.inject.tests.inject.tbox.impl.DullBlade; import jakarta.inject.Inject; import jakarta.inject.Named; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Tool.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Tool.java similarity index 83% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Tool.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Tool.java index f029fb7e8a3..f4e147d273b 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/Tool.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/Tool.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; -import io.helidon.pico.api.Contract; -import io.helidon.pico.api.OptionallyNamed; +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.OptionallyNamed; /** - * Pico Testing. + * Testing. */ @Contract public interface Tool extends OptionallyNamed { /** - * Pico Testing. + * Testing. * * @return for testing */ diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/ToolBox.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/ToolBox.java similarity index 86% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/ToolBox.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/ToolBox.java index 0588364dec5..1e0c673fe18 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/ToolBox.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/ToolBox.java @@ -14,29 +14,29 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; import java.util.List; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; import jakarta.inject.Provider; /** - * Pico Testing. + * Testing. */ @Contract public interface ToolBox { /** - * Pico Testing. + * Testing. * * @return for testing */ List> toolsInBox(); /** - * Pico Testing. + * Testing. * * @return for testing */ diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/AwlImpl.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/AwlImpl.java similarity index 86% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/AwlImpl.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/AwlImpl.java index e8f9cf13c75..60e6cb14a91 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/AwlImpl.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/AwlImpl.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.Optional; -import io.helidon.pico.api.OptionallyNamed; -import io.helidon.pico.tests.pico.tbox.Awl; +import io.helidon.inject.api.OptionallyNamed; +import io.helidon.inject.tests.inject.tbox.Awl; import jakarta.inject.Inject; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/BigHammer.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/BigHammer.java similarity index 87% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/BigHammer.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/BigHammer.java index 4078af86854..7ab7fcd6144 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/BigHammer.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/BigHammer.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.Optional; import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.tests.pico.tbox.Hammer; -import io.helidon.pico.tests.pico.tbox.Preferred; +import io.helidon.inject.tests.inject.tbox.Hammer; +import io.helidon.inject.tests.inject.tbox.Preferred; import jakarta.inject.Named; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/BladeProvider.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/BladeProvider.java similarity index 90% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/BladeProvider.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/BladeProvider.java index b944015cac2..1a119f58308 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/BladeProvider.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/BladeProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.ArrayList; import java.util.List; @@ -22,11 +22,11 @@ import java.util.Optional; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.tests.pico.tbox.AbstractBlade; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.tests.inject.tbox.AbstractBlade; import jakarta.inject.Named; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/CoarseBlade.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/CoarseBlade.java similarity index 89% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/CoarseBlade.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/CoarseBlade.java index b0e497b115f..3af86f148b1 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/CoarseBlade.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/CoarseBlade.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.Optional; -import io.helidon.pico.tests.pico.tbox.AbstractBlade; +import io.helidon.inject.tests.inject.tbox.AbstractBlade; import jakarta.inject.Named; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/DullBlade.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/DullBlade.java similarity index 89% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/DullBlade.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/DullBlade.java index 37351bec29b..329c8ae2b96 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/DullBlade.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/DullBlade.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.Optional; -import io.helidon.pico.tests.pico.tbox.AbstractBlade; +import io.helidon.inject.tests.inject.tbox.AbstractBlade; /** * When a particular blade name is not "asked for" explicitly then we give out a dull blade. diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/FineBlade.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/FineBlade.java similarity index 89% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/FineBlade.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/FineBlade.java index d8d5f55ccf5..d9c9506fb2e 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/FineBlade.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/FineBlade.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.Optional; -import io.helidon.pico.tests.pico.tbox.AbstractBlade; +import io.helidon.inject.tests.inject.tbox.AbstractBlade; import jakarta.inject.Named; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/HandSaw.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/HandSaw.java similarity index 77% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/HandSaw.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/HandSaw.java index e5c411cf4e6..e7823d463de 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/HandSaw.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/HandSaw.java @@ -14,19 +14,20 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.List; import java.util.Optional; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.tests.pico.tbox.AbstractBlade; -import io.helidon.pico.tests.pico.tbox.AbstractSaw; -import io.helidon.pico.tests.pico.tbox.Lubricant; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.tests.inject.Verification; +import io.helidon.inject.tests.inject.tbox.AbstractBlade; +import io.helidon.inject.tests.inject.tbox.AbstractSaw; +import io.helidon.inject.tests.inject.tbox.Lubricant; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -105,25 +106,25 @@ void setAllBlades(@Named("*") List> blades) { @Override public void verifyState() { - verifyInjected(ctorInjectedLubricantInSubClass, getClass() + Verification.verifyInjected(ctorInjectedLubricantInSubClass, getClass() + "." + InjectionPointInfo.CONSTRUCTOR, null, false, null); - verifyInjected(setterInjectedLubricantInSubClass, getClass() + Verification.verifyInjected(setterInjectedLubricantInSubClass, getClass() + ".injectLubricant(Optional lubricant)", setterInjectedLubricantInSubClassInjectedCount, false, null); - verifyInjected(fineBladeFieldInjectedPkgPrivateProviderInSubClass, getClass() + Verification.verifyInjected(fineBladeFieldInjectedPkgPrivateProviderInSubClass, getClass() + ".fineBladeFieldInjectedPkgPrivateProviderInSubClass", null, true, FineBlade.class); - verifyInjected(fineBladeFieldInjectedPkgPrivateOptionalInSubClass, getClass() + + Verification.verifyInjected(fineBladeFieldInjectedPkgPrivateOptionalInSubClass, getClass() + ".fineBladeFieldInjectedPkgPrivateOptionalInSubClass", null, true, FineBlade.class); - verifyInjected(fineBladeFieldInjectedPkgPrivateListInSubClass, getClass() + + Verification.verifyInjected(fineBladeFieldInjectedPkgPrivateListInSubClass, getClass() + ".fineBladeFieldInjectedPkgPrivateListInSubClass", null, 1, FineBlade.class); - verifyInjected(setterInjectedPkgPrivateProviderInSubClass, getClass() + - ".setBladeProvider(Provider blade)", setterInjectedPkgPrivateProviderInSubClassInjectedCount, true, DullBlade.class); - verifyInjected(setterInjectedPkgPrivateOptionalInSubClass, getClass() + + Verification.verifyInjected(setterInjectedPkgPrivateProviderInSubClass, getClass() + + ".setBladeProvider(Provider blade)", setterInjectedPkgPrivateProviderInSubClassInjectedCount, true, DullBlade.class); + Verification.verifyInjected(setterInjectedPkgPrivateOptionalInSubClass, getClass() + ".setBladeOptional(Optional blade)", setterInjectedPkgPrivateOptionalInSubClassInjectedCount, true, DullBlade.class); - verifyInjected(setterInjectedPkgPrivateListInSubClass, getClass() + + Verification.verifyInjected(setterInjectedPkgPrivateListInSubClass, getClass() + ".setBladeList(List blades)", setterInjectedPkgPrivateListInSubClassInjectedCount, 1, AbstractBlade.class); - verifyInjected(setterInjectedAllProviderListInSubClass, getClass() + + Verification.verifyInjected(setterInjectedAllProviderListInSubClass, getClass() + ".setAllBlades(List blades)", setterInjectedAllProviderListInSubClassInjectedCount, 1, ServiceProvider.class); List blades = setterInjectedAllProviderListInSubClass.get(0) .list(ContextualServiceQuery.builder() @@ -131,7 +132,7 @@ public void verifyState() { .addContractImplemented(AbstractBlade.class) .build()) .build()); - verifyInjected(blades, getClass() + + Verification.verifyInjected(blades, getClass() + "", null, 3, AbstractBlade.class); super.verifyState(); diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/LittleHammer.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/LittleHammer.java similarity index 90% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/LittleHammer.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/LittleHammer.java index c56cda7c58b..3ff2b44d8bf 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/LittleHammer.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/LittleHammer.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.Optional; -import io.helidon.pico.tests.pico.tbox.Hammer; +import io.helidon.inject.tests.inject.tbox.Hammer; import jakarta.inject.Named; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/MainToolBox.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/MainToolBox.java similarity index 91% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/MainToolBox.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/MainToolBox.java index 061bacabe74..019cadd4646 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/MainToolBox.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/MainToolBox.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.List; import java.util.Objects; -import io.helidon.pico.tests.pico.tbox.Hammer; -import io.helidon.pico.tests.pico.tbox.Preferred; -import io.helidon.pico.tests.pico.tbox.Tool; -import io.helidon.pico.tests.pico.tbox.ToolBox; +import io.helidon.inject.tests.inject.tbox.Hammer; +import io.helidon.inject.tests.inject.tbox.Preferred; +import io.helidon.inject.tests.inject.tbox.Tool; +import io.helidon.inject.tests.inject.tbox.ToolBox; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/Screwdriver.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/Screwdriver.java similarity index 84% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/Screwdriver.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/Screwdriver.java index 4620c96a90f..e804d53637d 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/Screwdriver.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/Screwdriver.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.io.Serializable; import java.util.Optional; -import io.helidon.pico.tests.pico.SomeOtherLocalNonContractInterface1; -import io.helidon.pico.tests.pico.tbox.Tool; +import io.helidon.inject.tests.inject.SomeOtherLocalNonContractInterface1; +import io.helidon.inject.tests.inject.tbox.Tool; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/SledgeHammer.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/SledgeHammer.java similarity index 91% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/SledgeHammer.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/SledgeHammer.java index 7bf59429437..0d6ffacef41 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/SledgeHammer.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/SledgeHammer.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox.impl; +package io.helidon.inject.tests.inject.tbox.impl; import java.util.Optional; import io.helidon.common.Weight; import io.helidon.common.Weighted; -import io.helidon.pico.tests.pico.tbox.Hammer; +import io.helidon.inject.tests.inject.tbox.Hammer; import jakarta.inject.Singleton; diff --git a/pico/runtime/src/main/java/io/helidon/pico/runtime/package-info.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/package-info.java similarity index 90% rename from pico/runtime/src/main/java/io/helidon/pico/runtime/package-info.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/package-info.java index 5bf3afd8fca..37d5e11a505 100644 --- a/pico/runtime/src/main/java/io/helidon/pico/runtime/package-info.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/impl/package-info.java @@ -15,6 +15,6 @@ */ /** - * Pico runtime services. + * Testing. */ -package io.helidon.pico.runtime; +package io.helidon.inject.tests.inject.tbox.impl; diff --git a/pico/testing/src/main/java/io/helidon/pico/testing/package-info.java b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/package-info.java similarity index 91% rename from pico/testing/src/main/java/io/helidon/pico/testing/package-info.java rename to inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/package-info.java index 1db9110bd6a..b2d2ad32ac7 100644 --- a/pico/testing/src/main/java/io/helidon/pico/testing/package-info.java +++ b/inject/tests/resources-inject/src/main/java/io/helidon/inject/tests/inject/tbox/package-info.java @@ -15,6 +15,6 @@ */ /** - * Pico testing support. + * Testing. */ -package io.helidon.pico.testing; +package io.helidon.inject.tests.inject.tbox; diff --git a/pico/tests/resources-pico/src/main/java/module-info.java b/inject/tests/resources-inject/src/main/java/module-info.java similarity index 61% rename from pico/tests/resources-pico/src/main/java/module-info.java rename to inject/tests/resources-inject/src/main/java/module-info.java index a5fe93b31bb..4d2160b4ae0 100644 --- a/pico/tests/resources-pico/src/main/java/module-info.java +++ b/inject/tests/resources-inject/src/main/java/module-info.java @@ -15,23 +15,23 @@ */ /** - * Pico Test Resources. + * Injection Test Resources. */ -module io.helidon.pico.tests.pico { +module io.helidon.inject.tests.inject { requires static jakarta.inject; requires static jakarta.annotation; requires io.helidon.common.types; requires io.helidon.common; - requires io.helidon.pico.api; - requires io.helidon.pico.runtime; - requires io.helidon.pico.tests.plain; + requires io.helidon.inject.api; + requires io.helidon.inject.runtime; + requires io.helidon.inject.tests.plain; requires io.helidon.config; - exports io.helidon.pico.tests.pico; - exports io.helidon.pico.tests.pico.interceptor; - exports io.helidon.pico.tests.pico.stacking; - exports io.helidon.pico.tests.pico.tbox; + exports io.helidon.inject.tests.inject; + exports io.helidon.inject.tests.inject.interceptor; + exports io.helidon.inject.tests.inject.stacking; + exports io.helidon.inject.tests.inject.tbox; - provides io.helidon.pico.api.ModuleComponent with io.helidon.pico.tests.pico.Pico$$Module; + provides io.helidon.inject.api.ModuleComponent with io.helidon.inject.tests.inject.Injection$$Module; } diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/AnApplicationScopedService.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/AnApplicationScopedService.java similarity index 96% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/AnApplicationScopedService.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/AnApplicationScopedService.java index a3263da7857..cac80cc3abd 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/AnApplicationScopedService.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/AnApplicationScopedService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.Default; diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/EmptyListInjectionTest.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/EmptyListInjectionTest.java similarity index 79% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/EmptyListInjectionTest.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/EmptyListInjectionTest.java index 96ebf5b69da..9d81821dd87 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/EmptyListInjectionTest.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/EmptyListInjectionTest.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import io.helidon.config.Config; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.basicTestableConfig; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.basicTestableConfig; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/JavaxTest.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/JavaxTest.java similarity index 78% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/JavaxTest.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/JavaxTest.java index d0fa83f4e0f..7029ac8940c 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/JavaxTest.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/JavaxTest.java @@ -14,22 +14,23 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import io.helidon.config.Config; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.tools.TypeNames; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.tools.Options; +import io.helidon.inject.tools.TypeNames; import jakarta.enterprise.inject.Default; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.basicTestableConfig; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.basicTestableConfig; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; @@ -54,7 +55,7 @@ void tearDown() { } /** - * Uses {@link io.helidon.pico.tools.Options#TAG_MAP_APPLICATION_TO_SINGLETON_SCOPE}. + * Uses {@link Options#TAG_MAP_APPLICATION_TO_SINGLETON_SCOPE}. * This also verifies that the qualifiers were mapped over properly from javax as well. */ @Test diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/TestUtils.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/TestUtils.java similarity index 89% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/TestUtils.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/TestUtils.java index 0883ab9b2c5..c1fc0a347fb 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/TestUtils.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/TestUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import java.io.IOException; import java.io.InputStream; @@ -22,7 +22,7 @@ import java.nio.file.Files; import java.nio.file.Path; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.ToolsException; /** * Testing utilities. @@ -50,11 +50,11 @@ public static String loadStringFromResource(String resourceNamePath) { } /** - * Loads a String from a file, wrapping any exception encountered to a {@link io.helidon.pico.tools.ToolsException}. + * Loads a String from a file, wrapping any exception encountered to a {@link ToolsException}. * * @param fileName the file name to load * @return the contents of the file - * @throws io.helidon.pico.tools.ToolsException if there were any exceptions encountered + * @throws ToolsException if there were any exceptions encountered */ // same as from CommonUtils. public static String loadStringFromFile(String fileName) { diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/TestingSingleton.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/TestingSingleton.java similarity index 86% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/TestingSingleton.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/TestingSingleton.java index f1f58a88947..df8ef4d18c7 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/TestingSingleton.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/TestingSingleton.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico; +package io.helidon.inject.tests.inject; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.tests.pico.stacking.Intercepted; -import io.helidon.pico.tests.pico.stacking.InterceptedImpl; -import io.helidon.pico.tests.pico.tbox.Awl; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.tests.inject.stacking.Intercepted; +import io.helidon.inject.tests.inject.stacking.InterceptedImpl; +import io.helidon.inject.tests.inject.tbox.Awl; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/interceptor/InterceptorRuntimeTest.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/interceptor/InterceptorRuntimeTest.java similarity index 76% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/interceptor/InterceptorRuntimeTest.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/interceptor/InterceptorRuntimeTest.java index c2c37272da2..fb6c74d2dc9 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/interceptor/InterceptorRuntimeTest.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/interceptor/InterceptorRuntimeTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.interceptor; +package io.helidon.inject.tests.inject.interceptor; import java.io.Closeable; import java.io.File; @@ -26,18 +26,18 @@ import io.helidon.common.types.TypeName; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.testing.ReflectionBasedSingletonServiceProvider; -import io.helidon.pico.tests.pico.ClassNamedY; -import io.helidon.pico.tests.plain.interceptor.IB; -import io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno; -import io.helidon.pico.tests.plain.interceptor.TestNamedInterceptor; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.testing.ReflectionBasedSingletonServiceProvider; +import io.helidon.inject.tests.inject.ClassNamedY; +import io.helidon.inject.tests.plain.interceptor.IB; +import io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno; +import io.helidon.inject.tests.plain.interceptor.TestNamedInterceptor; import jakarta.inject.Named; import org.junit.jupiter.api.AfterEach; @@ -45,16 +45,16 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import static io.helidon.pico.api.Qualifier.create; -import static io.helidon.pico.api.Qualifier.createNamed; -import static io.helidon.pico.testing.PicoTestingSupport.basicTestableConfig; -import static io.helidon.pico.testing.PicoTestingSupport.bind; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; -import static io.helidon.pico.testing.PicoTestingSupport.toDescription; -import static io.helidon.pico.testing.PicoTestingSupport.toDescriptions; -import static io.helidon.pico.tests.pico.TestUtils.loadStringFromResource; -import static io.helidon.pico.tools.TypeTools.toFilePath; +import static io.helidon.inject.api.Qualifier.create; +import static io.helidon.inject.api.Qualifier.createNamed; +import static io.helidon.inject.testing.InjectionTestingSupport.basicTestableConfig; +import static io.helidon.inject.testing.InjectionTestingSupport.bind; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.toDescription; +import static io.helidon.inject.testing.InjectionTestingSupport.toDescriptions; +import static io.helidon.inject.tests.inject.TestUtils.loadStringFromResource; +import static io.helidon.inject.tools.TypeTools.toFilePath; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -65,7 +65,7 @@ class InterceptorRuntimeTest { Config config = basicTestableConfig(); - PicoServices picoServices; + InjectionServices injectionServices; Services services; @BeforeEach @@ -74,8 +74,8 @@ void setUp() { } void setUp(Config config) { - this.picoServices = testableServices(config); - this.services = picoServices.services(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @AfterEach @@ -85,7 +85,7 @@ void tearDown() { @Test void createNoArgBasedInterceptorSource() throws Exception { - TypeName interceptorTypeName = TypeName.create(XImpl$$Pico$$Interceptor.class); + TypeName interceptorTypeName = TypeName.create(XImpl$$Injection$$Interceptor.class); String path = toFilePath(interceptorTypeName); File file = new File("./target/generated-sources/annotations", path); assertThat(file.exists(), is(true)); @@ -97,7 +97,7 @@ void createNoArgBasedInterceptorSource() throws Exception { @Disabled // will be handled in https://github.com/helidon-io/helidon/issues/6542 @Test void createInterfaceBasedInterceptorSource() throws Exception { - TypeName interceptorTypeName = TypeName.create(YImpl$$Pico$$Interceptor.class); + TypeName interceptorTypeName = TypeName.create(YImpl$$Injection$$Interceptor.class); String path = toFilePath(interceptorTypeName); File file = new File("./target/generated-sources/annotations", path); assertThat(file.exists(), is(true)); @@ -115,7 +115,7 @@ void runtimeWithNoInterception() throws Exception { List> closeableProviders = services.lookupAll(criteria); assertThat("the interceptors should always be weighted higher than the non-interceptors", toDescriptions(closeableProviders), - contains("XImpl$$Pico$$Interceptor:INIT", "YImpl$$Pico$$Interceptor:INIT", + contains("XImpl$$Injection$$Interceptor:INIT", "YImpl$$Injection$$Interceptor:INIT", "XImpl:INIT", "YImpl:INIT")); criteria = ServiceInfoCriteria.builder() @@ -125,7 +125,7 @@ void runtimeWithNoInterception() throws Exception { closeableProviders = services.lookupAll(criteria); assertThat("the interceptors should always be weighted higher than the non-interceptors", toDescriptions(closeableProviders), - contains("XImpl$$Pico$$Interceptor:INIT", "YImpl$$Pico$$Interceptor:INIT")); + contains("XImpl$$Injection$$Interceptor:INIT", "YImpl$$Injection$$Interceptor:INIT")); List> ibProviders = services.lookupAll(IB.class); assertThat(closeableProviders, @@ -149,7 +149,7 @@ void runtimeWithNoInterception() throws Exception { equalTo("methodY")); assertThat(x.methodZ(), equalTo("methodZ")); - PicoException pe = assertThrows(PicoException.class, x::close); + InjectionException pe = assertThrows(InjectionException.class, x::close); assertThat("the error handling should be the same if there are interceptors or not", pe.getMessage(), equalTo("Error in interceptor chain processing: service provider: XImpl:ACTIVE")); @@ -166,7 +166,7 @@ void runtimeWithNoInterception() throws Exception { .qualifiers(Set.of(create(Named.class, ClassNamedY.class.getName()))) .build()); assertThat(toDescription(yimplProvider), - equalTo("YImpl$$Pico$$Interceptor:INIT")); + equalTo("YImpl$$Injection$$Interceptor:INIT")); IB ibOnYInterceptor = (IB) yimplProvider.get(); sval = ibOnYInterceptor.methodIB2("test"); assertThat(sval, @@ -178,16 +178,16 @@ void runtimeWithInterception() throws Exception { // disable application and modules to effectively start with an empty registry Config config = Config.builder( ConfigSources.create( - Map.of("pico.permits-dynamic", "true", - "pico.uses-compile-time-applications", "false", - "pico.uses-compile-time-modules", "true"), + Map.of("inject.permits-dynamic", "true", + "inject.uses-compile-time-applications", "false", + "inject.uses-compile-time-modules", "true"), "config-1")) .disableEnvironmentVariablesSource() .disableSystemPropertiesSource() .build(); tearDown(); setUp(config); - bind(picoServices, ReflectionBasedSingletonServiceProvider + bind(injectionServices, ReflectionBasedSingletonServiceProvider .create(TestNamedInterceptor.class, ServiceInfo.builder() .serviceTypeName(TestNamedInterceptor.class) @@ -198,10 +198,10 @@ void runtimeWithInterception() throws Exception { assertThat(TestNamedInterceptor.ctorCount.get(), equalTo(0)); - List> closeableProviders = picoServices.services().lookupAll(Closeable.class); + List> closeableProviders = injectionServices.services().lookupAll(Closeable.class); assertThat("the interceptors should always be weighted higher than the non-interceptors", toDescriptions(closeableProviders), - contains("XImpl$$Pico$$Interceptor:INIT", "YImpl$$Pico$$Interceptor:INIT")); + contains("XImpl$$Injection$$Interceptor:INIT", "YImpl$$Injection$$Interceptor:INIT")); List> ibProviders = services.lookupAll(IB.class); assertThat(closeableProviders, @@ -230,7 +230,7 @@ void runtimeWithInterception() throws Exception { equalTo("intercepted:methodY")); assertThat(xIntercepted.methodZ(), equalTo("intercepted:methodZ")); - PicoException pe = assertThrows(PicoException.class, xIntercepted::close); + InjectionException pe = assertThrows(InjectionException.class, xIntercepted::close); assertThat(pe.getMessage(), equalTo("forced: service provider: XImpl:ACTIVE")); RuntimeException re = assertThrows(RuntimeException.class, xIntercepted::throwRuntimeException); @@ -248,7 +248,7 @@ void runtimeWithInterception() throws Exception { .qualifiers(Set.of(create(Named.class, ClassNamedY.class.getName()))) .build()); assertThat(toDescription(yimplProvider), - equalTo("YImpl$$Pico$$Interceptor:INIT")); + equalTo("YImpl$$Injection$$Interceptor:INIT")); IB ibOnYInterceptor = (IB) yimplProvider.get(); sval = ibOnYInterceptor.methodIB2("test"); assertThat(sval, diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/provider/PerRequestProviderTest.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/provider/PerRequestProviderTest.java similarity index 75% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/provider/PerRequestProviderTest.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/provider/PerRequestProviderTest.java index c6326ef2364..5b9f8964a4a 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/provider/PerRequestProviderTest.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/provider/PerRequestProviderTest.java @@ -14,27 +14,27 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.provider; +package io.helidon.inject.tests.inject.provider; import io.helidon.config.Config; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.testing.PicoTestingSupport; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.testing.InjectionTestingSupport; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; class PerRequestProviderTest { - Config config = PicoTestingSupport.basicTestableConfig(); - PicoServices picoServices; + Config config = InjectionTestingSupport.basicTestableConfig(); + InjectionServices injectionServices; Services services; @BeforeEach @@ -43,8 +43,8 @@ void setUp() { } void setUp(Config config) { - this.picoServices = testableServices(config); - this.services = picoServices.services(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @AfterEach diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/stacking/InterceptorStackingTest.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/stacking/InterceptorStackingTest.java similarity index 81% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/stacking/InterceptorStackingTest.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/stacking/InterceptorStackingTest.java index 51b71bc8565..e7c86b2ab5b 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/stacking/InterceptorStackingTest.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/stacking/InterceptorStackingTest.java @@ -14,30 +14,30 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.stacking; +package io.helidon.inject.tests.inject.stacking; import java.util.List; import io.helidon.config.Config; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.testing.PicoTestingSupport; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.testing.InjectionTestingSupport; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; class InterceptorStackingTest { - Config config = PicoTestingSupport.basicTestableConfig(); - PicoServices picoServices; + Config config = InjectionTestingSupport.basicTestableConfig(); + InjectionServices injectionServices; Services services; @BeforeEach @@ -46,8 +46,8 @@ void setUp() { } void setUp(Config config) { - this.picoServices = testableServices(config); - this.services = picoServices.services(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @AfterEach diff --git a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/tbox/ToolBoxTest.java b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/tbox/ToolBoxTest.java similarity index 74% rename from pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/tbox/ToolBoxTest.java rename to inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/tbox/ToolBoxTest.java index 3eaaa364db1..41405dc6060 100644 --- a/pico/tests/resources-pico/src/test/java/io/helidon/pico/tests/pico/tbox/ToolBoxTest.java +++ b/inject/tests/resources-inject/src/test/java/io/helidon/inject/tests/inject/tbox/ToolBoxTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tests.inject.tbox; import java.io.Serializable; import java.util.List; @@ -24,34 +24,37 @@ import io.helidon.common.types.TypeName; import io.helidon.config.Config; -import io.helidon.pico.api.ActivationResult; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.testing.PicoTestingSupport; -import io.helidon.pico.tests.pico.ASerialProviderImpl; -import io.helidon.pico.tests.pico.ClassNamedY; -import io.helidon.pico.tests.pico.TestingSingleton; -import io.helidon.pico.tests.pico.provider.FakeConfig; -import io.helidon.pico.tests.pico.provider.FakeServer; -import io.helidon.pico.tests.pico.stacking.Intercepted; -import io.helidon.pico.tests.pico.tbox.impl.BigHammer; -import io.helidon.pico.tests.pico.tbox.impl.MainToolBox; +import io.helidon.inject.api.ActivationResult; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.testing.InjectionTestingSupport; +import io.helidon.inject.tests.inject.tbox.impl.BigHammer; +import io.helidon.inject.tests.inject.tbox.impl.HandSaw; +import io.helidon.inject.tests.inject.ASerialProviderImpl; +import io.helidon.inject.tests.inject.ClassNamedY; +import io.helidon.inject.tests.inject.TestingSingleton; +import io.helidon.inject.tests.inject.provider.FakeConfig; +import io.helidon.inject.tests.inject.provider.FakeServer; +import io.helidon.inject.tests.inject.stacking.Intercepted; +import io.helidon.inject.tests.inject.tbox.impl.MainToolBox; +import io.helidon.inject.tools.Options; import jakarta.inject.Provider; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; -import static io.helidon.pico.tests.pico.TestUtils.loadStringFromFile; -import static io.helidon.pico.tests.pico.TestUtils.loadStringFromResource; +import static io.helidon.common.types.TypeName.*; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; +import static io.helidon.inject.tests.inject.TestUtils.loadStringFromFile; +import static io.helidon.inject.tests.inject.TestUtils.loadStringFromResource; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; @@ -64,11 +67,11 @@ import static org.junit.jupiter.api.Assertions.assertThrows; /** - * Expectation here is that the annotation processor ran, and we can use standard injection and pico-di registry services, etc. + * Expectation here is that the annotation processor ran, and we can use standard injection and di registry services, etc. */ class ToolBoxTest { - Config config = PicoTestingSupport.basicTestableConfig(); - PicoServices picoServices; + Config config = InjectionTestingSupport.basicTestableConfig(); + InjectionServices injectionServices; Services services; @BeforeEach @@ -77,8 +80,8 @@ void setUp() { } void setUp(Config config) { - this.picoServices = testableServices(config); - this.services = picoServices.services(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @AfterEach @@ -88,7 +91,7 @@ void tearDown() { @Test void sanity() { - assertNotNull(picoServices); + assertNotNull(injectionServices); assertNotNull(services); } @@ -153,7 +156,7 @@ void testClasses() { } /** - * This assumes {@link io.helidon.pico.tools.Options#TAG_AUTO_ADD_NON_CONTRACT_INTERFACES} has + * This assumes {@link Options#TAG_AUTO_ADD_NON_CONTRACT_INTERFACES} has * been enabled - see pom.xml */ @Test @@ -179,32 +182,32 @@ void modules() { List> allModules = services.lookupAll(ModuleComponent.class); List desc = allModules.stream().map(ServiceProvider::description).collect(Collectors.toList()); // note that order matters here - // there is now config pico module as active as well + // there is now config module as active as well assertThat("ensure that Annotation Processors are enabled in the tools module meta-inf/services", - desc, contains("Pico$$Module:ACTIVE", "Pico$$Module:ACTIVE", "Pico$$TestModule:ACTIVE")); + desc, contains("Injection$$Module:ACTIVE", "Injection$$Module:ACTIVE", "Injection$$TestModule:ACTIVE")); List names = allModules.stream() .sorted() .map(m -> m.get().named().orElse(m.get().getClass().getSimpleName() + ":null")).collect(Collectors.toList()); assertThat(names, - contains("io.helidon.config", "io.helidon.pico.tests.pico", "io.helidon.pico.tests.pico/test")); + contains("io.helidon.config", "io.helidon.inject.tests.inject", "io.helidon.inject.tests.inject/test")); } /** - * The pico module-info that was created (by APT processing). + * The module-info that was created (by APT processing). */ @Test void moduleInfo() { - assertThat(loadStringFromFile("target/pico/classes/module-info.java.pico"), - equalTo(loadStringFromResource("expected/module-info.java._pico_"))); + assertThat(loadStringFromFile("target/inject/classes/module-info.java.inject"), + equalTo(loadStringFromResource("expected/module-info.java._inject_"))); } /** - * The pico test version of module-info that was created (by APT processing). + * The test version of module-info that was created (by APT processing). */ @Test void testModuleInfo() { - assertThat(loadStringFromFile("target/pico/test-classes/module-info.java.pico"), - equalTo(loadStringFromResource("expected/tests-module-info.java._pico_"))); + assertThat(loadStringFromFile("target/inject/test-classes/module-info.java.inject"), + equalTo(loadStringFromResource("expected/tests-module-info.java._inject_"))); } @Test @@ -219,8 +222,8 @@ void innerClassesCanBeGenerated() { } /** - * Targets {@link io.helidon.pico.tests.pico.tbox.AbstractSaw} with derived classes of - * {@link io.helidon.pico.tests.pico.tbox.impl.HandSaw} and {@link io.helidon.pico.tests.pico.tbox.TableSaw} found in different packages. + * Targets {@link AbstractSaw} with derived classes of + * {@link HandSaw} and {@link TableSaw} found in different packages. */ @Test void hierarchyOfInjections() { @@ -240,7 +243,7 @@ void hierarchyOfInjections() { @Test void runlevel() { assertThat("we start with 2 because we are looking for interceptors (which there is 2 here in this module)", - picoServices.metrics().orElseThrow().lookupCount().orElseThrow(), + injectionServices.metrics().orElseThrow().lookupCount().orElseThrow(), equalTo(2)); List> runLevelServices = services .lookupAll(ServiceInfoCriteria.builder().runLevel(RunLevel.STARTUP).build(), true); @@ -250,7 +253,7 @@ void runlevel() { runLevelServices.forEach(sp -> Objects.requireNonNull(sp.get(), sp + " failed on get()")); assertThat("activation should not triggered one new lookup from startup", - picoServices.metrics().orElseThrow().lookupCount().orElseThrow(), + injectionServices.metrics().orElseThrow().lookupCount().orElseThrow(), equalTo(3)); desc = runLevelServices.stream().map(ServiceProvider::description).collect(Collectors.toList()); assertThat(desc, @@ -269,7 +272,7 @@ void noServiceActivationRequiresLookupWhenApplicationIsPresent() { .forEach(sp -> { sp.get(); assertThat("activation should not have triggered any lookups (for singletons): " - + sp + " triggered lookups", picoServices.metrics().orElseThrow().lookupCount(), + + sp + " triggered lookups", injectionServices.metrics().orElseThrow().lookupCount(), equalTo(1)); }); } @@ -290,36 +293,36 @@ void startupAndShutdownCallsPostConstructAndPreDestroy() { assertThat(TestingSingleton.postConstructCount(), equalTo(1)); assertThat(TestingSingleton.preDestroyCount(), equalTo(0)); - Map map = picoServices.shutdown().orElseThrow(); + Map map = injectionServices.shutdown().orElseThrow(); Map report = map.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().startingActivationPhase().toString() + "->" + e.getValue().finishingActivationPhase())); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.Pico$$Application"), "ACTIVE->DESTROYED")); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.Pico$$Module"), "ACTIVE->DESTROYED")); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.Pico$$TestApplication"), "ACTIVE->DESTROYED")); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.Pico$$TestModule"), "ACTIVE->DESTROYED")); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.stacking.MostOuterInterceptedImpl"), "ACTIVE->DESTROYED")); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.stacking.OuterInterceptedImpl"), "ACTIVE->DESTROYED")); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.stacking.InterceptedImpl"), "ACTIVE->DESTROYED")); - assertThat(report, hasEntry(TypeName.create("io.helidon.pico.tests.pico.TestingSingleton"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.Injection$$Application"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.Injection$$Module"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.Injection$$TestApplication"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.Injection$$TestModule"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.stacking.MostOuterInterceptedImpl"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.stacking.OuterInterceptedImpl"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.stacking.InterceptedImpl"), "ACTIVE->DESTROYED")); + assertThat(report, hasEntry(create("io.helidon.inject.tests.inject.TestingSingleton"), "ACTIVE->DESTROYED")); // ConfigProducer is the 9th assertThat(report + " : expected 9 services to be present", report.size(), equalTo(9)); assertThat(TestingSingleton.postConstructCount(), equalTo(1)); assertThat(TestingSingleton.preDestroyCount(), equalTo(1)); - assertThat(picoServices.metrics().orElseThrow().lookupCount().orElse(0), equalTo(0)); + assertThat(injectionServices.metrics().orElseThrow().lookupCount().orElse(0), equalTo(0)); - PicoException e = assertThrows(PicoException.class, () -> picoServices.services()); + InjectionException e = assertThrows(InjectionException.class, () -> injectionServices.services()); assertThat(e.getMessage(), equalTo("Must reset() after shutdown()")); tearDown(); setUp(); - TestingSingleton testingSingletonFromLookup2 = picoServices.services().lookup(TestingSingleton.class).get(); + TestingSingleton testingSingletonFromLookup2 = injectionServices.services().lookup(TestingSingleton.class).get(); assertThat(testingSingletonFromLookup2, not(testingSingletonFromLookup)); - map = picoServices.shutdown().orElseThrow(); + map = injectionServices.shutdown().orElseThrow(); report = map.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, e2 -> e2.getValue().startingActivationPhase().toString() @@ -328,7 +331,7 @@ void startupAndShutdownCallsPostConstructAndPreDestroy() { assertThat(report.toString(), report.size(), is(6)); tearDown(); - map = picoServices.shutdown().orElseThrow(); + map = injectionServices.shutdown().orElseThrow(); assertThat(map.toString(), map.size(), is(0)); } @@ -353,7 +356,7 @@ void classNamed() { .build()); List desc = providers.stream().map(ServiceProvider::description).collect(Collectors.toList()); assertThat(desc, - contains("YImpl$$Pico$$Interceptor:INIT", + contains("YImpl$$Injection$$Interceptor:INIT", "BladeProvider:INIT")); providers = services.lookupAll( diff --git a/inject/tests/resources-inject/src/test/resources/expected/module-info.java._inject_ b/inject/tests/resources-inject/src/test/resources/expected/module-info.java._inject_ new file mode 100644 index 00000000000..abb40c2b451 --- /dev/null +++ b/inject/tests/resources-inject/src/test/resources/expected/module-info.java._inject_ @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Injection Test Resources. + */ +module io.helidon.inject.tests.inject { + requires static jakarta.inject; + requires static jakarta.annotation; + + requires io.helidon.common.types; + requires io.helidon.common; + requires io.helidon.inject.api; + requires io.helidon.inject.runtime; + requires io.helidon.inject.tests.plain; + requires io.helidon.config; + + exports io.helidon.inject.tests.inject; + exports io.helidon.inject.tests.inject.interceptor; + exports io.helidon.inject.tests.inject.stacking; + exports io.helidon.inject.tests.inject.tbox; + + provides io.helidon.inject.api.ModuleComponent with io.helidon.inject.tests.inject.Injection$$Module; + // External contract usage - @io.helidon.common.Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", trigger = "io.helidon.inject.tools.ActivatorCreatorDefault") + requires test1; + requires test2; + // Contract usage - @io.helidon.common.Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", trigger = "io.helidon.inject.tools.ActivatorCreatorDefault") + exports io.helidon.inject.tests.inject.provider; + // Application - @io.helidon.common.Generated(value = "io.helidon.inject.tools.ApplicationCreatorDefault", trigger = "io.helidon.inject.tools.ApplicationCreatorDefault") + provides io.helidon.inject.api.Application with io.helidon.inject.tests.inject.Injection$$Application; +} diff --git a/inject/tests/resources-inject/src/test/resources/expected/tests-module-info.java._inject_ b/inject/tests/resources-inject/src/test/resources/expected/tests-module-info.java._inject_ new file mode 100644 index 00000000000..344f5a2b6c3 --- /dev/null +++ b/inject/tests/resources-inject/src/test/resources/expected/tests-module-info.java._inject_ @@ -0,0 +1,10 @@ +// @io.helidon.common.Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", trigger = "io.helidon.inject.tools.ActivatorCreatorDefault") +module io.helidon.inject.tests.inject/test { + exports io.helidon.inject.tests.inject; + // Module Component - @io.helidon.common.Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", trigger = "io.helidon.inject.tools.ActivatorCreatorDefault") + provides io.helidon.inject.api.ModuleComponent with io.helidon.inject.tests.inject.Injection$$TestModule; + // Injection Runtime - @io.helidon.common.Generated(value = "io.helidon.inject.tools.ActivatorCreatorDefault", trigger = "io.helidon.inject.tools.ActivatorCreatorDefault") + requires transitive io.helidon.inject.runtime; + // Application - @io.helidon.common.Generated(value = "io.helidon.inject.tools.ApplicationCreatorDefault", trigger = "io.helidon.inject.tools.ApplicationCreatorDefault") + provides io.helidon.inject.api.Application with io.helidon.inject.tests.inject.Injection$$TestApplication; +} diff --git a/pico/tests/resources-pico/src/test/resources/expected/ximpl-interceptor._java_ b/inject/tests/resources-inject/src/test/resources/expected/ximpl-interceptor._java_ similarity index 60% rename from pico/tests/resources-pico/src/test/resources/expected/ximpl-interceptor._java_ rename to inject/tests/resources-inject/src/test/resources/expected/ximpl-interceptor._java_ index ee903e3afea..62cf4f81bfd 100644 --- a/pico/tests/resources-pico/src/test/resources/expected/ximpl-interceptor._java_ +++ b/inject/tests/resources-inject/src/test/resources/expected/ximpl-interceptor._java_ @@ -1,6 +1,6 @@ // This is a generated file (powered by Helidon). Do not edit or extend from this artifact as it is subject to change at any time! -package io.helidon.pico.tests.pico.interceptor; +package io.helidon.inject.tests.inject.interceptor; import java.util.List; import java.util.Map; @@ -13,12 +13,12 @@ import io.helidon.common.types.TypedElementInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; import io.helidon.common.types.TypeValues; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationException; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.runtime.InterceptedMethod; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationException; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.runtime.InterceptedMethod; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -26,33 +26,33 @@ import jakarta.inject.Provider; import jakarta.inject.Singleton; import static io.helidon.common.types.TypeName.create; -import static io.helidon.pico.runtime.Invocation.createInvokeAndSupply; -import static io.helidon.pico.runtime.Invocation.mergeAndCollapse; +import static io.helidon.inject.runtime.Invocation.createInvokeAndSupply; +import static io.helidon.inject.runtime.Invocation.mergeAndCollapse; /** - * Pico {@link Interceptor} for {@link io.helidon.pico.tests.pico.interceptor.XImpl }. + * Injection {@link Interceptor} for {@link io.helidon.inject.tests.inject.interceptor.XImpl }. */ // using the no-arg constructor approach @io.helidon.common.Weight(100.001) -@io.helidon.pico.api.Intercepted(io.helidon.pico.tests.pico.interceptor.XImpl.class) +@io.helidon.inject.api.Intercepted(io.helidon.inject.tests.inject.interceptor.XImpl.class) @Singleton @SuppressWarnings("ALL") -@io.helidon.common.Generated(value = "io.helidon.pico.tools.InterceptorCreatorDefault", trigger = "io.helidon.pico.tests.pico.interceptor.XImpl") -public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interceptor.XImpl { +@io.helidon.common.Generated(value = "io.helidon.inject.tools.InterceptorCreatorDefault", trigger = "io.helidon.inject.tests.inject.interceptor.XImpl") +public class XImpl$$Injection$$Interceptor extends io.helidon.inject.tests.inject.interceptor.XImpl { private static final List __serviceLevelAnnotations = List.of( Annotation.create(jakarta.inject.Singleton.class), - Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX")), - Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX")), - Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable")), + Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX")), + Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX")), + Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable")), Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))); private static final TypedElementInfo __ctor = TypedElementInfo.builder() .typeName(create(void.class)) .elementTypeKind(TypeValues.KIND_CONSTRUCTOR) - .elementName(io.helidon.pico.api.ElementInfo.CONSTRUCTOR) - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .elementName(io.helidon.inject.api.ElementInfo.CONSTRUCTOR) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) .addAnnotation(Annotation.create(jakarta.inject.Inject.class)) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) @@ -61,9 +61,9 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(void.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("methodIA1") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.Override.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) @@ -72,10 +72,10 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(void.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("methodIA2") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", "IA2"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", "IA2"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.Override.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) @@ -84,10 +84,10 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(void.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("methodIB") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", "IBSubAnno"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", "IBSubAnno"))) .addAnnotation(Annotation.create(jakarta.inject.Named.class, Map.of("value", "methodIB"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.Override.class)) @@ -103,10 +103,10 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(java.lang.String.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("methodIB2") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", "IBSubAnno"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", "IBSubAnno"))) .addAnnotation(Annotation.create(jakarta.inject.Named.class, Map.of("value", "methodIB2"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.Override.class)) @@ -122,10 +122,10 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(void.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("close") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", ""))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno.class, Map.of("value", ""))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.Override.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) @@ -134,9 +134,9 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(long.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("methodX") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) .build(); @@ -159,9 +159,9 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(java.lang.String.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("methodY") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) .build(); @@ -169,9 +169,9 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(java.lang.String.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("methodZ") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) .build(); @@ -179,18 +179,18 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce .typeName(create(void.class)) .elementTypeKind(TypeValues.KIND_METHOD) .elementName("throwRuntimeException") - .addAnnotation(Annotation.create(io.helidon.pico.api.ClassNamed.class, Map.of("value", "io.helidon.pico.tests.pico.ClassNamedX"))) - .addAnnotation(Annotation.create(io.helidon.pico.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) - .addAnnotation(Annotation.create(io.helidon.pico.tests.pico.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ClassNamed.class, Map.of("value", "io.helidon.inject.tests.inject.ClassNamedX"))) + .addAnnotation(Annotation.create(io.helidon.inject.api.ExternalContracts.class, Map.of("moduleNames", "test1, test2", "value", "java.io.Closeable"))) + .addAnnotation(Annotation.create(io.helidon.inject.tests.inject.interceptor.TestNamed.class, Map.of("value", "TestNamed-ClassX"))) .addAnnotation(Annotation.create(jakarta.inject.Singleton.class)) .addAnnotation(Annotation.create(java.lang.SuppressWarnings.class, Map.of("value", "unused"))) .build(); - private static final TypeName __serviceTypeName = TypeName.create(io.helidon.pico.tests.pico.interceptor.XImpl.class); + private static final TypeName __serviceTypeName = TypeName.create(io.helidon.inject.tests.inject.interceptor.XImpl.class); - private final Provider __provider; - private final ServiceProvider __sp; - private final io.helidon.pico.tests.pico.interceptor.XImpl __impl; + private final Provider __provider; + private final ServiceProvider __sp; + private final io.helidon.inject.tests.inject.interceptor.XImpl __impl; private final List> __methodIA1__interceptors; private final List> __methodIA2__interceptors; private final List> __methodIB__interceptors; @@ -200,37 +200,37 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce private final List> __methodY__interceptors; private final List> __methodZ__interceptors; private final List> __throwRuntimeException__interceptors; - private final InterceptedMethod __methodIA1__call; - private final InterceptedMethod __methodIA2__call; - private final InterceptedMethod __methodIB__call; - private final InterceptedMethod __methodIB2__call; - private final InterceptedMethod __close__call; - private final InterceptedMethod __methodX__call; - private final InterceptedMethod __methodY__call; - private final InterceptedMethod __methodZ__call; - private final InterceptedMethod __throwRuntimeException__call; + private final InterceptedMethod __methodIA1__call; + private final InterceptedMethod __methodIA2__call; + private final InterceptedMethod __methodIB__call; + private final InterceptedMethod __methodIB2__call; + private final InterceptedMethod __close__call; + private final InterceptedMethod __methodX__call; + private final InterceptedMethod __methodY__call; + private final InterceptedMethod __methodZ__call; + private final InterceptedMethod __throwRuntimeException__call; @Inject @SuppressWarnings("unchecked") - XImpl$$Pico$$Interceptor( - @ClassNamed(io.helidon.pico.tests.pico.interceptor.TestNamed.class) List> io_helidon_pico_tests_pico_interceptor_TestNamed, - @ClassNamed(io.helidon.pico.tests.plain.interceptor.InterceptorBasedAnno.class) List> io_helidon_pico_tests_plain_interceptor_InterceptorBasedAnno, - Provider provider) { + XImpl$$Injection$$Interceptor( + @ClassNamed(io.helidon.inject.tests.plain.interceptor.InterceptorBasedAnno.class) List> io_helidon_inject_tests_plain_interceptor_InterceptorBasedAnno, + @ClassNamed(io.helidon.inject.tests.inject.interceptor.TestNamed.class) List> io_helidon_inject_tests_inject_interceptor_TestNamed, + Provider provider) { this.__provider = Objects.requireNonNull(provider); - this.__sp = (provider instanceof ServiceProvider) ? (ServiceProvider) __provider : null; - List> __ctor__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed); - this.__methodIA1__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed); - this.__methodIA2__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed, io_helidon_pico_tests_plain_interceptor_InterceptorBasedAnno); - this.__methodIB__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed, io_helidon_pico_tests_plain_interceptor_InterceptorBasedAnno); - this.__methodIB2__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed, io_helidon_pico_tests_plain_interceptor_InterceptorBasedAnno); - this.__close__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed, io_helidon_pico_tests_plain_interceptor_InterceptorBasedAnno); - this.__methodX__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed); - this.__methodY__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed); - this.__methodZ__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed); - this.__throwRuntimeException__interceptors = mergeAndCollapse(io_helidon_pico_tests_pico_interceptor_TestNamed); + this.__sp = (provider instanceof ServiceProvider) ? (ServiceProvider) __provider : null; + List> __ctor__interceptors = mergeAndCollapse(io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__methodIA1__interceptors = mergeAndCollapse(io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__methodIA2__interceptors = mergeAndCollapse(io_helidon_inject_tests_plain_interceptor_InterceptorBasedAnno, io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__methodIB__interceptors = mergeAndCollapse(io_helidon_inject_tests_plain_interceptor_InterceptorBasedAnno, io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__methodIB2__interceptors = mergeAndCollapse(io_helidon_inject_tests_plain_interceptor_InterceptorBasedAnno, io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__close__interceptors = mergeAndCollapse(io_helidon_inject_tests_plain_interceptor_InterceptorBasedAnno, io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__methodX__interceptors = mergeAndCollapse(io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__methodY__interceptors = mergeAndCollapse(io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__methodZ__interceptors = mergeAndCollapse(io_helidon_inject_tests_inject_interceptor_TestNamed); + this.__throwRuntimeException__interceptors = mergeAndCollapse(io_helidon_inject_tests_inject_interceptor_TestNamed); - Function call = args -> __provider.get(); - io.helidon.pico.tests.pico.interceptor.XImpl result = createInvokeAndSupply( + Function call = args -> __provider.get(); + io.helidon.inject.tests.inject.interceptor.XImpl result = createInvokeAndSupply( InvocationContext.builder() .serviceProvider(__sp) .serviceTypeName(__serviceTypeName) @@ -242,7 +242,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce new Object[0]); this.__impl = Objects.requireNonNull(result); - this.__methodIA1__call = new InterceptedMethod( + this.__methodIA1__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __methodIA1__interceptors, __methodIA1) { @Override public java.lang.Void invoke(Object... args) throws Throwable { @@ -251,7 +251,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__methodIA2__call = new InterceptedMethod( + this.__methodIA2__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __methodIA2__interceptors, __methodIA2) { @Override public java.lang.Void invoke(Object... args) throws Throwable { @@ -260,7 +260,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__methodIB__call = new InterceptedMethod( + this.__methodIB__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __methodIB__interceptors, __methodIB, List.of(__methodIB__p1)) { @Override @@ -270,7 +270,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__methodIB2__call = new InterceptedMethod( + this.__methodIB2__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __methodIB2__interceptors, __methodIB2, List.of(__methodIB2__p1)) { @Override @@ -279,7 +279,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__close__call = new InterceptedMethod( + this.__close__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __close__interceptors, __close) { @Override public java.lang.Void invoke(Object... args) throws Throwable { @@ -288,7 +288,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__methodX__call = new InterceptedMethod( + this.__methodX__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __methodX__interceptors, __methodX, List.of(__methodX__p1, __methodX__p2, __methodX__p3)) { @Override @@ -297,7 +297,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__methodY__call = new InterceptedMethod( + this.__methodY__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __methodY__interceptors, __methodY) { @Override public java.lang.String invoke(Object... args) throws Throwable { @@ -305,7 +305,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__methodZ__call = new InterceptedMethod( + this.__methodZ__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __methodZ__interceptors, __methodZ) { @Override public java.lang.String invoke(Object... args) throws Throwable { @@ -313,7 +313,7 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce } }; - this.__throwRuntimeException__call = new InterceptedMethod( + this.__throwRuntimeException__call = new InterceptedMethod( __impl, __sp, __serviceTypeName, __serviceLevelAnnotations, __throwRuntimeException__interceptors, __throwRuntimeException) { @Override public java.lang.Void invoke(Object... args) throws Throwable { @@ -377,4 +377,4 @@ public class XImpl$$Pico$$Interceptor extends io.helidon.pico.tests.pico.interce createInvokeAndSupply(__throwRuntimeException__call.ctx(), __interceptedArgs -> __throwRuntimeException__call.apply(__interceptedArgs), args); } -} \ No newline at end of file +} diff --git a/pico/tests/resources-pico/src/test/resources/expected/yimpl-interceptor._java_ b/inject/tests/resources-inject/src/test/resources/expected/yimpl-interceptor._java_ similarity index 100% rename from pico/tests/resources-pico/src/test/resources/expected/yimpl-interceptor._java_ rename to inject/tests/resources-inject/src/test/resources/expected/yimpl-interceptor._java_ diff --git a/pico/tests/resources-plain/pom.xml b/inject/tests/resources-plain/pom.xml similarity index 74% rename from pico/tests/resources-plain/pom.xml rename to inject/tests/resources-plain/pom.xml index 2ad7fa44ada..5c23bec21f2 100644 --- a/pico/tests/resources-plain/pom.xml +++ b/inject/tests/resources-plain/pom.xml @@ -21,22 +21,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.tests - helidon-pico-tests-project + io.helidon.inject.tests + helidon-inject-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-tests-resources-plain - Helidon Pico Test Plain Resources - a jar that offers contracts and other artifacts but is not a native Pico module (e.g., no Pico APT) + helidon-inject-tests-resources-plain + Helidon Injection Test Plain Resources + a jar that offers contracts and other artifacts but is not a native injection module (e.g., no injection APT). - + - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api jakarta.inject diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/Hello.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/Hello.java similarity index 89% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/Hello.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/Hello.java index ff65226544f..687fc05b168 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/Hello.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/Hello.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.hello; +package io.helidon.inject.tests.plain.hello; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; @Contract public interface Hello { diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/HelloImpl.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/HelloImpl.java similarity index 98% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/HelloImpl.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/HelloImpl.java index 1c0b7b6b23c..c8c75403df8 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/HelloImpl.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/HelloImpl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.hello; +package io.helidon.inject.tests.plain.hello; import java.util.List; import java.util.Optional; diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/MyTestQualifier.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/MyTestQualifier.java similarity index 97% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/MyTestQualifier.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/MyTestQualifier.java index a55029b848b..d70280f74c6 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/MyTestQualifier.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/MyTestQualifier.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.hello; +package io.helidon.inject.tests.plain.hello; import java.lang.annotation.Documented; import java.lang.annotation.Inherited; diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/SomeOtherLocalNonContractInterface2.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/SomeOtherLocalNonContractInterface2.java similarity index 93% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/SomeOtherLocalNonContractInterface2.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/SomeOtherLocalNonContractInterface2.java index f9930ec9c51..925f60bf868 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/SomeOtherLocalNonContractInterface2.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/SomeOtherLocalNonContractInterface2.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.hello; +package io.helidon.inject.tests.plain.hello; public interface SomeOtherLocalNonContractInterface2 { diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/World.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/World.java similarity index 93% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/World.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/World.java index b0585dbc517..9971f7d47c2 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/World.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/World.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.hello; +package io.helidon.inject.tests.plain.hello; @FunctionalInterface public interface World { diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/WorldImpl.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/WorldImpl.java similarity index 92% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/WorldImpl.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/WorldImpl.java index 7c2e8dbcbe1..c6452c3ef41 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/hello/WorldImpl.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/hello/WorldImpl.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.hello; +package io.helidon.inject.tests.plain.hello; import java.io.Serializable; -import io.helidon.pico.api.ExternalContracts; +import io.helidon.inject.api.ExternalContracts; import jakarta.inject.Named; import jakarta.inject.Singleton; diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/IA.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/IA.java similarity index 88% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/IA.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/IA.java index 0a8a81f1e94..060d6098147 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/IA.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/IA.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.interceptor; +package io.helidon.inject.tests.plain.interceptor; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; @Contract public interface IA { diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/IB.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/IB.java similarity index 93% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/IB.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/IB.java index 2366078f49c..062b8077728 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/IB.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/IB.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.interceptor; +package io.helidon.inject.tests.plain.interceptor; @InterceptorBasedAnno("IBAnno") public interface IB { diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/InterceptorBasedAnno.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/InterceptorBasedAnno.java similarity index 89% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/InterceptorBasedAnno.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/InterceptorBasedAnno.java index d585e2ff8f7..f55756f80fd 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/InterceptorBasedAnno.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/InterceptorBasedAnno.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.interceptor; +package io.helidon.inject.tests.plain.interceptor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import io.helidon.pico.api.InterceptedTrigger; +import io.helidon.inject.api.InterceptedTrigger; @InterceptedTrigger @Retention(RetentionPolicy.CLASS) diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/TestNamedInterceptor.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/TestNamedInterceptor.java similarity index 91% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/TestNamedInterceptor.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/TestNamedInterceptor.java index 6cac0fe7d6b..636d1234415 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/TestNamedInterceptor.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/TestNamedInterceptor.java @@ -14,14 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.interceptor; +package io.helidon.inject.tests.plain.interceptor; import java.util.concurrent.atomic.AtomicInteger; -import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; import static io.helidon.common.types.TypeNames.PRIMITIVE_LONG; import static io.helidon.common.types.TypeNames.STRING; diff --git a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/X.java b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/X.java similarity index 97% rename from pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/X.java rename to inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/X.java index 45931e33bd8..f6c1a2de40c 100644 --- a/pico/tests/resources-plain/src/main/java/io/helidon/pico/tests/plain/interceptor/X.java +++ b/inject/tests/resources-plain/src/main/java/io/helidon/inject/tests/plain/interceptor/X.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tests.plain.interceptor; +package io.helidon.inject.tests.plain.interceptor; import java.io.Closeable; import java.io.IOException; diff --git a/pico/tests/resources-plain/src/main/java/module-info.java b/inject/tests/resources-plain/src/main/java/module-info.java similarity index 81% rename from pico/tests/resources-plain/src/main/java/module-info.java rename to inject/tests/resources-plain/src/main/java/module-info.java index 53019f0d268..11e8d4fd85e 100644 --- a/pico/tests/resources-plain/src/main/java/module-info.java +++ b/inject/tests/resources-plain/src/main/java/module-info.java @@ -17,14 +17,14 @@ /** * Plain Test Resources. */ -module io.helidon.pico.tests.plain { +module io.helidon.inject.tests.plain { requires static jakarta.inject; requires static jakarta.annotation; requires io.helidon.common.types; requires io.helidon.common; - requires io.helidon.pico.api; + requires io.helidon.inject.api; - exports io.helidon.pico.tests.plain.hello; - exports io.helidon.pico.tests.plain.interceptor; + exports io.helidon.inject.tests.plain.hello; + exports io.helidon.inject.tests.plain.interceptor; } diff --git a/pico/tests/api/pom.xml b/inject/tests/runtime/pom.xml similarity index 80% rename from pico/tests/api/pom.xml rename to inject/tests/runtime/pom.xml index 8c82c15fa6a..48f9fd80329 100644 --- a/pico/tests/api/pom.xml +++ b/inject/tests/runtime/pom.xml @@ -21,23 +21,23 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.tests - helidon-pico-tests-project + io.helidon.inject.tests + helidon-inject-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-tests-api - Helidon Pico Tests API + helidon-inject-tests-runtime + Helidon Injection Tests Runtime - Test pico API to remove dependency on Helidon Config, which did not allow us to have contracts in config + Test Injection runtime to remove dependency on Helidon Config, which did not allow us to have services in config. - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-runtime io.helidon.config diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/DefaultInjectionPlansTest.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionPlansTest.java similarity index 74% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/DefaultInjectionPlansTest.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionPlansTest.java index 2ac2c265e84..8e4b4709d02 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/DefaultInjectionPlansTest.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionPlansTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.io.Closeable; import java.util.List; @@ -22,20 +22,20 @@ import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceBinder; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceBinder; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static io.helidon.pico.api.Qualifier.createNamed; -import static io.helidon.pico.runtime.DefaultInjectionPlans.injectionPointProvidersFor; +import static io.helidon.inject.api.Qualifier.createNamed; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; @@ -45,35 +45,35 @@ class DefaultInjectionPlansTest { Config config = Config.builder( ConfigSources.create( - Map.of("pico.permits-dynamic", "true"), "config-1")) + Map.of("inject.permits-dynamic", "true"), "config-1")) .disableEnvironmentVariablesSource() .disableSystemPropertiesSource() .build(); @BeforeEach void init() { - PicoServices.globalBootstrap(Bootstrap.builder().config(config).build()); + InjectionServices.globalBootstrap(Bootstrap.builder().config(config).build()); } @AfterEach void tearDown() { - SimplePicoTestingSupport.resetAll(); + SimpleInjectionTestingSupport.resetAll(); } /** - * Also exercised in examples/pico. + * Also exercised in examples/inject. */ @Test void testInjectionPointResolversFor() { - PicoServices picoServices = PicoServices.picoServices().orElseThrow(); - DefaultServices services = (DefaultServices) PicoServices.realizedServices(); - services.bind(picoServices, new FakeModuleComponent(), true); + InjectionServices injectionServices = InjectionServices.injectionServices().orElseThrow(); + DefaultServices services = (DefaultServices) InjectionServices.realizedServices(); + services.bind(injectionServices, new FakeModuleComponent(), true); ServiceInfoCriteria criteria = ServiceInfoCriteria.builder() .addQualifier(createNamed("whatever")) .addContractImplemented(Closeable.class) .build(); - List result = injectionPointProvidersFor(services, criteria).stream() + List result = DefaultInjectionPlans.injectionPointProvidersFor(services, criteria).stream() .map(ServiceProvider::description).toList(); assertThat(result, contains(sp1.description())); @@ -92,7 +92,7 @@ static class FakeInjectionPointProviderActivator extends AbstractServiceProvider ServiceInfo.builder() .serviceTypeName(FakeInjectionPointProviderActivator.class) .addContractImplemented(Closeable.class) - .addExternalContractImplemented(io.helidon.pico.api.InjectionPointProvider.class) + .addExternalContractImplemented(InjectionPointProvider.class) .addExternalContractImplemented(jakarta.inject.Provider.class) .build(); diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesTest.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesTest.java similarity index 66% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesTest.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesTest.java index 9f5358e71c2..71443454e1d 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/DefaultPicoServicesTest.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesTest.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.Map; import java.util.Objects; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.runtime.testsubjects.HelloPico$$Application; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.runtime.testsubjects.HelloInjection$$Application; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -33,32 +33,32 @@ import static io.helidon.common.testing.junit5.OptionalMatcher.optionalPresent; import static org.hamcrest.MatcherAssert.assertThat; -class DefaultPicoServicesTest { +class DefaultInjectionServicesTest { @BeforeEach void setUp() { tearDown(); Config config = Config.builder( ConfigSources.create( - Map.of("pico.permits-dynamic", "true"), "config-1")) + Map.of("inject.permits-dynamic", "true"), "config-1")) .disableEnvironmentVariablesSource() .disableSystemPropertiesSource() .build(); - PicoServices.globalBootstrap(Bootstrap.builder().config(config).build()); + InjectionServices.globalBootstrap(Bootstrap.builder().config(config).build()); } @AfterEach void tearDown() { - HelloPico$$Application.ENABLED = true; - SimplePicoTestingSupport.resetAll(); + HelloInjection$$Application.ENABLED = true; + SimpleInjectionTestingSupport.resetAll(); } @Test void realizedServices() { - assertThat(PicoServices.unrealizedServices(), optionalEmpty()); + assertThat(InjectionServices.unrealizedServices(), optionalEmpty()); - Objects.requireNonNull(PicoServices.realizedServices()); - assertThat(PicoServices.unrealizedServices(), optionalPresent()); + Objects.requireNonNull(InjectionServices.realizedServices()); + assertThat(InjectionServices.unrealizedServices(), optionalPresent()); } } diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/HelloPicoWorldSanityTest.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/HelloInjectionWorldSanityTest.java similarity index 61% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/HelloPicoWorldSanityTest.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/HelloInjectionWorldSanityTest.java index 0162ffb8d5e..0661fa3c8db 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/HelloPicoWorldSanityTest.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/HelloInjectionWorldSanityTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; import java.util.ArrayList; import java.util.List; @@ -25,27 +25,27 @@ import io.helidon.common.types.TypeName; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.pico.api.ActivationRequest; -import io.helidon.pico.api.ActivationResult; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.DeActivationRequest; -import io.helidon.pico.api.Injector; -import io.helidon.pico.api.InjectorOptions; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.runtime.testsubjects.HelloPico$$Application; -import io.helidon.pico.runtime.testsubjects.HelloPicoImpl$$picoActivator; -import io.helidon.pico.runtime.testsubjects.HelloPicoWorld; -import io.helidon.pico.runtime.testsubjects.HelloPicoWorldImpl; -import io.helidon.pico.runtime.testsubjects.PicoWorld; -import io.helidon.pico.runtime.testsubjects.PicoWorldImpl; -import io.helidon.pico.runtime.testsubjects.PicoWorldImpl$$picoActivator; -import io.helidon.pico.spi.InjectionPlan; +import io.helidon.inject.api.ActivationRequest; +import io.helidon.inject.api.ActivationResult; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.DeActivationRequest; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Injector; +import io.helidon.inject.api.InjectorOptions; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.runtime.testsubjects.HelloInjection$$Application; +import io.helidon.inject.runtime.testsubjects.HelloInjectionImpl$$injectionActivator; +import io.helidon.inject.runtime.testsubjects.HelloInjectionWorld; +import io.helidon.inject.runtime.testsubjects.HelloInjectionWorldImpl; +import io.helidon.inject.runtime.testsubjects.InjectionWorld; +import io.helidon.inject.runtime.testsubjects.InjectionWorldImpl; +import io.helidon.inject.runtime.testsubjects.InjectionWorldImpl$$injectionActivator; +import io.helidon.inject.spi.InjectionPlan; import jakarta.inject.Singleton; import org.hamcrest.MatcherAssert; @@ -66,7 +66,7 @@ /** * Sanity type tests only. The "real" testing is in the tests submodules. */ -class HelloPicoWorldSanityTest { +class HelloInjectionWorldSanityTest { // helidon-config is now one of the modules private static final int EXPECTED_MODULES = 3; @@ -75,22 +75,22 @@ void setUp() { tearDown(); Config config = Config.builder( ConfigSources.create( - Map.of("pico.permits-dynamic", "true"), "config-1")) + Map.of("inject.permits-dynamic", "true"), "config-1")) .disableEnvironmentVariablesSource() .disableSystemPropertiesSource() .build(); - PicoServices.globalBootstrap(Bootstrap.builder().config(config).build()); + InjectionServices.globalBootstrap(Bootstrap.builder().config(config).build()); } @AfterEach void tearDown() { - HelloPico$$Application.ENABLED = true; - SimplePicoTestingSupport.resetAll(); + HelloInjection$$Application.ENABLED = true; + SimpleInjectionTestingSupport.resetAll(); } @Test void sanity() { - Services services = PicoServices.realizedServices(); + Services services = InjectionServices.realizedServices(); List> moduleProviders = services.lookupAll(ModuleComponent.class); assertThat(moduleProviders.size(), @@ -98,47 +98,47 @@ void sanity() { List descriptions = ServiceUtils.toDescriptions(moduleProviders); // helidon-config is now first assertThat(descriptions, - containsInAnyOrder("Pico$$Module:ACTIVE", "EmptyModule:ACTIVE", "HelloPico$$Module:ACTIVE")); + containsInAnyOrder("Injection$$Module:ACTIVE", "EmptyModule:ACTIVE", "HelloInjection$$Module:ACTIVE")); List> applications = services.lookupAll(Application.class); assertThat(applications.size(), equalTo(1)); assertThat(ServiceUtils.toDescriptions(applications), - containsInAnyOrder("HelloPico$$Application:ACTIVE")); + containsInAnyOrder("HelloInjection$$Application:ACTIVE")); } @Test void standardActivationWithNoApplicationEnabled() { - HelloPico$$Application.ENABLED = false; - Optional picoServices = PicoServices.picoServices(); - ((DefaultPicoServices) picoServices.orElseThrow()).reset(true); + HelloInjection$$Application.ENABLED = false; + Optional injectionServices = InjectionServices.injectionServices(); + ((DefaultInjectionServices) injectionServices.orElseThrow()).reset(true); standardActivation(); } @Test void standardActivation() { - Services services = PicoServices.realizedServices(); + Services services = InjectionServices.realizedServices(); - ServiceProvider helloProvider1 = services.lookup(HelloPicoWorld.class); + ServiceProvider helloProvider1 = services.lookup(HelloInjectionWorld.class); assertThat(helloProvider1, notNullValue()); - ServiceProvider helloProvider2 = services.lookup(HelloPicoWorldImpl.class); + ServiceProvider helloProvider2 = services.lookup(HelloInjectionWorldImpl.class); assertThat(helloProvider1, sameInstance(helloProvider2)); assertThat(helloProvider1.id(), - equalTo(HelloPicoWorldImpl.class.getName())); + equalTo(HelloInjectionWorldImpl.class.getName())); assertThat(helloProvider1.currentActivationPhase(), equalTo(Phase.INIT)); assertThat(helloProvider1.description(), - equalTo(HelloPicoWorldImpl.class.getSimpleName() + ":" + Phase.INIT)); + equalTo(HelloInjectionWorldImpl.class.getSimpleName() + ":" + Phase.INIT)); ServiceInfo serviceInfo = helloProvider1.serviceInfo(); assertThat(serviceInfo.serviceTypeName(), - equalTo(TypeName.create(HelloPicoWorldImpl.class))); + equalTo(TypeName.create(HelloInjectionWorldImpl.class))); assertThat(serviceInfo.contractsImplemented(), - containsInAnyOrder(TypeName.create(HelloPicoWorld.class))); + containsInAnyOrder(TypeName.create(HelloInjectionWorld.class))); assertThat(serviceInfo.externalContractsImplemented().size(), equalTo(0)); assertThat(serviceInfo.scopeTypeNames(), @@ -146,7 +146,7 @@ void standardActivation() { assertThat(serviceInfo.qualifiers().size(), equalTo(0)); assertThat(serviceInfo.activatorTypeName().orElseThrow(), - equalTo(TypeName.create(HelloPicoImpl$$picoActivator.class))); + equalTo(TypeName.create(HelloInjectionImpl$$injectionActivator.class))); assertThat(serviceInfo.declaredRunLevel(), optionalValue(equalTo(0))); assertThat(serviceInfo.realizedRunLevel(), @@ -158,65 +158,68 @@ void standardActivation() { assertThat(serviceInfo.realizedWeight(), equalTo(Weighted.DEFAULT_WEIGHT)); - ServiceProvider worldProvider1 = services.lookup(PicoWorld.class); + ServiceProvider worldProvider1 = services.lookup(InjectionWorld.class); assertThat(worldProvider1, notNullValue()); assertThat(worldProvider1.description(), - equalTo("PicoWorldImpl:INIT")); + equalTo("InjectionWorldImpl:INIT")); // now activate - HelloPicoWorld hello1 = helloProvider1.get(); + HelloInjectionWorld hello1 = helloProvider1.get(); MatcherAssert.assertThat(hello1.sayHello(), - equalTo("Hello pico")); + equalTo("Hello inject")); assertThat(helloProvider1.currentActivationPhase(), equalTo(Phase.ACTIVE)); assertThat(helloProvider1.description(), - equalTo("HelloPicoWorldImpl:ACTIVE")); + equalTo("HelloInjectionWorldImpl:ACTIVE")); // world should be active now too, since Hello should have implicitly activated it assertThat(worldProvider1.description(), - equalTo("PicoWorldImpl:ACTIVE")); + equalTo("InjectionWorldImpl:ACTIVE")); // check the post construct counts - MatcherAssert.assertThat(((HelloPicoWorldImpl) helloProvider1.get()).postConstructCallCount(), + MatcherAssert.assertThat(((HelloInjectionWorldImpl) helloProvider1.get()).postConstructCallCount(), equalTo(1)); - MatcherAssert.assertThat(((HelloPicoWorldImpl) helloProvider1.get()).preDestroyCallCount(), + MatcherAssert.assertThat(((HelloInjectionWorldImpl) helloProvider1.get()).preDestroyCallCount(), equalTo(0)); // deactivate just the Hello service ActivationResult result = helloProvider1.deActivator().orElseThrow() .deactivate(DeActivationRequest.create()); - assertThat(result.finished(), is(true)); - assertThat(result.success(), is(true)); - assertThat(result.serviceProvider(), sameInstance(helloProvider2)); + assertThat(result.finished(), + is(true)); + assertThat(result.success(), + is(true)); + assertThat(result.serviceProvider(), + sameInstance(helloProvider2)); assertThat(result.finishingActivationPhase(), is(Phase.DESTROYED)); assertThat(result.startingActivationPhase(), is(Phase.ACTIVE)); assertThat(helloProvider1.description(), - equalTo("HelloPicoWorldImpl:DESTROYED")); - MatcherAssert.assertThat(((HelloPicoWorldImpl) hello1).postConstructCallCount(), + equalTo("HelloInjectionWorldImpl:DESTROYED")); + MatcherAssert.assertThat(((HelloInjectionWorldImpl) hello1).postConstructCallCount(), equalTo(1)); - MatcherAssert.assertThat(((HelloPicoWorldImpl) hello1).preDestroyCallCount(), + MatcherAssert.assertThat(((HelloInjectionWorldImpl) hello1).preDestroyCallCount(), equalTo(1)); assertThat(worldProvider1.description(), - equalTo("PicoWorldImpl:ACTIVE")); + equalTo("InjectionWorldImpl:ACTIVE")); } @Test void viaInjector() { - PicoServices picoServices = PicoServices.picoServices().orElseThrow(); - Injector injector = picoServices.injector().orElseThrow(); + InjectionServices injectionServices = InjectionServices.injectionServices().orElseThrow(); + Injector injector = injectionServices.injector().orElseThrow(); - HelloPicoImpl$$picoActivator subversiveWay = new HelloPicoImpl$$picoActivator(); - subversiveWay.picoServices(Optional.of(picoServices)); + HelloInjectionImpl$$injectionActivator subversiveWay = new HelloInjectionImpl$$injectionActivator(); + subversiveWay.injectionServices(Optional.of(injectionServices)); ActivationResult result = injector.activateInject(subversiveWay, InjectorOptions.builder().build()); assertThat(result.finished(), is(true)); assertThat(result.success(), is(true)); - HelloPicoWorld hello1 = subversiveWay.serviceRef().orElseThrow(); + HelloInjectionWorld hello1 = subversiveWay.serviceRef().orElseThrow(); MatcherAssert.assertThat(hello1.sayHello(), - equalTo("Hello pico")); + equalTo("Hello inject")); MatcherAssert.assertThat(subversiveWay.currentActivationPhase(), equalTo(Phase.ACTIVE)); @@ -225,9 +228,9 @@ void viaInjector() { assertThat(subversiveWay, sameInstance(result.serviceProvider())); // the above is subversive because it is disconnected from the "real" activator - Services services = picoServices.services(); + Services services = injectionServices.services(); ServiceProvider realHelloProvider = - ((DefaultServices) services).serviceProviderFor(TypeName.create(HelloPicoWorldImpl.class)); + ((DefaultServices) services).serviceProviderFor(TypeName.create(HelloInjectionWorldImpl.class)); assertThat(subversiveWay, not(sameInstance(realHelloProvider))); assertThat(realHelloProvider.currentActivationPhase(), @@ -239,8 +242,8 @@ void viaInjector() { @Test void injectionPlanResolved() { - HelloPicoImpl$$picoActivator activator = new HelloPicoImpl$$picoActivator(); - activator.picoServices(PicoServices.picoServices()); + HelloInjectionImpl$$injectionActivator activator = new HelloInjectionImpl$$injectionActivator(); + activator.injectionServices(InjectionServices.injectionServices()); ActivationResult result = activator.activate(ActivationRequest.builder().targetPhase(Phase.INJECTING).build()); assertThat(result.success(), is(true)); @@ -251,22 +254,22 @@ void injectionPlanResolved() { Map injectionPlan = result.injectionPlans(); assertThat(injectionPlan.keySet(), containsInAnyOrder( - "io.helidon.pico.runtime.testsubjects.world", - "io.helidon.pico.runtime.testsubjects.worldRef", - "io.helidon.pico.runtime.testsubjects.redWorld", - "io.helidon.pico.runtime.testsubjects.listOfWorlds", - "io.helidon.pico.runtime.testsubjects.listOfWorldRefs", - "io.helidon.pico.runtime.testsubjects.world|1(1)")); - InjectionPlan plan = injectionPlan.get("io.helidon.pico.runtime.testsubjects.world"); + "io.helidon.inject.runtime.testsubjects.world", + "io.helidon.inject.runtime.testsubjects.worldRef", + "io.helidon.inject.runtime.testsubjects.redWorld", + "io.helidon.inject.runtime.testsubjects.listOfWorlds", + "io.helidon.inject.runtime.testsubjects.listOfWorldRefs", + "io.helidon.inject.runtime.testsubjects.world|1(1)")); + InjectionPlan plan = injectionPlan.get("io.helidon.inject.runtime.testsubjects.world"); assertThat(plan.wasResolved(), is(true)); - assertThat(plan.resolved().orElseThrow().getClass(), equalTo(PicoWorldImpl.class)); - plan = injectionPlan.get("io.helidon.pico.runtime.testsubjects.redWorld"); + assertThat(plan.resolved().orElseThrow().getClass(), equalTo(InjectionWorldImpl.class)); + plan = injectionPlan.get("io.helidon.inject.runtime.testsubjects.redWorld"); assertThat(plan.wasResolved(), is(true)); assertThat(plan.resolved().orElseThrow().getClass(), equalTo(Optional.class)); - plan = injectionPlan.get("io.helidon.pico.runtime.testsubjects.worldRef"); + plan = injectionPlan.get("io.helidon.inject.runtime.testsubjects.worldRef"); assertThat(plan.wasResolved(), is(true)); - assertThat(plan.resolved().orElseThrow().getClass(), equalTo(PicoWorldImpl$$picoActivator.class)); - plan = injectionPlan.get("io.helidon.pico.runtime.testsubjects.listOfWorlds"); + assertThat(plan.resolved().orElseThrow().getClass(), equalTo(InjectionWorldImpl$$injectionActivator.class)); + plan = injectionPlan.get("io.helidon.inject.runtime.testsubjects.listOfWorlds"); assertThat(plan.wasResolved(), is(true)); assertThat(plan.resolved().orElseThrow().getClass(), equalTo(ArrayList.class)); diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java similarity index 67% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java index 55958a5fe89..39d3da2c4f2 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/SimplePicoTestingSupport.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/SimpleInjectionTestingSupport.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.runtime; +package io.helidon.inject.runtime; -import io.helidon.pico.api.PicoServicesHolder; +import io.helidon.inject.api.InjectionServicesHolder; /** - * Supporting helper utilities unit-testing Pico services. + * Supporting helper utilities unit-testing services. */ -class SimplePicoTestingSupport { +class SimpleInjectionTestingSupport { /** - * Resets all internal Pico configuration instances, JVM global singletons, service registries, etc. + * Resets all internal configuration instances, JVM global singletons, service registries, etc. */ static void resetAll() { Holder.reset(); @@ -32,9 +32,9 @@ static void resetAll() { @SuppressWarnings("deprecation") - private static class Holder extends PicoServicesHolder { + private static class Holder extends InjectionServicesHolder { public static void reset() { - PicoServicesHolder.reset(); + InjectionServicesHolder.reset(); } } diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/EmptyModule.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/EmptyModule.java similarity index 85% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/EmptyModule.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/EmptyModule.java index 9eaf9771a5d..f6a0a0c2e0c 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/EmptyModule.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/EmptyModule.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.helidon.pico.runtime.testsubjects; +package io.helidon.inject.runtime.testsubjects; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.ServiceBinder; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceBinder; import jakarta.inject.Singleton; diff --git a/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Application.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Application.java new file mode 100644 index 00000000000..1091da44e3c --- /dev/null +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Application.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.helidon.inject.runtime.testsubjects; + +import java.util.Optional; + +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ServiceInjectionPlanBinder; + +import jakarta.annotation.Generated; +import jakarta.inject.Named; +import jakarta.inject.Singleton; + +/** + * For testing. + */ +@Generated(value = "example", comments = "API Version: n") +@Singleton +@Named(HelloInjection$$Application.NAME) +public class HelloInjection$$Application implements Application { + public static boolean ENABLED = true; + + static final String NAME = "HelloInjectionApplication"; + + public HelloInjection$$Application() { + assert(true); // for setting breakpoints in debug + } + + @Override + public Optional named() { + return Optional.of(NAME); + } + + @Override + public void configure(ServiceInjectionPlanBinder binder) { + if (!ENABLED) { + return; + } + + binder.bindTo(HelloInjectionImpl$$injectionActivator.INSTANCE) + .bind(HelloInjectionWorld.class.getPackageName() + ".world", InjectionWorldImpl$$injectionActivator.INSTANCE) + .bind(HelloInjectionWorld.class.getPackageName() + ".worldRef", InjectionWorldImpl$$injectionActivator.INSTANCE) + .bindMany(HelloInjectionWorld.class.getPackageName() + ".listOfWorldRefs", InjectionWorldImpl$$injectionActivator.INSTANCE) + .bindMany(HelloInjectionWorld.class.getPackageName() + ".listOfWorlds", InjectionWorldImpl$$injectionActivator.INSTANCE) + .bindVoid(HelloInjectionWorld.class.getPackageName() + ".redWorld") + .bind(HelloInjectionWorld.class.getPackageName() + ".world|1(1)", InjectionWorldImpl$$injectionActivator.INSTANCE) + .commit(); + + binder.bindTo(InjectionWorldImpl$$injectionActivator.INSTANCE) + .commit(); + } + +} diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Module.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Module.java similarity index 71% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Module.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Module.java index 2e77a8be001..3f42605cc7c 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Module.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjection$$Module.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.runtime.testsubjects; +package io.helidon.inject.runtime.testsubjects; import java.util.Optional; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.ServiceBinder; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceBinder; import jakarta.annotation.Generated; import jakarta.inject.Named; @@ -27,12 +27,12 @@ @Generated(value = "example", comments = "API Version: n") @Singleton -@Named(HelloPico$$Module.NAME) -public final class HelloPico$$Module implements ModuleComponent { +@Named(HelloInjection$$Module.NAME) +public final class HelloInjection$$Module implements ModuleComponent { public static final String NAME = "example"; - public HelloPico$$Module() { + public HelloInjection$$Module() { } @Override @@ -42,8 +42,8 @@ public Optional named() { @Override public void configure(ServiceBinder binder) { - binder.bind(HelloPicoImpl$$picoActivator.INSTANCE); - binder.bind(PicoWorldImpl$$picoActivator.INSTANCE); + binder.bind(HelloInjectionImpl$$injectionActivator.INSTANCE); + binder.bind(InjectionWorldImpl$$injectionActivator.INSTANCE); } } diff --git a/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionImpl$$injectionActivator.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionImpl$$injectionActivator.java new file mode 100644 index 00000000000..4e2ec0ff3c6 --- /dev/null +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionImpl$$injectionActivator.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.helidon.inject.runtime.testsubjects; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; + +import io.helidon.common.Weight; +import io.helidon.common.types.TypeName; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.PostConstructMethod; +import io.helidon.inject.api.PreDestroyMethod; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.runtime.AbstractServiceProvider; +import io.helidon.inject.runtime.Dependencies; + +import jakarta.annotation.Generated; +import jakarta.inject.Provider; +import jakarta.inject.Singleton; + +import static io.helidon.inject.api.ServiceInfoBasics.DEFAULT_INJECT_WEIGHT; + +/** + * Serves as an exemplar of what will is normally code generated. + */ +@Generated(value = "example", comments = "API Version: N") +@Singleton +@Weight(DEFAULT_INJECT_WEIGHT) +@SuppressWarnings({"unchecked", "checkstyle:TypeName"}) +public class HelloInjectionImpl$$injectionActivator extends AbstractServiceProvider { + + private static final ServiceInfo serviceInfo = + ServiceInfo.builder() + .serviceTypeName(HelloInjectionWorldImpl.class) + .activatorTypeName(HelloInjectionImpl$$injectionActivator.class) + .addContractImplemented(HelloInjectionWorld.class) + .addScopeTypeName(Singleton.class) + .declaredRunLevel(0) + .build(); + + public static final HelloInjectionImpl$$injectionActivator INSTANCE = new HelloInjectionImpl$$injectionActivator(); + + public HelloInjectionImpl$$injectionActivator() { + serviceInfo(serviceInfo); + } + + @Override + public Class serviceType() { + return HelloInjectionWorldImpl.class; + } + + @Override + public DependenciesInfo dependencies() { + DependenciesInfo deps = Dependencies.builder(HelloInjectionWorldImpl.class) + .add("world", InjectionWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE).ipName("world").ipType(TypeName.create( + InjectionWorld.class)) + .add("worldRef", InjectionWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) + .providerWrapped().ipName("worldRef").ipType(TypeName.create(Provider.class)) + .add("listOfWorlds", InjectionWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) + .listWrapped().ipName("listOfWorlds").ipType(TypeName.create(List.class)) + .add("listOfWorldRefs", InjectionWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) + .listWrapped().providerWrapped().ipName("listOfWorldRefs").ipType(TypeName.create(List.class)) + .add("redWorld", InjectionWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) + .named("red").optionalWrapped().ipName("redWorld").ipType(TypeName.create(Optional.class)) + .add("world", InjectionWorld.class, ElementKind.METHOD, 1, AccessModifier.PACKAGE_PRIVATE) + .elemOffset(1).ipName("world").ipType(TypeName.create(InjectionWorld.class)) + .build(); + return Dependencies.combine(super.dependencies(), deps); + } + + @Override + protected HelloInjectionWorldImpl createServiceProvider(Map deps) { + return new HelloInjectionWorldImpl(); + } + + @Override + protected void doInjectingFields(Object t, Map deps, Set injections, TypeName forServiceType) { + super.doInjectingFields(t, deps, injections, forServiceType); + HelloInjectionWorldImpl target = (HelloInjectionWorldImpl) t; + target.world = Objects.requireNonNull( + (InjectionWorld) deps.get(InjectionWorld.class.getPackageName() + ".world"), "world"); + target.worldRef = Objects.requireNonNull( + (Provider) deps.get(InjectionWorld.class.getPackageName() + ".worldRef"), "worldRef"); + target.listOfWorldRefs = Objects.requireNonNull( + (List>) deps.get(InjectionWorld.class.getPackageName() + ".listOfWorldRefs"), "listOfWorldRefs"); + target.listOfWorlds = Objects.requireNonNull( + (List) deps.get(InjectionWorld.class.getPackageName() + ".listOfWorlds"), "listOfWorlds"); + target.redWorld = Objects.requireNonNull( + (Optional) deps.get(InjectionWorld.class.getPackageName() + ".redWorld"), "redWorld"); + } + + @Override + protected void doInjectingMethods(Object t, Map deps, Set injections, TypeName forServiceType) { + super.doInjectingMethods(t, deps, injections, forServiceType); + HelloInjectionWorldImpl target = (HelloInjectionWorldImpl)t; + target.world(Objects.requireNonNull( + (InjectionWorld) deps.get(InjectionWorld.class.getPackageName() + ".world|1(1)"))); + } + + @Override + public Optional postConstructMethod() { + HelloInjectionWorldImpl impl = serviceRef().get(); + return Optional.of(impl::postConstruct); + } + + @Override + public Optional preDestroyMethod() { + HelloInjectionWorldImpl impl = serviceRef().get(); + return Optional.of(impl::preDestroy); + } + +} diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorld.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorld.java similarity index 85% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorld.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorld.java index 8f370059ad6..3758843f37c 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorld.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorld.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.runtime.testsubjects; +package io.helidon.inject.runtime.testsubjects; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * For testing. */ @Contract -public interface HelloPicoWorld { +public interface HelloInjectionWorld { /** * For testing. diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorldImpl.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorldImpl.java similarity index 80% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorldImpl.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorldImpl.java index fa5ca3fdc42..e26335bb9a1 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoWorldImpl.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/HelloInjectionWorldImpl.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package io.helidon.pico.runtime.testsubjects; +package io.helidon.inject.runtime.testsubjects; import java.util.List; import java.util.Optional; -import io.helidon.pico.api.RunLevel; +import io.helidon.inject.api.RunLevel; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; @@ -31,24 +31,24 @@ @SuppressWarnings("OptionalUsedAsFieldOrParameterType") @Singleton @RunLevel(0) -public class HelloPicoWorldImpl implements HelloPicoWorld { +public class HelloInjectionWorldImpl implements HelloInjectionWorld { @Inject - PicoWorld world; + InjectionWorld world; @Inject - Provider worldRef; + Provider worldRef; @Inject - List> listOfWorldRefs; + List> listOfWorldRefs; @Inject - List listOfWorlds; + List listOfWorlds; @Inject @Named("red") - Optional redWorld; + Optional redWorld; - private PicoWorld setWorld; + private InjectionWorld setWorld; int postConstructCallCount; int preDestroyCallCount; @@ -65,7 +65,7 @@ public String sayHello() { } @Inject - void world(PicoWorld world) { + void world(InjectionWorld world) { this.setWorld = world; } diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorld.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorld.java similarity index 90% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorld.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorld.java index 7f6cfcb7a8a..89680d45075 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorld.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorld.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.runtime.testsubjects; +package io.helidon.inject.runtime.testsubjects; /** * For testing. */ // @Contract - we will test ExternalContracts here instead -public interface PicoWorld { +public interface InjectionWorld { /** * For testing. diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl$$picoActivator.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl$$injectionActivator.java similarity index 50% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl$$picoActivator.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl$$injectionActivator.java index f7cbac4f2ee..ba0b95d27c2 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl$$picoActivator.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl$$injectionActivator.java @@ -14,54 +14,54 @@ * limitations under the License. */ -package io.helidon.pico.runtime.testsubjects; +package io.helidon.inject.runtime.testsubjects; import java.util.Map; import io.helidon.common.Weight; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.runtime.AbstractServiceProvider; -import io.helidon.pico.runtime.Dependencies; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.runtime.AbstractServiceProvider; +import io.helidon.inject.runtime.Dependencies; import jakarta.annotation.Generated; import jakarta.inject.Singleton; -import static io.helidon.pico.api.ServiceInfoBasics.DEFAULT_PICO_WEIGHT; +import static io.helidon.inject.api.ServiceInfoBasics.DEFAULT_INJECT_WEIGHT; @Generated(value = "example", comments = "API Version: n") @Singleton -@Weight(DEFAULT_PICO_WEIGHT) -public class PicoWorldImpl$$picoActivator extends AbstractServiceProvider { +@Weight(DEFAULT_INJECT_WEIGHT) +public class InjectionWorldImpl$$injectionActivator extends AbstractServiceProvider { private static final ServiceInfo serviceInfo = ServiceInfo.builder() - .serviceTypeName(PicoWorldImpl.class) - .activatorTypeName(PicoWorldImpl$$picoActivator.class) - .addExternalContractImplemented(PicoWorld.class) + .serviceTypeName(InjectionWorldImpl.class) + .activatorTypeName(InjectionWorldImpl$$injectionActivator.class) + .addExternalContractImplemented(InjectionWorld.class) .addScopeTypeName(Singleton.class) - .declaredWeight(DEFAULT_PICO_WEIGHT) + .declaredWeight(DEFAULT_INJECT_WEIGHT) .build(); - public static final PicoWorldImpl$$picoActivator INSTANCE = new PicoWorldImpl$$picoActivator(); + public static final InjectionWorldImpl$$injectionActivator INSTANCE = new InjectionWorldImpl$$injectionActivator(); - PicoWorldImpl$$picoActivator() { + InjectionWorldImpl$$injectionActivator() { serviceInfo(serviceInfo); } @Override public DependenciesInfo dependencies() { - DependenciesInfo dependencies = Dependencies.builder(PicoWorldImpl.class) + DependenciesInfo dependencies = Dependencies.builder(InjectionWorldImpl.class) .build(); return Dependencies.combine(super.dependencies(), dependencies); } @Override - protected PicoWorldImpl createServiceProvider(Map deps) { - return new PicoWorldImpl(); + protected InjectionWorldImpl createServiceProvider(Map deps) { + return new InjectionWorldImpl(); } @Override - public Class serviceType() { - return PicoWorldImpl.class; + public Class serviceType() { + return InjectionWorldImpl.class; } } diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl.java b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl.java similarity index 72% rename from pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl.java rename to inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl.java index eae30845296..ae1b5f85365 100644 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/PicoWorldImpl.java +++ b/inject/tests/runtime/src/test/java/io/helidon/inject/runtime/testsubjects/InjectionWorldImpl.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.runtime.testsubjects; +package io.helidon.inject.runtime.testsubjects; -import io.helidon.pico.api.ExternalContracts; +import io.helidon.inject.api.ExternalContracts; -@ExternalContracts(PicoWorld.class) -public class PicoWorldImpl implements PicoWorld { +@ExternalContracts(InjectionWorld.class) +public class InjectionWorldImpl implements InjectionWorld { private final String name; - PicoWorldImpl() { - this("pico"); + InjectionWorldImpl() { + this("inject"); } - PicoWorldImpl(String name) { + InjectionWorldImpl(String name) { this.name = name; } diff --git a/pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.Application b/inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.Application similarity index 89% rename from pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.Application rename to inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.Application index 3f10df7b8b5..2fc304751dd 100644 --- a/pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.Application +++ b/inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.Application @@ -14,4 +14,4 @@ # limitations under the License. # -io.helidon.pico.runtime.testsubjects.HelloPico$$Application +io.helidon.inject.runtime.testsubjects.HelloInjection$$Application diff --git a/pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.ModuleComponent b/inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.ModuleComponent similarity index 84% rename from pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.ModuleComponent rename to inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.ModuleComponent index e684a847a31..dd99203a03b 100644 --- a/pico/tests/runtime/src/test/resources/META-INF/services/io.helidon.pico.api.ModuleComponent +++ b/inject/tests/runtime/src/test/resources/META-INF/services/io.helidon.inject.api.ModuleComponent @@ -14,5 +14,5 @@ # limitations under the License. # -io.helidon.pico.runtime.testsubjects.HelloPico$$Module -io.helidon.pico.runtime.testsubjects.EmptyModule +io.helidon.inject.runtime.testsubjects.HelloInjection$$Module +io.helidon.inject.runtime.testsubjects.EmptyModule diff --git a/pico/tests/tck-jsr330/pom.xml b/inject/tests/tck-jsr330/pom.xml similarity index 84% rename from pico/tests/tck-jsr330/pom.xml rename to inject/tests/tck-jsr330/pom.xml index 25dd7f2ca78..cdfe0986d85 100644 --- a/pico/tests/tck-jsr330/pom.xml +++ b/inject/tests/tck-jsr330/pom.xml @@ -21,15 +21,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico.tests - helidon-pico-tests-project + io.helidon.inject.tests + helidon-inject-tests-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-tests-tck-jsr330 - Helidon Pico Test JSR-330 TCK + helidon-inject-tests-tck-jsr330 + Helidon Injection Test JSR-330 TCK true @@ -48,12 +48,12 @@ - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin provided true @@ -68,8 +68,8 @@ provided - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test @@ -87,8 +87,8 @@ - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin ${helidon.version} @@ -99,8 +99,8 @@ - -Apico.debug=${pico.debug} - -Apico.autoAddNonContractInterfaces=true + -Ainject.debug=${inject.debug} + -Ainject.autoAddNonContractInterfaces=true org.atinject.tck.auto diff --git a/pico/tests/tck-jsr330/src/test/java/io/helidon/pico/tests/tck/jsr330/Jsr330TckTest.java b/inject/tests/tck-jsr330/src/test/java/io/helidon/inject/tests/tck/jsr330/Jsr330TckTest.java similarity index 85% rename from pico/tests/tck-jsr330/src/test/java/io/helidon/pico/tests/tck/jsr330/Jsr330TckTest.java rename to inject/tests/tck-jsr330/src/test/java/io/helidon/inject/tests/tck/jsr330/Jsr330TckTest.java index edfe64af5be..3b5d5fca877 100644 --- a/pico/tests/tck-jsr330/src/test/java/io/helidon/pico/tests/tck/jsr330/Jsr330TckTest.java +++ b/inject/tests/tck-jsr330/src/test/java/io/helidon/inject/tests/tck/jsr330/Jsr330TckTest.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tests.tck.jsr330; +package io.helidon.inject.tests.tck.jsr330; import java.util.Enumeration; import java.util.Objects; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesConfig; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesConfig; import jakarta.inject.Provider; import junit.framework.TestFailure; @@ -45,9 +45,9 @@ class Jsr330TckTest { */ @Test void testItAll() { - PicoServices picoServices = PicoServices.picoServices().orElseThrow(); - PicoServicesConfig cfg = picoServices.config(); - Provider carProvider = picoServices.services().lookupFirst(Car.class); + InjectionServices injectionServices = InjectionServices.injectionServices().orElseThrow(); + InjectionServicesConfig cfg = injectionServices.config(); + Provider carProvider = injectionServices.services().lookupFirst(Car.class); Objects.requireNonNull(carProvider.get()); assertThat("sanity", carProvider.get(), not(carProvider.get())); junit.framework.Test jsrTest = Tck.testsFor(carProvider.get(), diff --git a/pico/tools/README.md b/inject/tools/README.md similarity index 77% rename from pico/tools/README.md rename to inject/tools/README.md index 0e2a7bcc581..cfbb904885d 100644 --- a/pico/tools/README.md +++ b/inject/tools/README.md @@ -1,3 +1,3 @@ -# pico-tools +# inject-tools This module is primarily used at compile-time only. diff --git a/pico/tools/etc/spotbugs/exclude.xml b/inject/tools/etc/spotbugs/exclude.xml similarity index 75% rename from pico/tools/etc/spotbugs/exclude.xml rename to inject/tools/etc/spotbugs/exclude.xml index 6a2c8f88952..29e45a5638f 100644 --- a/pico/tools/etc/spotbugs/exclude.xml +++ b/inject/tools/etc/spotbugs/exclude.xml @@ -24,48 +24,48 @@ - + - + - + - + - + - + - + - + - + diff --git a/pico/tools/pom.xml b/inject/tools/pom.xml similarity index 92% rename from pico/tools/pom.xml rename to inject/tools/pom.xml index 157722a943d..723f38f25fb 100644 --- a/pico/tools/pom.xml +++ b/inject/tools/pom.xml @@ -21,15 +21,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - io.helidon.pico - helidon-pico-project + io.helidon.inject + helidon-inject-project 4.0.0-SNAPSHOT ../pom.xml 4.0.0 - helidon-pico-tools - Helidon Pico Tools + helidon-inject-tools + Helidon Injection Tools etc/spotbugs/exclude.xml @@ -41,12 +41,12 @@ helidon-common-types - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime io.helidon.common diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/AbstractCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/AbstractCreator.java similarity index 84% rename from pico/tools/src/main/java/io/helidon/pico/tools/AbstractCreator.java rename to inject/tools/src/main/java/io/helidon/inject/tools/AbstractCreator.java index dba27841dc3..63bada38461 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/AbstractCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/AbstractCreator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.nio.file.Path; import java.nio.file.Paths; @@ -26,13 +26,13 @@ import java.util.Set; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.runtime.AbstractServiceProvider; -import io.helidon.pico.runtime.ServiceBinderDefault; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.runtime.AbstractServiceProvider; +import io.helidon.inject.runtime.ServiceBinderDefault; -import static io.helidon.pico.tools.CommonUtils.hasValue; -import static io.helidon.pico.tools.TypeTools.needToDeclareModuleUsage; -import static io.helidon.pico.tools.TypeTools.needToDeclarePackageUsage; +import static io.helidon.inject.tools.TypeTools.needToDeclareModuleUsage; +import static io.helidon.inject.tools.TypeTools.needToDeclarePackageUsage; /** * Abstract base for any codegen creator. @@ -48,8 +48,8 @@ public abstract class AbstractCreator { public static final String DEFAULT_TARGET = "11"; // no special chars since this will be used as a package and class name - static final String NAME_PREFIX = "Pico$$"; - static final String PICO_FRAMEWORK_MODULE = "io.helidon.pico.runtime"; + static final String NAME_PREFIX = "Injection$$"; + static final String INJECT_FRAMEWORK_MODULE = "io.helidon.inject.runtime"; static final String MODULE_NAME_SUFFIX = "Module"; private final System.Logger logger = System.getLogger(getClass().getName()); @@ -62,7 +62,7 @@ public abstract class AbstractCreator { } /** - * Generates the {@link io.helidon.pico.api.Activator} source code for the provided service providers. Custom + * Generates the {@link Activator} source code for the provided service providers. Custom * service providers (see {@link AbstractServiceProvider#isCustom()}) do not qualify to * have activators code generated. * @@ -77,7 +77,7 @@ static String toActivatorCodeGen(ServiceProvider sp) { } /** - * Generates the {@link io.helidon.pico.api.Activator} source code for the provided service providers. + * Generates the {@link Activator} source code for the provided service providers. * * @param coll the collection of service providers * @return the code generated string for the collection of service providers given @@ -93,7 +93,7 @@ static Set toAllContracts(Map> servicesToContr } /** - * Creates the {@link io.helidon.pico.tools.CodeGenPaths} given the current batch of services to process. + * Creates the {@link CodeGenPaths} given the current batch of services to process. * * @param servicesToProcess the services to process * @return the payload for code gen paths @@ -149,20 +149,20 @@ String toGeneratedSticker(TypeName generator, TypeName trigger, TypeName generat } /** - * Automatically adds the requirements to the module-info descriptor for what pico requires. + * Automatically adds the requirements to the module-info descriptor for what Injection requires. * * @param moduleInfo the module info descriptor * @param generatedAnno the generator sticker value * @return the modified descriptor, fluent style */ - ModuleInfoDescriptor.Builder addPicoProviderRequirementsTo(ModuleInfoDescriptor.Builder moduleInfo, - String generatedAnno) { + ModuleInfoDescriptor.Builder addProviderRequirementsTo(ModuleInfoDescriptor.Builder moduleInfo, + String generatedAnno) { Objects.requireNonNull(generatedAnno); - // requirements on the pico services framework itself - String preComment = " // Pico services - " + generatedAnno; - ModuleInfoUtil.addIfAbsent(moduleInfo, PICO_FRAMEWORK_MODULE, ModuleInfoItem.builder() + // requirements on the injection services framework itself + String preComment = " // Injection Runtime - " + generatedAnno; + ModuleInfoUtil.addIfAbsent(moduleInfo, INJECT_FRAMEWORK_MODULE, ModuleInfoItem.builder() .requires(true) - .target(PICO_FRAMEWORK_MODULE) + .target(INJECT_FRAMEWORK_MODULE) .isTransitiveUsed(true) .addPrecomment(preComment)); return moduleInfo; @@ -187,10 +187,10 @@ ModuleInfoDescriptor createModuleInfo(ModuleInfoCreatorRequest req) { if (moduleInfoPath != null) { descriptorBuilder = ModuleInfoDescriptor .builder(ModuleInfoDescriptor.create(Paths.get(moduleInfoPath))); - if (hasValue(moduleName) && ModuleUtils.isUnnamedModuleName(descriptorBuilder.name())) { + if (CommonUtils.hasValue(moduleName) && ModuleUtils.isUnnamedModuleName(descriptorBuilder.name())) { descriptorBuilder.name(moduleName); } - assert (descriptorBuilder.name().equals(moduleName) || (!hasValue(moduleName))) + assert (descriptorBuilder.name().equals(moduleName) || (!CommonUtils.hasValue(moduleName))) : "bad module name: " + moduleName + " targeting " + descriptorBuilder.name(); moduleName = descriptorBuilder.name(); } else { @@ -214,12 +214,12 @@ ModuleInfoDescriptor createModuleInfo(ModuleInfoCreatorRequest req) { .exports(true) .target(moduleTypeName.packageName())); } - ModuleInfoUtil.addIfAbsent(descriptorBuilder, TypeNames.PICO_MODULE, + ModuleInfoUtil.addIfAbsent(descriptorBuilder, TypeNames.INJECT_MODULE, ModuleInfoItem.builder() .provides(true) - .target(TypeNames.PICO_MODULE) + .target(TypeNames.INJECT_MODULE) .addWithOrTo(moduleTypeName.name()) - .addPrecomment(" // Pico module - " + generatedAnno)); + .addPrecomment(" // Module Component - " + generatedAnno)); } if (isApplicationCreated && applicationTypeName != null) { if (!isTestModule) { @@ -228,15 +228,15 @@ ModuleInfoDescriptor createModuleInfo(ModuleInfoCreatorRequest req) { .exports(true) .target(applicationTypeName.packageName())); } - ModuleInfoUtil.addIfAbsent(descriptorBuilder, TypeNames.PICO_APPLICATION, + ModuleInfoUtil.addIfAbsent(descriptorBuilder, TypeNames.INJECT_APPLICATION, ModuleInfoItem.builder() .provides(true) - .target(TypeNames.PICO_APPLICATION) + .target(TypeNames.INJECT_APPLICATION) .addWithOrTo(applicationTypeName.name()) - .addPrecomment(" // Pico application - " + generatedAnno)); + .addPrecomment(" // Application - " + generatedAnno)); } - String preComment = " // Pico external contract usage - " + generatedAnno; + String preComment = " // External contract usage - " + generatedAnno; if (modulesRequired != null) { for (String externalModuleName : modulesRequired) { if (!needToDeclareModuleUsage(externalModuleName)) { @@ -246,7 +246,7 @@ ModuleInfoDescriptor createModuleInfo(ModuleInfoCreatorRequest req) { ModuleInfoItem.Builder itemBuilder = ModuleInfoItem.builder() .requires(true) .target(externalModuleName); - if (hasValue(preComment)) { + if (CommonUtils.hasValue(preComment)) { itemBuilder.addPrecomment(preComment); } @@ -259,7 +259,7 @@ ModuleInfoDescriptor createModuleInfo(ModuleInfoCreatorRequest req) { Set allExternalContracts = toAllContracts(externalContracts); if (!isTestModule && (contracts != null)) { - preComment = " // Pico contract usage - " + generatedAnno; + preComment = " // Contract usage - " + generatedAnno; for (Map.Entry> e : contracts.entrySet()) { for (TypeName contract : e.getValue()) { if (!allExternalContracts.contains(contract)) { @@ -271,7 +271,7 @@ ModuleInfoDescriptor createModuleInfo(ModuleInfoCreatorRequest req) { ModuleInfoItem.Builder itemBuilder = ModuleInfoItem.builder() .exports(true) .target(packageName); - if (hasValue(preComment)) { + if (CommonUtils.hasValue(preComment)) { itemBuilder.addPrecomment(preComment); } @@ -284,7 +284,7 @@ ModuleInfoDescriptor createModuleInfo(ModuleInfoCreatorRequest req) { } } - return addPicoProviderRequirementsTo(descriptorBuilder, generatedAnno); + return addProviderRequirementsTo(descriptorBuilder, generatedAnno); } } diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/AbstractFilerMessager.java b/inject/tools/src/main/java/io/helidon/inject/tools/AbstractFilerMessager.java similarity index 99% rename from pico/tools/src/main/java/io/helidon/pico/tools/AbstractFilerMessager.java rename to inject/tools/src/main/java/io/helidon/inject/tools/AbstractFilerMessager.java index c0523cf7940..d6dad3bcb20 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/AbstractFilerMessager.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/AbstractFilerMessager.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.File; import java.io.FileInputStream; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCodeGenDetailBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCodeGenDetailBlueprint.java similarity index 84% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCodeGenDetailBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCodeGenDetailBlueprint.java index d2569ebc563..3a453e68056 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCodeGenDetailBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCodeGenDetailBlueprint.java @@ -14,16 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; import io.helidon.builder.api.Prototype; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ServiceInfoBasics; /** - * The specifics for a single {@link io.helidon.pico.api.ServiceProvider} that was code generated. + * The specifics for a single {@link ServiceProvider} that was code generated. * * @see ActivatorCreatorResponse#serviceTypeDetails() */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorArgsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorArgsBlueprint.java similarity index 93% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorArgsBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorArgsBlueprint.java index 3686bcf3a83..07a8a485562 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorArgsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorArgsBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Collection; import java.util.List; @@ -23,8 +23,8 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ServiceInfoBasics; /** * See {@link ActivatorCreatorDefault}. diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorCodeGenBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorCodeGenBlueprint.java similarity index 84% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorCodeGenBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorCodeGenBlueprint.java index a07fbec35bf..d05bd8a23b1 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorCodeGenBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorCodeGenBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Map; @@ -23,8 +23,16 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.Qualifier; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.ExternalContracts; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.PostConstructMethod; +import io.helidon.inject.api.PreDestroyMethod; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.Qualifier; /** * Codegen request options applicable as part of the overall {@link ActivatorCreatorRequest}. @@ -65,7 +73,7 @@ interface ActivatorCreatorCodeGenBlueprint { * * @return the map of service type names to each respective access level */ - Map serviceTypeAccessLevels(); + Map serviceTypeAccessLevels(); /** * The map of service type names to whether they are abstract. If not found then assume concrete. @@ -75,16 +83,16 @@ interface ActivatorCreatorCodeGenBlueprint { Map serviceTypeIsAbstractTypes(); /** - * The {@link io.helidon.pico.api.Contract}'s associated with each service type. + * The {@link Contract}'s associated with each service type. * - * @return the map of service type names to {@link io.helidon.pico.api.Contract}'s implemented + * @return the map of service type names to {@link Contract}'s implemented */ Map> serviceTypeContracts(); /** - * The {@link io.helidon.pico.api.ExternalContracts} associated with each service type. + * The {@link ExternalContracts} associated with each service type. * - * @return the map of service type names to {@link io.helidon.pico.api.ExternalContracts} implemented + * @return the map of service type names to {@link ExternalContracts} implemented */ Map> serviceTypeExternalContracts(); @@ -106,7 +114,7 @@ interface ActivatorCreatorCodeGenBlueprint { * The {@code PreDestroy} method name for each service type. * * @return the map of service type names to PreDestroy method names - * @see io.helidon.pico.api.PreDestroyMethod + * @see PreDestroyMethod */ Map serviceTypePreDestroyMethodNames(); @@ -114,7 +122,7 @@ interface ActivatorCreatorCodeGenBlueprint { * The {@code PostConstruct} method name for each service type. * * @return the map of service type names to PostConstruct method names - * @see io.helidon.pico.api.PostConstructMethod + * @see PostConstructMethod */ Map serviceTypePostConstructMethodNames(); @@ -126,7 +134,7 @@ interface ActivatorCreatorCodeGenBlueprint { Map serviceTypeWeights(); /** - * The declared {@link io.helidon.pico.api.RunLevel} value for each service type. + * The declared {@link RunLevel} value for each service type. * * @return the map of service type names to declared run level */ @@ -190,10 +198,10 @@ interface ActivatorCreatorCodeGenBlueprint { String classPrefixName(); /** - * Used in conjunction with {@link io.helidon.pico.tools.ActivatorCreatorConfigOptions#moduleCreated()}. + * Used in conjunction with {@link ActivatorCreatorConfigOptions#moduleCreated()}. * If a module is created and this set is - * populated then this set will be used to represent all {@link io.helidon.pico.api.Activator} type names that should be code - * generated for this {@link io.helidon.pico.api.ModuleComponent}. + * populated then this set will be used to represent all {@link Activator} type names that should be code + * generated for this {@link ModuleComponent}. * * @return all module activator type names known for this given module being processed */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorConfigOptionsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorConfigOptionsBlueprint.java similarity index 74% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorConfigOptionsBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorConfigOptionsBlueprint.java index 6d8980f6b71..da8d74c270d 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorConfigOptionsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorConfigOptionsBlueprint.java @@ -14,16 +14,20 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.tools.spi.ActivatorCreator; /** * These options are expected to have an affinity match to "permit" properties found within - * {@link io.helidon.pico.api.PicoServicesConfig}. These are used to fine tune the type of code generated. + * {@link InjectionServicesConfig}. These are used to fine tune the type of code generated. * - * @see io.helidon.pico.tools.spi.ActivatorCreator + * @see ActivatorCreator */ @Prototype.Blueprint interface ActivatorCreatorConfigOptionsBlueprint { @@ -42,7 +46,7 @@ interface ActivatorCreatorConfigOptionsBlueprint { boolean supportsJsr330InStrictMode(); /** - * Should a {@link io.helidon.pico.api.ModuleComponent} be created during activator creation. The default is true. + * Should a {@link ModuleComponent} be created during activator creation. The default is true. * * @return true if the module should be created */ @@ -50,8 +54,8 @@ interface ActivatorCreatorConfigOptionsBlueprint { boolean moduleCreated(); /** - * Should a stub {@link io.helidon.pico.api.Application} be created during activator creation. The default is false. - * This feature can opt'ed in by using {@code pico.application.pre.create}. Pre-req requires that this can + * Should a stub {@link Application} be created during activator creation. The default is false. + * This feature can opt'ed in by using {@code inject.application.pre.create}. Pre-req requires that this can * only be enabled if {@link #moduleCreated()} is also enabled. * * @return true if the application should be created diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorDefault.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorDefault.java similarity index 95% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorDefault.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorDefault.java index 2adbfe64c8f..1a63368364e 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorDefault.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorDefault.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.nio.file.Path; import java.util.ArrayList; @@ -38,21 +38,25 @@ import io.helidon.common.processor.CopyrightHandler; import io.helidon.common.processor.GeneratorTools; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.DependencyInfo; -import io.helidon.pico.api.DependencyInfoComparator; -import io.helidon.pico.api.ElementInfo; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.runtime.AbstractServiceProvider; -import io.helidon.pico.runtime.Dependencies; -import io.helidon.pico.tools.spi.ActivatorCreator; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.DeActivator; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.DependencyInfo; +import io.helidon.inject.api.DependencyInfoComparator; +import io.helidon.inject.api.ElementInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.runtime.AbstractServiceProvider; +import io.helidon.inject.runtime.Dependencies; +import io.helidon.inject.tools.spi.ActivatorCreator; import io.github.classgraph.AnnotationInfo; import io.github.classgraph.ClassInfo; @@ -61,31 +65,28 @@ import io.github.classgraph.ScanResult; import jakarta.inject.Singleton; -import static io.helidon.pico.api.ServiceInfoBasics.DEFAULT_PICO_WEIGHT; -import static io.helidon.pico.tools.CommonUtils.first; -import static io.helidon.pico.tools.CommonUtils.hasValue; -import static io.helidon.pico.tools.CommonUtils.toFlatName; -import static io.helidon.pico.tools.TypeTools.componentTypeNameOf; -import static io.helidon.pico.tools.TypeTools.createTypeNameFromClassInfo; -import static io.helidon.pico.tools.TypeTools.isPackagePrivate; +import static io.helidon.inject.api.ServiceInfoBasics.DEFAULT_INJECT_WEIGHT; +import static io.helidon.inject.tools.TypeTools.componentTypeNameOf; +import static io.helidon.inject.tools.TypeTools.createTypeNameFromClassInfo; +import static io.helidon.inject.tools.TypeTools.isPackagePrivate; /** - * Responsible for building all pico-di related collateral for a module, including: + * Responsible for building all di related collateral for a module, including: *

        - *
      1. The {@link io.helidon.pico.api.ServiceProvider} for each service type implementation passed in. - *
      2. The {@link io.helidon.pico.api.Activator} and {@link io.helidon.pico.api.DeActivator} for each service type + *
      3. The {@link ServiceProvider} for each service type implementation passed in. + *
      4. The {@link Activator} and {@link DeActivator} for each service type * implementation passed in. - *
      5. The {@link io.helidon.pico.api.ModuleComponent} for the aggregate service provider bindings for the same set of service + *
      6. The {@link ModuleComponent} for the aggregate service provider bindings for the same set of service * type names. *
      7. The module-info as appropriate for the above set of services (and contracts). *
      8. The /META-INF/services entries as appropriate. *
      * * This API can also be used to only produce meta-information describing the model without the codegen option - see - * {@link io.helidon.pico.tools.ActivatorCreatorRequest#codeGenPaths()} for details. + * {@link ActivatorCreatorRequest#codeGenPaths()} for details. */ @Singleton -@Weight(DEFAULT_PICO_WEIGHT) +@Weight(DEFAULT_INJECT_WEIGHT) public class ActivatorCreatorDefault extends AbstractCreator implements ActivatorCreator, Weighted { /** * The suffix name for the service type activator class. @@ -116,7 +117,7 @@ public ActivatorCreatorDefault() { static TypeName toModuleTypeName(ActivatorCreatorRequest req, List activatorTypeNames) { String packageName; - if (hasValue(req.packageName().orElse(null))) { + if (CommonUtils.hasValue(req.packageName().orElse(null))) { packageName = req.packageName().orElseThrow(); } else { if (activatorTypeNames == null || activatorTypeNames.isEmpty()) { @@ -142,11 +143,11 @@ static Map> toMetaInfServices(ModuleDetail moduleDetail, boolean isModuleCreated) { Map> metaInfServices = new LinkedHashMap<>(); if (isApplicationCreated && applicationTypeName != null) { - metaInfServices.put(TypeNames.PICO_APPLICATION, + metaInfServices.put(TypeNames.INJECT_APPLICATION, List.of(applicationTypeName.name())); } if (isModuleCreated && moduleDetail != null) { - metaInfServices.put(TypeNames.PICO_MODULE, + metaInfServices.put(TypeNames.INJECT_MODULE, List.of(moduleDetail.moduleTypeName().name())); } return metaInfServices; @@ -162,8 +163,8 @@ public static Optional createActivatorCreatorCodeGen(Se // do not generate activators for modules or applications... List serviceTypeNames = services.serviceTypeNames(); if (!serviceTypeNames.isEmpty()) { - TypeName applicationTypeName = TypeName.create(TypeNames.PICO_APPLICATION); - TypeName moduleTypeName = TypeName.create(TypeNames.PICO_MODULE); + TypeName applicationTypeName = TypeName.create(TypeNames.INJECT_APPLICATION); + TypeName moduleTypeName = TypeName.create(TypeNames.INJECT_MODULE); serviceTypeNames = serviceTypeNames.stream() .filter(typeName -> { Set contracts = services.contracts().get(typeName); @@ -313,7 +314,7 @@ static String applicationClassName(String modulePrefix) { @Override public ActivatorCreatorResponse createModuleActivators(ActivatorCreatorRequest req) throws ToolsException { - String templateName = (hasValue(req.templateName())) ? req.templateName() : templateName(); + String templateName = (CommonUtils.hasValue(req.templateName())) ? req.templateName() : templateName(); ActivatorCreatorResponse.Builder builder = ActivatorCreatorResponse.builder() .getConfigOptions(req.configOptions()) @@ -524,7 +525,7 @@ String toApplicationStubBody(ActivatorCreatorRequest req, Map subst = new HashMap<>(); subst.put("classname", applicationTypeName.className()); subst.put("packagename", applicationTypeName.packageName()); - subst.put("description", "Generated Pico Application."); + subst.put("description", "Generated Application."); subst.put("generatedanno", generatedSticker); TypeName generatorType = TypeName.create(getClass()); subst.put("header", CopyrightHandler.copyright(generatorType, generatorType, applicationTypeName)); @@ -549,7 +550,7 @@ String toModuleBody(ActivatorCreatorRequest req, Map subst = new HashMap<>(); subst.put("classname", className); subst.put("packagename", packageName); - subst.put("description", "Generated Pico Module."); + subst.put("description", "Generated ModuleComponent."); subst.put("generatedanno", generatedSticker); TypeName generatorType = TypeName.create(getClass()); TypeName moduleType = TypeName.builder() @@ -567,7 +568,7 @@ String toModuleBody(ActivatorCreatorRequest req, public TypeName toActivatorImplTypeName(TypeName serviceTypeName) { return TypeName.builder() .packageName(serviceTypeName.packageName()) - .className(toFlatName(serviceTypeName.classNameWithEnclosingNames()) + INNER_ACTIVATOR_CLASS_NAME) + .className(CommonUtils.toFlatName(serviceTypeName.classNameWithEnclosingNames()) + INNER_ACTIVATOR_CLASS_NAME) .build(); } @@ -601,7 +602,7 @@ String toCodegenDependency(ServiceInfoCriteria dependencyTo, //.add("world", World.class, InjectionPointInfo.ElementKind.FIELD, InjectionPointInfo.Access.PACKAGE_PRIVATE) String elemName = CodeGenUtils.elementNameKindRef(ipInfo.elementName(), ipInfo.elementKind()); builder.append(".add(").append(elemName).append(", "); - builder.append(Objects.requireNonNull(componentTypeNameOf(first(dependencyTo.contractsImplemented(), true)))) + builder.append(Objects.requireNonNull(componentTypeNameOf(CommonUtils.first(dependencyTo.contractsImplemented(), true)))) .append(".class, "); builder.append("ElementKind.").append(Objects.requireNonNull(ipInfo.elementKind())).append(", "); if (ElementKind.FIELD != ipInfo.elementKind()) { @@ -666,7 +667,7 @@ String toCodegenQuotedString(String value) { String toCodegenDecl(ServiceInfoCriteria dependencyTo, InjectionPointInfo injectionPointInfo) { - TypeName contract = first(dependencyTo.contractsImplemented(), true); + TypeName contract = CommonUtils.first(dependencyTo.contractsImplemented(), true); StringBuilder builder = new StringBuilder(); if (injectionPointInfo.optionalWrapped()) { builder.append("Optional<").append(contract).append(">"); @@ -685,11 +686,11 @@ String toCodegenDecl(ServiceInfoCriteria dependencyTo, builder.append(">"); } } - PicoSupported.isSupportedInjectionPoint(logger(), - injectionPointInfo.serviceTypeName(), - injectionPointInfo, - AccessModifier.PRIVATE == injectionPointInfo.access(), - injectionPointInfo.staticDeclaration()); + InjectionSupported.isSupportedInjectionPoint(logger(), + injectionPointInfo.serviceTypeName(), + injectionPointInfo, + AccessModifier.PRIVATE == injectionPointInfo.access(), + injectionPointInfo.staticDeclaration()); return builder.toString(); } @@ -899,7 +900,7 @@ List toCodegenInjectMethodsSkippedInParent(boolean isSupportsJsr330InStr MethodInfoList parentMethods = parentClassInfo.getDeclaredMethodInfo(); Map injectedParentMethods = parentMethods.stream() .filter(m -> (m.getAnnotationInfo(TypeNames.JAKARTA_INJECT) != null)) - .filter(m -> ExternalModuleCreatorDefault.isPicoSupported(parentTypeName, m, logger())) + .filter(m -> ExternalModuleCreatorDefault.isInjectionSupported(parentTypeName, m, logger())) .collect(Collectors.toMap(ActivatorCreatorDefault::toBaseIdTag, Function.identity())); if (injectedParentMethods.isEmpty()) { return null; @@ -907,7 +908,7 @@ List toCodegenInjectMethodsSkippedInParent(boolean isSupportsJsr330InStr MethodInfoList methods = classInfo.getDeclaredMethodInfo(); Map allSupportedMethodsOnServiceType = methods.stream() - .filter(m -> ExternalModuleCreatorDefault.isPicoSupported(serviceTypeName, m, logger())) + .filter(m -> ExternalModuleCreatorDefault.isInjectionSupported(serviceTypeName, m, logger())) .collect(Collectors.toMap(ActivatorCreatorDefault::toBaseIdTag, Function.identity())); List removeList = null; @@ -1247,7 +1248,7 @@ private String toActivatorBody(ActivatorCreatorArgs args) { subst.put("activatorsuffix", INNER_ACTIVATOR_CLASS_NAME); subst.put("constructor", args.constructor()); subst.put("classname", args.activatorTypeName().classNameWithEnclosingNames()); - subst.put("flatclassname", toFlatName(args.activatorTypeName().classNameWithEnclosingNames())); + subst.put("flatclassname", CommonUtils.toFlatName(args.activatorTypeName().classNameWithEnclosingNames())); subst.put("packagename", args.activatorTypeName().packageName()); subst.put("activatorgenericdecl", args.activatorGenericDecl().orElse(null)); subst.put("parent", toCodenParent(args.isSupportsJsr330InStrictMode(), diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorProvider.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorProvider.java similarity index 91% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorProvider.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorProvider.java index 82683bfefd3..cd43d2c6d1d 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorProvider.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorProvider.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.ServiceLoader; import io.helidon.common.HelidonServiceLoader; import io.helidon.common.LazyValue; -import io.helidon.pico.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.spi.ActivatorCreator; import jakarta.inject.Provider; import jakarta.inject.Singleton; /** - * Provides access to the global singleton {@link io.helidon.pico.tools.spi.ActivatorCreator} in use. + * Provides access to the global singleton {@link ActivatorCreator} in use. */ @Singleton public class ActivatorCreatorProvider implements Provider { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorRequestBlueprint.java similarity index 82% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorRequestBlueprint.java index ee79b7c00b8..2467965735b 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorRequestBlueprint.java @@ -14,13 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import io.helidon.builder.api.Prototype; +import io.helidon.inject.api.Activator; +import io.helidon.inject.tools.spi.ActivatorCreator; /** - * Request used in conjunction with {@link io.helidon.pico.tools.spi.ActivatorCreator} to codegen the - * {@link io.helidon.pico.api.Activator} source artifacts. + * Request used in conjunction with {@link ActivatorCreator} to codegen the + * {@link Activator} source artifacts. */ @Prototype.Blueprint interface ActivatorCreatorRequestBlueprint extends GeneralCreatorRequestBlueprint { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorResponseBlueprint.java similarity index 85% rename from pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorResponseBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorResponseBlueprint.java index 98a26683ab4..0344b909beb 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ActivatorCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorResponseBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Map; import java.util.Optional; @@ -22,9 +22,11 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.tools.spi.ActivatorCreator; /** - * The result of calling {@link io.helidon.pico.tools.spi.ActivatorCreator} assuming no errors are thrown. + * The result of calling {@link ActivatorCreator} assuming no errors are thrown. */ @Prototype.Blueprint interface ActivatorCreatorResponseBlueprint extends GeneralCreatorResponseBlueprint { @@ -45,7 +47,7 @@ interface ActivatorCreatorResponseBlueprint extends GeneralCreatorResponseBluepr Map serviceTypeInterceptorPlans(); /** - * The activator types placed in the generated {@link io.helidon.pico.api.ModuleComponent}. + * The activator types placed in the generated {@link ModuleComponent}. * * @return the activator type names placed in the module component */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorCodeGenBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorCodeGenBlueprint.java similarity index 87% rename from pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorCodeGenBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorCodeGenBlueprint.java index 16a3e59e226..af4df737eff 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorCodeGenBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorCodeGenBlueprint.java @@ -14,17 +14,18 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; +import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Codegen request options applicable for {@link io.helidon.pico.tools.spi.ApplicationCreator}. + * Codegen request options applicable for {@link ApplicationCreator}. * - * @see io.helidon.pico.tools.spi.ApplicationCreator + * @see ApplicationCreator */ @Prototype.Blueprint interface ApplicationCreatorCodeGenBlueprint { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorConfigOptionsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorConfigOptionsBlueprint.java similarity index 94% rename from pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorConfigOptionsBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorConfigOptionsBlueprint.java index 8b16bf03ee1..f7289ebeea5 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorConfigOptionsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorConfigOptionsBlueprint.java @@ -14,16 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Set; import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; import io.helidon.config.metadata.ConfiguredOption; +import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Configuration directives and options optionally provided to the {@link io.helidon.pico.tools.spi.ApplicationCreator}. + * Configuration directives and options optionally provided to the {@link ApplicationCreator}. */ @Prototype.Blueprint interface ApplicationCreatorConfigOptionsBlueprint { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorDefault.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorDefault.java similarity index 86% rename from pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorDefault.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorDefault.java index dccc2f79667..d373808b615 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorDefault.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorDefault.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.File; import java.nio.file.Path; @@ -32,33 +32,34 @@ import io.helidon.common.processor.CopyrightHandler; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.runtime.AbstractServiceProvider; -import io.helidon.pico.runtime.PicoInjectionPlan; -import io.helidon.pico.runtime.ServiceBinderDefault; -import io.helidon.pico.tools.spi.ApplicationCreator; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.runtime.AbstractServiceProvider; +import io.helidon.inject.runtime.HeldionInjectionPlan; +import io.helidon.inject.runtime.ServiceBinderDefault; +import io.helidon.inject.tools.spi.ApplicationCreator; import jakarta.inject.Provider; import jakarta.inject.Singleton; -import static io.helidon.pico.api.ServiceInfoBasics.DEFAULT_PICO_WEIGHT; -import static io.helidon.pico.runtime.ServiceUtils.isQualifiedInjectionTarget; +import static io.helidon.inject.api.ServiceInfoBasics.DEFAULT_INJECT_WEIGHT; +import static io.helidon.inject.runtime.ServiceUtils.isQualifiedInjectionTarget; /** - * The default implementation for {@link io.helidon.pico.tools.spi.ApplicationCreator}. + * The default implementation for {@link ApplicationCreator}. */ @Singleton -@Weight(DEFAULT_PICO_WEIGHT) +@Weight(DEFAULT_INJECT_WEIGHT) public class ApplicationCreatorDefault extends AbstractCreator implements ApplicationCreator { /** - * The prefix to add before the generated "Application" class name (i.e., "Pico$$" in the "Pico$$Application"). + * The prefix to add before the generated "Application" class name (i.e., "Injection$$" in the "Injection$$Application"). */ public static final String NAME_PREFIX = AbstractCreator.NAME_PREFIX; @@ -68,7 +69,7 @@ public class ApplicationCreatorDefault extends AbstractCreator implements Applic public static final String APPLICATION_NAME_SUFFIX = "Application"; /** - * The FQN "Pico$$Application" name. + * The FQN "Injection$$Application" name. */ public static final String APPLICATION_NAME = NAME_PREFIX + APPLICATION_NAME_SUFFIX; @@ -153,7 +154,7 @@ static TypeName toApplicationTypeName(ApplicationCreatorRequest req) { ApplicationCreatorCodeGen codeGen = Objects.requireNonNull(req.codeGen()); String packageName = codeGen.packageName().orElse(null); if (packageName == null) { - packageName = "pico"; + packageName = "inject"; } String className = Objects.requireNonNull(codeGen.className().orElse(null)); return TypeName.builder() @@ -166,20 +167,20 @@ static String toModuleName(ApplicationCreatorRequest req) { return req.moduleName().orElse(ModuleInfoDescriptor.DEFAULT_MODULE_NAME); } - static Optional moduleServiceTypeOf(PicoServices picoServices, + static Optional moduleServiceTypeOf(InjectionServices injectionServices, String moduleName) { - Services services = picoServices.services(); + Services services = injectionServices.services(); ServiceProvider serviceProvider; try { serviceProvider = services.lookup(ModuleComponent.class, moduleName); - } catch (PicoException e) { + } catch (InjectionException e) { return Optional.empty(); } return Optional.of(serviceProvider.serviceInfo().serviceTypeName()); } /** - * Generates the source and class file for {@link io.helidon.pico.api.Application} using the current classpath. + * Generates the source and class file for {@link Application} using the current classpath. * * @param req the request * @return the response for application creation @@ -218,8 +219,8 @@ public ApplicationCreatorResponse createApplication(ApplicationCreatorRequest re @SuppressWarnings("rawtypes") List providersNotAllowed(ApplicationCreatorRequest req) { - PicoServices picoServices = PicoServices.picoServices().orElseThrow(); - Services services = picoServices.services(); + InjectionServices injectionServices = InjectionServices.injectionServices().orElseThrow(); + Services services = injectionServices.services(); List> providers = services.lookupAll(Provider.class); if (providers.isEmpty()) { @@ -239,7 +240,7 @@ && isProvider(typeName, services) ApplicationCreatorResponse codegen(ApplicationCreatorRequest req, ApplicationCreatorResponse.Builder builder) { - PicoServices picoServices = PicoServices.picoServices().orElseThrow(); + InjectionServices injectionServices = InjectionServices.injectionServices().orElseThrow(); String serviceTypeBindingTemplate = templateHelper() .safeLoadTemplate(req.templateName(), SERVICE_PROVIDER_APPLICATION_SERVICETYPEBINDING_HBS); @@ -250,7 +251,7 @@ ApplicationCreatorResponse codegen(ApplicationCreatorRequest req, List serviceTypeBindings = new ArrayList<>(); for (TypeName serviceTypeName : req.serviceTypeNames()) { try { - String injectionPlan = toServiceTypeInjectionPlan(picoServices, serviceTypeName, + String injectionPlan = toServiceTypeInjectionPlan(injectionServices, serviceTypeName, serviceTypeBindingTemplate, serviceTypeBindingEmptyTemplate); if (injectionPlan == null) { continue; @@ -270,7 +271,7 @@ ApplicationCreatorResponse codegen(ApplicationCreatorRequest req, Map subst = new HashMap<>(); subst.put("classname", application.className()); subst.put("packagename", application.packageName()); - subst.put("description", application + " - Generated Pico Application."); + subst.put("description", application + " - Generated Application."); subst.put("header", CopyrightHandler.copyright(CREATOR, CREATOR, application)); @@ -285,7 +286,7 @@ ApplicationCreatorResponse codegen(ApplicationCreatorRequest req, if (req.codeGenPaths().isPresent() && req.codeGenPaths().get().generatedSourcesPath().isPresent()) { - codegen(picoServices, req, application, body); + codegen(injectionServices, req, application, body); } GeneralCodeGenDetail codeGenDetail = GeneralCodeGenDetail.builder() @@ -306,11 +307,11 @@ ApplicationCreatorResponse codegen(ApplicationCreatorRequest req, .build(); } - String toServiceTypeInjectionPlan(PicoServices picoServices, + String toServiceTypeInjectionPlan(InjectionServices injectionServices, TypeName serviceTypeName, String serviceTypeBindingTemplate, String serviceTypeBindingEmptyTemplate) { - Services services = picoServices.services(); + Services services = injectionServices.services(); ServiceInfoCriteria si = toServiceInfoCriteria(serviceTypeName); ServiceProvider sp = services.lookupFirst(si); @@ -340,8 +341,8 @@ List toInjectionPlanBindings(ServiceProvider sp) { } List plan = new ArrayList<>(deps.allDependencies().size()); - Map injectionPlan = asp.getOrCreateInjectionPlan(false); - for (Map.Entry e : injectionPlan.entrySet()) { + Map injectionPlan = asp.getOrCreateInjectionPlan(false); + for (Map.Entry e : injectionPlan.entrySet()) { StringBuilder line = new StringBuilder(); InjectionPointInfo ipInfo = e.getValue().injectionPointInfo(); List> ipQualified = e.getValue().injectionPointQualifiedServiceProviders(); @@ -388,12 +389,12 @@ List toInjectionPlanBindings(ServiceProvider sp) { /** * Perform the file creation and javac it. * - * @param picoServices the pico services to use + * @param injectionServices the injection services to use * @param req the request * @param applicationTypeName the application type name * @param body the source code / body to generate */ - void codegen(PicoServices picoServices, + void codegen(InjectionServices injectionServices, ApplicationCreatorRequest req, TypeName applicationTypeName, String body) { @@ -408,10 +409,10 @@ void codegen(PicoServices picoServices, // setup meta-inf services codegenMetaInfServices(filer, req.codeGenPaths().orElse(null), - Map.of(TypeNames.PICO_APPLICATION, List.of(applicationTypeName.name()))); + Map.of(TypeNames.INJECT_APPLICATION, List.of(applicationTypeName.name()))); // setup module-info - codegenModuleInfoDescriptor(filer, picoServices, req, applicationTypeName); + codegenModuleInfoDescriptor(filer, injectionServices, req, applicationTypeName); // compile, but only if we generated the source file if (applicationJavaFilePath != null) { @@ -440,26 +441,26 @@ void codegen(PicoServices picoServices, } void codegenModuleInfoDescriptor(CodeGenFiler filer, - PicoServices picoServices, + InjectionServices injectionServices, ApplicationCreatorRequest req, TypeName applicationTypeName) { - Optional picoModuleInfoPath = filer.toResourceLocation(ModuleUtils.PICO_MODULE_INFO_JAVA_NAME); - ModuleInfoDescriptor descriptor = filer.readModuleInfo(ModuleUtils.PICO_MODULE_INFO_JAVA_NAME).orElse(null); + Optional injectionModuleInfoPath = filer.toResourceLocation(ModuleUtils.MODULE_INFO_JAVA_NAME); + ModuleInfoDescriptor descriptor = filer.readModuleInfo(ModuleUtils.MODULE_INFO_JAVA_NAME).orElse(null); if (descriptor != null) { - Objects.requireNonNull(picoModuleInfoPath.orElseThrow()); + Objects.requireNonNull(injectionModuleInfoPath.orElseThrow()); String moduleName = req.moduleName().orElse(null); if (moduleName == null || ModuleInfoDescriptor.DEFAULT_MODULE_NAME.equals(moduleName)) { moduleName = descriptor.name(); } - TypeName moduleTypeName = moduleServiceTypeOf(picoServices, moduleName).orElse(null); + TypeName moduleTypeName = moduleServiceTypeOf(injectionServices, moduleName).orElse(null); if (moduleTypeName != null) { String typePrefix = req.codeGen().classPrefixName(); ModuleInfoCreatorRequest moduleBuilderRequest = ModuleInfoCreatorRequest.builder() .name(moduleName) .moduleTypeName(moduleTypeName) .applicationTypeName(applicationTypeName) - .moduleInfoPath(picoModuleInfoPath.get().toAbsolutePath().toString()) + .moduleInfoPath(injectionModuleInfoPath.get().toAbsolutePath().toString()) .classPrefixName(typePrefix) .applicationCreated(true) .moduleCreated(false) @@ -473,7 +474,7 @@ void codegenModuleInfoDescriptor(CodeGenFiler filer, Path realModuleInfoPath = filer.toSourceLocation(ModuleUtils.REAL_MODULE_INFO_JAVA_NAME).orElse(null); if (realModuleInfoPath != null && !realModuleInfoPath.toFile().exists()) { throw new ToolsException("Expected to find " + realModuleInfoPath - + ". Did the Pico APT run?"); + + ". Did the Injection APT run?"); } } diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorRequestBlueprint.java similarity index 87% rename from pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorRequestBlueprint.java index c13d163cb5d..35202deae6c 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorRequestBlueprint.java @@ -14,14 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; import io.helidon.builder.api.Prototype; +import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Defines the request that will be passed to the {@link io.helidon.pico.tools.spi.ApplicationCreator} in order to produce the + * Defines the request that will be passed to the {@link ApplicationCreator} in order to produce the * codegen artifacts. */ @Prototype.Blueprint diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorResponseBlueprint.java similarity index 77% rename from pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorResponseBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorResponseBlueprint.java index 405d7e6b26b..d47f9aee7ab 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ApplicationCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorResponseBlueprint.java @@ -14,20 +14,22 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import io.helidon.builder.api.Prototype; +import io.helidon.inject.api.Application; +import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Response from {@link io.helidon.pico.tools.spi.ApplicationCreator}. + * Response from {@link ApplicationCreator}. * - * @see io.helidon.pico.tools.spi.ApplicationCreator + * @see ApplicationCreator */ @Prototype.Blueprint public interface ApplicationCreatorResponseBlueprint extends GeneralCreatorResponseBlueprint { /** - * The basic description for the {@link io.helidon.pico.api.Application} generated. + * The basic description for the {@link Application} generated. * * @return describes the application generated (package and class) */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenFiler.java b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenFiler.java similarity index 93% rename from pico/tools/src/main/java/io/helidon/pico/tools/CodeGenFiler.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CodeGenFiler.java index f608c87dafa..91908307c42 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenFiler.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenFiler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; @@ -47,10 +47,9 @@ import javax.tools.StandardLocation; import io.helidon.common.types.TypeName; - -import static io.helidon.pico.tools.ModuleUtils.PICO_MODULE_INFO_JAVA_NAME; -import static io.helidon.pico.tools.ModuleUtils.normalizedBaseModuleName; -import static io.helidon.pico.tools.ModuleUtils.saveAppPackageName; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ModuleComponent; /** * This class is used to generate the source and resources originating from either annotation processing or maven-plugin @@ -58,7 +57,7 @@ * and resources, and instead will use the filer's messager to report what it would have performed (applicable for apt cases). */ public class CodeGenFiler { - private static final boolean FORCE_MODULE_INFO_PICO_INTO_SCRATCH_DIR = true; + private static final boolean FORCE_MODULE_INFO_INTO_SCRATCH_DIR = true; private static final boolean FILER_WRITE_ONCE_PER_TYPE = true; private static final Set FILER_TYPES_FILED = new LinkedHashSet<>(); private static volatile boolean filerWriteEnabled = true; @@ -117,10 +116,10 @@ static boolean filerWriterEnabled(boolean enabled) { } /** - * Returns the path to the target scratch directory for Pico. + * Returns the path to the target scratch directory for Injection. * * @param targetOutputPath the target class output path - * @return the pico target scratch path + * @return the target scratch path */ public static Path scratchClassOutputPath(Path targetOutputPath) { Path fileName = targetOutputPath.getFileName(); @@ -129,7 +128,7 @@ public static Path scratchClassOutputPath(Path targetOutputPath) { throw new IllegalStateException(targetOutputPath.toString()); } String name = fileName.toString(); - return parent.resolve("pico").resolve(name); + return parent.resolve("inject").resolve(name); } /** @@ -256,7 +255,7 @@ Optional codegenResourceFilerOut(String outPath, } /** - * Code generates the {@link io.helidon.pico.api.ModuleComponent} source. + * Code generates the {@link ModuleComponent} source. * * @param moduleDetail the module details */ @@ -271,7 +270,7 @@ void codegenModuleFilerOut(ModuleDetail moduleDetail) { } /** - * Code generates the {@link io.helidon.pico.api.Application} source. + * Code generates the {@link Application} source. * * @param applicationTypeName the application type * @param body the application body of source @@ -282,7 +281,7 @@ void codegenApplicationFilerOut(TypeName applicationTypeName, } /** - * Code generates the {@link io.helidon.pico.api.Activator} source. + * Code generates the {@link Activator} source. * * @param activatorDetail the activator details */ @@ -333,7 +332,7 @@ public Optional codegenJavaFilerOut(TypeName typeName, } /** - * Code generate the module-info.java.pico file. + * Code generate the {@code module-info.java.inject} file. * * @param newDeltaDescriptor the descriptor * @param overwriteTargetIfExists should the file be overwritten if it already exists @@ -344,7 +343,7 @@ Optional codegenModuleInfoFilerOut(ModuleInfoDescriptor newDeltaDescriptor Objects.requireNonNull(newDeltaDescriptor); Messager messager = messager(); - String typeName = PICO_MODULE_INFO_JAVA_NAME; + String typeName = ModuleUtils.MODULE_INFO_JAVA_NAME; if (!filerWriterEnabled()) { messager.log("(disabled) Writing " + typeName + " with:\n" + newDeltaDescriptor); return Optional.empty(); @@ -366,7 +365,7 @@ Optional codegenModuleInfoFilerOut(ModuleInfoDescriptor newDeltaDescriptor } if (!newDeltaDescriptor.isUnnamed()) { - saveAppPackageName(scratchBaseOutputPath, normalizedBaseModuleName(newDeltaDescriptor.name())); + ModuleUtils.saveAppPackageName(scratchBaseOutputPath, ModuleUtils.normalizedBaseModuleName(newDeltaDescriptor.name())); } return filePath; @@ -398,9 +397,9 @@ CharSequence readResourceAsString(String name) { FileObject f = filer.getResource(StandardLocation.CLASS_OUTPUT, "", name); return f.getCharContent(true); } catch (IOException e) { - if (FORCE_MODULE_INFO_PICO_INTO_SCRATCH_DIR + if (FORCE_MODULE_INFO_INTO_SCRATCH_DIR && targetClassOutputPath != null - && name.equals(PICO_MODULE_INFO_JAVA_NAME)) { + && name.equals(ModuleUtils.MODULE_INFO_JAVA_NAME)) { // hack: physically read it from its relocated location File newPath = new File(scratchClassClassOutputPath.toFile(), name); if (newPath.exists()) { @@ -425,9 +424,9 @@ CharSequence readResourceAsString(String name) { */ Optional toResourceLocation(String name) { // hack: physically read it from its relocated location - if (FORCE_MODULE_INFO_PICO_INTO_SCRATCH_DIR + if (FORCE_MODULE_INFO_INTO_SCRATCH_DIR && targetClassOutputPath != null - && name.equals(PICO_MODULE_INFO_JAVA_NAME)) { + && name.equals(ModuleUtils.MODULE_INFO_JAVA_NAME)) { return Optional.of(scratchClassClassOutputPath.resolve(name)); } @@ -486,9 +485,9 @@ private Optional codegenResourceFilerOut(String outPath, Function fnUpdater = optFnUpdater.orElse(null); try { - if (FORCE_MODULE_INFO_PICO_INTO_SCRATCH_DIR + if (FORCE_MODULE_INFO_INTO_SCRATCH_DIR && targetClassOutputPath != null - && outPath.equals(PICO_MODULE_INFO_JAVA_NAME)) { + && outPath.equals(ModuleUtils.MODULE_INFO_JAVA_NAME)) { // hack: physically relocate it elsewhere under our scratch output directory filer = scratchFiler(); } diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenInterceptorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenInterceptorRequestBlueprint.java similarity index 88% rename from pico/tools/src/main/java/io/helidon/pico/tools/CodeGenInterceptorRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CodeGenInterceptorRequestBlueprint.java index 71aeeb16557..0d612a06a30 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenInterceptorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenInterceptorRequestBlueprint.java @@ -14,15 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Map; import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; +import io.helidon.inject.tools.spi.ActivatorCreator; /** - * Used by {@link io.helidon.pico.tools.spi.ActivatorCreator#codegenInterceptors}. + * Used by {@link ActivatorCreator#codegenInterceptors}. */ @Prototype.Blueprint interface CodeGenInterceptorRequestBlueprint { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenPathsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenPathsBlueprint.java similarity index 94% rename from pico/tools/src/main/java/io/helidon/pico/tools/CodeGenPathsBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CodeGenPathsBlueprint.java index 0b6ad3474ec..58bdf52c07b 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenPathsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenPathsBlueprint.java @@ -14,16 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; +import io.helidon.inject.tools.spi.ActivatorCreator; /** * Applies only to the output paths that various {@code creators} will use (e.g., - * {@link io.helidon.pico.tools.spi.ActivatorCreator}). + * {@link ActivatorCreator}). */ @Prototype.Blueprint interface CodeGenPathsBlueprint { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenUtils.java b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenUtils.java similarity index 88% rename from pico/tools/src/main/java/io/helidon/pico/tools/CodeGenUtils.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CodeGenUtils.java index fe7079dff9f..0427b9a1b64 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CodeGenUtils.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenUtils.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; -import io.helidon.pico.api.ElementInfo; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.InjectionPointInfo; +import io.helidon.inject.api.ElementInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.InjectionPointInfo; /** * Code generation utilities. diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CommonUtils.java b/inject/tools/src/main/java/io/helidon/inject/tools/CommonUtils.java similarity index 93% rename from pico/tools/src/main/java/io/helidon/pico/tools/CommonUtils.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CommonUtils.java index c0351f5b8fc..f2601f22131 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CommonUtils.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CommonUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.BufferedReader; import java.io.IOException; @@ -43,7 +43,7 @@ private CommonUtils() { * * @param resourceNamePath the resource path * @return the loaded string resource - * @throws io.helidon.pico.tools.ToolsException if there were any exceptions encountered + * @throws ToolsException if there were any exceptions encountered */ static String loadStringFromResource(String resourceNamePath) { try { @@ -56,11 +56,11 @@ static String loadStringFromResource(String resourceNamePath) { } /** - * Loads a String from a file, wrapping any exception encountered to a {@link io.helidon.pico.tools.ToolsException}. + * Loads a String from a file, wrapping any exception encountered to a {@link ToolsException}. * * @param fileName the file name to load * @return the contents of the file - * @throws io.helidon.pico.tools.ToolsException if there were any exceptions encountered + * @throws ToolsException if there were any exceptions encountered */ static String loadStringFromFile(String fileName) { try { @@ -181,7 +181,7 @@ static String trimLines(String multiLineStr) { * @param allowEmptyCollection if true, and the collection is empty, will return null instead of throwing * @param the type of the collection * @return the first element, or null if empty collections are allowed - * @throws io.helidon.pico.tools.ToolsException if not allowEmptyCollection and the collection is empty + * @throws ToolsException if not allowEmptyCollection and the collection is empty */ static T first(Collection coll, boolean allowEmptyCollection) { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CompilerOptionsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CompilerOptionsBlueprint.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/CompilerOptionsBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CompilerOptionsBlueprint.java index 18fb3b66043..1ec53f0f9a2 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CompilerOptionsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CompilerOptionsBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.nio.file.Path; import java.util.List; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateRequestBlueprint.java similarity index 89% rename from pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateRequestBlueprint.java index acfadbf212f..3802532c69d 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateRequestBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; @@ -23,12 +23,13 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * The request will be generated internally and then passed to the appropriate - * {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator} to handle the request. + * {@link CustomAnnotationTemplateCreator} to handle the request. */ @Prototype.Blueprint interface CustomAnnotationTemplateRequestBlueprint { @@ -71,7 +72,7 @@ interface CustomAnnotationTemplateRequestBlueprint { boolean isElementStatic(); /** - * Projects the {@link #enclosingTypeInfo()} as a {@link io.helidon.pico.api.ServiceInfoBasics} type. + * Projects the {@link #enclosingTypeInfo()} as a {@link ServiceInfoBasics} type. * * @return the basic service info of the element being processed */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponseBlueprint.java similarity index 88% rename from pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateResponseBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponseBlueprint.java index 3304f50371c..447d68d16aa 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponseBlueprint.java @@ -14,16 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Map; import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** - * The response from {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator#create(CustomAnnotationTemplateRequest)}. + * The response from {@link CustomAnnotationTemplateCreator#create(CustomAnnotationTemplateRequest)}. */ @Prototype.Blueprint interface CustomAnnotationTemplateResponseBlueprint { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateResponses.java b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponses.java similarity index 98% rename from pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateResponses.java rename to inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponses.java index 1cdea0500fb..5efd2a2506c 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/CustomAnnotationTemplateResponses.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponses.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; /** * Custom annotation template response utility. diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorDefault.java b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorDefault.java similarity index 81% rename from pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorDefault.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorDefault.java index c097f95e17f..e792b95c526 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorDefault.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorDefault.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.net.URI; import java.nio.file.Path; @@ -30,12 +30,12 @@ import io.helidon.common.LazyValue; import io.helidon.common.Weight; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.runtime.Dependencies; -import io.helidon.pico.tools.spi.ExternalModuleCreator; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.runtime.Dependencies; +import io.helidon.inject.tools.spi.ExternalModuleCreator; import io.github.classgraph.ClassInfo; import io.github.classgraph.ClassInfoList; @@ -48,25 +48,14 @@ import io.github.classgraph.ScanResult; import jakarta.inject.Singleton; -import static io.helidon.pico.api.ServiceInfoBasics.DEFAULT_PICO_WEIGHT; -import static io.helidon.pico.tools.TypeTools.createInjectionPointInfo; -import static io.helidon.pico.tools.TypeTools.createQualifierSet; -import static io.helidon.pico.tools.TypeTools.createTypeNameFromClassInfo; -import static io.helidon.pico.tools.TypeTools.extractScopeTypeName; -import static io.helidon.pico.tools.TypeTools.hasAnnotation; -import static io.helidon.pico.tools.TypeTools.isAbstract; -import static io.helidon.pico.tools.TypeTools.isPrivate; -import static io.helidon.pico.tools.TypeTools.isStatic; -import static io.helidon.pico.tools.TypeTools.methodsAnnotatedWith; -import static io.helidon.pico.tools.TypeTools.providesContractType; -import static io.helidon.pico.tools.TypeTools.toAccess; +import static io.helidon.inject.api.ServiceInfoBasics.DEFAULT_INJECT_WEIGHT; import static java.util.function.Predicate.not; /** - * The default implementation of {@link io.helidon.pico.tools.spi.ExternalModuleCreator}. + * The default implementation of {@link ExternalModuleCreator}. */ @Singleton -@Weight(DEFAULT_PICO_WEIGHT) +@Weight(DEFAULT_INJECT_WEIGHT) public class ExternalModuleCreatorDefault extends AbstractCreator implements ExternalModuleCreator { private static final Set SERVICE_DEFINING_ANNOTATIONS = Set.of(TypeNames.JAKARTA_SINGLETON, TypeNames.JAKARTA_APPLICATION_SCOPED); @@ -83,11 +72,11 @@ public ExternalModuleCreatorDefault() { super(TemplateHelper.DEFAULT_TEMPLATE_NAME); } - static boolean isPicoSupported(TypeName serviceTypeName, - MethodInfo methodInfo, - System.Logger logger) { - return PicoSupported.isSupportedInjectionPoint(logger, serviceTypeName, methodInfo.toString(), - isPrivate(methodInfo.getModifiers()), methodInfo.isStatic()); + static boolean isInjectionSupported(TypeName serviceTypeName, + MethodInfo methodInfo, + System.Logger logger) { + return InjectionSupported.isSupportedInjectionPoint(logger, serviceTypeName, methodInfo.toString(), + TypeTools.isPrivate(methodInfo.getModifiers()), methodInfo.isStatic()); } @Override @@ -120,7 +109,7 @@ public ExternalModuleCreatorResponse prepareToCreateExternalModule(ExternalModul .filter(classInfo -> packageNames.contains(classInfo.getPackageName())) .filter(not(ClassInfo::isInterface)) .filter(not(ClassInfo::isExternalClass)) - .filter(classInfo -> !isPrivate(classInfo.getModifiers())) + .filter(classInfo -> !TypeTools.isPrivate(classInfo.getModifiers())) .filter(classInfo -> !classInfo.isInnerClass() || req.innerClassesProcessed()) .forEach(this::processServiceType); @@ -174,7 +163,7 @@ private Collection identifyExternalJars(Collection packageNames) { private void processServiceType(ClassInfo classInfo) { logger().log(System.Logger.Level.DEBUG, "processing " + classInfo); - TypeName serviceTypeName = createTypeNameFromClassInfo(classInfo); + TypeName serviceTypeName = TypeTools.createTypeNameFromClassInfo(classInfo); ModuleInfo moduleInfo = classInfo.getModuleInfo(); Collection requiresModule = null; @@ -206,8 +195,8 @@ private void processTypeAndContracts(ClassInfo classInfo, .filter((parentTypeName) -> !parentTypeName.equals(serviceTypeName)) .forEach((parentTypeName) -> services.addTypeForContract(serviceTypeName, parentTypeName, false)); } - services.addAccessLevel(serviceTypeName, toAccess(classInfo.getModifiers())); - services.addIsAbstract(serviceTypeName, isAbstract(classInfo.getModifiers())); + services.addAccessLevel(serviceTypeName, TypeTools.toAccess(classInfo.getModifiers())); + services.addIsAbstract(serviceTypeName, TypeTools.isAbstract(classInfo.getModifiers())); boolean firstRound = true; while (classInfo != null && !Object.class.getName().equals(classInfo.getName())) { @@ -218,7 +207,7 @@ private void processTypeAndContracts(ClassInfo classInfo, services.addTypeForContract(serviceTypeName, contract, true); } if (firstRound) { - String cn = providesContractType(classInfo); + String cn = TypeTools.providesContractType(classInfo); if (cn != null) { TypeName contract = TypeName.create(cn); services.addTypeForContract(serviceTypeName, contract, true); @@ -246,7 +235,7 @@ private Optional findActivatedInHierarchy(ClassInfo superClass, HashSe // any type that has // - @Singleton on type (or any other "service defining annotation"), or has @Scope meta annotation // - @Inject on any field or constructor - // same code in PicoAnnotationProcessor for TypeInfo + // same code in InjectionAnnotationProcessor for TypeInfo for (ClassInfo annotation : superClass.getAnnotations()) { if (SERVICE_DEFINING_ANNOTATIONS.contains(annotation.getName())) { return Optional.of(TypeName.create(superClass.getName())); @@ -272,12 +261,12 @@ private boolean hasInjectAnnotation(ClassMemberInfo member) { private void processScopeAndQualifiers(ClassInfo classInfo, TypeName serviceTypeName) { - TypeName scopeTypeName = extractScopeTypeName(classInfo); + TypeName scopeTypeName = TypeTools.extractScopeTypeName(classInfo); if (scopeTypeName != null) { services.addScopeTypeName(serviceTypeName, scopeTypeName); } - Set qualifiers = createQualifierSet(classInfo); + Set qualifiers = TypeTools.createQualifierSet(classInfo); if (!qualifiers.isEmpty()) { services.addQualifiers(serviceTypeName, qualifiers); } @@ -285,13 +274,13 @@ private void processScopeAndQualifiers(ClassInfo classInfo, private void processPostConstructAndPreDestroy(ClassInfo classInfo, TypeName serviceTypeName) { - MethodInfo postConstructMethod = methodsAnnotatedWith(classInfo, TypeNames.JAKARTA_POST_CONSTRUCT) + MethodInfo postConstructMethod = TypeTools.methodsAnnotatedWith(classInfo, TypeNames.JAKARTA_POST_CONSTRUCT) .stream().findFirst().orElse(null); if (postConstructMethod != null) { services.addPostConstructMethod(serviceTypeName, postConstructMethod.getName()); } - MethodInfo preDestroyMethods = methodsAnnotatedWith(classInfo, TypeNames.JAKARTA_PRE_DESTROY) + MethodInfo preDestroyMethods = TypeTools.methodsAnnotatedWith(classInfo, TypeNames.JAKARTA_PRE_DESTROY) .stream().findFirst().orElse(null); if (preDestroyMethods != null) { services.addPreDestroyMethod(serviceTypeName, preDestroyMethods.getName()); @@ -322,14 +311,14 @@ private void processDependencies(ClassInfo classInfo, private Dependencies.BuilderContinuation continuationProcess(TypeName serviceTypeName, Dependencies.BuilderContinuation continuation, FieldInfo fieldInfo) { - if (hasAnnotation(fieldInfo, TypeNames.JAKARTA_INJECT)) { - if (!PicoSupported.isSupportedInjectionPoint(logger(), - serviceTypeName, fieldInfo.toString(), - isPrivate(fieldInfo.getModifiers()), fieldInfo.isStatic())) { + if (TypeTools.hasAnnotation(fieldInfo, TypeNames.JAKARTA_INJECT)) { + if (!InjectionSupported.isSupportedInjectionPoint(logger(), + serviceTypeName, fieldInfo.toString(), + TypeTools.isPrivate(fieldInfo.getModifiers()), fieldInfo.isStatic())) { return continuation; } - InjectionPointInfo ipInfo = createInjectionPointInfo(serviceTypeName, fieldInfo); + InjectionPointInfo ipInfo = TypeTools.createInjectionPointInfo(serviceTypeName, fieldInfo); continuation = continuation.add(ipInfo); } @@ -340,23 +329,23 @@ private Dependencies.BuilderContinuation continuationProcess(TypeName serviceTyp Dependencies.BuilderContinuation continuation, ElementKind kind, MethodInfo methodInfo) { - if (hasAnnotation(methodInfo, TypeNames.JAKARTA_INJECT)) { - if (!isPicoSupported(serviceTypeName, methodInfo, logger())) { + if (TypeTools.hasAnnotation(methodInfo, TypeNames.JAKARTA_INJECT)) { + if (!isInjectionSupported(serviceTypeName, methodInfo, logger())) { return continuation; } MethodParameterInfo[] params = methodInfo.getParameterInfo(); if (params.length == 0) { continuation = continuation.add(methodInfo.getName(), Void.class, kind, - toAccess(methodInfo.getModifiers())) + TypeTools.toAccess(methodInfo.getModifiers())) .ipName(methodInfo.getName()) .ipType(TypeName.create(Void.class)) - .staticDeclaration(isStatic(methodInfo.getModifiers())); + .staticDeclaration(TypeTools.isStatic(methodInfo.getModifiers())); } else { int count = 0; for (MethodParameterInfo ignore : params) { count++; - InjectionPointInfo ipInfo = createInjectionPointInfo(serviceTypeName, methodInfo, count); + InjectionPointInfo ipInfo = TypeTools.createInjectionPointInfo(serviceTypeName, methodInfo, count); continuation = continuation.add(ipInfo); } } diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorRequestBlueprint.java similarity index 85% rename from pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorRequestBlueprint.java index daf29f8119e..1591e1591b5 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorRequestBlueprint.java @@ -14,17 +14,18 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Map; import java.util.Set; import io.helidon.builder.api.Prototype; -import io.helidon.pico.api.Qualifier; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.tools.spi.ExternalModuleCreator; /** - * The request payload that is used by {@link io.helidon.pico.tools.spi.ExternalModuleCreator}. + * The request payload that is used by {@link ExternalModuleCreator}. *

      * Note that the thread context classloader should be setup appropriately so that service types can be resolved * based upon the packages requested to scan. @@ -33,7 +34,7 @@ interface ExternalModuleCreatorRequestBlueprint extends GeneralCreatorRequestBlueprint { /** - * The set of packages to analyze and eventually generate pico activators against. + * The set of packages to analyze and eventually generate activators against. * * @return the list of package names to analyze and target for activator creation */ @@ -56,9 +57,9 @@ interface ExternalModuleCreatorRequestBlueprint extends GeneralCreatorRequestBlu ActivatorCreatorConfigOptions activatorCreatorConfigOptions(); /** - * Optionally, set this to allow inner classes to be processed for potential pico activators. + * Optionally, set this to allow inner classes to be processed for potential activators. * - * @return allows inner classes to be processed for potential pico activators + * @return allows inner classes to be processed for potential activators */ boolean innerClassesProcessed(); diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorResponseBlueprint.java similarity index 78% rename from pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorResponseBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorResponseBlueprint.java index e05be255d82..98bf840bca7 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ExternalModuleCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorResponseBlueprint.java @@ -14,15 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import io.helidon.builder.api.Prototype; +import io.helidon.inject.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.spi.ExternalModuleCreator; /** - * The response from {@link io.helidon.pico.tools.spi.ExternalModuleCreator}. + * The response from {@link ExternalModuleCreator}. *

      * The response, if successful, will contribute to the {@link ActivatorCreatorRequest} - * passed to {@link io.helidon.pico.tools.spi.ActivatorCreator} in any next phase of creation for the external Pico module. + * passed to {@link ActivatorCreator} in any next phase of creation for the external module. */ @Prototype.Blueprint interface ExternalModuleCreatorResponseBlueprint extends GeneralCreatorResponseBlueprint { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCodeGenDetailBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenDetailBlueprint.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/GeneralCodeGenDetailBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenDetailBlueprint.java index d160fbd26ec..d1bf12a5df3 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCodeGenDetailBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenDetailBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCodeGenNamesBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenNamesBlueprint.java similarity index 84% rename from pico/tools/src/main/java/io/helidon/pico/tools/GeneralCodeGenNamesBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenNamesBlueprint.java index d6e251f7d13..b1b8d291af7 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCodeGenNamesBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenNamesBlueprint.java @@ -14,12 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ModuleComponent; /** * General code gen information. @@ -37,7 +39,7 @@ interface GeneralCodeGenNamesBlueprint { /** * The module name. - * This name is used primarily to serve as the codegen name for the {@link io.helidon.pico.api.ModuleComponent} that is + * This name is used primarily to serve as the codegen name for the {@link ModuleComponent} that is * generated. * * @return module name @@ -45,8 +47,8 @@ interface GeneralCodeGenNamesBlueprint { Optional moduleName(); /** - * The package name to use for the generated {@link io.helidon.pico.api.ModuleComponent}, - * {@link io.helidon.pico.api.Application}, etc. + * The package name to use for the generated {@link ModuleComponent}, + * {@link Application}, etc. * If one is not provided, one will be determined internally. * * @return the suggested package name, otherwise passing null will delegate package naming to the implementation heuristic diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorRequestBlueprint.java similarity index 98% rename from pico/tools/src/main/java/io/helidon/pico/tools/GeneralCreatorRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorRequestBlueprint.java index 8baf2428410..9d1f29b6709 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorRequestBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Optional; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorResponseBlueprint.java similarity index 98% rename from pico/tools/src/main/java/io/helidon/pico/tools/GeneralCreatorResponseBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorResponseBlueprint.java index 5da4f8bb2a4..8bd16ca7ed0 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/GeneralCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorResponseBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Map; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/GenericTemplateCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/GenericTemplateCreator.java similarity index 86% rename from pico/tools/src/main/java/io/helidon/pico/tools/GenericTemplateCreator.java rename to inject/tools/src/main/java/io/helidon/inject/tools/GenericTemplateCreator.java index 2fe637a736f..3dc50fa817b 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/GenericTemplateCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GenericTemplateCreator.java @@ -14,12 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; + /** - * Tools to assist with using {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator}'s. + * Tools to assist with using {@link CustomAnnotationTemplateCreator}'s. */ public interface GenericTemplateCreator { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/GenericTemplateCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/GenericTemplateCreatorRequestBlueprint.java similarity index 99% rename from pico/tools/src/main/java/io/helidon/pico/tools/GenericTemplateCreatorRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/GenericTemplateCreatorRequestBlueprint.java index 4fb0aba845e..b005367200f 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/GenericTemplateCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GenericTemplateCreatorRequestBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Map; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/IdAndToString.java b/inject/tools/src/main/java/io/helidon/inject/tools/IdAndToString.java similarity index 98% rename from pico/tools/src/main/java/io/helidon/pico/tools/IdAndToString.java rename to inject/tools/src/main/java/io/helidon/inject/tools/IdAndToString.java index ff51a1e95b5..6e6ca3ff6af 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/IdAndToString.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/IdAndToString.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Collection; import java.util.List; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/PicoSupported.java b/inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java similarity index 86% rename from pico/tools/src/main/java/io/helidon/pico/tools/PicoSupported.java rename to inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java index a2af6d14e40..6c410f1059b 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/PicoSupported.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,27 +14,27 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import io.helidon.common.types.TypeName; /** * Centralized utility to help callers determine what is and is not supported. */ -class PicoSupported { +class InjectionSupported { - private PicoSupported() { + private InjectionSupported() { } /** - * Returns true if the targetElement can be supported within the pico model as an injection point target. + * Returns true if the targetElement can be supported within the model as an injection point target. * * @param logger the optional logger to use if not supported * @param serviceType the enclosing service type * @param targetElement the target element description * @param isPrivate is the target element private * @param isStatic is the target element static - * @return true if the target supported pico injection, false otherwise (assuming not throwIfNotSupported) + * @return true if the target supports injection, false otherwise (assuming not throwIfNotSupported) */ static boolean isSupportedInjectionPoint(System.Logger logger, TypeName serviceType, diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptedElementBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptedElementBlueprint.java similarity index 68% rename from pico/tools/src/main/java/io/helidon/pico/tools/InterceptedElementBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/InterceptedElementBlueprint.java index 58a5743e517..84329559e11 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptedElementBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptedElementBlueprint.java @@ -14,24 +14,26 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Set; import io.helidon.builder.api.Prototype; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.InterceptedTrigger; /** * Used in the interception model described by {@link InterceptionPlan}. An intercepted - * element typically refers to a {@link io.helidon.pico.api.ElementKind#CONSTRUCTOR} or - * {@link io.helidon.pico.api.ElementKind#METHOD} that qualifies for interception. If, however, - * the {@link io.helidon.pico.api.InterceptedTrigger} is applied on the enclosing service type then all public methods. - * Note that only public methods on pico-activated services can be intercepted. + * element typically refers to a {@link ElementKind#CONSTRUCTOR} or + * {@link ElementKind#METHOD} that qualifies for interception. If, however, + * the {@link InterceptedTrigger} is applied on the enclosing service type then all public methods. + * Note that only public methods on Helidon injection-activated services can be intercepted. */ @Prototype.Blueprint interface InterceptedElementBlueprint { /** - * The set of {@link io.helidon.pico.api.InterceptedTrigger} types that apply to this method/element. + * The set of {@link InterceptedTrigger} types that apply to this method/element. * * @return the set of intercepted trigger types that apply to this method/element */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptionPlanBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptionPlanBlueprint.java similarity index 93% rename from pico/tools/src/main/java/io/helidon/pico/tools/InterceptionPlanBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/InterceptionPlanBlueprint.java index 7f5324cbb14..6195f060daa 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptionPlanBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptionPlanBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Set; @@ -22,7 +22,7 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ServiceInfoBasics; /** * Once a service type qualifies for interception, the interception plan will be created describing how the service type @@ -54,7 +54,7 @@ interface InterceptionPlanBlueprint { /** * The interfaces that this service implements (usually a superset of - * {@link io.helidon.pico.api.ServiceInfoBasics#contractsImplemented()}). + * {@link ServiceInfoBasics#contractsImplemented()}). * * @return the interfaces implemented */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorDefault.java b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorDefault.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorDefault.java rename to inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorDefault.java index 0906d361b4a..5349955ab09 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorDefault.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorDefault.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -49,11 +49,11 @@ import io.helidon.common.processor.TypeFactory; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.ElementInfo; -import io.helidon.pico.api.InterceptedTrigger; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.tools.spi.InterceptorCreator; +import io.helidon.inject.api.ElementInfo; +import io.helidon.inject.api.InterceptedTrigger; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.tools.spi.InterceptorCreator; import io.github.classgraph.ClassInfo; import io.github.classgraph.MethodInfo; @@ -61,18 +61,18 @@ import io.github.classgraph.ScanResult; import jakarta.inject.Singleton; -import static io.helidon.pico.api.ServiceInfoBasics.DEFAULT_PICO_WEIGHT; -import static io.helidon.pico.tools.TypeTools.createAnnotationListFromAnnotations; -import static io.helidon.pico.tools.TypeTools.createAnnotationSet; -import static io.helidon.pico.tools.TypeTools.createMethodElementInfo; -import static io.helidon.pico.tools.TypeTools.gatherAllAnnotationsUsedOnPublicNonStaticMethods; -import static io.helidon.pico.tools.TypeTools.toKind; +import static io.helidon.inject.api.ServiceInfoBasics.DEFAULT_INJECT_WEIGHT; +import static io.helidon.inject.tools.TypeTools.createAnnotationListFromAnnotations; +import static io.helidon.inject.tools.TypeTools.createAnnotationSet; +import static io.helidon.inject.tools.TypeTools.createMethodElementInfo; +import static io.helidon.inject.tools.TypeTools.gatherAllAnnotationsUsedOnPublicNonStaticMethods; +import static io.helidon.inject.tools.TypeTools.toKind; /** - * The default {@link io.helidon.pico.tools.spi.InterceptorCreator} provider in use. + * The default {@link InterceptorCreator} provider in use. */ @Singleton -@Weight(DEFAULT_PICO_WEIGHT) +@Weight(DEFAULT_INJECT_WEIGHT) @SuppressWarnings("unchecked") public class InterceptorCreatorDefault extends AbstractCreator implements InterceptorCreator, Resettable { private static final LazyValue SCAN = LazyValue.create(ReflectionHandler.INSTANCE::scan); @@ -953,7 +953,7 @@ private static List toInterceptedMethodDecls(InterceptionPlan pla IdAndToString methodTypedElement = toDecl(element); result.add(methodTypedElement); - if (element.elementInfo().elementKind() == io.helidon.pico.api.ElementKind.CONSTRUCTOR) { + if (element.elementInfo().elementKind() == io.helidon.inject.api.ElementKind.CONSTRUCTOR) { continue; } @@ -975,7 +975,7 @@ private static String toInterfacesDecl(InterceptionPlan plan) { private static IdAndToString toDecl(InterceptedElement method) { MethodElementInfo mi = method.elementInfo(); - boolean constructor = mi.elementKind() == io.helidon.pico.api.ElementKind.CONSTRUCTOR; + boolean constructor = mi.elementKind() == io.helidon.inject.api.ElementKind.CONSTRUCTOR; String name = constructor ? CTOR_ALIAS : mi.elementName(); String builder = typeNameElementNameAnnotations(mi, constructor); return new IdAndToString(name, builder); @@ -1033,7 +1033,7 @@ private static IdAndToString toDecl(Annotation anno) { @SuppressWarnings("checkstyle:OperatorWrap") private static InterceptedMethodCodeGen toBody(InterceptedElement method) { MethodElementInfo mi = method.elementInfo(); - String name = (mi.elementKind() == io.helidon.pico.api.ElementKind.CONSTRUCTOR) ? CTOR_ALIAS : mi.elementName(); + String name = (mi.elementKind() == io.helidon.inject.api.ElementKind.CONSTRUCTOR) ? CTOR_ALIAS : mi.elementName(); StringBuilder builder = new StringBuilder(); builder.append("public ").append(mi.elementTypeName()).append(" ").append(mi.elementName()).append("("); String args = mi.parameterInfo().stream() diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorProvider.java b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorProvider.java similarity index 91% rename from pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorProvider.java rename to inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorProvider.java index 0bbca153297..fc1dd80a08c 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorProvider.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorProvider.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.ServiceLoader; import io.helidon.common.HelidonServiceLoader; import io.helidon.common.LazyValue; -import io.helidon.pico.tools.spi.InterceptorCreator; +import io.helidon.inject.tools.spi.InterceptorCreator; import jakarta.inject.Provider; import jakarta.inject.Singleton; /** - * Provides access to the global singleton {@link io.helidon.pico.tools.spi.InterceptorCreator} in use. + * Provides access to the global singleton {@link InterceptorCreator} in use. */ @Singleton public class InterceptorCreatorProvider implements Provider { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorResponseBlueprint.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorResponseBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorResponseBlueprint.java index ae814ceb12f..99d38e4b9e6 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/InterceptorCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptorCreatorResponseBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.nio.file.Path; import java.util.Map; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/JavaC.java b/inject/tools/src/main/java/io/helidon/inject/tools/JavaC.java similarity index 99% rename from pico/tools/src/main/java/io/helidon/pico/tools/JavaC.java rename to inject/tools/src/main/java/io/helidon/inject/tools/JavaC.java index 2d33b139676..7cda6dde238 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/JavaC.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/JavaC.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.File; import java.nio.file.Path; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/Messager.java b/inject/tools/src/main/java/io/helidon/inject/tools/Messager.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/Messager.java rename to inject/tools/src/main/java/io/helidon/inject/tools/Messager.java index e8080c65631..4845bf6cb06 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/Messager.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/Messager.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; /** * Abstraction for logging messages. diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/MethodElementInfoBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/MethodElementInfoBlueprint.java similarity index 87% rename from pico/tools/src/main/java/io/helidon/pico/tools/MethodElementInfoBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/MethodElementInfoBlueprint.java index 86713bc38e3..1220e848ff1 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/MethodElementInfoBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/MethodElementInfoBlueprint.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import io.helidon.builder.api.Prototype; -import io.helidon.pico.api.ElementInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.ElementInfo; /** * Describes a method element. @@ -29,7 +30,7 @@ interface MethodElementInfoBlueprint extends ElementInfo { /** * The list of "throws" that the method throws. Applies only to - * {@link io.helidon.pico.api.ElementKind#METHOD} element types. + * {@link ElementKind#METHOD} element types. * * @return the list of throwable types this method may throw */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleDetailBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleDetailBlueprint.java similarity index 92% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleDetailBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleDetailBlueprint.java index 43ff21ce405..908a13fd344 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleDetailBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleDetailBlueprint.java @@ -14,16 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Optional; import java.util.Set; import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; +import io.helidon.inject.api.ModuleComponent; /** - * The specifics for a single {@link io.helidon.pico.api.ModuleComponent} that was codegen'ed. + * The specifics for a single {@link ModuleComponent} that was codegen'ed. * * @see ActivatorCreatorResponse#moduleDetail */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoCreatorRequestBlueprint.java similarity index 76% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoCreatorRequestBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoCreatorRequestBlueprint.java index 6cdbc9f3f8e..53d14a428cf 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoCreatorRequestBlueprint.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Map; @@ -24,11 +24,13 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; import io.helidon.config.metadata.ConfiguredOption; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ModuleComponent; /** - * Used to represent the parameters that feed into the code generation of a module-info file specifically for Pico in that - * it offers easy ability to add the {@link io.helidon.pico.api.ModuleComponent} as well as optionally the - * {@link io.helidon.pico.api.Application}. + * Used to represent the parameters that feed into the code generation of a module-info file specifically for Injection in that + * it offers easy ability to add the {@link ModuleComponent} as well as optionally the + * {@link Application}. */ @Prototype.Blueprint interface ModuleInfoCreatorRequestBlueprint { @@ -41,31 +43,31 @@ interface ModuleInfoCreatorRequestBlueprint { Optional name(); /** - * The Pico {@link io.helidon.pico.api.ModuleComponent} type name. + * The {@link ModuleComponent} type name. * - * @return Pico module type name + * @return module type name */ TypeName moduleTypeName(); /** - * The Pico {@link io.helidon.pico.api.Application} type name. + * The {@link Application} type name. * * @return application type name */ Optional applicationTypeName(); /** - * Set to true if the {@link io.helidon.pico.api.ModuleComponent} should be created. + * Set to true if the {@link ModuleComponent} should be created. * - * @return true if the Pico Module should be created + * @return true if the Module should be created */ @ConfiguredOption("true") boolean moduleCreated(); /** - * Set to true if the {@link io.helidon.pico.api.Application} should be created. + * Set to true if the {@link Application} should be created. * - * @return true if the Pico Application should be created + * @return true if the Application should be created */ boolean applicationCreated(); diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoDescriptorBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorBlueprint.java similarity index 96% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoDescriptorBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorBlueprint.java index 20ed33262e9..30311dd1645 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoDescriptorBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.IOException; import java.nio.file.Files; @@ -63,7 +63,7 @@ interface ModuleInfoDescriptorBlueprint { String name(); /** - * The template name to apply. The default is {@link io.helidon.pico.tools.TemplateHelper#DEFAULT_TEMPLATE_NAME}. + * The template name to apply. The default is {@link TemplateHelper#DEFAULT_TEMPLATE_NAME}. * * @return the template name */ @@ -167,7 +167,7 @@ default ModuleInfoDescriptor mergeCreate(ModuleInfoDescriptor another) { * Saves the descriptor source to the provided path. * * @param path the target path - * @throws io.helidon.pico.tools.ToolsException if there is any exception encountered + * @throws ToolsException if there is any exception encountered */ default void save(Path path) { try { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoDescriptorSupport.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorSupport.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoDescriptorSupport.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorSupport.java index ccc0ea57977..9d680e6ebd2 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoDescriptorSupport.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorSupport.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.BufferedReader; import java.io.IOException; @@ -71,7 +71,7 @@ static ModuleInfoDescriptor create(Path path, * * @param moduleInfo the source * @return the module-info descriptor - * @throws io.helidon.pico.tools.ToolsException if there is any exception encountered + * @throws ToolsException if there is any exception encountered */ @Prototype.FactoryMethod static ModuleInfoDescriptor create(String moduleInfo) { @@ -85,7 +85,7 @@ static ModuleInfoDescriptor create(String moduleInfo) { * @param ordering the ordering to apply * @param strict when set to true, parsing must pass fully and completely (i.e., {@link ModuleInfoDescriptor#handled()} ()} must be true) * @return the module-info descriptor - * @throws io.helidon.pico.tools.ToolsException if there is any exception encountered + * @throws ToolsException if there is any exception encountered */ @Prototype.FactoryMethod static ModuleInfoDescriptor create(String moduleInfo, @@ -201,7 +201,7 @@ static ModuleInfoDescriptor create(String moduleInfo, * * @param is the source file input stream * @return the module-info descriptor - * @throws io.helidon.pico.tools.ToolsException if there is any exception encountered + * @throws ToolsException if there is any exception encountered */ @Prototype.FactoryMethod static ModuleInfoDescriptor create(InputStream is) { @@ -214,7 +214,7 @@ static ModuleInfoDescriptor create(InputStream is) { * @param is the source file location * @param ordering the ordering to apply * @return the module-info descriptor - * @throws io.helidon.pico.tools.ToolsException if there is any exception encountered + * @throws ToolsException if there is any exception encountered */ @Prototype.FactoryMethod static ModuleInfoDescriptor create(InputStream is, diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoItemBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoItemBlueprint.java similarity index 98% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoItemBlueprint.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoItemBlueprint.java index 70151156555..f419e3e9dba 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoItemBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoItemBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Objects; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoOrdering.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoOrdering.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoOrdering.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoOrdering.java index 11fbd308f68..fe7cebb5b35 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoOrdering.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoOrdering.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; /** * Used to declare the preferred ordering of the items in the module-info. diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoUtil.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoUtil.java similarity index 99% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoUtil.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoUtil.java index 8c40a2bdf0f..91ec24157b4 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleInfoUtil.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoUtil.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Objects; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleUtils.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleUtils.java similarity index 92% rename from pico/tools/src/main/java/io/helidon/pico/tools/ModuleUtils.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ModuleUtils.java index 94646a3a8d3..d8d33967837 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ModuleUtils.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.File; import java.io.IOException; @@ -40,13 +40,11 @@ import io.helidon.common.HelidonServiceLoader; import io.helidon.common.processor.TypeFactory; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.tools.spi.ModuleComponentNamer; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.tools.spi.ModuleComponentNamer; -import static io.helidon.pico.tools.CommonUtils.first; -import static io.helidon.pico.tools.CommonUtils.hasValue; -import static io.helidon.pico.tools.ModuleInfoDescriptorBlueprint.DEFAULT_MODULE_NAME; +import static io.helidon.inject.tools.ModuleInfoDescriptorBlueprint.DEFAULT_MODULE_NAME; /** * Module specific utils. @@ -57,11 +55,11 @@ public class ModuleUtils { */ public static final String REAL_MODULE_INFO_JAVA_NAME = ModuleInfoDescriptorBlueprint.DEFAULT_MODULE_INFO_JAVA_NAME; /** - * The pico generated (e.g., module-info.java.pico) file name. + * The injection generated (e.g., module-info.java.inject) file name. */ - public static final String PICO_MODULE_INFO_JAVA_NAME = REAL_MODULE_INFO_JAVA_NAME + ".pico"; + public static final String MODULE_INFO_JAVA_NAME = REAL_MODULE_INFO_JAVA_NAME + ".inject"; /** - * The file name written to ./target/pico/ to track the last package name generated for this application. + * The file name written to ./target/inject/ to track the last package name generated for this application. * This application package name is what we fall back to for the application name and the module name if not otherwise * specified directly. */ @@ -113,7 +111,7 @@ static String innerToSuggestedGeneratedPackageName(ModuleInfoDescriptor descript if (provides.isEmpty() || provides.get().withOrTo().isEmpty()) { export = descriptor.firstUnqualifiedPackageExport().orElse(null); } else { - export = TypeName.create(first(provides.get().withOrTo(), false)).packageName(); + export = TypeName.create(CommonUtils.first(provides.get().withOrTo(), false)).packageName(); } } @@ -157,8 +155,8 @@ private static ServiceLoader namerLoader() { } /** - * Common way for naming a module (generally for use by {@link io.helidon.pico.api.Application} and - * {@link io.helidon.pico.api.ModuleComponent}). + * Common way for naming a module (generally for use by {@link Application} and + * {@link ModuleComponent}). * * @param moduleName the module name (from module-info) * @param typeSuffix "test" for test, or null for normal src classes @@ -185,7 +183,7 @@ static String toSuggestedModuleName(String moduleName, * @return the module name suffix */ static String normalizedModuleNameTypeSuffix(String typeSuffix) { - if (!hasValue(typeSuffix)) { + if (!CommonUtils.hasValue(typeSuffix)) { return ""; } return "/" + typeSuffix; @@ -198,7 +196,7 @@ static String normalizedModuleNameTypeSuffix(String typeSuffix) { * @return the base module name */ static String normalizedBaseModuleName(String moduleName) { - if (!hasValue(moduleName)) { + if (!CommonUtils.hasValue(moduleName)) { return moduleName; } int pos = moduleName.lastIndexOf("/"); @@ -213,7 +211,7 @@ static String normalizedBaseModuleName(String moduleName) { * @param sourcePath the source path * @param defaultToUnnamed if true, will return the default name, otherwise empty is returned * @return the module name suggested to use, most appropriate for the name of {@link - * io.helidon.pico.api.Application} or {@link io.helidon.pico.api.ModuleComponent} + * Application} or {@link ModuleComponent} */ public static Optional toSuggestedModuleName(Path basePath, Path sourcePath, @@ -265,15 +263,15 @@ static Optional findModuleInfo(Path basePath, } // if we get to here then there was no "real" module-info file found anywhere in the target build directories - // plan b: look for the pico generated files to infer the name + // plan b: look for the injection generated files to infer the name Path parent = sourcePath.getParent(); if (parent != null) { String fileName = String.valueOf(sourcePath.getFileName()); - Path scratch = parent.resolve("pico").resolve(fileName); - moduleInfoPaths = findFile(scratch, scratch, PICO_MODULE_INFO_JAVA_NAME); + Path scratch = parent.resolve("inject").resolve(fileName); + moduleInfoPaths = findFile(scratch, scratch, MODULE_INFO_JAVA_NAME); if (1 == moduleInfoPaths.size()) { // looks to be a potential test module, get the base name from the source tree... - return finishModuleInfoDescriptor(moduleInfoPath, srcPath, moduleInfoPaths, PICO_MODULE_INFO_JAVA_NAME); + return finishModuleInfoDescriptor(moduleInfoPath, srcPath, moduleInfoPaths, MODULE_INFO_JAVA_NAME); } } @@ -364,7 +362,7 @@ public static Path toBasePath(String sourcePath) { * @return true if the provided module name is unnamed */ public static boolean isUnnamedModuleName(String moduleName) { - return !hasValue(moduleName) + return !CommonUtils.hasValue(moduleName) || moduleName.equals(DEFAULT_MODULE_NAME) || moduleName.equals(DEFAULT_MODULE_NAME + "/test"); } @@ -386,7 +384,7 @@ public static Optional loadAppPackageName(Path scratchPath) { throw new ToolsException("Unable to load: " + packageFileName, e); } - if (hasValue(packageName)) { + if (CommonUtils.hasValue(packageName)) { return Optional.of(packageName); } } @@ -416,7 +414,7 @@ private static Optional finishModuleInfoDescriptor(AtomicR AtomicReference srcPath, Set moduleInfoPaths, String moduleInfoName) { - File moduleInfoFile = new File(first(moduleInfoPaths, false).toFile(), moduleInfoName); + File moduleInfoFile = new File(CommonUtils.first(moduleInfoPaths, false).toFile(), moduleInfoName); if (moduleInfoPath != null) { moduleInfoPath.set(moduleInfoFile); } diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/Options.java b/inject/tools/src/main/java/io/helidon/inject/tools/Options.java similarity index 78% rename from pico/tools/src/main/java/io/helidon/pico/tools/Options.java rename to inject/tools/src/main/java/io/helidon/inject/tools/Options.java index 67269a1556e..be5bcfdc7bc 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/Options.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/Options.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.HashMap; import java.util.List; @@ -23,10 +23,8 @@ import javax.annotation.processing.ProcessingEnvironment; -import io.helidon.pico.api.PicoServices; - -import static io.helidon.pico.tools.CommonUtils.hasValue; -import static io.helidon.pico.tools.CommonUtils.toList; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.InjectionServices; /** * Options that can be provided via -A (in annotation processing mode), or via system properties or env properties @@ -35,45 +33,45 @@ public class Options { /** - * Tag for putting Pico's annotation processing into debug mode. + * Tag for putting Injection's annotation processing into debug mode. */ - public static final String TAG_DEBUG = PicoServices.TAG_DEBUG; + public static final String TAG_DEBUG = InjectionServices.TAG_DEBUG; /** * Treat all super types as a contract for a given service type being added. */ - public static final String TAG_AUTO_ADD_NON_CONTRACT_INTERFACES = "pico.autoAddNonContractInterfaces"; + public static final String TAG_AUTO_ADD_NON_CONTRACT_INTERFACES = "inject.autoAddNonContractInterfaces"; /** - * Pre-creates a placeholder for an {@link io.helidon.pico.api.Application}. + * Pre-creates a placeholder for an {@link Application}. */ - public static final String TAG_APPLICATION_PRE_CREATE = "pico.application.pre.create"; + public static final String TAG_APPLICATION_PRE_CREATE = "inject.application.pre.create"; /** * Identify the module name being processed or the desired target module name. */ public static final String TAG_MODULE_NAME = "modulename"; /** - * Identify the pico sidecar (module-info.java.pico) module file name or path. + * Identify the sidecar (module-info.java.inject) module file name or path. */ - public static final String TAG_PICO_MODULE_NAME = "pico." + TAG_MODULE_NAME; + public static final String TAG_INJECTION_MODULE_NAME = "inject." + TAG_MODULE_NAME; /** * Identify whether any application scopes (from ee) is translated to {@link jakarta.inject.Singleton}. */ - public static final String TAG_MAP_APPLICATION_TO_SINGLETON_SCOPE = "pico.mapApplicationToSingletonScope"; + public static final String TAG_MAP_APPLICATION_TO_SINGLETON_SCOPE = "inject.mapApplicationToSingletonScope"; /** * Identify whether any unsupported types should trigger annotation processing to keep going (the default is to fail). */ - public static final String TAG_IGNORE_UNSUPPORTED_ANNOTATIONS = "pico.ignoreUnsupportedAnnotations"; + public static final String TAG_IGNORE_UNSUPPORTED_ANNOTATIONS = "inject.ignoreUnsupportedAnnotations"; /** - * Identify invalid usage of the {@code module-info.java} for appropriate Pico references (the default is to fail). + * Identify invalid usage of the {@code module-info.java} for appropriate Injection references (the default is to fail). */ - public static final String TAG_IGNORE_MODULE_USAGE = "pico.ignoreModuleUsage"; + public static final String TAG_IGNORE_MODULE_USAGE = "inject.ignoreModuleUsage"; /** - * For future use. Should the module-info.java be automatically patched to reflect the pico DI model. + * For future use. Should the module-info.java be automatically patched to reflect the DI model. */ - static final String TAG_AUTO_PATCH_MODULE_INFO = "pico.autoPatchModuleInfo"; + static final String TAG_AUTO_PATCH_MODULE_INFO = "inject.autoPatchModuleInfo"; /** * Identify the additional annotation type names that will trigger interception. */ - static final String TAG_ALLOW_LISTED_INTERCEPTOR_ANNOTATIONS = "pico.allowListedInterceptorAnnotations"; + static final String TAG_ALLOW_LISTED_INTERCEPTOR_ANNOTATIONS = "inject.allowListedInterceptorAnnotations"; private static final Map OPTS = new HashMap<>(); @@ -97,8 +95,8 @@ public static void init(ProcessingEnvironment processingEnv) { String.valueOf(isOptionEnabled(TAG_AUTO_PATCH_MODULE_INFO, processingEnv))); OPTS.put(TAG_MODULE_NAME, getOption(TAG_MODULE_NAME, null, processingEnv)); - OPTS.put(TAG_PICO_MODULE_NAME, - getOption(TAG_PICO_MODULE_NAME, null, processingEnv)); + OPTS.put(TAG_INJECTION_MODULE_NAME, + getOption(TAG_INJECTION_MODULE_NAME, null, processingEnv)); OPTS.put(TAG_ALLOW_LISTED_INTERCEPTOR_ANNOTATIONS, getOption(TAG_ALLOW_LISTED_INTERCEPTOR_ANNOTATIONS, null, processingEnv)); OPTS.put(TAG_MAP_APPLICATION_TO_SINGLETON_SCOPE, @@ -111,7 +109,7 @@ public static void init(ProcessingEnvironment processingEnv) { } /** - * Only supports the subset of options that pico cares about, and should not be generally used for options. + * Only supports the subset of options that Injection cares about, and should not be generally used for options. * * @param option the key (assumed to be meaningful to this class) * @return true if the option is enabled @@ -121,7 +119,7 @@ public static boolean isOptionEnabled(String option) { } /** - * This only supports the subset of options that pico cares about, and should not be generally used for options. + * This only supports the subset of options that Injection cares about, and should not be generally used for options. * * @param option the key (assumed to be meaningful to this class) * @return the option value @@ -138,15 +136,15 @@ public static Optional getOption(String option) { */ static List getOptionStringList(String option) { String result = getOption(option, null); - if (!hasValue(result)) { + if (!CommonUtils.hasValue(result)) { return List.of(); } - return toList(result); + return CommonUtils.toList(result); } /** - * This only supports the subset of options that pico cares about, and should not be generally used for options. + * This only supports the subset of options that Injection cares about, and should not be generally used for options. * * @param option the key (assumed to be meaningful to this class) * @param defaultVal the default value used if the associated value is null. diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/PermittedProviderType.java b/inject/tools/src/main/java/io/helidon/inject/tools/PermittedProviderType.java similarity index 85% rename from pico/tools/src/main/java/io/helidon/pico/tools/PermittedProviderType.java rename to inject/tools/src/main/java/io/helidon/inject/tools/PermittedProviderType.java index 92a2b77aa77..2d5ae1ecbb8 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/PermittedProviderType.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/PermittedProviderType.java @@ -14,11 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; + +import io.helidon.inject.api.InjectionPointProvider; /** * Defines how the generator should allow the presence of {@link jakarta.inject.Provider}'s or - * {@link io.helidon.pico.api.InjectionPointProvider}'s. Since providers add a level of non-deterministic behavior + * {@link InjectionPointProvider}'s. Since providers add a level of non-deterministic behavior * to the system it is required for the application to explicitly define whether this feature should be permitted. */ public enum PermittedProviderType { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ReflectionHandler.java b/inject/tools/src/main/java/io/helidon/inject/tools/ReflectionHandler.java similarity index 96% rename from pico/tools/src/main/java/io/helidon/pico/tools/ReflectionHandler.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ReflectionHandler.java index d9bed135489..5e7439bb018 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ReflectionHandler.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ReflectionHandler.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; -import io.helidon.pico.api.Resettable; +import io.helidon.inject.api.Resettable; import io.github.classgraph.ClassGraph; import io.github.classgraph.ScanResult; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ServicesToProcess.java b/inject/tools/src/main/java/io/helidon/inject/tools/ServicesToProcess.java similarity index 97% rename from pico/tools/src/main/java/io/helidon/pico/tools/ServicesToProcess.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ServicesToProcess.java index 742892e7d6f..855511ee812 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ServicesToProcess.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ServicesToProcess.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.nio.file.Path; import java.util.ArrayList; @@ -35,15 +35,13 @@ import javax.annotation.processing.RoundEnvironment; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.Resettable; -import io.helidon.pico.runtime.Dependencies; - -import static io.helidon.pico.tools.ModuleUtils.innerToSuggestedGeneratedPackageName; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.Resettable; +import io.helidon.inject.runtime.Dependencies; /** * Tracks the services to process, and ingests them to build the codegen model. @@ -262,7 +260,7 @@ Map parentServiceTypes() { /** * Introduce the activator generic portion of the declaration (e.g., the "CB extends MySingletonConfig" portion of - * {@code MyService$$picoActivator}). + * {@code MyService$$injectionActivator}). * * @param serviceTypeName the service type name * @param activatorGenericDecl the generics portion of the class decl @@ -904,7 +902,7 @@ String determineGeneratedPackageName() { } ModuleInfoDescriptor descriptor = lastKnownModuleInfoDescriptor(); - String packageName = innerToSuggestedGeneratedPackageName(descriptor, serviceTypeNames(), "pico"); + String packageName = ModuleUtils.innerToSuggestedGeneratedPackageName(descriptor, serviceTypeNames(), "inject"); return Objects.requireNonNull(packageName); } @@ -919,11 +917,11 @@ public void defaultConstructor(TypeName serviceType, String constructor) { } /** - * If we made it here we know that Pico annotation processing was used. If there is a module-info in use and services where + * If we made it here we know that Injection annotation processing was used. If there is a module-info in use and services where * defined during processing, then we should have a module created and optionally and application. If so then we should - * validate the integrity of the user's module-info.java for the {@link io.helidon.pico.api.ModuleComponent} and - * {@link io.helidon.pico.api.Application} definitions - unless the user opted out of this check with the - * {@link io.helidon.pico.tools.Options#TAG_IGNORE_MODULE_USAGE} option. + * validate the integrity of the user's module-info.java for the {@link ModuleComponent} and + * {@link Application} definitions - unless the user opted out of this check with the + * {@link Options#TAG_IGNORE_MODULE_USAGE} option. * @throws IllegalStateException thrown if internal state inconsistencies are found */ private void performModuleUsageValidation(Messager processor) { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/TemplateHelper.java b/inject/tools/src/main/java/io/helidon/inject/tools/TemplateHelper.java similarity index 91% rename from pico/tools/src/main/java/io/helidon/pico/tools/TemplateHelper.java rename to inject/tools/src/main/java/io/helidon/inject/tools/TemplateHelper.java index f6eb755ba00..93b9275d5e3 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/TemplateHelper.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/TemplateHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.IOException; import java.util.LinkedHashSet; @@ -26,23 +26,21 @@ import io.helidon.common.processor.GeneratedAnnotationHandler; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.PicoServicesConfig; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesConfig; import com.github.jknack.handlebars.Handlebars; import com.github.jknack.handlebars.TagType; import com.github.jknack.handlebars.Template; -import static io.helidon.pico.tools.CommonUtils.loadStringFromResource; - /** - * Helper tools for dealing with Pico-related Handlebar templates. + * Helper tools for dealing with Injection-related Handlebar templates. */ public class TemplateHelper { /** * The tag that us used to represent the template name to use. */ - public static final String TAG_TEMPLATE_NAME = "io.helidon.pico.template.name"; + public static final String TAG_TEMPLATE_NAME = "io.helidon.inject.template.name"; /** * The default template name to use. @@ -53,7 +51,7 @@ public class TemplateHelper { private final String versionId; - private TemplateHelper(PicoServicesConfig cfg) { + private TemplateHelper(InjectionServicesConfig cfg) { Objects.requireNonNull(cfg.providerName(), "provider name is required"); this.versionId = cfg.providerVersion().orElseThrow(() -> new IllegalStateException("provider version is required")); } @@ -64,8 +62,8 @@ private TemplateHelper(PicoServicesConfig cfg) { * @return the template helper initialized with the bootstrap configuration */ public static TemplateHelper create() { - PicoServicesConfig cfg = PicoServices.picoServices() - .orElseThrow(() -> new ToolsException("Pico services not found")).config(); + InjectionServicesConfig cfg = InjectionServices.injectionServices() + .orElseThrow(() -> new ToolsException("Injection services not found")).config(); return new TemplateHelper(cfg); } @@ -148,7 +146,7 @@ String safeLoadTemplate(String templateName, */ public String loadTemplate(String templateName, String name) { - return loadStringFromResource(toFQN(templateName, name)); + return CommonUtils.loadStringFromResource(toFQN(templateName, name)); } /** @@ -181,7 +179,7 @@ Set requiredArguments(String target, private static String toFQN(String templateName, String name) { - return "templates/pico/" + templateName + "/" + name; + return "templates/inject/" + templateName + "/" + name; } private static String applySubstitutions(String target, diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/ToolsException.java b/inject/tools/src/main/java/io/helidon/inject/tools/ToolsException.java similarity index 92% rename from pico/tools/src/main/java/io/helidon/pico/tools/ToolsException.java rename to inject/tools/src/main/java/io/helidon/inject/tools/ToolsException.java index cdb5f7372dd..9950aea1096 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/ToolsException.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ToolsException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; /** * An unchecked exception thrown for any tooling related problem. diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/TypeNames.java b/inject/tools/src/main/java/io/helidon/inject/tools/TypeNames.java similarity index 82% rename from pico/tools/src/main/java/io/helidon/pico/tools/TypeNames.java rename to inject/tools/src/main/java/io/helidon/inject/tools/TypeNames.java index f133c2df6f7..81653b35f56 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/TypeNames.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/TypeNames.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import io.helidon.common.types.TypeName; -import io.helidon.pico.runtime.AbstractServiceProvider; +import io.helidon.inject.runtime.AbstractServiceProvider; /** * Type name constants. @@ -35,57 +35,57 @@ public final class TypeNames { public static final String PREFIX_JAVAX = "javax."; /** - * Pico {@value} type. + * Injection {@value} type. */ - public static final String PICO_APPLICATION = "io.helidon.pico.api.Application"; + public static final String INJECT_APPLICATION = "io.helidon.inject.api.Application"; /** - * Pico {@value} annotation. + * Injection {@value} annotation. */ - public static final String PICO_CONTRACT = "io.helidon.pico.api.Contract"; + public static final String CONTRACT = "io.helidon.inject.api.Contract"; /** - * Pico {@value} annotation. + * Injection {@value} annotation. */ - public static final String PICO_EXTERNAL_CONTRACTS = "io.helidon.pico.api.ExternalContracts"; + public static final String EXTERNAL_CONTRACTS = "io.helidon.inject.api.ExternalContracts"; /** - * Pico {@value} annotation. + * Injection {@value} annotation. */ - public static final String PICO_INTERCEPTED = "io.helidon.pico.api.Intercepted"; + public static final String INTERCEPTED = "io.helidon.inject.api.Intercepted"; /** - * Pico {@value} type. + * Injection {@value} type. */ - public static final String PICO_MODULE = "io.helidon.pico.api.ModuleComponent"; + public static final String INJECT_MODULE = "io.helidon.inject.api.ModuleComponent"; /** - * Pico {@value} annotation. + * Injection {@value} annotation. */ - public static final String PICO_CONFIGURED_BY = "io.helidon.pico.configdriven.api.ConfiguredBy"; + public static final String CONFIGURED_BY = "io.helidon.inject.configdriven.api.ConfiguredBy"; /** - * Pico class name {@value} for {@code InjectionPointProvider}. + * Injection class name {@value} for {@code InjectionPointProvider}. */ - public static final String PICO_INJECTION_POINT_PROVIDER = "io.helidon.pico.api.InjectionPointProvider"; + public static final String INJECTION_POINT_PROVIDER = "io.helidon.inject.api.InjectionPointProvider"; /** - * Pico {@value PICO_INJECTION_POINT_PROVIDER} type. + * Injection {@value INJECTION_POINT_PROVIDER} type. */ - public static final TypeName PICO_INJECTION_POINT_PROVIDER_TYPE = TypeName.create(PICO_INJECTION_POINT_PROVIDER); + public static final TypeName INJECTION_POINT_PROVIDER_TYPE = TypeName.create(INJECTION_POINT_PROVIDER); /** - * Pico service provider type name. + * Injection service provider type name. */ - public static final String PICO_SERVICE_PROVIDER = "io.helidon.pico.api.ServiceProvider"; + public static final String INJECTION_SERVICE_PROVIDER = "io.helidon.inject.api.ServiceProvider"; /** - * Pico service provider type. + * Injection service provider type. */ - public static final TypeName PICO_SERVICE_PROVIDER_TYPE = TypeName.create("io.helidon.pico.api.ServiceProvider"); + public static final TypeName SERVICE_PROVIDER_TYPE = TypeName.create("io.helidon.inject.api.ServiceProvider"); /** - * Pico abstract service provider type. + * Injection abstract service provider type. */ - public static final TypeName PICO_ABSTRACT_SERVICE_PROVIDER_TYPE = TypeName.create(AbstractServiceProvider.class); + public static final TypeName ABSTRACT_SERVICE_PROVIDER_TYPE = TypeName.create(AbstractServiceProvider.class); /** - * Pico class name {@value} for {@code ConfigDrivenServiceProviderBase}. + * Injection class name {@value} for {@code ConfigDrivenServiceProviderBase}. */ - public static final String PICO_ABSTRACT_CONFIGURED_SERVICE_PROVIDER = - "io.helidon.pico.configdriven.runtime.ConfigDrivenServiceProviderBase"; + public static final String ABSTRACT_CONFIGURED_SERVICE_PROVIDER = + "io.helidon.inject.configdriven.runtime.ConfigDrivenServiceProviderBase"; /** * Jakarta {@value} annotation. */ diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/TypeTools.java b/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java similarity index 96% rename from pico/tools/src/main/java/io/helidon/pico/tools/TypeTools.java rename to inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java index 6bfc1a4c807..7ce55f99858 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/TypeTools.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.File; import java.lang.reflect.Array; @@ -54,12 +54,13 @@ import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.ElementInfo; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.runtime.Dependencies; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.ElementInfo; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.runtime.Dependencies; import io.github.classgraph.AnnotationInfo; import io.github.classgraph.AnnotationInfoList; @@ -79,11 +80,9 @@ import static io.helidon.common.types.TypeNames.COLLECTION; import static io.helidon.common.types.TypeNames.LIST; import static io.helidon.common.types.TypeNames.OPTIONAL; -import static io.helidon.pico.tools.CommonUtils.first; -import static io.helidon.pico.tools.CommonUtils.hasValue; /** - * Generically handles Pico generated artifact creation via APT. + * Generically handles generated artifact creation via APT. */ public final class TypeTools { private TypeTools() { @@ -110,7 +109,7 @@ public static String toFilePath(TypeName typeName, String fileType) { String className = typeName.className(); String packageName = typeName.packageName(); - if (!hasValue(packageName)) { + if (!CommonUtils.hasValue(packageName)) { packageName = ""; } else { packageName = packageName.replace('.', File.separatorChar); @@ -561,7 +560,7 @@ static TypeName extractScopeTypeName(ClassInfo classInfo) { return null; } - return translate(TypeName.create(first(list, false).getName())); + return translate(TypeName.create(CommonUtils.first(list, false).getName())); } /** @@ -633,7 +632,7 @@ static AnnotationInfoList resolveMetaAnnotations(AnnotationInfoList annoList, } /** - * Determines the {@link jakarta.inject.Provider} or {@link io.helidon.pico.api.InjectionPointProvider} contract type. + * Determines the {@link jakarta.inject.Provider} or {@link InjectionPointProvider} contract type. * * @param classInfo class info * @return the provided type @@ -672,7 +671,7 @@ static String providesContractType(ClassInfo classInfo) { } if (!candidates.isEmpty()) { - return first(candidates, false); + return CommonUtils.first(candidates, false); } if (firstTe != null) { @@ -769,7 +768,7 @@ static InjectionPointInfo createInjectionPointInfo(TypeName serviceTypeName, .serviceTypeName(serviceTypeName) .elementName(elemName) .elementKind(elemInfo.isConstructor() - ? io.helidon.pico.api.ElementKind.CONSTRUCTOR : io.helidon.pico.api.ElementKind.METHOD) + ? io.helidon.inject.api.ElementKind.CONSTRUCTOR : io.helidon.inject.api.ElementKind.METHOD) .elementTypeName(elemType) .elementArgs(elemArgs) .elementOffset(elemOffset) @@ -808,7 +807,7 @@ static MethodElementInfo createMethodElementInfo(MethodInfo methodInfo, .elementName(methodInfo.isConstructor() ? InjectionPointInfo.CONSTRUCTOR : methodInfo.getName()) .elementKind(methodInfo.isConstructor() - ? io.helidon.pico.api.ElementKind.CONSTRUCTOR : io.helidon.pico.api.ElementKind.METHOD) + ? io.helidon.inject.api.ElementKind.CONSTRUCTOR : io.helidon.inject.api.ElementKind.METHOD) .elementTypeName(elemType) .elementArgs(methodInfo.getParameterInfo().length) .access(toAccess(methodInfo.getModifiers())) @@ -846,7 +845,7 @@ static MethodElementInfo createMethodElementInfo(ProcessingEnvironment processin .elementName((ee.getKind() == ElementKind.CONSTRUCTOR) ? InjectionPointInfo.CONSTRUCTOR : ee.getSimpleName().toString()) .elementKind((ee.getKind() == ElementKind.CONSTRUCTOR) - ? io.helidon.pico.api.ElementKind.CONSTRUCTOR : io.helidon.pico.api.ElementKind.METHOD) + ? io.helidon.inject.api.ElementKind.CONSTRUCTOR : io.helidon.inject.api.ElementKind.METHOD) .elementTypeName(elemType) .elementArgs(ee.getParameters().size()) .access(toAccess(ee)) @@ -876,7 +875,7 @@ static ElementInfo createParameterInfo(TypeName serviceTypeName, .serviceTypeName(serviceTypeName) .elementName("p" + elemOffset) .elementKind(elemInfo.isConstructor() - ? io.helidon.pico.api.ElementKind.CONSTRUCTOR : io.helidon.pico.api.ElementKind.METHOD) + ? io.helidon.inject.api.ElementKind.CONSTRUCTOR : io.helidon.inject.api.ElementKind.METHOD) .elementTypeName(elemType) .elementArgs(elemInfo.getParameterInfo().length) .elementOffset(elemOffset) @@ -907,7 +906,7 @@ static ElementInfo createParameterInfo(ProcessingEnvironment processingEnv, .serviceTypeName(serviceTypeName) .elementName("p" + elemOffset) .elementKind(elemInfo.getKind() == ElementKind.CONSTRUCTOR - ? io.helidon.pico.api.ElementKind.CONSTRUCTOR : io.helidon.pico.api.ElementKind.METHOD) + ? io.helidon.inject.api.ElementKind.CONSTRUCTOR : io.helidon.inject.api.ElementKind.METHOD) .elementTypeName(elemTypeName) .elementArgs(elemInfo.getParameters().size()) .elementOffset(elemOffset) @@ -942,7 +941,7 @@ static InjectionPointInfo createInjectionPointInfo(TypeName serviceTypeName, .dependencyToServiceInfo(serviceInfo) .serviceTypeName(serviceTypeName) .elementName(elemInfo.getName()) - .elementKind(io.helidon.pico.api.ElementKind.FIELD) + .elementKind(io.helidon.inject.api.ElementKind.FIELD) .elementTypeName(elemType) .access(toAccess(elemInfo.getModifiers())) .staticDeclaration(isStatic(elemInfo.getModifiers())) @@ -956,7 +955,7 @@ static InjectionPointInfo createInjectionPointInfo(TypeName serviceTypeName, } /** - * Determines the meta parts making up {@link io.helidon.pico.api.InjectionPointInfo}. + * Determines the meta parts making up {@link InjectionPointInfo}. * * @param paramInfo the method info * @param isProviderWrapped set to indicate that the ip is a provided type @@ -977,7 +976,7 @@ static TypeName extractInjectionPointTypeInfo(MethodParameterInfo paramInfo, } /** - * Determines the meta parts making up {@link io.helidon.pico.api.InjectionPointInfo}. + * Determines the meta parts making up {@link InjectionPointInfo}. * * @param elemInfo the field info * @param isProviderWrapped set to indicate that the ip is a provided type @@ -998,7 +997,7 @@ static TypeName extractInjectionPointTypeInfo(FieldInfo elemInfo, } /** - * Determines the meta parts making up {@link io.helidon.pico.api.InjectionPointInfo} for reflective processing. + * Determines the meta parts making up {@link InjectionPointInfo} for reflective processing. * * @param sig the variable / element type * @param isProviderWrapped set to indicate that the ip is a provided type @@ -1065,7 +1064,7 @@ static TypeName extractInjectionPointTypeInfo(TypeSignature sig, } /** - * Determines the meta parts making up {@link io.helidon.pico.api.InjectionPointInfo} for annotation processing. + * Determines the meta parts making up {@link InjectionPointInfo} for annotation processing. * * @param typeElement the variable / element type * @param isProviderWrapped set to indicate that the ip is a provided type @@ -1162,7 +1161,7 @@ public static TypeName extractInjectionPointTypeInfo(Element typeElement, * Determines whether the type is a {@link jakarta.inject.Provider} (or javax equiv) type. * * @param typeElement the type element to check - * @return true if {@link jakarta.inject.Provider} or {@link io.helidon.pico.api.InjectionPointProvider} + * @return true if {@link jakarta.inject.Provider} or {@link InjectionPointProvider} */ static boolean isProviderType(TypeElement typeElement) { return isProviderType(TypeName.create(typeElement.getQualifiedName().toString())); @@ -1172,13 +1171,13 @@ static boolean isProviderType(TypeElement typeElement) { * Determines whether the type is a {@link jakarta.inject.Provider} (or javax equiv) type. * * @param typeName the type name to check - * @return true if {@link jakarta.inject.Provider} or {@link io.helidon.pico.api.InjectionPointProvider} + * @return true if {@link jakarta.inject.Provider} or {@link InjectionPointProvider} */ public static boolean isProviderType(TypeName typeName) { TypeName type = translate(componentTypeNameOf(typeName)); return TypeNames.JAKARTA_PROVIDER_TYPE.equals(type) || TypeNames.JAVAX_PROVIDER_TYPE.equals(type) - || TypeNames.PICO_INJECTION_POINT_PROVIDER_TYPE.equals(type); + || TypeNames.INJECTION_POINT_PROVIDER_TYPE.equals(type); } /** @@ -1319,7 +1318,7 @@ public static boolean isAbstract(Element element) { } /** - * Converts the modifiers to an {@link io.helidon.pico.api.AccessModifier} type. + * Converts the modifiers to an {@link AccessModifier} type. * * @param modifiers the modifiers * @return the access @@ -1337,7 +1336,7 @@ static AccessModifier toAccess(int modifiers) { } /** - * Converts the modifiers to an {@link io.helidon.pico.api.AccessModifier} type. + * Converts the modifiers to an {@link AccessModifier} type. * * @param modifiers the modifiers * @return the access @@ -1412,7 +1411,7 @@ public static boolean needToDeclarePackageUsage(String packageName) { packageName.startsWith("java.") || packageName.startsWith("sun.") || packageName.toLowerCase().endsWith(".impl") - || packageName.equals("io.helidon.pico.api")); + || packageName.equals("io.helidon.inject.api")); } /** @@ -1427,7 +1426,7 @@ public static boolean needToDeclareModuleUsage(String moduleName) { moduleName.startsWith("java.") || moduleName.startsWith("sun.") || moduleName.startsWith("jakarta.inject") - || moduleName.startsWith("io.helidon.pico")); + || moduleName.startsWith("io.helidon.inject")); } /** diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/package-info.java b/inject/tools/src/main/java/io/helidon/inject/tools/package-info.java similarity index 83% rename from pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/package-info.java rename to inject/tools/src/main/java/io/helidon/inject/tools/package-info.java index 93c99508704..132ab3fc839 100644 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/package-info.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,6 @@ */ /** - * Pico Testing. + * Injection Tools. */ -package io.helidon.pico.tests.pico.tbox; +package io.helidon.inject.tools; diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ActivatorCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ActivatorCreator.java similarity index 67% rename from pico/tools/src/main/java/io/helidon/pico/tools/spi/ActivatorCreator.java rename to inject/tools/src/main/java/io/helidon/inject/tools/spi/ActivatorCreator.java index 5adaeeca7a3..d0b17553f37 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ActivatorCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ActivatorCreator.java @@ -14,37 +14,42 @@ * limitations under the License. */ -package io.helidon.pico.tools.spi; +package io.helidon.inject.tools.spi; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Contract; -import io.helidon.pico.tools.ActivatorCreatorRequest; -import io.helidon.pico.tools.ActivatorCreatorResponse; -import io.helidon.pico.tools.CodeGenInterceptorRequest; -import io.helidon.pico.tools.InterceptorCreatorResponse; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.api.Contract; +import io.helidon.inject.tools.ActivatorCreatorProvider; +import io.helidon.inject.tools.ActivatorCreatorRequest; +import io.helidon.inject.tools.ActivatorCreatorResponse; +import io.helidon.inject.tools.CodeGenInterceptorRequest; +import io.helidon.inject.tools.InterceptorCreatorResponse; /** - * Implementors of this contract are responsible for code-generating the Pico - * {@link io.helidon.pico.api.Activator}s and {@link io.helidon.pico.api.ServiceProvider}s for service types found in your + * Implementors of this contract are responsible for code-generating the + * {@link Activator}s and {@link ServiceProvider}s for service types found in your * DI-enabled * module. *

      - * The typical scenario will have 1-SingletonServiceType:1-GeneratedPicoActivatorClassForThatService:1-ServiceProvider - * representation in the {@link io.helidon.pico.api.Services} registry that can be lazily activated. + * The typical scenario will have 1-SingletonServiceType:1-GeneratedInjectionActivatorClassForThatService:1-ServiceProvider + * representation in the {@link Services} registry that can be lazily activated. *

      * Activators are only generated if your service is marked as a {@code jakarta.inject.Singleton} scoped service. *

      - * All activators for your jar module are then aggregated and registered into a pico code-generated - * {@link io.helidon.pico.api.ModuleComponent} class. + * All activators for your jar module are then aggregated and registered into a code-generated + * {@link ModuleComponent} class. * - * @see io.helidon.pico.tools.ActivatorCreatorProvider + * @see ActivatorCreatorProvider */ @Contract public interface ActivatorCreator { /** - * Used during annotation processing in compile time to automatically generate {@link io.helidon.pico.api.Activator}'s - * and optionally an aggregating {@link io.helidon.pico.api.ModuleComponent} for those activators. + * Used during annotation processing in compile time to automatically generate {@link Activator}'s + * and optionally an aggregating {@link ModuleComponent} for those activators. * * @param request the request for what to generate * @return the response result for the create operation diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ApplicationCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ApplicationCreator.java similarity index 72% rename from pico/tools/src/main/java/io/helidon/pico/tools/spi/ApplicationCreator.java rename to inject/tools/src/main/java/io/helidon/inject/tools/spi/ApplicationCreator.java index 96103c86563..ca3cb2765de 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ApplicationCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ApplicationCreator.java @@ -14,21 +14,22 @@ * limitations under the License. */ -package io.helidon.pico.tools.spi; +package io.helidon.inject.tools.spi; -import io.helidon.pico.api.Contract; -import io.helidon.pico.tools.ApplicationCreatorRequest; -import io.helidon.pico.tools.ApplicationCreatorResponse; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.Contract; +import io.helidon.inject.tools.ApplicationCreatorRequest; +import io.helidon.inject.tools.ApplicationCreatorResponse; /** - * Implementors of this contract are responsible for creating the {@link io.helidon.pico.api.Application} instance. - * This is used by Pico's maven-plugin. + * Implementors of this contract are responsible for creating the {@link Application} instance. + * This is used by Injection maven-plugin. */ @Contract public interface ApplicationCreator { /** - * Used to create the {@link io.helidon.pico.api.Application} source for the entire + * Used to create the {@link Application} source for the entire * application / assembly. * * @param request the request for what to generate diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/spi/CustomAnnotationTemplateCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/CustomAnnotationTemplateCreator.java similarity index 84% rename from pico/tools/src/main/java/io/helidon/pico/tools/spi/CustomAnnotationTemplateCreator.java rename to inject/tools/src/main/java/io/helidon/inject/tools/spi/CustomAnnotationTemplateCreator.java index 32b38041a29..acb37303137 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/spi/CustomAnnotationTemplateCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/CustomAnnotationTemplateCreator.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools.spi; +package io.helidon.inject.tools.spi; import java.util.Optional; import java.util.Set; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; /** * Instances of this are found via the service loader during compilation time and called by the - * {@code io.helidon.pico.processor.CustomAnnotationProcessor}. It should be noted that this contract may be + * {@code io.helidon.inject.processor.CustomAnnotationProcessor}. It should be noted that this contract may be * called multiple times since annotation processing naturally happens over multiple iterations. */ public interface CustomAnnotationTemplateCreator { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ExternalModuleCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ExternalModuleCreator.java similarity index 63% rename from pico/tools/src/main/java/io/helidon/pico/tools/spi/ExternalModuleCreator.java rename to inject/tools/src/main/java/io/helidon/inject/tools/spi/ExternalModuleCreator.java index 9184f18a5d1..429ae879693 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ExternalModuleCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ExternalModuleCreator.java @@ -14,23 +14,24 @@ * limitations under the License. */ -package io.helidon.pico.tools.spi; +package io.helidon.inject.tools.spi; -import io.helidon.pico.api.Contract; -import io.helidon.pico.tools.ExternalModuleCreatorRequest; -import io.helidon.pico.tools.ExternalModuleCreatorResponse; +import io.helidon.inject.api.Contract; +import io.helidon.inject.tools.ActivatorCreatorRequest; +import io.helidon.inject.tools.ExternalModuleCreatorRequest; +import io.helidon.inject.tools.ExternalModuleCreatorResponse; /** - * Implementors are responsible for creating an {@link io.helidon.pico.tools.ActivatorCreatorRequest} that can be then passed + * Implementors are responsible for creating an {@link ActivatorCreatorRequest} that can be then passed * to the - * {@link io.helidon.pico.tools.spi.ActivatorCreator} based upon the scanning and reflective introspection of a set of classes + * {@link ActivatorCreator} based upon the scanning and reflective introspection of a set of classes * found in an external * jar module. * This involves a two-step process of first preparing to create using - * {@link #prepareToCreateExternalModule(io.helidon.pico.tools.ExternalModuleCreatorRequest)}, followed by taking the response + * {@link #prepareToCreateExternalModule(ExternalModuleCreatorRequest)}, followed by taking the response * and proceeding * to call - * {@link io.helidon.pico.tools.spi.ActivatorCreator#createModuleActivators(io.helidon.pico.tools.ActivatorCreatorRequest)}. + * {@link ActivatorCreator#createModuleActivators(ActivatorCreatorRequest)}. */ @Contract public interface ExternalModuleCreator { diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/spi/InterceptorCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/InterceptorCreator.java similarity index 88% rename from pico/tools/src/main/java/io/helidon/pico/tools/spi/InterceptorCreator.java rename to inject/tools/src/main/java/io/helidon/inject/tools/spi/InterceptorCreator.java index 917dfa617ea..ddcec8d80bf 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/spi/InterceptorCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/InterceptorCreator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools.spi; +package io.helidon.inject.tools.spi; import java.util.Objects; import java.util.Optional; @@ -22,15 +22,17 @@ import javax.annotation.processing.ProcessingEnvironment; -import io.helidon.pico.api.Contract; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.tools.InterceptionPlan; +import io.helidon.inject.api.InterceptedTrigger; +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.tools.InterceptionPlan; +import io.helidon.inject.tools.InterceptorCreatorProvider; /** - * Provides the strategy used to determine which annotations cause interceptor creation. Only services that are pico- + * Provides the strategy used to determine which annotations cause interceptor creation. Only services that are injection- * activated may qualify for interception. * - * @see io.helidon.pico.tools.InterceptorCreatorProvider + * @see InterceptorCreatorProvider */ @Contract public interface InterceptorCreator { @@ -45,7 +47,7 @@ default Strategy strategy() { } /** - * Applicable when {@link io.helidon.pico.tools.spi.InterceptorCreator.Strategy#ALLOW_LISTED} is in use. + * Applicable when {@link InterceptorCreator.Strategy#ALLOW_LISTED} is in use. * * @return the set of type names that should trigger creation */ @@ -54,7 +56,7 @@ default Set allowListedAnnotationTypes() { } /** - * Applicable when {@link io.helidon.pico.tools.spi.InterceptorCreator.Strategy#CUSTOM} is in use. + * Applicable when {@link InterceptorCreator.Strategy#CUSTOM} is in use. * * @param annotationType the annotation type name * @return true if the annotation type should trigger interceptor creation @@ -83,7 +85,7 @@ InterceptorProcessor createInterceptorProcessor(ServiceInfoBasics interceptedSer enum Strategy { /** - * Meta-annotation based. Only annotations annotated with {@link io.helidon.pico.api.InterceptedTrigger} will + * Meta-annotation based. Only annotations annotated with {@link InterceptedTrigger} will * qualify. */ EXPLICIT, diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ModuleComponentNamer.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ModuleComponentNamer.java similarity index 82% rename from pico/tools/src/main/java/io/helidon/pico/tools/spi/ModuleComponentNamer.java rename to inject/tools/src/main/java/io/helidon/inject/tools/spi/ModuleComponentNamer.java index 8b1462e54a2..14aa4c3d2c9 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/spi/ModuleComponentNamer.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ModuleComponentNamer.java @@ -14,23 +14,24 @@ * limitations under the License. */ -package io.helidon.pico.tools.spi; +package io.helidon.inject.tools.spi; import java.util.Collection; import java.util.Optional; import io.helidon.common.types.TypeName; +import io.helidon.inject.api.ModuleComponent; /** * Implementors of these are responsible for choosing the best {@link io.helidon.common.types.TypeName} for any - * {@link io.helidon.pico.api.ModuleComponent} being generated. Note that this provider will only be called if there is some + * {@link ModuleComponent} being generated. Note that this provider will only be called if there is some * ambiguity in choosing a name (e.g., there are no exports or there is no {@code module-info} for the module being processed, * etc.) */ public interface ModuleComponentNamer { /** - * Implementors should return the suggested {@link io.helidon.pico.api.ModuleComponent} package name, or {@code empty} + * Implementors should return the suggested {@link ModuleComponent} package name, or {@code empty} * to abstain from naming. * * @param serviceActivatorTypeNames the set of activator type names to be generated diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/spi/package-info.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/package-info.java similarity index 94% rename from pico/tools/src/main/java/io/helidon/pico/tools/spi/package-info.java rename to inject/tools/src/main/java/io/helidon/inject/tools/spi/package-info.java index 46b1f44afb2..7bb50736b82 100644 --- a/pico/tools/src/main/java/io/helidon/pico/tools/spi/package-info.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/package-info.java @@ -17,4 +17,4 @@ /** * Tools SPI support. */ -package io.helidon.pico.tools.spi; +package io.helidon.inject.tools.spi; diff --git a/inject/tools/src/main/java/module-info.java b/inject/tools/src/main/java/module-info.java new file mode 100644 index 00000000000..105ed3cdbdf --- /dev/null +++ b/inject/tools/src/main/java/module-info.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The Injection Tools module. + */ +module io.helidon.inject.tools { + requires static io.helidon.config.metadata; + requires static jakarta.annotation; + + requires java.compiler; + requires jakarta.inject; + requires handlebars; + requires io.github.classgraph; + requires io.helidon.builder.api; + requires io.helidon.common; + requires io.helidon.common.config; + requires io.helidon.common.processor; + requires transitive io.helidon.common.types; + requires transitive io.helidon.inject.runtime; + + exports io.helidon.inject.tools; + exports io.helidon.inject.tools.spi; + + uses io.helidon.inject.tools.spi.InterceptorCreator; + uses io.helidon.inject.tools.spi.ApplicationCreator; + uses io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; + uses io.helidon.inject.tools.spi.ExternalModuleCreator; + uses io.helidon.inject.tools.spi.ActivatorCreator; + uses io.helidon.inject.tools.spi.ModuleComponentNamer; + + provides io.helidon.inject.tools.spi.ActivatorCreator + with io.helidon.inject.tools.ActivatorCreatorDefault; + provides io.helidon.inject.tools.spi.ApplicationCreator + with io.helidon.inject.tools.ApplicationCreatorDefault; + provides io.helidon.inject.tools.spi.ExternalModuleCreator + with io.helidon.inject.tools.ExternalModuleCreatorDefault; + provides io.helidon.inject.tools.spi.InterceptorCreator + with io.helidon.inject.tools.InterceptorCreatorDefault; +} diff --git a/pico/tools/src/main/resources/templates/pico/default/interface-based-interceptor.hbs b/inject/tools/src/main/resources/templates/inject/default/interface-based-interceptor.hbs similarity index 89% rename from pico/tools/src/main/resources/templates/pico/default/interface-based-interceptor.hbs rename to inject/tools/src/main/resources/templates/inject/default/interface-based-interceptor.hbs index 941a6f4320f..4a78f9d1ae2 100644 --- a/pico/tools/src/main/resources/templates/pico/default/interface-based-interceptor.hbs +++ b/inject/tools/src/main/resources/templates/inject/default/interface-based-interceptor.hbs @@ -27,12 +27,12 @@ import io.helidon.common.types.TypedElementInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; import io.helidon.common.types.TypeValues; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationException; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.runtime.InterceptedMethod; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationException; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.runtime.InterceptedMethod; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -40,15 +40,15 @@ import jakarta.inject.Provider; import jakarta.inject.Singleton; import static io.helidon.common.types.TypeName.create; -import static io.helidon.pico.runtime.Invocation.createInvokeAndSupply; -import static io.helidon.pico.runtime.Invocation.mergeAndCollapse; +import static io.helidon.inject.runtime.Invocation.createInvokeAndSupply; +import static io.helidon.inject.runtime.Invocation.mergeAndCollapse; /** - * Pico {@link Interceptor} for {@link {{parent}} }. + * Injection {@link Interceptor} for {@link {{parent}} }. */ // using the interfaces approach @io.helidon.common.Weight({{weight}}) -@io.helidon.pico.api.Intercepted({{parent}}.class) +@io.helidon.inject.api.Intercepted({{parent}}.class) @Singleton @SuppressWarnings("ALL") {{{generatedanno}}} diff --git a/pico/tools/src/main/resources/templates/pico/default/module-info.hbs b/inject/tools/src/main/resources/templates/inject/default/module-info.hbs similarity index 100% rename from pico/tools/src/main/resources/templates/pico/default/module-info.hbs rename to inject/tools/src/main/resources/templates/inject/default/module-info.hbs diff --git a/pico/tools/src/main/resources/templates/pico/default/no-arg-based-interceptor.hbs b/inject/tools/src/main/resources/templates/inject/default/no-arg-based-interceptor.hbs similarity index 89% rename from pico/tools/src/main/resources/templates/pico/default/no-arg-based-interceptor.hbs rename to inject/tools/src/main/resources/templates/inject/default/no-arg-based-interceptor.hbs index 647c365809b..c7b09279ef1 100644 --- a/pico/tools/src/main/resources/templates/pico/default/no-arg-based-interceptor.hbs +++ b/inject/tools/src/main/resources/templates/inject/default/no-arg-based-interceptor.hbs @@ -27,12 +27,12 @@ import io.helidon.common.types.TypedElementInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; import io.helidon.common.types.TypeValues; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationException; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.runtime.InterceptedMethod; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationException; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.runtime.InterceptedMethod; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -40,15 +40,15 @@ import jakarta.inject.Provider; import jakarta.inject.Singleton; import static io.helidon.common.types.TypeName.create; -import static io.helidon.pico.runtime.Invocation.createInvokeAndSupply; -import static io.helidon.pico.runtime.Invocation.mergeAndCollapse; +import static io.helidon.inject.runtime.Invocation.createInvokeAndSupply; +import static io.helidon.inject.runtime.Invocation.mergeAndCollapse; /** - * Pico {@link Interceptor} for {@link {{parent}} }. + * Injection {@link Interceptor} for {@link {{parent}} }. */ // using the no-arg constructor approach @io.helidon.common.Weight({{weight}}) -@io.helidon.pico.api.Intercepted({{parent}}.class) +@io.helidon.inject.api.Intercepted({{parent}}.class) @Singleton @SuppressWarnings("ALL") {{{generatedanno}}} diff --git a/pico/tools/src/main/resources/templates/pico/default/service-provider-activator.hbs b/inject/tools/src/main/resources/templates/inject/default/service-provider-activator.hbs similarity index 93% rename from pico/tools/src/main/resources/templates/pico/default/service-provider-activator.hbs rename to inject/tools/src/main/resources/templates/inject/default/service-provider-activator.hbs index e90d891ca0a..4df8a758b33 100644 --- a/pico/tools/src/main/resources/templates/pico/default/service-provider-activator.hbs +++ b/inject/tools/src/main/resources/templates/inject/default/service-provider-activator.hbs @@ -20,14 +20,14 @@ import io.helidon.common.Weight; import io.helidon.common.Weighted; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.PostConstructMethod; -import io.helidon.pico.api.PreDestroyMethod; -import io.helidon.pico.api.RunLevel; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.runtime.Dependencies; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.DependenciesInfo; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.PostConstructMethod; +import io.helidon.inject.api.PreDestroyMethod; +import io.helidon.inject.api.RunLevel; +import io.helidon.inject.api.ServiceInfo; +import io.helidon.inject.runtime.Dependencies; import jakarta.inject.Provider; import jakarta.inject.Singleton; @@ -38,7 +38,7 @@ import java.util.Optional; import java.util.Set; -import static io.helidon.pico.api.InjectionPointInfo.CONSTRUCTOR; +import static io.helidon.inject.api.InjectionPointInfo.CONSTRUCTOR; /**{{#description}} * {{{.}}}{{/description}}{{#extraclasscomments}} diff --git a/pico/tools/src/main/resources/templates/pico/default/service-provider-application-empty-servicetypebinding.hbs b/inject/tools/src/main/resources/templates/inject/default/service-provider-application-empty-servicetypebinding.hbs similarity index 100% rename from pico/tools/src/main/resources/templates/pico/default/service-provider-application-empty-servicetypebinding.hbs rename to inject/tools/src/main/resources/templates/inject/default/service-provider-application-empty-servicetypebinding.hbs diff --git a/pico/tools/src/main/resources/templates/pico/default/service-provider-application-servicetypebinding.hbs b/inject/tools/src/main/resources/templates/inject/default/service-provider-application-servicetypebinding.hbs similarity index 100% rename from pico/tools/src/main/resources/templates/pico/default/service-provider-application-servicetypebinding.hbs rename to inject/tools/src/main/resources/templates/inject/default/service-provider-application-servicetypebinding.hbs diff --git a/pico/tools/src/main/resources/templates/pico/default/service-provider-application-stub.hbs b/inject/tools/src/main/resources/templates/inject/default/service-provider-application-stub.hbs similarity index 85% rename from pico/tools/src/main/resources/templates/pico/default/service-provider-application-stub.hbs rename to inject/tools/src/main/resources/templates/inject/default/service-provider-application-stub.hbs index 47d6c20b36d..08c561ed836 100644 --- a/pico/tools/src/main/resources/templates/pico/default/service-provider-application-stub.hbs +++ b/inject/tools/src/main/resources/templates/inject/default/service-provider-application-stub.hbs @@ -18,15 +18,15 @@ package {{packagename}}; import java.util.Optional; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.ServiceInjectionPlanBinder; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ServiceInjectionPlanBinder; import jakarta.inject.Named; import jakarta.inject.Singleton; /** * THIS IS A TEMPORARY PLACEHOLDER. - * It is expected that this module should have eventually generated the "final" Application using the pico-maven-plugin + * It is expected that this module should have eventually generated the "final" Application using the maven-plugin * attached to the compile phase. See the documentation for more information. */ {{{generatedanno}}} @@ -50,7 +50,7 @@ public final class {{classname}} implements Application { @Override public void configure(ServiceInjectionPlanBinder binder) { throw new IllegalStateException("The application is in an invalid state.\n" - + "The pico-maven-plugin either did not get run, or failed to generate the final replacement to this class: " + this + + "The injection maven-plugin either did not get run, or failed to generate the final replacement to this class: " + this + "\nPlease check the logs or consult the documentation."); } diff --git a/pico/tools/src/main/resources/templates/pico/default/service-provider-application.hbs b/inject/tools/src/main/resources/templates/inject/default/service-provider-application.hbs similarity index 94% rename from pico/tools/src/main/resources/templates/pico/default/service-provider-application.hbs rename to inject/tools/src/main/resources/templates/inject/default/service-provider-application.hbs index ca413d6fa47..6b5a75ba487 100644 --- a/pico/tools/src/main/resources/templates/pico/default/service-provider-application.hbs +++ b/inject/tools/src/main/resources/templates/inject/default/service-provider-application.hbs @@ -18,8 +18,8 @@ package {{packagename}}; import java.util.Optional; -import io.helidon.pico.api.Application; -import io.helidon.pico.api.ServiceInjectionPlanBinder; +import io.helidon.inject.api.Application; +import io.helidon.inject.api.ServiceInjectionPlanBinder; import jakarta.inject.Named; import jakarta.inject.Singleton; diff --git a/pico/tools/src/main/resources/templates/pico/default/service-provider-module.hbs b/inject/tools/src/main/resources/templates/inject/default/service-provider-module.hbs similarity index 94% rename from pico/tools/src/main/resources/templates/pico/default/service-provider-module.hbs rename to inject/tools/src/main/resources/templates/inject/default/service-provider-module.hbs index 5e6299f964b..57b94c55624 100644 --- a/pico/tools/src/main/resources/templates/pico/default/service-provider-module.hbs +++ b/inject/tools/src/main/resources/templates/inject/default/service-provider-module.hbs @@ -16,8 +16,8 @@ limitations under the License. {{/header}} package {{packagename}}; -import io.helidon.pico.api.ModuleComponent; -import io.helidon.pico.api.ServiceBinder; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.api.ServiceBinder; import jakarta.inject.Named; import jakarta.inject.Singleton; diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/AbstractBaseCreator.java b/inject/tools/src/test/java/io/helidon/inject/tools/AbstractBaseCreator.java similarity index 96% rename from pico/tools/src/test/java/io/helidon/pico/tools/AbstractBaseCreator.java rename to inject/tools/src/test/java/io/helidon/inject/tools/AbstractBaseCreator.java index 928732926cf..5f3b18d4de7 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/AbstractBaseCreator.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/AbstractBaseCreator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.ServiceLoader; diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/ActivatorCreatorDefaultTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/ActivatorCreatorDefaultTest.java similarity index 88% rename from pico/tools/src/test/java/io/helidon/pico/tools/ActivatorCreatorDefaultTest.java rename to inject/tools/src/test/java/io/helidon/inject/tools/ActivatorCreatorDefaultTest.java index 7d4698b7777..e9a076e0e3d 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/ActivatorCreatorDefaultTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/ActivatorCreatorDefaultTest.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.Collections; import java.util.List; import io.helidon.common.types.TypeName; -import io.helidon.pico.tools.spi.ActivatorCreator; -import io.helidon.pico.tools.testsubjects.HelloPicoWorldImpl; +import io.helidon.inject.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.testsubjects.HelloInjectionWorldImpl; import org.junit.jupiter.api.Test; @@ -50,15 +50,15 @@ void sanity() { void codegenHelloActivator() { ActivatorCreatorDefault activatorCreator = (ActivatorCreatorDefault) this.activatorCreator; CodeGenPaths codeGenPaths = CodeGenPaths.builder() - .generatedSourcesPath("target/pico/generated-sources") - .outputPath("target/pico/generated-classes") + .generatedSourcesPath("target/inject/generated-sources") + .outputPath("target/inject/generated-classes") .build(); AbstractFilerMessager directFiler = AbstractFilerMessager .createDirectFiler(codeGenPaths, System.getLogger(getClass().getName())); CodeGenFiler filer = CodeGenFiler.create(directFiler); ActivatorCreatorCodeGen codeGen = ActivatorCreatorCodeGen.builder().build(); ActivatorCreatorRequest req = ActivatorCreatorRequest.builder() - .serviceTypeNames(List.of(TypeName.create(HelloPicoWorldImpl.class))) + .serviceTypeNames(List.of(TypeName.create(HelloInjectionWorldImpl.class))) .generatedServiceTypeNames(List.of(TypeName.create(HelloPicoWorldImpl.class))) .codeGen(codeGen) .codeGenPaths(codeGenPaths) @@ -70,7 +70,7 @@ void codegenHelloActivator() { assertEquals("Failed in create", te.getMessage()); ActivatorCreatorRequest req2 = ActivatorCreatorRequest.builder() - .serviceTypeNames(Collections.singletonList(TypeName.create(HelloPicoWorldImpl.class))) + .serviceTypeNames(Collections.singletonList(TypeName.create(HelloInjectionWorldImpl.class))) .generatedServiceTypeNames(Collections.singletonList(TypeName.create(HelloPicoWorldImpl.class))) .codeGenPaths(CodeGenPaths.builder().build()) .throwIfError(Boolean.FALSE) diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/ApplicationCreatorDefaultTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/ApplicationCreatorDefaultTest.java similarity index 83% rename from pico/tools/src/test/java/io/helidon/pico/tools/ApplicationCreatorDefaultTest.java rename to inject/tools/src/test/java/io/helidon/inject/tools/ApplicationCreatorDefaultTest.java index 56986558698..23b4627217d 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/ApplicationCreatorDefaultTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/ApplicationCreatorDefaultTest.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.tools.spi.ApplicationCreator; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.tools.spi.ApplicationCreator; import org.junit.jupiter.api.Test; @@ -54,8 +54,8 @@ void codegenHelloWorldApplication() { ApplicationCreator creator = this.applicationCreator; ServiceInfoCriteria allServices = ServiceInfoCriteria.builder().build(); - PicoServices picoServices = PicoServices.picoServices().orElseThrow(); - Services services = picoServices.services(); + InjectionServices injectionServices = InjectionServices.injectionServices().orElseThrow(); + Services services = injectionServices.services(); List> serviceProviders = services.lookupAll(allServices); assertThat(serviceProviders.size(), is(0)); @@ -63,10 +63,10 @@ void codegenHelloWorldApplication() { .map(sp -> sp.serviceInfo().serviceTypeName()) .toList(); - // note: this test needs to align with target/pico/... for this to work/test properly + // note: this test needs to align with target/inject/... for this to work/test properly CodeGenPaths codeGenPaths = CodeGenPaths.builder() - .generatedSourcesPath("target/pico/generated-sources") - .outputPath("target/pico/generated-classes") + .generatedSourcesPath("target/inject/generated-sources") + .outputPath("target/inject/generated-classes") .build(); AbstractFilerMessager directFiler = AbstractFilerMessager .createDirectFiler(codeGenPaths, System.getLogger(getClass().getName())); @@ -94,7 +94,7 @@ void codegenHelloWorldApplication() { assertThat(res.error(), optionalEmpty()); assertThat(res.success(), is(true)); assertThat(res.serviceTypeNames().stream().map(TypeName::name).collect(Collectors.toList()), - contains("pico.Pico$$TestApplication")); + contains("inject.Injection$$TestApplication")); assertThat(res.templateName(), equalTo("default")); assertThat(res.moduleName(), optionalEmpty()); } diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/ExternalModuleCreatorDefaultTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/ExternalModuleCreatorDefaultTest.java similarity index 91% rename from pico/tools/src/test/java/io/helidon/pico/tools/ExternalModuleCreatorDefaultTest.java rename to inject/tools/src/test/java/io/helidon/inject/tools/ExternalModuleCreatorDefaultTest.java index b7282c46d57..6831a434357 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/ExternalModuleCreatorDefaultTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/ExternalModuleCreatorDefaultTest.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.tools.spi.ActivatorCreator; -import io.helidon.pico.tools.spi.ExternalModuleCreator; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.tools.spi.ActivatorCreator; +import io.helidon.inject.tools.spi.ExternalModuleCreator; import org.atinject.tck.auto.Drivers; import org.atinject.tck.auto.DriversSeat; @@ -39,7 +39,7 @@ /** * Tests for {@link ExternalModuleCreatorDefault}. This test - * effectively demonstrates the behavior of the pico-maven-plugin. + * effectively demonstrates the behavior of the injection {@code maven-plugin}. */ class ExternalModuleCreatorDefaultTest extends AbstractBaseCreator { @@ -55,8 +55,8 @@ void tck330Gen() { Thread.currentThread().setContextClassLoader(ExternalModuleCreatorDefaultTest.class.getClassLoader()); CodeGenPaths codeGenPaths = CodeGenPaths.builder() - .generatedSourcesPath("target/pico/generated-sources") - .outputPath("target/pico/generated-classes") + .generatedSourcesPath("target/inject/generated-sources") + .outputPath("target/inject/generated-classes") .build(); AbstractFilerMessager directFiler = AbstractFilerMessager .createDirectFiler(codeGenPaths, System.getLogger(getClass().getName())); diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/InterceptorCreatorDefaultTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/InterceptorCreatorDefaultTest.java similarity index 79% rename from pico/tools/src/test/java/io/helidon/pico/tools/InterceptorCreatorDefaultTest.java rename to inject/tools/src/test/java/io/helidon/inject/tools/InterceptorCreatorDefaultTest.java index 9e4998a8d7e..b89ebbaa0a6 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/InterceptorCreatorDefaultTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/InterceptorCreatorDefaultTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.lang.annotation.Documented; import java.lang.annotation.Retention; @@ -24,18 +24,16 @@ import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; -import io.helidon.pico.api.InterceptedTrigger; -import io.helidon.pico.api.ServiceInfoBasics; -import io.helidon.pico.tools.spi.InterceptorCreator; -import io.helidon.pico.tools.testsubjects.HelloPicoWorld; -import io.helidon.pico.tools.testsubjects.HelloPicoWorldImpl; +import io.helidon.inject.api.InterceptedTrigger; +import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.tools.spi.InterceptorCreator; +import io.helidon.inject.tools.testsubjects.HelloInjectionWorld; +import io.helidon.inject.tools.testsubjects.HelloInjectionWorldImpl; import jakarta.inject.Named; import jakarta.inject.Singleton; import org.junit.jupiter.api.Test; -import static io.helidon.pico.tools.InterceptorCreatorDefault.AnnotationTypeNameResolver; -import static io.helidon.pico.tools.InterceptorCreatorDefault.createResolverFromReflection; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -56,7 +54,7 @@ void sanity() { @Test void resolverByReflection() { - AnnotationTypeNameResolver resolver = createResolverFromReflection(); + InterceptorCreatorDefault.AnnotationTypeNameResolver resolver = InterceptorCreatorDefault.createResolverFromReflection(); assertThat(resolver.resolve(InterceptedTrigger.class.getName()), containsInAnyOrder( Annotation.create(Documented.class), @@ -68,15 +66,17 @@ void resolverByReflection() { @Test void interceptorPlanByReflection() { ServiceInfoBasics serviceInfoBasics = ServiceInfoBasics.builder() - .serviceTypeName(HelloPicoWorldImpl.class) + .serviceTypeName(HelloInjectionWorldImpl.class) .build(); InterceptorCreatorDefault.AbstractInterceptorProcessor processor = ((InterceptorCreatorDefault) interceptorCreator).createInterceptorProcessor(serviceInfoBasics, interceptorCreator, Optional.empty()); InterceptionPlan plan = processor.createInterceptorPlan(Set.of(Singleton.class.getName())).orElseThrow(); - assertThat(plan.hasNoArgConstructor(), is(false)); - assertThat(plan.interfaces(), contains(TypeName.create(HelloPicoWorld.class))); + assertThat(plan.hasNoArgConstructor(), + is(false)); + assertThat(plan.interfaces(), + contains(TypeName.create(HelloInjectionWorld.class))); } } diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/ModuleInfoDescriptorTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/ModuleInfoDescriptorTest.java similarity index 91% rename from pico/tools/src/test/java/io/helidon/pico/tools/ModuleInfoDescriptorTest.java rename to inject/tools/src/test/java/io/helidon/inject/tools/ModuleInfoDescriptorTest.java index eff4a9a84ec..30f44adeff8 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/ModuleInfoDescriptorTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/ModuleInfoDescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.io.File; import java.util.List; -import io.helidon.pico.api.Contract; -import io.helidon.pico.api.ExternalContracts; +import io.helidon.inject.api.Contract; +import io.helidon.inject.api.ExternalContracts; import org.junit.jupiter.api.Test; @@ -35,7 +35,7 @@ class ModuleInfoDescriptorTest { @Test void programmatic() { ModuleInfoDescriptor.Builder builder = ModuleInfoDescriptor.builder(); - String typeName = "io.helidon.pico.tools.ModuleInfoDescriptor"; + String typeName = "io.helidon.inject.tools.ModuleInfoDescriptor"; assertThat(builder.build().contents(), equalTo("// @io.helidon.common.Generated(value = \"" + typeName + "\", trigger = \"" @@ -94,7 +94,7 @@ void firstUnqualifiedExport() { .addItem(ModuleInfoUtil.exportsPackage("export2")) .build(); - String typeName = "io.helidon.pico.tools.ModuleInfoDescriptor"; + String typeName = "io.helidon.inject.tools.ModuleInfoDescriptor"; assertThat(descriptor.contents(), equalTo("// @io.helidon.common.Generated(value = \"" + typeName + "\", trigger = \"" @@ -129,7 +129,7 @@ void sortedWithComments() { .build()) .build(); - String typeName = "io.helidon.pico.tools.ModuleInfoDescriptor"; + String typeName = "io.helidon.inject.tools.ModuleInfoDescriptor"; assertThat(descriptor.contents(), equalTo("// @io.helidon.common.Generated(value = \"" + typeName + "\", trigger = \"" @@ -202,16 +202,16 @@ void loadCreateAndSave() throws Exception { .create(CommonUtils.loadStringFromResource("testsubjects/m0._java_"), ModuleInfoOrdering.NATURAL, true); assertThat(descriptor.contents(false), - equalTo("module io.helidon.pico {\n" - + " requires transitive io.helidon.pico.api;\n" + equalTo("module io.helidon.inject {\n" + + " requires transitive io.helidon.inject.api;\n" + " requires static com.fasterxml.jackson.annotation;\n" + " requires static lombok;\n" + " requires io.helidon.common;\n" - + " exports io.helidon.pico.spi.impl;\n" - + " provides io.helidon.pico.api.PicoServices with io.helidon.pico.spi.impl" - + ".DefaultPicoServices;\n" - + " uses io.helidon.pico.api.ModuleComponent;\n" - + " uses io.helidon.pico.api.Application;\n" + + " exports io.helidon.inject.spi.impl;\n" + + " provides io.helidon.inject.api.InjectionServices with io.helidon.inject.spi.impl" + + ".DefaultInjectionServices;\n" + + " uses io.helidon.inject.api.ModuleComponent;\n" + + " uses io.helidon.inject.api.Application;\n" + " opens io.helidon.config to weld.core.impl,\n" + " io.helidon.microprofile.cdi;\n" + "}")); @@ -244,19 +244,19 @@ void mergeCreate() { .create(CommonUtils.loadStringFromResource("testsubjects/m0._java_"), ModuleInfoOrdering.NATURAL_PRESERVE_COMMENTS, true); assertThat(descriptor.contents(false), - equalTo("module io.helidon.pico {\n" + equalTo("module io.helidon.inject {\n" + "\n" - + " requires transitive io.helidon.pico.api;\n" + + " requires transitive io.helidon.inject.api;\n" + " requires static com.fasterxml.jackson.annotation;\n" + " requires static lombok;\n" + " requires io.helidon.common;\n" + "\n" - + " exports io.helidon.pico.spi.impl;\n" + + " exports io.helidon.inject.spi.impl;\n" + "\n" - + " provides io.helidon.pico.api.PicoServices with io.helidon.pico.spi.impl.DefaultPicoServices;\n" + + " provides io.helidon.inject.api.InjectionServices with io.helidon.inject.spi.impl.DefaultInjectionServices;\n" + "\n" - + " uses io.helidon.pico.api.ModuleComponent;\n" - + " uses io.helidon.pico.api.Application;\n" + + " uses io.helidon.inject.api.ModuleComponent;\n" + + " uses io.helidon.inject.api.Application;\n" + "\n" + " // needed when running with modules - to make private methods accessible\n" + " // another comment with a semicolon;\n" diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/TemplateHelperTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/TemplateHelperTest.java similarity index 97% rename from pico/tools/src/test/java/io/helidon/pico/tools/TemplateHelperTest.java rename to inject/tools/src/test/java/io/helidon/inject/tools/TemplateHelperTest.java index 842bfb14999..6065bfd4239 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/TemplateHelperTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/TemplateHelperTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022-2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.HashMap; import java.util.List; @@ -40,7 +40,7 @@ void bogusTemplateName() { TemplateHelper helper = TemplateHelper.create(); ToolsException e = assertThrows(ToolsException.class, () -> helper.safeLoadTemplate("bogus.hbs")); - assertThat(e.getMessage(), equalTo("Failed to load: templates/pico/default/bogus.hbs")); + assertThat(e.getMessage(), equalTo("Failed to load: templates/inject/default/bogus.hbs")); } @Test diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/TypeToolsTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/TypeToolsTest.java similarity index 94% rename from pico/tools/src/test/java/io/helidon/pico/tools/TypeToolsTest.java rename to inject/tools/src/test/java/io/helidon/inject/tools/TypeToolsTest.java index 028d2e81e5c..9dc7544c06a 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/TypeToolsTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/TypeToolsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.pico.tools; +package io.helidon.inject.tools; import java.util.List; import java.util.Objects; @@ -29,10 +29,10 @@ import io.github.classgraph.ScanResult; import jakarta.inject.Named; import jakarta.inject.Provider; +import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.Test; import static io.helidon.common.types.TypeName.create; -import static io.helidon.pico.tools.TypeTools.extractInjectionPointTypeInfo; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -67,16 +67,16 @@ void optionalsProvidersAndListsOfFieldInfo() { providerOfGenericClassInfo.getFieldInfo("optionalProvider")); optionalsProvidersAndLists(typeToolsTestTypeName, false, false, true, providerOfGenericClassInfo.getFieldInfo("optionalNotProvider")); - optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.pico.tools" + optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.inject.tools" + ".TypeToolsTest$ProviderOfGeneric implements jakarta.inject.Provider", providerOfGenericClassInfo.getFieldInfo("generic")); - optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.pico.tools" + optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.inject.tools" + ".TypeToolsTest$ProviderOfGeneric implements jakarta.inject.Provider", providerOfGenericClassInfo.getFieldInfo("listOfProvidersOfGeneric")); - optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.pico.tools" + optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.inject.tools" + ".TypeToolsTest$ProviderOfGeneric implements jakarta.inject.Provider", providerOfGenericClassInfo.getFieldInfo("optionalProviderOfGeneric")); - optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.pico.tools" + optionalsProvidersAndListsException("Unsupported type for D in abstract static class io.helidon.inject.tools" + ".TypeToolsTest$ProviderOfGeneric implements jakarta.inject.Provider", providerOfGenericClassInfo.getFieldInfo("optionalOfGeneric")); @@ -141,7 +141,7 @@ private void optionalsProvidersAndLists(TypeName expectedType, AtomicReference isProvider = new AtomicReference<>(); AtomicReference isList = new AtomicReference<>(); AtomicReference isOptional = new AtomicReference<>(); - assertThat(extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional), equalTo(expectedType)); + MatcherAssert.assertThat(TypeTools.extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional), equalTo(expectedType)); assertThat("provider for " + fld, isProvider.get(), is(expectedProvider)); assertThat("list for " + fld, isList.get(), equalTo(expectedList)); assertThat("optional for " + fld, isOptional.get(), is(expectedOptional)); @@ -153,7 +153,7 @@ private void optionalsProvidersAndListsException(String exceptedException, AtomicReference isList = new AtomicReference<>(); AtomicReference isOptional = new AtomicReference<>(); Exception te = assertThrows(IllegalStateException.class, - () -> extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional)); + () -> TypeTools.extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional)); assertThat(fld.toString(), te.getMessage(), equalTo(exceptedException)); } @@ -165,7 +165,7 @@ private void optionalsProvidersAndLists(TypeName expectedType, AtomicReference isProvider = new AtomicReference<>(); AtomicReference isList = new AtomicReference<>(); AtomicReference isOptional = new AtomicReference<>(); - assertThat(extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional), equalTo(expectedType)); + MatcherAssert.assertThat(TypeTools.extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional), equalTo(expectedType)); assertThat("provider for " + fld, isProvider.get(), is(expectedProvider)); assertThat("list for " + fld, isList.get(), equalTo(expectedList)); assertThat("optional for " + fld, isOptional.get(), is(expectedOptional)); @@ -177,7 +177,7 @@ private void optionalsProvidersAndListsException(String exceptedException, AtomicReference isList = new AtomicReference<>(); AtomicReference isOptional = new AtomicReference<>(); Exception te = assertThrows(IllegalStateException.class, - () -> extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional)); + () -> TypeTools.extractInjectionPointTypeInfo(fld, isProvider, isList, isOptional)); assertThat(fld.toString(), te.getMessage(), equalTo(exceptedException)); } diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorld.java b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorld.java similarity index 85% rename from pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorld.java rename to inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorld.java index 3662caf64bb..56f06a6d74f 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorld.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorld.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package io.helidon.pico.tools.testsubjects; +package io.helidon.inject.tools.testsubjects; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * For testing. */ @Contract -public interface HelloPicoWorld { +public interface HelloInjectionWorld { /** * For testing. diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorldImpl.java b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorldImpl.java similarity index 77% rename from pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorldImpl.java rename to inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorldImpl.java index c9d2093e378..a8de2c0497f 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/HelloPicoWorldImpl.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/HelloInjectionWorldImpl.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tools.testsubjects; +package io.helidon.inject.tools.testsubjects; import java.util.List; import java.util.Objects; import java.util.Optional; -import io.helidon.pico.api.RunLevel; +import io.helidon.inject.api.RunLevel; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; @@ -32,31 +32,31 @@ @Singleton @RunLevel(0) @SuppressWarnings("unused") -public class HelloPicoWorldImpl implements HelloPicoWorld { +public class HelloInjectionWorldImpl implements HelloInjectionWorld { @Inject - PicoWorld world; + InjectionWorld world; @Inject - Provider worldRef; + Provider worldRef; @Inject - List> listOfWorldRefs; + List> listOfWorldRefs; @Inject - List listOfWorlds; + List listOfWorlds; @Inject @Named("red") - Optional redWorld; + Optional redWorld; - private PicoWorld setWorld; + private InjectionWorld setWorld; int postConstructCallCount; int preDestroyCallCount; @Inject - HelloPicoWorldImpl(PicoWorld picoWorld) { - Objects.requireNonNull(picoWorld); + HelloInjectionWorldImpl(InjectionWorld injectionWorld) { + Objects.requireNonNull(injectionWorld); } @Override @@ -71,7 +71,7 @@ public String sayHello() { } @Inject - void world(PicoWorld world) { + void world(InjectionWorld world) { this.setWorld = world; } diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorld.java b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorld.java similarity index 90% rename from pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorld.java rename to inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorld.java index 82fc9a50fd4..2ad1996fb2b 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorld.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorld.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package io.helidon.pico.tools.testsubjects; +package io.helidon.inject.tools.testsubjects; /** * For testing. */ // @Contract - we will test ExternalContracts here instead -public interface PicoWorld { +public interface InjectionWorld { /** * For testing. diff --git a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorldImpl.java b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorldImpl.java similarity index 72% rename from pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorldImpl.java rename to inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorldImpl.java index c11b6005100..e9d28bb91a2 100644 --- a/pico/tools/src/test/java/io/helidon/pico/tools/testsubjects/PicoWorldImpl.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/testsubjects/InjectionWorldImpl.java @@ -14,19 +14,19 @@ * limitations under the License. */ -package io.helidon.pico.tools.testsubjects; +package io.helidon.inject.tools.testsubjects; -import io.helidon.pico.api.ExternalContracts; +import io.helidon.inject.api.ExternalContracts; -@ExternalContracts(PicoWorld.class) -public class PicoWorldImpl implements PicoWorld { +@ExternalContracts(InjectionWorld.class) +public class InjectionWorldImpl implements InjectionWorld { private final String name; - PicoWorldImpl() { - this("pico"); + InjectionWorldImpl() { + this("inject"); } - PicoWorldImpl(String name) { + InjectionWorldImpl(String name) { this.name = name; } diff --git a/pico/tools/src/test/resources/testsubjects/m0._java_ b/inject/tools/src/test/resources/testsubjects/m0._java_ similarity index 50% rename from pico/tools/src/test/resources/testsubjects/m0._java_ rename to inject/tools/src/test/resources/testsubjects/m0._java_ index 080cb5ab848..bbda04d46ed 100644 --- a/pico/tools/src/test/resources/testsubjects/m0._java_ +++ b/inject/tools/src/test/resources/testsubjects/m0._java_ @@ -1,16 +1,16 @@ -module io.helidon.pico { +module io.helidon.inject { - requires transitive io.helidon.pico.api; + requires transitive io.helidon.inject.api; requires static com.fasterxml.jackson.annotation; requires static lombok; requires io.helidon.common; - exports io.helidon.pico.spi.impl; + exports io.helidon.inject.spi.impl; - provides io.helidon.pico.api.PicoServices with io.helidon.pico.spi.impl.DefaultPicoServices; + provides io.helidon.inject.api.InjectionServices with io.helidon.inject.spi.impl.DefaultInjectionServices; - uses io.helidon.pico.api.ModuleComponent; - uses io.helidon.pico.api.Application; + uses io.helidon.inject.api.ModuleComponent; + uses io.helidon.inject.api.Application; // needed when running with modules - to make private methods accessible // another comment with a semicolon; diff --git a/integrations/oci/sdk/README.md b/integrations/oci/sdk/README.md index d1dc81b493e..c4dbe96e74e 100644 --- a/integrations/oci/sdk/README.md +++ b/integrations/oci/sdk/README.md @@ -5,7 +5,7 @@ There are two different approaches for [OCI SDK](https://docs.oracle.com/en-us/i * **Helidon SE** (not using _CDI_). For this refer to the information below. ## Helidon Injection Framework and OCI SDK Integration -This section only applies for **Helidon SE** type applications. If you are using **Helidon MP** then this section does not apply to you, and you should instead refer to the [cdi](./cdi) module. If you are using **Helidon SE** then continue reading below. Please familiarize yourself with the basics of the [Helidon Injection Framework](../../../pico) and terminology before continuing further. +This section only applies for **Helidon SE** type applications. If you are using **Helidon MP** then this section does not apply to you, and you should instead refer to the [cdi](./cdi) module. If you are using **Helidon SE** then continue reading below. Please familiarize yourself with the basics of the [Helidon Injection Framework](../../../inject) and terminology before continuing further. The **Helidon Injection Framework** offers two modules for integrating with the **OCI SDK API** - the _processor_ module and the _runtime_ module. diff --git a/integrations/oci/sdk/processor/pom.xml b/integrations/oci/sdk/processor/pom.xml index ab52fea7073..4c14c0c2d59 100644 --- a/integrations/oci/sdk/processor/pom.xml +++ b/integrations/oci/sdk/processor/pom.xml @@ -35,8 +35,8 @@ - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor com.github.jknack diff --git a/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserver.java b/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserver.java index a890688769d..bb0a1e96a73 100644 --- a/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserver.java +++ b/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserver.java @@ -42,20 +42,23 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.processor.ProcessingEvent; -import io.helidon.pico.processor.spi.PicoAnnotationProcessorObserver; -import io.helidon.pico.tools.TemplateHelper; -import io.helidon.pico.tools.ToolsException; -import io.helidon.pico.tools.TypeNames; - -import static io.helidon.pico.processor.GeneralProcessorUtils.isProviderType; +import io.helidon.inject.api.Activator; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.processor.InjectionAnnotationProcessor; +import io.helidon.inject.processor.ProcessingEvent; +import io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver; +import io.helidon.inject.tools.TemplateHelper; +import io.helidon.inject.tools.ToolsException; +import io.helidon.inject.tools.TypeNames; + +import static io.helidon.inject.processor.GeneralProcessorUtils.isProviderType; import static java.util.function.Predicate.not; /** - * This processor is an implementation of {@link PicoAnnotationProcessorObserver}. When on the APT classpath, it will monitor - * {@link io.helidon.pico.processor.PicoAnnotationProcessor} for all injection points that are + * This processor is an implementation of {@link InjectionAnnotationProcessorObserver}. When on the APT classpath, it will monitor + * {@link InjectionAnnotationProcessor} for all injection points that are * using the {@code OCI SDK Services} and translate those injection points into code-generated - * {@link io.helidon.pico.api.Activator}s, {@link io.helidon.pico.api.ModuleComponent}, etc. for those services / components. + * {@link Activator}s, {@link ModuleComponent}, etc. for those services / components. * This process will therefore make the {@code OCI SDK} set of services injectable by your (non-MP-based) Helidon application, and * be tailored to exactly what is actually used by your application from the SDK. *

      @@ -84,7 +87,7 @@ * not be processed. * */ -public class OciInjectionProcessorObserver implements PicoAnnotationProcessorObserver { +public class OciInjectionProcessorObserver implements InjectionAnnotationProcessorObserver { static final String OCI_ROOT_PACKAGE_NAME_PREFIX = "com.oracle.bmc."; // all generated sources will have this package prefix diff --git a/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciModuleComponentNamer.java b/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciModuleComponentNamer.java index 1b78db516db..cdd0986c18d 100644 --- a/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciModuleComponentNamer.java +++ b/integrations/oci/sdk/processor/src/main/java/io/helidon/integrations/oci/sdk/processor/OciModuleComponentNamer.java @@ -20,12 +20,13 @@ import java.util.Optional; import io.helidon.common.types.TypeName; -import io.helidon.pico.tools.spi.ModuleComponentNamer; +import io.helidon.inject.api.ModuleComponent; +import io.helidon.inject.tools.spi.ModuleComponentNamer; import static java.util.function.Predicate.not; /** - * Avoids using any OCI SDK package name(s) as the {@link io.helidon.pico.api.ModuleComponent} name that is code-generated. + * Avoids using any OCI SDK package name(s) as the {@link ModuleComponent} name that is code-generated. */ public class OciModuleComponentNamer implements ModuleComponentNamer { diff --git a/integrations/oci/sdk/processor/src/main/java/module-info.java b/integrations/oci/sdk/processor/src/main/java/module-info.java index 80cd6668e48..6d182763359 100644 --- a/integrations/oci/sdk/processor/src/main/java/module-info.java +++ b/integrations/oci/sdk/processor/src/main/java/module-info.java @@ -14,8 +14,6 @@ * limitations under the License. */ -import io.helidon.integrations.oci.sdk.processor.OciModuleComponentNamer; - /** * Helidon Injection Integrations for OCI SDK. */ @@ -24,15 +22,15 @@ requires static jdk.jfr; requires java.compiler; requires handlebars; - requires transitive io.helidon.pico.processor; + requires transitive io.helidon.inject.processor; exports io.helidon.integrations.oci.sdk.processor; - uses io.helidon.pico.processor.spi.PicoAnnotationProcessorObserver; - uses io.helidon.pico.tools.spi.ModuleComponentNamer; + uses io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver; + uses io.helidon.inject.tools.spi.ModuleComponentNamer; - provides io.helidon.pico.processor.spi.PicoAnnotationProcessorObserver with + provides io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver with io.helidon.integrations.oci.sdk.processor.OciInjectionProcessorObserver; - provides io.helidon.pico.tools.spi.ModuleComponentNamer with - OciModuleComponentNamer; + provides io.helidon.inject.tools.spi.ModuleComponentNamer with + io.helidon.integrations.oci.sdk.processor.OciModuleComponentNamer; } diff --git a/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-builder-provider.hbs b/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-builder-provider.hbs index bbeb3e0af9f..03c73220869 100644 --- a/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-builder-provider.hbs +++ b/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-builder-provider.hbs @@ -23,9 +23,9 @@ import {{classname}}Client{{dot}}Builder;{{#if usesRegion}} import com.oracle.bmc.Region;{{/if}} import io.helidon.common.Weight; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.ServiceInfoBasics; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -35,7 +35,7 @@ import java.util.Optional; {{{generatedanno}}} @Singleton -@Weight(ServiceInfoBasics.DEFAULT_PICO_WEIGHT) +@Weight(ServiceInfoBasics.DEFAULT_INJECT_WEIGHT) class {{simpleclassname}}$$Oci$$ClientBuilder implements InjectionPointProvider<{{simpleclassname}}Client{{dot}}Builder> { {{#if usesRegion}} private final InjectionPointProvider regionProvider; diff --git a/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-provider.hbs b/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-provider.hbs index 2c28fc831ca..e9731bf155a 100644 --- a/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-provider.hbs +++ b/integrations/oci/sdk/processor/src/main/resources/io/helidon/integrations/oci/sdk/processor/templates/service-client-provider.hbs @@ -22,10 +22,10 @@ import {{classname}}Client; import {{classname}}Client{{dot}}Builder; import io.helidon.common.Weight; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.ExternalContracts; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.ExternalContracts; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.ServiceInfoBasics; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -35,7 +35,7 @@ import java.util.Optional; {{{generatedanno}}} @Singleton -@Weight(ServiceInfoBasics.DEFAULT_PICO_WEIGHT) +@Weight(ServiceInfoBasics.DEFAULT_INJECT_WEIGHT) @ExternalContracts({{classname}}.class) class {{simpleclassname}}$$Oci$$Client implements InjectionPointProvider<{{simpleclassname}}Client> { private final InjectionPointProvider authProvider; diff --git a/integrations/oci/sdk/processor/src/test/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserverTest.java b/integrations/oci/sdk/processor/src/test/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserverTest.java index d69286b2fe7..a3cb853d42b 100644 --- a/integrations/oci/sdk/processor/src/test/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserverTest.java +++ b/integrations/oci/sdk/processor/src/test/java/io/helidon/integrations/oci/sdk/processor/OciInjectionProcessorObserverTest.java @@ -21,7 +21,7 @@ import java.util.Set; import io.helidon.common.types.TypeName; -import io.helidon.pico.tools.ToolsException; +import io.helidon.inject.tools.ToolsException; import com.oracle.bmc.objectstorage.ObjectStorage; import com.oracle.bmc.streaming.Stream; @@ -38,7 +38,7 @@ class OciInjectionProcessorObserverTest { @Test - void generatedPicoArtifactsForTypicalOciServices() { + void generatedInjectionArtifactsForTypicalOciServices() { TypeName ociServiceType = TypeName.create(ObjectStorage.class); TypeName generatedOciServiceClientTypeName = OciInjectionProcessorObserver.toGeneratedServiceClientTypeName(ociServiceType); diff --git a/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$Client._java_ b/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$Client._java_ index 1df9678c5fb..0fe2c307a02 100644 --- a/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$Client._java_ +++ b/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$Client._java_ @@ -6,10 +6,10 @@ import com.oracle.bmc.objectstorage.ObjectStorageClient; import com.oracle.bmc.objectstorage.ObjectStorageClient.Builder; import io.helidon.common.Weight; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.ExternalContracts; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.ExternalContracts; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.ServiceInfoBasics; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -19,7 +19,7 @@ import java.util.Optional; @io.helidon.common.Generated(value = "io.helidon.integrations.oci.sdk.processor.OciInjectionProcessorObserver", trigger = "com.oracle.bmc.objectstorage.ObjectStorage") @Singleton -@Weight(ServiceInfoBasics.DEFAULT_PICO_WEIGHT) +@Weight(ServiceInfoBasics.DEFAULT_INJECT_WEIGHT) @ExternalContracts(com.oracle.bmc.objectstorage.ObjectStorage.class) class ObjectStorage$$Oci$$Client implements InjectionPointProvider { private final InjectionPointProvider authProvider; diff --git a/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$ClientBuilder._java_ b/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$ClientBuilder._java_ index 9f1b0ea37f3..7111873562a 100644 --- a/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$ClientBuilder._java_ +++ b/integrations/oci/sdk/processor/src/test/resources/expected/objectstorage$$Oci$$ClientBuilder._java_ @@ -7,9 +7,9 @@ import com.oracle.bmc.objectstorage.ObjectStorageClient.Builder; import com.oracle.bmc.Region; import io.helidon.common.Weight; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.ServiceInfoBasics; import jakarta.inject.Inject; import jakarta.inject.Named; @@ -19,7 +19,7 @@ import java.util.Optional; @io.helidon.common.Generated(value = "io.helidon.integrations.oci.sdk.processor.OciInjectionProcessorObserver", trigger = "com.oracle.bmc.objectstorage.ObjectStorage") @Singleton -@Weight(ServiceInfoBasics.DEFAULT_PICO_WEIGHT) +@Weight(ServiceInfoBasics.DEFAULT_INJECT_WEIGHT) class ObjectStorage$$Oci$$ClientBuilder implements InjectionPointProvider { private final InjectionPointProvider regionProvider; diff --git a/integrations/oci/sdk/runtime/pom.xml b/integrations/oci/sdk/runtime/pom.xml index 5492a2148e1..192c3037cd9 100644 --- a/integrations/oci/sdk/runtime/pom.xml +++ b/integrations/oci/sdk/runtime/pom.xml @@ -48,16 +48,16 @@ helidon-builder-api - io.helidon.pico.configdriven - helidon-pico-configdriven-api + io.helidon.inject.configdriven + helidon-inject-configdriven-api io.helidon.config helidon-config-metadata - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime jakarta.inject @@ -70,8 +70,8 @@ test - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test @@ -95,8 +95,8 @@ true - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} @@ -113,8 +113,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} diff --git a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProvider.java b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProvider.java index a14c054c642..0aa109d43be 100644 --- a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProvider.java +++ b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProvider.java @@ -28,10 +28,10 @@ import io.helidon.common.Weight; import io.helidon.common.types.Annotation; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.ServiceInfoBasics; import com.oracle.bmc.ConfigFileReader; import com.oracle.bmc.Region; @@ -54,7 +54,7 @@ * @see OciConfig */ @Singleton -@Weight(ServiceInfoBasics.DEFAULT_PICO_WEIGHT) +@Weight(ServiceInfoBasics.DEFAULT_INJECT_WEIGHT) class OciAuthenticationDetailsProvider implements InjectionPointProvider { static final System.Logger LOGGER = System.getLogger(OciAuthenticationDetailsProvider.class.getName()); diff --git a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailability.java b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailability.java index 7992db94f76..ed4a3872793 100644 --- a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailability.java +++ b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailability.java @@ -16,7 +16,7 @@ package io.helidon.integrations.oci.sdk.runtime; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * Provides a convenient contract for checking whether the current runtime environment is running on/inside an OCI compute node. diff --git a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailabilityDefault.java b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailabilityDefault.java index 1e0b77c81ca..4e55995ff6b 100644 --- a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailabilityDefault.java +++ b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciAvailabilityDefault.java @@ -23,7 +23,7 @@ import java.net.UnknownHostException; import io.helidon.common.Weight; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.ServiceInfoBasics; import com.oracle.bmc.Region; import jakarta.inject.Singleton; @@ -33,7 +33,7 @@ * available, will also perform a secondary check on {@link Region#getRegionFromImds()} to ensure it returns a non-null value. */ @Singleton -@Weight(ServiceInfoBasics.DEFAULT_PICO_WEIGHT) +@Weight(ServiceInfoBasics.DEFAULT_INJECT_WEIGHT) class OciAvailabilityDefault implements OciAvailability { @Override diff --git a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciExtension.java b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciExtension.java index 3a252135f3d..1867133a39c 100644 --- a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciExtension.java +++ b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciExtension.java @@ -21,8 +21,8 @@ import io.helidon.common.LazyValue; import io.helidon.common.config.Config; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; import com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider; @@ -58,7 +58,7 @@ *

      Basic Usage

      * * To use this extension, make sure it is on your project's runtime - * classpath. Also be sure the helidon-pico-integrations-oci-processor is + * classpath. Also be sure the helidon-integrations-oci-processor is * on your APT/compile-time classpath. To {@linkplain jakarta.inject.Inject inject} a service * interface named * com.oracle.bmc.cloudexample.CloudExample @@ -78,11 +78,11 @@ * create service client builder and asynchronous service client * builder instances by invoking the {@code static} {@code builder()} * method that is present on all OCI service client classes, and will then - * provide those instances as regular pico services. The resulting service client or + * provide those instances as regular Injection/Injectable services. The resulting service client or * asynchronous service client will be built by that builder's {@link * com.oracle.bmc.common.ClientBuilderBase#build(AbstractAuthenticationDetailsProvider) * build(AbstractAuthenticationDetailsProvider)} method and will - * itself be provided as a pico service instance.

      + * itself be provided as a service instance.

      * *

      A user may wish to customize this builder so that the resulting * service client or asynchronous service client reflects the @@ -127,7 +127,7 @@ private OciExtension() { * @return the bootstrap oci config bean */ public static OciConfig ociConfig() { - Optional bootstrap = PicoServices.globalBootstrap(); + Optional bootstrap = InjectionServices.globalBootstrap(); if (bootstrap.isEmpty()) { LOGGER.log(System.Logger.Level.DEBUG, "No bootstrap - using default oci config"); return DEFAULT_OCI_CONFIG_BEAN.get(); diff --git a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java index e3448c03a23..5d5dcdb6d2c 100644 --- a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java +++ b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java @@ -19,10 +19,11 @@ import java.util.Optional; import io.helidon.common.Weight; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.InjectionPointProvider; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceInfoBasics; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ServiceInfoBasics; import com.oracle.bmc.Region; import jakarta.inject.Singleton; @@ -30,10 +31,10 @@ import static io.helidon.integrations.oci.sdk.runtime.OciAuthenticationDetailsProvider.toNamedProfile; /** - * Can optionally be used to return a {@link Region} appropriate for the {@link io.helidon.pico.api.InjectionPointInfo} context. + * Can optionally be used to return a {@link Region} appropriate for the {@link InjectionPointInfo} context. */ @Singleton -@Weight(ServiceInfoBasics.DEFAULT_PICO_WEIGHT) +@Weight(ServiceInfoBasics.DEFAULT_INJECT_WEIGHT) class OciRegionProvider implements InjectionPointProvider { OciRegionProvider() { @@ -42,7 +43,7 @@ class OciRegionProvider implements InjectionPointProvider { @Override public Region get() { return first(ContextualServiceQuery.builder() - .serviceInfoCriteria(PicoServices.EMPTY_CRITERIA) + .serviceInfoCriteria(InjectionServices.EMPTY_CRITERIA) .expected(false) .build()) .orElseThrow(); diff --git a/integrations/oci/sdk/runtime/src/main/java/module-info.java b/integrations/oci/sdk/runtime/src/main/java/module-info.java index 2b4bfdb63a7..0a72035780f 100644 --- a/integrations/oci/sdk/runtime/src/main/java/module-info.java +++ b/integrations/oci/sdk/runtime/src/main/java/module-info.java @@ -25,14 +25,14 @@ requires io.helidon.common; requires io.helidon.common.config; requires io.helidon.config.metadata; - requires transitive io.helidon.pico.runtime; + requires transitive io.helidon.inject.runtime; requires oci.java.sdk.common; requires io.helidon.common.types; exports io.helidon.integrations.oci.sdk.runtime; - uses io.helidon.pico.api.ModuleComponent; + uses io.helidon.inject.api.ModuleComponent; - provides io.helidon.pico.api.ModuleComponent with - io.helidon.integrations.oci.sdk.runtime.Pico$$Module; + provides io.helidon.inject.api.ModuleComponent with + io.helidon.integrations.oci.sdk.runtime.Injection$$Module; } diff --git a/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProviderTest.java b/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProviderTest.java index efe3c3cb3ec..44cfacd1489 100644 --- a/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProviderTest.java +++ b/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciAuthenticationDetailsProviderTest.java @@ -23,12 +23,12 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.Annotation; import io.helidon.config.Config; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; import com.oracle.bmc.Region; import com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider; @@ -38,8 +38,8 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; @@ -49,7 +49,7 @@ class OciAuthenticationDetailsProviderTest { - PicoServices picoServices; + InjectionServices injectionServices; Services services; @AfterAll @@ -59,8 +59,8 @@ static void tearDown() { void resetWith(Config config) { resetAll(); - this.picoServices = testableServices(config); - this.services = picoServices.services(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @Test @@ -159,7 +159,7 @@ void selectionWhenNoConfigIsSet() { ServiceProvider authServiceProvider = services.lookupFirst(AbstractAuthenticationDetailsProvider.class, true).orElseThrow(); - PicoServiceProviderException e = assertThrows(PicoServiceProviderException.class, authServiceProvider::get); + InjectionServiceProviderException e = assertThrows(InjectionServiceProviderException.class, authServiceProvider::get); assertThat(e.getCause().getMessage(), equalTo("No instances of com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider available for use. " + "Verify your configuration named: oci")); @@ -176,7 +176,7 @@ void selectionWhenFileConfigIsSetWithAuto() { ServiceProvider authServiceProvider = services.lookupFirst(AbstractAuthenticationDetailsProvider.class, true).orElseThrow(); - PicoServiceProviderException e = assertThrows(PicoServiceProviderException.class, authServiceProvider::get); + InjectionServiceProviderException e = assertThrows(InjectionServiceProviderException.class, authServiceProvider::get); assertThat(e.getCause().getClass(), equalTo(UncheckedIOException.class)); } diff --git a/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciConfigTest.java b/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciConfigTest.java index 09cb7ab2880..0053ae8cae6 100644 --- a/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciConfigTest.java +++ b/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciConfigTest.java @@ -209,8 +209,8 @@ static Config createTestConfig(MapConfigSource.Builder... builders) { static MapConfigSource.Builder basicTestingConfigSource() { return ConfigSources.create( - Map.of("pico.permits-dynamic", "true", - "pico.activation-logs", "true" + Map.of("inject.permits-dynamic", "true", + "inject.activation-logs", "true" ), "config-basic"); } diff --git a/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProviderTest.java b/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProviderTest.java index 8f5c536812d..b10eaaef901 100644 --- a/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProviderTest.java +++ b/integrations/oci/sdk/runtime/src/test/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProviderTest.java @@ -18,30 +18,30 @@ import io.helidon.common.types.TypeName; import io.helidon.config.Config; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.ContextualServiceQuery; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.InjectionPointInfo; -import io.helidon.pico.api.PicoServiceProviderException; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.AccessModifier; +import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.ElementKind; +import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServiceProviderException; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; import com.oracle.bmc.Region; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Test; import static io.helidon.common.testing.junit5.OptionalMatcher.optionalValue; -import static io.helidon.pico.testing.PicoTestingSupport.resetAll; -import static io.helidon.pico.testing.PicoTestingSupport.testableServices; +import static io.helidon.inject.testing.InjectionTestingSupport.resetAll; +import static io.helidon.inject.testing.InjectionTestingSupport.testableServices; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; class OciRegionProviderTest { - PicoServices picoServices; + InjectionServices injectionServices; Services services; @AfterAll @@ -51,8 +51,8 @@ static void tearDown() { void resetWith(Config config) { resetAll(); - this.picoServices = testableServices(config); - this.services = picoServices.services(); + this.injectionServices = testableServices(config); + this.services = injectionServices.services(); } @Test @@ -63,9 +63,9 @@ void regionProviderService() { OciConfigTest.ociAuthSimpleConfig("tenant", "user", "phrase", "fp", null, null, "region")); resetWith(config); - ServiceProvider regionProvider = PicoServices.realizedServices() + ServiceProvider regionProvider = InjectionServices.realizedServices() .lookupFirst(Region.class, false).orElseThrow(); - assertThrows(PicoServiceProviderException.class, + assertThrows(InjectionServiceProviderException.class, regionProvider::get); TypeName regionType = TypeName.create(Region.class); diff --git a/integrations/oci/sdk/tests/test-application/pom.xml b/integrations/oci/sdk/tests/test-application/pom.xml index dfb811fb47b..8b16c4a576a 100644 --- a/integrations/oci/sdk/tests/test-application/pom.xml +++ b/integrations/oci/sdk/tests/test-application/pom.xml @@ -114,8 +114,8 @@ - io.helidon.pico - helidon-pico-maven-plugin + io.helidon.inject + helidon-inject-maven-plugin ${helidon.version} diff --git a/integrations/oci/sdk/tests/test-module1/pom.xml b/integrations/oci/sdk/tests/test-module1/pom.xml index 9e7e7239917..a2475c92281 100644 --- a/integrations/oci/sdk/tests/test-module1/pom.xml +++ b/integrations/oci/sdk/tests/test-module1/pom.xml @@ -41,8 +41,8 @@ helidon-integrations-oci-sdk-runtime - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime jakarta.annotation diff --git a/integrations/oci/sdk/tests/test-module2/pom.xml b/integrations/oci/sdk/tests/test-module2/pom.xml index 44eb1864358..cc9a5e10bba 100644 --- a/integrations/oci/sdk/tests/test-module2/pom.xml +++ b/integrations/oci/sdk/tests/test-module2/pom.xml @@ -41,8 +41,8 @@ helidon-integrations-oci-sdk-runtime - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime jakarta.annotation diff --git a/nima/fault-tolerance/fault-tolerance/pom.xml b/nima/fault-tolerance/fault-tolerance/pom.xml index 155b8a8b468..f6c569a8cae 100644 --- a/nima/fault-tolerance/fault-tolerance/pom.xml +++ b/nima/fault-tolerance/fault-tolerance/pom.xml @@ -48,16 +48,16 @@ must be in compile & runtime dependencies as we provide services that are in API --> - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime true @@ -87,17 +87,17 @@ - io.helidon.pico.configdriven - helidon-pico-configdriven-api + io.helidon.inject.configdriven + helidon-inject-configdriven-api true - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime true @@ -143,8 +143,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} @@ -166,8 +166,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Async.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Async.java index cd06cb8f7d2..7b57be7a31a 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Async.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Async.java @@ -21,7 +21,7 @@ import java.util.function.Supplier; import io.helidon.builder.api.RuntimeType; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * Runs synchronous suppliers asynchronously using virtual threads. Includes diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncImpl.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncImpl.java index 43df75d444f..f20148296f9 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncImpl.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncImpl.java @@ -23,10 +23,10 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; import jakarta.inject.Inject; @@ -101,11 +101,11 @@ public boolean cancel(boolean mayInterruptIfRunning) { private static Optional executorService(String name) { var qualifier = Qualifier.createNamed(name); - return PicoServices.realizedServices().lookupFirst(ExecutorService.class, - ServiceInfoCriteria.builder() + return InjectionServices.realizedServices().lookupFirst(ExecutorService.class, + ServiceInfoCriteria.builder() .addQualifier(qualifier) .build(), - false) + false) .map(ServiceProvider::get); } } diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java index 10ce84dfd37..5d5460fdc54 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java @@ -23,9 +23,9 @@ import io.helidon.common.Weight; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InjectionServices; import jakarta.inject.Singleton; @@ -34,7 +34,7 @@ @Singleton class AsyncInterceptor extends InterceptorBase implements Interceptor { AsyncInterceptor() { - super(PicoServices.realizedServices(), Async.class, FaultTolerance.Async.class); + super(InjectionServices.realizedServices(), Async.class, FaultTolerance.Async.class); } @Override diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Bulkhead.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Bulkhead.java index c95bf32ffbe..0618ffde86f 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Bulkhead.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Bulkhead.java @@ -20,7 +20,7 @@ import java.util.function.Supplier; import io.helidon.builder.api.RuntimeType; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * Bulkhead protects a resource that cannot serve unlimited parallel diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadConfigBlueprint.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadConfigBlueprint.java index 0352c783863..704f3fa37b2 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadConfigBlueprint.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadConfigBlueprint.java @@ -22,7 +22,7 @@ import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; /** * {@link io.helidon.nima.faulttolerance.Bulkhead} configuration bean. diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadInterceptor.java index d17e8c90845..d92466517f6 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/BulkheadInterceptor.java @@ -19,8 +19,8 @@ import io.helidon.common.Weight; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InjectionServices; import jakarta.inject.Singleton; @@ -29,7 +29,7 @@ @Singleton class BulkheadInterceptor extends InterceptorBase { BulkheadInterceptor() { - super(PicoServices.realizedServices(), Bulkhead.class, FaultTolerance.Bulkhead.class); + super(InjectionServices.realizedServices(), Bulkhead.class, FaultTolerance.Bulkhead.class); } @Override diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreaker.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreaker.java index 824b904f996..664a9e3e944 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreaker.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreaker.java @@ -19,7 +19,7 @@ import java.util.function.Consumer; import io.helidon.builder.api.RuntimeType; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * CircuitBreaker protects a potentially failing endpoint from overloading and the application diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerConfigBlueprint.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerConfigBlueprint.java index ca550d381a8..6e66c487636 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerConfigBlueprint.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerConfigBlueprint.java @@ -24,7 +24,7 @@ import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; @Prototype.Blueprint(builderInterceptor = CircuitBreakerConfigBlueprint.BuilderInterceptor.class) @Configured(prefix = "fault-tolerance.circuit-breakers", root = true) diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerImpl.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerImpl.java index 92da3e2fc83..a23bedd535d 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerImpl.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerImpl.java @@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.inject.Inject; diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerInterceptor.java index 93e78e1c970..e9ae3332df2 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerInterceptor.java @@ -18,8 +18,8 @@ import io.helidon.common.Weight; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InjectionServices; import jakarta.inject.Singleton; @@ -28,7 +28,7 @@ @Singleton class CircuitBreakerInterceptor extends InterceptorBase { CircuitBreakerInterceptor() { - super(PicoServices.realizedServices(), CircuitBreaker.class, FaultTolerance.CircuitBreaker.class); + super(InjectionServices.realizedServices(), CircuitBreaker.class, FaultTolerance.CircuitBreaker.class); } @Override diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerMethod.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerMethod.java index 0289d0189c0..6cefb17caa3 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerMethod.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/CircuitBreakerMethod.java @@ -16,7 +16,7 @@ package io.helidon.nima.faulttolerance; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * A generated service to support circuit breaker without resorting to Class.forName() for exception types. diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java index 13f2c725844..035f2ed5b07 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java @@ -22,10 +22,10 @@ import io.helidon.common.Weight; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.InjectionException; import jakarta.inject.Singleton; @@ -35,7 +35,7 @@ @Singleton class FallbackInterceptor extends InterceptorBase { FallbackInterceptor() { - super(PicoServices.realizedServices(), Fallback.class, FaultTolerance.Fallback.class); + super(InjectionServices.realizedServices(), Fallback.class, FaultTolerance.Fallback.class); } @Override @@ -76,7 +76,7 @@ private FailingFallbackMethod(CacheRecord cacheRecord) { @Override public Object fallback(Object service, Throwable throwable, Object... arguments) { - throw new PicoException("Could not find a service that implements fallback method for: " + throw new InjectionException("Could not find a service that implements fallback method for: " + cacheRecord); } diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackMethod.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackMethod.java index 1f442f54aab..55803babb9a 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackMethod.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackMethod.java @@ -16,7 +16,7 @@ package io.helidon.nima.faulttolerance; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * A generated service to support fallback without reflection. diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FaultTolerance.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FaultTolerance.java index 62541f2ef09..a86372fc156 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FaultTolerance.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FaultTolerance.java @@ -32,7 +32,7 @@ import io.helidon.common.LazyValue; import io.helidon.config.Config; -import io.helidon.pico.api.InterceptedTrigger; +import io.helidon.inject.api.InterceptedTrigger; import static java.lang.System.Logger.Level.ERROR; diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java index aaf93b54fde..b5ea1a3e9d6 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java @@ -27,13 +27,13 @@ import io.helidon.common.GenericType; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.Interceptor; -import io.helidon.pico.api.InvocationContext; -import io.helidon.pico.api.PicoException; -import io.helidon.pico.api.Qualifier; -import io.helidon.pico.api.ServiceInfoCriteria; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; +import io.helidon.inject.api.Interceptor; +import io.helidon.inject.api.InvocationContext; +import io.helidon.inject.api.InjectionException; +import io.helidon.inject.api.Qualifier; +import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; @SuppressWarnings({"unchecked", "rawtypes", "deprecation"}) abstract class InterceptorBase implements Interceptor { @@ -95,7 +95,7 @@ T namedHandler(TypedElementInfo elementInfo, Function annotationTypeName.equals(it.typeName())) .findFirst() - .orElseThrow(() -> new PicoException("Interceptor triggered for a method not annotated with " + .orElseThrow(() -> new InjectionException("Interceptor triggered for a method not annotated with " + annotationTypeName)); String name = ftAnnotation.getValue("name") diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Retry.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Retry.java index 72281d075c6..1903d348533 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Retry.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Retry.java @@ -23,7 +23,7 @@ import java.util.function.Supplier; import io.helidon.builder.api.RuntimeType; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * Retry supports retry policies to be applied on an execution of asynchronous tasks. diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryInterceptor.java index cc2feb6e037..f64ccfb010f 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryInterceptor.java @@ -18,8 +18,8 @@ import io.helidon.common.Weight; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InjectionServices; import jakarta.inject.Singleton; @@ -28,7 +28,7 @@ @Singleton class RetryInterceptor extends InterceptorBase { RetryInterceptor() { - super(PicoServices.realizedServices(), Retry.class, FaultTolerance.Retry.class); + super(InjectionServices.realizedServices(), Retry.class, FaultTolerance.Retry.class); } @Override diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryMethod.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryMethod.java index f8eef448b15..02c51446055 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryMethod.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/RetryMethod.java @@ -16,7 +16,7 @@ package io.helidon.nima.faulttolerance; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * A generated service to support retries without resorting to Class.forName() for exception types. diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Timeout.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Timeout.java index c18599511df..37090776c23 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Timeout.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/Timeout.java @@ -20,7 +20,7 @@ import java.util.function.Consumer; import io.helidon.builder.api.RuntimeType; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * Timeout attempts to terminate execution after defined duration of time. diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/TimeoutInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/TimeoutInterceptor.java index ebe9bd6afab..34853b1c1a0 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/TimeoutInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/TimeoutInterceptor.java @@ -22,8 +22,8 @@ import io.helidon.common.Weight; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.api.ClassNamed; -import io.helidon.pico.api.PicoServices; +import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InjectionServices; import jakarta.inject.Singleton; @@ -32,7 +32,7 @@ @Singleton class TimeoutInterceptor extends InterceptorBase { TimeoutInterceptor() { - super(PicoServices.realizedServices(), Timeout.class, FaultTolerance.Timeout.class); + super(InjectionServices.realizedServices(), Timeout.class, FaultTolerance.Timeout.class); } @Override diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/module-info.java b/nima/fault-tolerance/fault-tolerance/src/main/java/module-info.java index 4d76425b94d..7a76e27d828 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/module-info.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/module-info.java @@ -30,20 +30,20 @@ requires io.helidon.common.types; requires io.helidon.common.configurable; requires io.helidon.config; - requires io.helidon.pico.api; + requires io.helidon.inject.api; requires io.helidon.builder.api; requires static jakarta.inject; requires static io.helidon.common.features.api; requires static io.helidon.config.metadata; - requires static io.helidon.pico.configdriven.api; + requires static io.helidon.inject.configdriven.api; // needed to compile generated types - requires static io.helidon.pico.configdriven.runtime; - requires static io.helidon.pico.runtime; + requires static io.helidon.inject.configdriven.runtime; + requires static io.helidon.inject.runtime; exports io.helidon.nima.faulttolerance; - // pico module - provides io.helidon.pico.api.ModuleComponent with io.helidon.nima.faulttolerance.Pico$$Module; -} \ No newline at end of file + // inject module + provides io.helidon.inject.api.ModuleComponent with io.helidon.nima.faulttolerance.Injection$$Module; +} diff --git a/nima/fault-tolerance/processor/pom.xml b/nima/fault-tolerance/processor/pom.xml index 23c6a182716..3ae658bde20 100644 --- a/nima/fault-tolerance/processor/pom.xml +++ b/nima/fault-tolerance/processor/pom.xml @@ -32,12 +32,12 @@ - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor diff --git a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/CircuitBreakerMethodCreator.java b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/CircuitBreakerMethodCreator.java index b5df7d2b2c8..659fd404508 100644 --- a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/CircuitBreakerMethodCreator.java +++ b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/CircuitBreakerMethodCreator.java @@ -30,16 +30,16 @@ import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.GenericTemplateCreator; -import io.helidon.pico.tools.GenericTemplateCreatorRequest; -import io.helidon.pico.tools.ToolsException; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.GenericTemplateCreator; +import io.helidon.inject.tools.GenericTemplateCreatorRequest; +import io.helidon.inject.tools.ToolsException; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * Annotation processor that generates a service for each method annotated with retry annotation. - * Service provider implementation of a {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator}. + * Service provider implementation of a {@link CustomAnnotationTemplateCreator}. */ public class CircuitBreakerMethodCreator extends FtMethodCreatorBase implements CustomAnnotationTemplateCreator { private static final String FT_ANNOTATION = "io.helidon.nima.faulttolerance.FaultTolerance.CircuitBreaker"; diff --git a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/FallbackMethodCreator.java b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/FallbackMethodCreator.java index 2d2034ee2dd..672df5ebf00 100644 --- a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/FallbackMethodCreator.java +++ b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/FallbackMethodCreator.java @@ -31,16 +31,16 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.GenericTemplateCreator; -import io.helidon.pico.tools.GenericTemplateCreatorRequest; -import io.helidon.pico.tools.ToolsException; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.GenericTemplateCreator; +import io.helidon.inject.tools.GenericTemplateCreatorRequest; +import io.helidon.inject.tools.ToolsException; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * Annotation processor that generates a service for each method annotated with fallback annotation. - * Service provider implementation of a {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator}. + * Service provider implementation of a {@link CustomAnnotationTemplateCreator}. */ public class FallbackMethodCreator extends FtMethodCreatorBase implements CustomAnnotationTemplateCreator { private static final String FALLBACK_ANNOTATION = "io.helidon.nima.faulttolerance.FaultTolerance.Fallback"; diff --git a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/RetryMethodCreator.java b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/RetryMethodCreator.java index 64592fec7b9..bee075aec5e 100644 --- a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/RetryMethodCreator.java +++ b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/RetryMethodCreator.java @@ -30,16 +30,16 @@ import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.GenericTemplateCreator; -import io.helidon.pico.tools.GenericTemplateCreatorRequest; -import io.helidon.pico.tools.ToolsException; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.GenericTemplateCreator; +import io.helidon.inject.tools.GenericTemplateCreatorRequest; +import io.helidon.inject.tools.ToolsException; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * Annotation processor that generates a service for each method annotated with retry annotation. - * Service provider implementation of a {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator}. + * Service provider implementation of a {@link CustomAnnotationTemplateCreator}. */ public class RetryMethodCreator extends FtMethodCreatorBase implements CustomAnnotationTemplateCreator { private static final String RETRY_ANNOTATION = "io.helidon.nima.faulttolerance.FaultTolerance.Retry"; diff --git a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/Templates.java b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/Templates.java index 4da7076ea63..77a4a0f52e1 100644 --- a/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/Templates.java +++ b/nima/fault-tolerance/processor/src/main/java/io/helidon/nima/faulttolerance/processor/Templates.java @@ -24,7 +24,7 @@ private Templates() { } static String loadTemplate(String name) { - String path = "templates/pico/nima/" + name; + String path = "templates/inject/nima/" + name; try { InputStream in = Templates.class.getClassLoader().getResourceAsStream(path); if (in == null) { diff --git a/nima/fault-tolerance/processor/src/main/java/module-info.java b/nima/fault-tolerance/processor/src/main/java/module-info.java index d0515becae5..16e0f21fa79 100644 --- a/nima/fault-tolerance/processor/src/main/java/module-info.java +++ b/nima/fault-tolerance/processor/src/main/java/module-info.java @@ -14,19 +14,21 @@ * limitations under the License. */ +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; + /** * Annotation processor that generates HTTP Endpoints. */ module io.helidon.nima.faulttolerance.processor { - requires io.helidon.pico.api; - requires io.helidon.pico.tools; - requires io.helidon.pico.processor; + requires io.helidon.inject.api; + requires io.helidon.inject.tools; + requires io.helidon.inject.processor; requires java.compiler; exports io.helidon.nima.faulttolerance.processor; - opens templates.pico.nima; + opens templates.inject.nima; - provides io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator + provides CustomAnnotationTemplateCreator with io.helidon.nima.faulttolerance.processor.FallbackMethodCreator, io.helidon.nima.faulttolerance.processor.RetryMethodCreator, io.helidon.nima.faulttolerance.processor.CircuitBreakerMethodCreator; diff --git a/nima/fault-tolerance/processor/src/main/resources/templates/pico/nima/circuit-breaker-method.java.hbs b/nima/fault-tolerance/processor/src/main/resources/templates/inject/nima/circuit-breaker-method.java.hbs similarity index 100% rename from nima/fault-tolerance/processor/src/main/resources/templates/pico/nima/circuit-breaker-method.java.hbs rename to nima/fault-tolerance/processor/src/main/resources/templates/inject/nima/circuit-breaker-method.java.hbs diff --git a/nima/fault-tolerance/processor/src/main/resources/templates/pico/nima/fallback-method.java.hbs b/nima/fault-tolerance/processor/src/main/resources/templates/inject/nima/fallback-method.java.hbs similarity index 100% rename from nima/fault-tolerance/processor/src/main/resources/templates/pico/nima/fallback-method.java.hbs rename to nima/fault-tolerance/processor/src/main/resources/templates/inject/nima/fallback-method.java.hbs diff --git a/nima/fault-tolerance/processor/src/main/resources/templates/pico/nima/retry-method.java.hbs b/nima/fault-tolerance/processor/src/main/resources/templates/inject/nima/retry-method.java.hbs similarity index 100% rename from nima/fault-tolerance/processor/src/main/resources/templates/pico/nima/retry-method.java.hbs rename to nima/fault-tolerance/processor/src/main/resources/templates/inject/nima/retry-method.java.hbs diff --git a/nima/http/processor/pom.xml b/nima/http/processor/pom.xml index abc8f95dbe8..59a339145cc 100644 --- a/nima/http/processor/pom.xml +++ b/nima/http/processor/pom.xml @@ -33,12 +33,12 @@ - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-processor + io.helidon.inject + helidon-inject-processor org.junit.jupiter diff --git a/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpEndpointCreator.java b/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpEndpointCreator.java index 05ebe2681d2..1d79f7155a7 100644 --- a/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpEndpointCreator.java +++ b/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpEndpointCreator.java @@ -24,14 +24,14 @@ import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.GenericTemplateCreatorRequest; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.GenericTemplateCreatorRequest; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * Annotation processor that generates a service for each class annotated with {@value #PATH_ANNOTATION} annotation. - * Service provider implementation of a {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator}. + * Service provider implementation of a {@link CustomAnnotationTemplateCreator}. */ public class HttpEndpointCreator extends HttpCreatorBase implements CustomAnnotationTemplateCreator { private static final System.Logger LOGGER = System.getLogger(HttpEndpointCreator.class.getName()); diff --git a/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpMethodCreator.java b/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpMethodCreator.java index b32dbc7f749..6f8936bcf91 100644 --- a/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpMethodCreator.java +++ b/nima/http/processor/src/main/java/io/helidon/nima/http/processor/HttpMethodCreator.java @@ -29,15 +29,15 @@ import io.helidon.common.types.TypeInfo; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.pico.tools.CustomAnnotationTemplateRequest; -import io.helidon.pico.tools.CustomAnnotationTemplateResponse; -import io.helidon.pico.tools.GenericTemplateCreator; -import io.helidon.pico.tools.GenericTemplateCreatorRequest; -import io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; +import io.helidon.inject.tools.CustomAnnotationTemplateRequest; +import io.helidon.inject.tools.CustomAnnotationTemplateResponse; +import io.helidon.inject.tools.GenericTemplateCreator; +import io.helidon.inject.tools.GenericTemplateCreatorRequest; +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * Annotation processor that generates a service for each method annotated with an HTTP method annotation. - * Service provider implementation of a {@link io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator}. + * Service provider implementation of a {@link CustomAnnotationTemplateCreator}. */ public class HttpMethodCreator extends HttpCreatorBase implements CustomAnnotationTemplateCreator { private static final String PATH_ANNOTATION = "io.helidon.common.http.Endpoint.Path"; diff --git a/nima/http/processor/src/main/java/io/helidon/nima/http/processor/Templates.java b/nima/http/processor/src/main/java/io/helidon/nima/http/processor/Templates.java index c5db21e4b48..a71216e8c4c 100644 --- a/nima/http/processor/src/main/java/io/helidon/nima/http/processor/Templates.java +++ b/nima/http/processor/src/main/java/io/helidon/nima/http/processor/Templates.java @@ -24,7 +24,7 @@ private Templates() { } static String loadTemplate(String templateProfile, String name) { - String path = "templates/pico/" + templateProfile + "/" + name; + String path = "templates/inject/" + templateProfile + "/" + name; try { InputStream in = Templates.class.getClassLoader().getResourceAsStream(path); if (in == null) { diff --git a/nima/http/processor/src/main/java/module-info.java b/nima/http/processor/src/main/java/module-info.java index c671b172808..e11a8bcf537 100644 --- a/nima/http/processor/src/main/java/module-info.java +++ b/nima/http/processor/src/main/java/module-info.java @@ -14,6 +14,7 @@ * limitations under the License. */ +import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; import io.helidon.nima.http.processor.HttpEndpointCreator; import io.helidon.nima.http.processor.HttpMethodCreator; @@ -21,13 +22,13 @@ * Annotation processor that generates HTTP Endpoints. */ module io.helidon.nima.http.processor { - requires io.helidon.pico.api; - requires io.helidon.pico.tools; - requires io.helidon.pico.processor; + requires io.helidon.inject.api; + requires io.helidon.inject.tools; + requires io.helidon.inject.processor; requires java.compiler; exports io.helidon.nima.http.processor; - provides io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator + provides CustomAnnotationTemplateCreator with HttpEndpointCreator, HttpMethodCreator; } diff --git a/nima/tests/integration/imperative/pom.xml b/nima/tests/integration/imperative/pom.xml index a7ce4ee3eb1..abf940524e4 100644 --- a/nima/tests/integration/imperative/pom.xml +++ b/nima/tests/integration/imperative/pom.xml @@ -95,8 +95,8 @@ as long as we do not use integrations that require service registry, we should not bring in the runtime modules of injection and config driven --> - io.helidon.pico:helidon-pico-runtime - io.helidon.pico.configdriven:helidon-configdriven-runtime + io.helidon.inject:helidon-inject-runtime + io.helidon.inject.configdriven:helidon-configdriven-runtime diff --git a/nima/webserver/webserver/pom.xml b/nima/webserver/webserver/pom.xml index 2d06c5cefda..0e562e2fc14 100644 --- a/nima/webserver/webserver/pom.xml +++ b/nima/webserver/webserver/pom.xml @@ -71,8 +71,8 @@ - io.helidon.pico.configdriven - helidon-pico-configdriven-api + io.helidon.inject.configdriven + helidon-inject-configdriven-api io.helidon.common.features @@ -80,22 +80,22 @@ - io.helidon.pico.configdriven - helidon-pico-configdriven-runtime + io.helidon.inject.configdriven + helidon-inject-configdriven-runtime true - io.helidon.pico - helidon-pico-api + io.helidon.inject + helidon-inject-api - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime true - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor true @@ -156,8 +156,8 @@ test - io.helidon.pico - helidon-pico-testing + io.helidon.inject + helidon-inject-testing test @@ -185,8 +185,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} @@ -203,8 +203,8 @@ ${helidon.version} - io.helidon.pico.configdriven - helidon-pico-configdriven-processor + io.helidon.inject.configdriven + helidon-inject-configdriven-processor ${helidon.version} diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java index 6af267c306a..0beda3654ac 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java @@ -49,9 +49,9 @@ import io.helidon.nima.webserver.http.DirectHandlers; import io.helidon.nima.webserver.http.HttpFeature; import io.helidon.nima.webserver.http.HttpRouting; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Startable; -import io.helidon.pico.configdriven.api.ConfigDriven; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Startable; +import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.annotation.PreDestroy; import jakarta.inject.Inject; @@ -116,7 +116,7 @@ class LoomServer implements WebServer, Startable { listeners = Map.copyOf(listenerMap); } - // based on Pico services + // based on Injection services @Inject LoomServer(WebServerConfig serverConfig, List> features) { this(addFeatures(serverConfig, features)); diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java index 0c90a7556f8..acbb488d802 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java @@ -21,7 +21,7 @@ import io.helidon.builder.api.RuntimeType; import io.helidon.common.context.Context; import io.helidon.nima.common.tls.Tls; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * Server that opens server sockets and handles requests through routing. diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServerConfigBlueprint.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServerConfigBlueprint.java index 5634e38d06a..16e263fb0ae 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServerConfigBlueprint.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServerConfigBlueprint.java @@ -24,7 +24,7 @@ import io.helidon.config.ConfigException; import io.helidon.config.metadata.Configured; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.pico.configdriven.api.ConfigBean; +import io.helidon.inject.configdriven.api.ConfigBean; /** * WebServer configuration bean. diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/GeneratedHandler.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/GeneratedHandler.java index 9a9e5d33622..39c85def981 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/GeneratedHandler.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/GeneratedHandler.java @@ -17,7 +17,7 @@ package io.helidon.nima.webserver.http; import io.helidon.common.http.Http; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * This class is only used by generated code. diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java index 6e152f1cb59..0262ff845e5 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java @@ -20,7 +20,7 @@ import io.helidon.nima.webserver.ServerLifecycle; import io.helidon.nima.webserver.WebServer; -import io.helidon.pico.api.Contract; +import io.helidon.inject.api.Contract; /** * Can be registered with {@link io.helidon.nima.webserver.http.HttpRouting.Builder#addFeature(java.util.function.Supplier)}. diff --git a/nima/webserver/webserver/src/main/java/module-info.java b/nima/webserver/webserver/src/main/java/module-info.java index 3ed71dbe1a0..d35ccc6a00f 100644 --- a/nima/webserver/webserver/src/main/java/module-info.java +++ b/nima/webserver/webserver/src/main/java/module-info.java @@ -47,14 +47,14 @@ requires io.helidon.common.uri; requires static io.helidon.config.metadata; - requires static io.helidon.pico.configdriven.runtime; + requires static io.helidon.inject.configdriven.runtime; requires static jakarta.inject; // to compile @Generated requires static java.compiler; - // needed to compile pico generated classes - requires io.helidon.pico.api; - requires static io.helidon.pico.runtime; + // needed to compile injection generated classes + requires io.helidon.inject.api; + requires static io.helidon.inject.runtime; // provides multiple packages due to intentional cyclic dependency // we want to support HTTP/1.1 by default (we could fully separate it, but the API would be harder to use @@ -75,5 +75,5 @@ provides io.helidon.nima.webserver.spi.ProtocolConfigProvider with io.helidon.nima.webserver.http1.Http1ProtocolConfigProvider; provides io.helidon.nima.webserver.spi.ServerConnectionSelectorProvider with io.helidon.nima.webserver.http1.Http1ConnectionProvider; - provides io.helidon.pico.api.ModuleComponent with io.helidon.nima.webserver.Pico$$Module; + provides io.helidon.inject.api.ModuleComponent with io.helidon.nima.webserver.Injection$$Module; } diff --git a/nima/webserver/webserver/src/test/java/io/helidon/nima/webserver/WebServerConfigDrivenTest.java b/nima/webserver/webserver/src/test/java/io/helidon/nima/webserver/WebServerConfigDrivenTest.java index cc24cb9915d..a036829e59e 100644 --- a/nima/webserver/webserver/src/test/java/io/helidon/nima/webserver/WebServerConfigDrivenTest.java +++ b/nima/webserver/webserver/src/test/java/io/helidon/nima/webserver/WebServerConfigDrivenTest.java @@ -17,12 +17,12 @@ package io.helidon.nima.webserver; import io.helidon.config.Config; -import io.helidon.pico.api.Bootstrap; -import io.helidon.pico.api.Phase; -import io.helidon.pico.api.PicoServices; -import io.helidon.pico.api.ServiceProvider; -import io.helidon.pico.api.Services; -import io.helidon.pico.testing.PicoTestingSupport; +import io.helidon.inject.api.Bootstrap; +import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Phase; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; +import io.helidon.inject.testing.InjectionTestingSupport; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Disabled; @@ -38,8 +38,8 @@ class WebServerConfigDrivenTest { @AfterEach public void reset() { if (!NORMAL_PRODUCTION_PATH) { - // requires 'pico.permits-dynamic=true' to be able to reset - PicoTestingSupport.resetAll(); + // requires 'inject.permits-dynamic=true' to be able to reset + InjectionTestingSupport.resetAll(); } } @@ -49,17 +49,17 @@ void testConfigDriven() { Config config = Config.create(); if (NORMAL_PRODUCTION_PATH) { - // bootstrap Pico with our config tree when it initializes - PicoServices.globalBootstrap(Bootstrap.builder().config(config).build()); + // bootstrap Injection with our config tree when it initializes + InjectionServices.globalBootstrap(Bootstrap.builder().config(config).build()); } - // initialize Pico, and drive all activations based upon what has been configured + // initialize Injection, and drive all activations based upon what has been configured Services services; if (NORMAL_PRODUCTION_PATH) { - services = PicoServices.realizedServices(); + services = InjectionServices.realizedServices(); } else { - PicoServices picoServices = PicoTestingSupport.testableServices(config); - services = picoServices.services(); + InjectionServices injectionServices = InjectionTestingSupport.testableServices(config); + services = injectionServices.services(); } ServiceProvider webServerSp = services.lookupFirst(WebServer.class); diff --git a/nima/webserver/webserver/src/test/resources/application.yaml b/nima/webserver/webserver/src/test/resources/application.yaml index 07967e08751..610ed54410c 100644 --- a/nima/webserver/webserver/src/test/resources/application.yaml +++ b/nima/webserver/webserver/src/test/resources/application.yaml @@ -54,5 +54,5 @@ server2: media-context: content-encoding: -pico: +inject: permits-dynamic: true diff --git a/pico/README.md b/pico/README.md deleted file mode 100644 index 6f4bad79b75..00000000000 --- a/pico/README.md +++ /dev/null @@ -1,336 +0,0 @@ -# helidon-pico - -Helidon Pico is an optional feature in Helidon. At its core it provides these main features: - -1. A service registry. The service registry holds service providers and are (or otherwise can produce) services. Each service provider in the registry advertises its meta-information for what each service provides, and what it requires in the way of dependencies. - -2. A lifecycle engine. Each service provider in the registry remains dormant until there is a "demand for activation". This "demand for activation" is also known as "lazy activation" that can come in different ways. One way is to simply "get" a service (or services) from the registry that matches the meta-information criteria you provide programmatically. If the service (or services) need other services as part of the activation then those services are chain activated, recursively. Pico provides graceful startup and shutdown at a micro service-level as well as at a macro application level for all services in the service registry. - -3. Integrations and Extensibility. More will be mentioned on this later. - -Over the foundation of these three main features of "services registry", "lifecycle", and "extensibility" there are a number of other tooling and layers that are delivered from various Pico submodules that provide the following additional features and benefits: - -1. A minimalist, compile-time generated dependency injection framework that is free from reflection, and compliant to the JSR-330 injection specification. Compile-time source code generation has a number of advantages, including: (a) pre-runtime validation of the DI model, (b) visibility into your application by providing "less magic", which in turn fosters understandability and debug-ability of your application, (c) deterministic behavior (instead of depending on reflection and classpath ordering, etc.) and (c) performance, since binding the model at compile-time is more efficient than computing it at runtime. Pico (through its tooling) provides you with a mix of declarative and programmatic ways to build your application. It doesn't have to be just one or the other like other popular frameworks in use today require. Inspiration for Pico, however, did come from many libraries and frameworks that came before it (e.g., Jakarta Hk2, Google Guice, Spring, CDI, and even OSGi). Foundationally, Pico provides a way to develop declarative code using standard (i.e., javax/jakarta, not Helidon specific) annotation types. - -2. Integrations. Blending services from different providers (e.g., Helidon services like WebServer, your application service, 3rd party service, etc.) becomes natural in the Pico framework, and enables you to build fully-integrated, feature-rich applications more easily. - -3. Extensibility. At the micro level developers can provide their own templates for things like code generation, or even provide an entirely different implementation from this reference implementation Helidon provides. At a macro level (and post the initial release), Pico will be providing a foundation to extend your Guice, Spring, Hk2, CDI, application naturally into one application runtime. The Helidon team fields a number of support questions that involve this area involving "battling DI frameworks" like CDI w/ Hk2. In time, Pico aims to smooth out this area through the integrations and extensibility features that it will be providing. - -4. Interception. Annotations are provided, that in conjunction with Pico's code-generation annotation processors, allow services in the service registry to support interception and decoration patterns - without the use of reflection at runtime, which is conducive to native image. - -*** -__Pico currently support Java 11+, using jakarta.inject or javax.inject, jakarta.annotations or javax.annotations.__ -*** - -The Helidon Team believes that the above features help developers achieve the following goals: -* More IoC options. With Pico... developers can choose to use an imperative coding style or a declarative IoC style previously only available with CDI using Helidon MP. At the initial release (Helidon 4.0), however, Pico will only be available with Helidon Nima support. -* Compile-time benefits. With Pico... developers can decide to use compile-time code generation into their build process, thereby statically and deterministically wiring their injection model while still enjoying the benefits of a declarative approach for writing their application. Added to this, all code-generated artifacts are in source form instead of bytecode thereby making your application more readable, understandable, consistent, and debuggable. Furthermore, DI model inconsistencies can be found during compile-time instead of at runtime. -* Improved performance. Pushing more into compile-time helps reduce what otherwise would need to occur (often times via reflection) to built/compile-time processing. Native code is generated that is further optimized by the compiler. Additionally, with lazy activation of services, only what is needed is activated. Anything not used may be in the classpath is available, but unless and until there is demand for those services they remain dormant. You control the lifecycle in your application code. -* Additional lifecycle options. Pico can handle micro, service-level activations for your services, as well as offer controlled shutdown if desired. - -Many DI frameworks start simple and over time become bloated with "bells and whistle" type features - the majority of which most developers don't need and will never use; especially in today's world of microservices where the application scope is the JVM process itself. - -*** -The Helidon Pico Framework is a reset back to basics, and perfect for such use cases requiring minimalism but yet still be extensible. This is why Pico intentionally chose to implement the earlier JSR-330 specification at its foundation. Application Scope == Singleton Scope in a microservices world. -*** - -Request and Session scopes are simply not made available in Pico. We believe that scoping is a recipe for undo complexity, confusion, and bugs for the many developers today. - -## Terminology -* DI - Dependency Injection. -* Inject - The assignment of a service instance to a field or method setter that has been annotated with @Inject - also referred to as an injection point. In Spring this would be referred to as 'Autowired'. -* Injection Plan - The act of determining how your application will resolve each injection point. In Pico this can optionally be performed at compile-time. But even when the injection plan is deferred to runtime it is resolved without using reflection, and is therefore conducive to native image restrictions and enhanced performance. -* Service (aka Bean) - In Spring this would be referred to as a bean with a @Service annotation; These are concrete class types in your application that represents some sort of business logic. -* Scope - This refers to the cardinality of a service instance in your application. -* Singleton - jakarta.inject.Singleton or javax.inject.Singleton - This is the default scope for services in Pico just like it is in Spring. -* Provided - jakarta.inject.Provider or javax.inject.Provider - If the scope of a service is not Singleton then it is considered to be a Provided scope - and the cardinality will be ascribed to the implementation of the Provider to determine its cardinality. The provider can optionally use the injection point context to determine the appropriate instance and/or cardinality it provides. -* Contract - These are how a service can alias itself for injection. Contracts are typically the interface or abstract base class definitions of a service implementation. Injection points must be based upon either using a contract or service that pico is aware of, usually through annotation processing at compile time. -* Qualifier - jakarta.inject.qualifier or javax.inject.qualifier - These are meta annotations that can be ascribed to other annotations. One built-in qualifier type is @Named in the same package. -* RunLevel - A way for you to describe when a service shut start up during process lifecycle. The lower the RunLevel the sooner it should start (usually based at 0). -* Dependency - An injection point represents what is considered to be a dependency, perhaps qualified or Optional, on another service or contract. This is just another what to describe an injection point. -* Activator (aka ServiceProvider) - This is what is code generated by Pico to lazily activate your service instance(s) in the Pico services registry, and it handles resolving all dependencies it has, along with injecting the fields, methods, etc. that are required to be satisfied as part of that activation process. -* Services (aka services registry) - This is the collection of all services that are known to the JVM/runtime in Pico. -* ModuleComponent - This is where your application will "bind" services into the services registry - typically code generated, and typically with one module per jar/module in your application. -* Application - The fully realized set of modules and services/service providers that constitute your application, and code-generated using Helidon Pico Tooling. - -## Getting Started -As stated in the introduction above, the Pico framework aims to provide a minimalist API implementation. As a result, it might be surprising to learn how small the actual API is for Pico - see [pico api](./pico) and the API/annotation types at [pico api](./api/src/main/java/io/helidon/pico). If you are already familiar with [jakarta.inject](https://javadoc.io/doc/jakarta.inject/jakarta.inject-api/latest/index.html) and optionally, [jakarta.annotation](https://javadoc.io/doc/jakarta.annotation/jakarta.annotation-api/latest/jakarta.annotation/jakarta/annotation/package-summary.html) then basically you are ready to go. But if you've never used DI before then first review the basics of [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection). - -The prerequisites are familiarity with dependency injection, Java 11+, and maven 3.8.5+. - -The best way to learn Helidon Pico is by looking at [the examples](../examples/pico). But if you want to immediately get started here are the basics steps: - -1. Put these in your pom.xml or gradle.build file: - Annotation processor dependency / path: -``` - io.helidon.pico - helidon-pico-processor - ${helidon.version} -``` -Compile-time dependency: -``` - - io.helidon.pico - helidon-pico-runtime - ${helidon.version} - -``` - -2. Write your application using w/ standard jakarta.inject.* and jakarta.annotation.* types. Again, see any of [the examples](./examples/README.md) for pointers as needed. - -3. Build and run. In a DI-based framework, the frameworks "owns" the creation of services in accordance with the Scope each service is declared as. You therefore need to get things started by creating demand for the initial service(s) instead of ever calling new directly in your application code. Generally speaking, there are two such ways to get things started at runtime: - -* If you know the class you want to create then look it up directly using the Services SPI. Here is a sample excerpt from [the book example](./examples/book/README.md): - -``` - Services services = PicoServices.realizedServices(); - // query - ServiceProvider serviceProvider = services.lookupFirst(MyService.class); - // lazily activate - MyService myLazyActivatedService = serviceProvider.get(); -``` - -* If there are a collection of services requiring activation at startup then we recommend annotating those service implementation types with RunLevel(RunLevel.STARTUP) and then use code below in main() to lazily activate those services. Note that whenever List-based injection is used in Pico all services matching the injection criteria will be in the injected (and immutable) list. The list will always be in order according to the Weight annotation value, ranking from the highest weight to the lowest weight. If services are not weighted explicitly, then a default weight is assigned. If the weight is the same for two services, then the secondary ordering will be based on the FN class name of the service types. While Weight determines list order, the RunLevel annotation is used to rank the startup ordering, from the lowest value to the highest value, where RunLevel.STARTUP == 0. The developer is expected to activate these directly using code like the following (the get() lazily creates & activates the underlying service type): - -``` - List> startupServices = services - .lookup(ServiceInfoCriteria.builder().runLevel(RunLevel.STARTUP).build()); - startupServices.stream().forEach(ServiceProvider::get); -``` - -* If the ordering of the list of services is important, remember to use the Weight and/or RunLevel annotations to establish the priority / weighted ordering, and startup ordering. - -## More Advanced Features - -* Pico provides a means to generate "Activators" (the DI supporting types) for externally built modules as well as supporting javax annotated types. See [the logger example](../examples/pico/logger) for use of these features. - -* Pico offers services the ability to be intercepted. If your service contains any annotation that itself is annotated with InterceptorTrigger then the code generated for that service will support interception. The Helidon Nima project provides these types of examples. - -* Pico provides meta-information for each service in its service registry, including such information as what contracts are provided by each service as well as describing its dependencies. - -* Java Module System support / generation. Pico generates a proposed module-info.java.pico file for your module (look for module-info.java.pico under ./target/pico). - -* Pico provides a maven-plugin that allows the injection graph to be (a) validated for completeness, and (b) deterministically bound to the service implementation - at compile-time. This is demonstrated in each of the examples, the result of which leads to early detection of issues at compile-time instead of at runtime as well as a marked performance enhancement. - -* Testability. The [testing](./testing) module offers a set of types in order to facility for creating fake/mock services for various testing scenarios. - -* Extensibility. The entire Pico Framework is designed to by extended either at a micro level (developers can override mustache/handlebar templates) to the macro level (developers can provide their own implementation of any SPI). Another example of internal extensibility is via our [config-driven](./configdriven) services. - -* Determinism. Pico strives to keep your application as deterministic as possible. Dynamically adding services post-initialization will not be allowed, and will even result in a runtime exception (configurable). Any service that is "a provider" that dynamically creates a service in runtime code will issue build failures or warnings (configurable). All services are always ordered first according to Weight and secondarily according to type name (instead of relying on classpath ordering). Essentially, all areas of Pico attempts to keep your application as deterministic as possible at production runtime. - -## Modules - -* [api](./api) - the Pico API and SPI; depends on jakarta-inject and jakarta-annotations. Required as a maven compile-time dependency for runtime consumption. -* [runtime](./runtime) - contains the default runtime implementation of the Pico API/SPI; depends on the pico api module above. Requires as a maven compile-time dependency for runtime consumption. -* [config-driven](./configdriven) - Extensions to Pico to integrate directly with the [Helidon Config](../config) subsystem. -* [tools](./tools) - contains the libraries and template-based codegen mustache resources as well as model validation tooling; depends on runtime services. Only required at build time and is not required for Pico at runtime. -* [processor](./processor) - contains the libraries for annotation processing; depends on tools. Only required at build time and is not required for Pico at runtime. -* [maven-plugin](./maven-plugin) - provides code generation Mojo wrappers for maven; depends on tools. Only required at build time and is not required for Pico at runtime. This is what would be used to create your Application. -* [testing](./testing) - provides testing types useful for Pico unit & integration testing. -* [tests](./tests) - used internally for testing Pico. -* [examples](../examples/pico) - providing examples for how to use Pico as well as side-by-side comparisons for Pico compared to Guice, Dagger2, Hk2, etc. - -## How Pico Works - -* The Pico annotation [processor](./processor) will look for standard jakarta/javax inject and jakarta/javax annotation types. When these types are found in a class that is being compiled by javac, Pico will trigger the creation of an Activator for that service class/type. For example, if you have a FooImpl class implementing Foo interface, and the FooImpl either contains "@Inject" or "@Singleton" then the presence of either of these annotations will trigger the creation of a FooImpl$$picoActivator to be created. The Activator is used to (a) describe the service in terms of what service contracts (i.e., interfaces) are advertised by FooImpl - in this case Foo (if Foo is annotated with @Contract or if "-Aio.helidon.pico.autoAddNonContractInterfaces=true" is used at compile-time), (b) lifecycle of services including creation, calling injection-based setters, and any PostConstruct or PreDestroy methods. - -* If one or more activators are created at compile-time, then a Pico$$Module is also created to aggregate the services for the given module. Below is an example if a picoModule from [examples/logger](./examples/logger). At initialization time of Pico, all Modules will be located using the ServiceLocator and each service will be binded into the Pico service registry. - -```java -@Generated(value = "io.helidon.pico.tools.creator.impl.DefaultActivatorCreator", comments = "version = 1") -@Singleton @Named(Pico$$Module.NAME) -public class Pico$$Module implements Module { - static final String NAME = "pico.examples.logger.common"; - - @Override - public Optional getName() { - return Optional.of(NAME); - } - - @Override - public String toString() { - return NAME + ":" + getClass().getName(); - } - - @Override - public void configure(ServiceBinder binder) { - binder.bind(io.helidon.pico.examples.logger.common.AnotherCommunicationMode$$picoActivator.INSTANCE); - binder.bind(io.helidon.pico.examples.logger.common.Communication$$picoActivator.INSTANCE); - binder.bind(io.helidon.pico.examples.logger.common.DefaultCommunicator$$picoActivator.INSTANCE); - binder.bind(io.helidon.pico.examples.logger.common.EmailCommunicationMode$$picoActivator.INSTANCE); - binder.bind(io.helidon.pico.examples.logger.common.ImCommunicationMode$$picoActivator.INSTANCE); - binder.bind(io.helidon.pico.examples.logger.common.LoggerProvider$$picoActivator.INSTANCE); - binder.bind(io.helidon.pico.examples.logger.common.SmsCommunicationMode$$picoActivator.INSTANCE); - } -} -``` - -And just randomly taking one of the generated Activators: -```java -@Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", comments = "version=1") -public class SmsCommunicationMode$$Pico$$Activator - extends io.helidon.pico.runtime.AbstractServiceProvider { - private static final ServiceInfo serviceInfo = - ServiceInfo.builder() - .serviceTypeName(io.helidon.examples.pico.logger.common.SmsCommunicationMode.class.getName()) - .addExternalContractsImplemented(io.helidon.examples.pico.logger.common.CommunicationMode.class.getName()) - .activatorTypeName(SmsCommunicationMode$$Pico$$Activator.class.getName()) - .addScopeTypeName(jakarta.inject.Singleton.class.getName()) - .addQualifier(io.helidon.pico.DefaultQualifier.create(jakarta.inject.Named.class, "sms")) - .build(); - - /** - * The global singleton instance for this service provider activator. - */ - public static final SmsCommunicationMode$$Pico$$Activator INSTANCE = new SmsCommunicationMode$$Pico$$Activator(); - - /** - * Default activator constructor. - */ - protected SmsCommunicationMode$$Pico$$Activator() { - serviceInfo(serviceInfo); - } - - /** - * The service type of the managed service. - * - * @return the service type of the managed service - */ - public Class serviceType() { - return io.helidon.examples.pico.logger.common.SmsCommunicationMode.class; - } - - @Override - public DependenciesInfo dependencies() { - DependenciesInfo deps = Dependencies.builder(io.helidon.examples.pico.logger.common.SmsCommunicationMode.class.getName()) - .add("logger", java.util.logging.Logger.class, ElementKind.FIELD, Access.PACKAGE_PRIVATE) - .build(); - return Dependencies.combine(super.dependencies(), deps); - } - - @Override - protected SmsCommunicationMode createServiceProvider(Map deps) { - return new io.helidon.examples.pico.logger.common.SmsCommunicationMode(); - } - - @Override - protected void doInjectingFields(Object t, Map deps, Set injections, String forServiceType) { - super.doInjectingFields(t, deps, injections, forServiceType); - SmsCommunicationMode target = (SmsCommunicationMode) t; - target.logger = (java.util.logging.Logger) get(deps, "io.helidon.examples.pico.logger.common.logger"); - } - -} -``` - -* As you can see from above example, the Activators are effectively managing the lifecycle and injection of your classes. These generated Activator types are placed in the same package as your class(es). Since Pico is avoiding reflection, however, it means that only public, protected, and package private injection points are supported. private and static injection points are not supported by the framework. - -* If an annotation in your service is meta-annotated with InterceptedTrigger, then an extra service type is created that will trigger interceptor service code generation. For example, if FooImpl was found to have one such annotation then FooImpl$$Pico$$Interceptor would also be created along with an activator for that interceptor. The interceptor would be created with a higher weight than your FooImpl, and would therefore be "preferred" when a single @Inject is used for Foo or FooImpl. If a list is injected then it would appear towards the head of the list. Once again, all reflection is avoided in these generated classes. Any calls to Foo/FooImpl will be interceptable for any Interceptor that is @Named to handle that type name. Search the test code and Nima code for such examples as this is an advanced feature. - -* The [maven-plugin](./maven-plugin) can optionally be used to avoid Pico lookup resolutions at runtime within each service activation. At startup Pico will attempt to first use the Application to avoid lookups. The best practice is to apply the maven-plugin to create-application on your maven assembly - this is usually your "final" application module that depends upon every other service / module in your entire deployed application. Here is the Pico$$Application from [examples/logger](../examples/pico/logger): - -```java -@Generated({"generator=io.helidon.pico.maven.plugin.ApplicationCreatorMojo", "ver=1"}) -@Singleton @Named(Pico$$Application.NAME) -public class Pico$$Application implements Application { - static final String NAME = "unnamed"; - - @Override - public Optional getName() { - return Optional.of(NAME); - } - - @Override - public String toString() { - return NAME + ":" + getClass().getName(); - } - - @Override - public void configure(ServiceInjectionPlanBinder binder) { - /** - * In module name "pico.examples.logger.common". - * @see {@link io.helidon.pico.examples.logger.common.AnotherCommunicationMode } - */ - binder.bindTo(io.helidon.pico.examples.logger.common.AnotherCommunicationMode$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.logger", - io.helidon.pico.examples.logger.common.LoggerProvider$$picoActivator.INSTANCE) - .commit(); - - /** - * In module name "pico.examples.logger.common". - * @see {@link io.helidon.pico.examples.logger.common.Communication } - */ - binder.bindTo(io.helidon.pico.examples.logger.common.Communication$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.|2(1)", - io.helidon.pico.examples.logger.common.LoggerProvider$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.|2(2)", - io.helidon.pico.examples.logger.common.DefaultCommunicator$$picoActivator.INSTANCE) - .commit(); - - /** - * In module name "pico.examples.logger.common". - * @see {@link io.helidon.pico.examples.logger.common.DefaultCommunicator } - */ - binder.bindTo(io.helidon.pico.examples.logger.common.DefaultCommunicator$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.sms", - io.helidon.pico.examples.logger.common.SmsCommunicationMode$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.email", - io.helidon.pico.examples.logger.common.EmailCommunicationMode$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.im", - io.helidon.pico.examples.logger.common.ImCommunicationMode$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.|1(1)", - io.helidon.pico.examples.logger.common.AnotherCommunicationMode$$picoActivator.INSTANCE) - .commit(); - - /** - * In module name "pico.examples.logger.common". - * @see {@link io.helidon.pico.examples.logger.common.EmailCommunicationMode } - */ - binder.bindTo(io.helidon.pico.examples.logger.common.EmailCommunicationMode$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.logger", - io.helidon.pico.examples.logger.common.LoggerProvider$$picoActivator.INSTANCE) - .commit(); - - /** - * In module name "pico.examples.logger.common". - * @see {@link io.helidon.pico.examples.logger.common.ImCommunicationMode } - */ - binder.bindTo(io.helidon.pico.examples.logger.common.ImCommunicationMode$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.logger", - io.helidon.pico.examples.logger.common.LoggerProvider$$picoActivator.INSTANCE) - .commit(); - - /** - * In module name "pico.examples.logger.common". - * @see {@link io.helidon.pico.examples.logger.common.LoggerProvider } - */ - binder.bindTo(io.helidon.pico.examples.logger.common.LoggerProvider$$picoActivator.INSTANCE) - .commit(); - - /** - * In module name "pico.examples.logger.common". - * @see {@link io.helidon.pico.examples.logger.common.SmsCommunicationMode } - */ - binder.bindTo(io.helidon.pico.examples.logger.common.SmsCommunicationMode$$picoActivator.INSTANCE) - .bind("io.helidon.pico.examples.logger.common.logger", - io.helidon.pico.examples.logger.common.LoggerProvider$$picoActivator.INSTANCE) - .commit(); - } -} -``` - -* The maven-plugin can additionally be used to create the Pico DI supporting types (Activators, Modules, Interceptors, Applications, etc.) from introspecting an external jar - see the [examples](../examples/pico) for details. - -That is basically all there is to know to get started and become productive using Pico. - -## Special Notes to Providers & Contributors -Pico aims to provide an extensible, SPI-based mechanism. There are many ways Pico can be overridden, extended, or even replaced with a different implementation than what is provided out of the built-in reference implementation modules included. Of course, you can also contribute directly by becoming a committer. However, if you are looking to fork the implementation then you are strongly encouraged to honor the "spirit of this framework" and follow this as a high-level guide: - -* In order to be a Pico provider implementation, the provider must supply an implementation for PicoServices discoverable by the - ServiceLoader with a higher-than-default Weight. -* All SPI class definitions from the io.helidon.pico.spi package are considered primordial and therefore should not participate in injection or conventionally be considered injectable. -* All service classes that are not targets for injection should be represented under - /META-INF/services/ to be found by the standard ServiceLocator. -* Providers are encouraged to fail-fast during compile time - this implies a sophisticated set of tooling that can and should be applied to create and validate the integrity of the dependency graph at compile time instead of at runtime. -* Providers are encouraged to avoid reflection completely at runtime. -* Providers are encouraged to advertise capabilities and configuration using PicoServicesConfig. diff --git a/pico/configdriven/runtime/README.md b/pico/configdriven/runtime/README.md deleted file mode 100644 index 7f1ffc16baa..00000000000 --- a/pico/configdriven/runtime/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# pico-configdriven-runtime - -This module should typically be used by anyone needing Pico's config driven services at runtime. diff --git a/pico/configdriven/tests/configuredby-application/README.md b/pico/configdriven/tests/configuredby-application/README.md deleted file mode 100644 index ec4353b2a3d..00000000000 --- a/pico/configdriven/tests/configuredby-application/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# pico-configdriven-test-configuredby-application - -Tests for full ConfiguredBy-generated service types, in combination with the DI model calculated at compile time using the pico-maven-plugin instead of calculated at runtime as is the case with pico-configdriven-test-configuredby. diff --git a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/package-info.java b/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/package-info.java deleted file mode 100644 index 2f3ca5c656c..00000000000 --- a/pico/configdriven/tests/configuredby/src/main/java/io/helidon/pico/configdriven/configuredby/yaml/test/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Pico ConfiguredBy tests driven testing from the {@code application.yaml} config under test/resources. - */ -package io.helidon.pico.configdriven.configuredby.yaml.test; diff --git a/pico/maven-plugin/README.md b/pico/maven-plugin/README.md deleted file mode 100644 index 683ae16cb22..00000000000 --- a/pico/maven-plugin/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# pico-maven-plugin -A collection of maven plugins for Pico-based applications that provides several features including options to: - -1. Validate the entirety of dependency graph across all modules. The application-create plugin would be applied in the same pom.xml - that would otherwise assemble your application for deployment. This module would be expected to have compile-time references to - each module that contributes to your application holistically - -2. After the model has been validated, the application-create plugin will code-generate the service provider "Activators", "Modules", and "Application" into the - final assembly that will be used at runtime to satisfy every injection point for the entire application without the need for reflection at runtime. This can be thought conceptually as a "linking phase" for your native application/image. - -3. Creating Pico modules from external jars and packages using the . - ---- - -Q: Is this maven plugin required for your Pico-based application to work? - -Answer 1: No, but it is recommended. Strictly speaking the main code generation occurs using the annotation processor, and the output from that processor is fully functional at runtime. However, without the use of this plugin your application's dependency model will not be validation nor will it be linked/bound/burned into your final application image. It will still work fine and Pico will handle this case, but your application is not as optimal from a runtime performance perspective. - -Answer 2: Yes, but only if you do not have access to the service implementation types, and are unable to apply the annotation processor on those types at compile time. Note, however, that Pico can still work without the maven processor in cases where you have possession to rebuild the service classes, but get the interfaces from an external module. In this later case, the ExternalContracts interfaces can be used on the service implementation classes. - ---- - -## Usage - -The following are the maven Mojo's that are available to use. Each can be used for either the src/main or src/test. - -example usage: -```pom.xml - - io.helidon.pico - helidon-pico-maven-plugin - ${helidon.version} - - - - external-module-create - - - - compile - compile - - application-create - - - - - - io.helidon.pico.examples.logger.common - - ALL - - -``` - -### application-create -This goal is used to trigger the creation of the Pico$$Application for your module (which typically is found in the final assembly jar module for your application). The usage of this also triggers the validation and integrity checks for your entire application's DI model, and will fail-fast at compilation time if any issue is detected (e.g., a non-Optional @Inject is found on a contract type having no concrete service implementations, etc.). Assuming there are no issues found during application creation - each of your service implementations will be listed inside the picoApplication, and it will include the literal DI resolution plan for each of your services. This can also be very useful for visualization and debugging purposes besides being optimal from a runtime performance perspective. - -Also note that Pico strives to ensure your application stays as deterministic as possible (as shown by the Pico$$Application/i> generated class). But when the jakarta.inject.Provider type is used within your application then some of that deterministic behavior goes away. This is due to how Provider<>'s work since the implementation for the Provider (i.e., your application logic) "owns" the behavior for what actual concrete type that are created by it, along with the scope/cardinality for those instances. These instances are then delivered (as potentially injectable services) into other dependent services. In this way Pico is simply acting as a broker and delivery mechanism between your Provider<> implementation(s) and the consumer that are using those service instances as injection points, etc. This is not meant to scare ore even dissuade you from using Provider<>, but merely to inform you that some of the deterministic behavior goes away under these circumstances using Provider instead of another Scope type like @Singleton. In many/most cases this is completely normal and acceptable. As a precaution, however, Pico chose to fail-fast at application creation time if your application is found to use jakarta.inject.Provider. You will then need to provide a strategy/configuration in your pom.xml file to permit these types of usages. There are options to allow ALL providers (as shown in the above example), or the strategy can be dictated on a case-by-case basis. See the javadoc for [AbstractApplicationCreatorMojo](./src/main/java/io/helidon/pico/maven/plugin/AbstractApplicationCreatorMojo.java) for details. - -### external-module-create -This goal is used to trigger the creation of the supporting set of Pico DI classes for an external jar/module - typically created without since it lacked hacing the Pico annotation processor during compilation. In this scenario, and to use this option then first be sure that the dependent module is a maven compile-time dependency in your module. After that then simply state the name of the package(s) to scan and produce the supporting Pico DI classes (e.g., "io.helidon.pico.examples.logger.common" in the above example) in the pom.xml and then target/generated-sources/pico should be generated accordingly. - -The example from above cover the basics for generation. There are one more advanced option that is available here that we'd like to cover. The below was taken from the [test-tck-jsr330 pom.xml](../tests/tck-jsr330/pom.xml): - -```pom.xml - - - -Apico.debug=true - -Apico.autoAddNonContractInterfaces=true - - - org.atinject.tck.auto - org.atinject.tck.auto.accessories - - true - - - org.atinject.tck.auto.accessories.SpareTire - - - jakarta.inject.Named - spare - - - - - org.atinject.tck.auto.DriversSeat - - - org.atinject.tck.auto.Drivers - - - - - -``` - -Here we can see additional DI constructs, specifically two Qualifiers, are being augmented into the DI declaration model for the 3rd party jar. We can also see the option used to treat all service type interfaces as Contracts. - -## Pico$$Application-and-Pico$$TestApplication -When the maven plugin creates an application for src/main/java sources, a Pico$$Application will be created for compile-time dependencies involved in the DI set of services. But when src/test/java sources are compiled, a Pico$$TestApplication will be created for test-type dependencies involved in the test-side DI set of services of your application. - -## Best Practices -Only one Pico$$Application should typically be in your module classpath. And in production applications there should never be any test service types or a Pico$$TestApplication, etc. diff --git a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/package-info.java b/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/package-info.java deleted file mode 100644 index 41c341a11f9..00000000000 --- a/pico/maven-plugin/src/main/java/io/helidon/pico/maven/plugin/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Internal tooling for the pico maven plugin. - */ -package io.helidon.pico.maven.plugin; diff --git a/pico/processor/src/main/java/io/helidon/pico/processor/package-info.java b/pico/processor/src/main/java/io/helidon/pico/processor/package-info.java deleted file mode 100644 index 020a40081b1..00000000000 --- a/pico/processor/src/main/java/io/helidon/pico/processor/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Pico Annotation Processors and supporting types. - */ -package io.helidon.pico.processor; diff --git a/pico/processor/src/test/resources/META-INF/services/io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator b/pico/processor/src/test/resources/META-INF/services/io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator deleted file mode 100644 index 5edf2516a12..00000000000 --- a/pico/processor/src/test/resources/META-INF/services/io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator +++ /dev/null @@ -1 +0,0 @@ -io.helidon.pico.processor.ExtensibleGetTemplateProducer diff --git a/pico/runtime/README.md b/pico/runtime/README.md deleted file mode 100644 index 569708a0532..00000000000 --- a/pico/runtime/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# pico-runtime - -This module represents the main runtime support for default [Pico API/SPI](../pico) services implementation. diff --git a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/package-info.java b/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/package-info.java deleted file mode 100644 index 8c007611bea..00000000000 --- a/pico/tests/resources-pico/src/main/java/io/helidon/pico/tests/pico/tbox/impl/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Pico Testing. - */ -package io.helidon.pico.tests.pico.tbox.impl; diff --git a/pico/tests/resources-pico/src/test/resources/expected/module-info.java._pico_ b/pico/tests/resources-pico/src/test/resources/expected/module-info.java._pico_ deleted file mode 100644 index 5a410882abc..00000000000 --- a/pico/tests/resources-pico/src/test/resources/expected/module-info.java._pico_ +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Pico Test Resources. - */ -module io.helidon.pico.tests.pico { - requires static jakarta.inject; - requires static jakarta.annotation; - - requires io.helidon.common.types; - requires io.helidon.common; - requires io.helidon.pico.api; - requires io.helidon.pico.runtime; - requires io.helidon.pico.tests.plain; - requires io.helidon.config; - - exports io.helidon.pico.tests.pico; - exports io.helidon.pico.tests.pico.interceptor; - exports io.helidon.pico.tests.pico.stacking; - exports io.helidon.pico.tests.pico.tbox; - - provides io.helidon.pico.api.ModuleComponent with io.helidon.pico.tests.pico.Pico$$Module; - // Pico external contract usage - @io.helidon.common.Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", trigger = "io.helidon.pico.tools.ActivatorCreatorDefault") - requires test1; - requires test2; - // Pico contract usage - @io.helidon.common.Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", trigger = "io.helidon.pico.tools.ActivatorCreatorDefault") - exports io.helidon.pico.tests.pico.provider; - // Pico application - @io.helidon.common.Generated(value = "io.helidon.pico.tools.ApplicationCreatorDefault", trigger = "io.helidon.pico.tools.ApplicationCreatorDefault") - provides io.helidon.pico.api.Application with io.helidon.pico.tests.pico.Pico$$Application; -} diff --git a/pico/tests/resources-pico/src/test/resources/expected/tests-module-info.java._pico_ b/pico/tests/resources-pico/src/test/resources/expected/tests-module-info.java._pico_ deleted file mode 100644 index 6b35a7dcc76..00000000000 --- a/pico/tests/resources-pico/src/test/resources/expected/tests-module-info.java._pico_ +++ /dev/null @@ -1,10 +0,0 @@ -// @io.helidon.common.Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", trigger = "io.helidon.pico.tools.ActivatorCreatorDefault") -module io.helidon.pico.tests.pico/test { - exports io.helidon.pico.tests.pico; - // Pico module - @io.helidon.common.Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", trigger = "io.helidon.pico.tools.ActivatorCreatorDefault") - provides io.helidon.pico.api.ModuleComponent with io.helidon.pico.tests.pico.Pico$$TestModule; - // Pico services - @io.helidon.common.Generated(value = "io.helidon.pico.tools.ActivatorCreatorDefault", trigger = "io.helidon.pico.tools.ActivatorCreatorDefault") - requires transitive io.helidon.pico.runtime; - // Pico application - @io.helidon.common.Generated(value = "io.helidon.pico.tools.ApplicationCreatorDefault", trigger = "io.helidon.pico.tools.ApplicationCreatorDefault") - provides io.helidon.pico.api.Application with io.helidon.pico.tests.pico.Pico$$TestApplication; -} diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Application.java b/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Application.java deleted file mode 100644 index eefe1a0b8fb..00000000000 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPico$$Application.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.pico.runtime.testsubjects; - -import java.util.Optional; - -import io.helidon.pico.api.Application; -import io.helidon.pico.api.ServiceInjectionPlanBinder; - -import jakarta.annotation.Generated; -import jakarta.inject.Named; -import jakarta.inject.Singleton; - -/** - * For testing. - */ -@Generated(value = "example", comments = "API Version: n") -@Singleton -@Named(HelloPico$$Application.NAME) -public class HelloPico$$Application implements Application { - public static boolean ENABLED = true; - - static final String NAME = "HelloPicoApplication"; - - public HelloPico$$Application() { - assert(true); // for setting breakpoints in debug - } - - @Override - public Optional named() { - return Optional.of(NAME); - } - - @Override - public void configure(ServiceInjectionPlanBinder binder) { - if (!ENABLED) { - return; - } - - binder.bindTo(HelloPicoImpl$$picoActivator.INSTANCE) - .bind(HelloPicoWorld.class.getPackageName() + ".world", PicoWorldImpl$$picoActivator.INSTANCE) - .bind(HelloPicoWorld.class.getPackageName() + ".worldRef", PicoWorldImpl$$picoActivator.INSTANCE) - .bindMany(HelloPicoWorld.class.getPackageName() + ".listOfWorldRefs", PicoWorldImpl$$picoActivator.INSTANCE) - .bindMany(HelloPicoWorld.class.getPackageName() + ".listOfWorlds", PicoWorldImpl$$picoActivator.INSTANCE) - .bindVoid(HelloPicoWorld.class.getPackageName() + ".redWorld") - .bind(HelloPicoWorld.class.getPackageName() + ".world|1(1)", PicoWorldImpl$$picoActivator.INSTANCE) - .commit(); - - binder.bindTo(PicoWorldImpl$$picoActivator.INSTANCE) - .commit(); - } - -} diff --git a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoImpl$$picoActivator.java b/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoImpl$$picoActivator.java deleted file mode 100644 index 5f989d80031..00000000000 --- a/pico/tests/runtime/src/test/java/io/helidon/pico/runtime/testsubjects/HelloPicoImpl$$picoActivator.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.helidon.pico.runtime.testsubjects; - -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; - -import io.helidon.common.Weight; -import io.helidon.common.types.TypeName; -import io.helidon.pico.api.AccessModifier; -import io.helidon.pico.api.DependenciesInfo; -import io.helidon.pico.api.ElementKind; -import io.helidon.pico.api.PostConstructMethod; -import io.helidon.pico.api.PreDestroyMethod; -import io.helidon.pico.api.ServiceInfo; -import io.helidon.pico.runtime.AbstractServiceProvider; -import io.helidon.pico.runtime.Dependencies; - -import jakarta.annotation.Generated; -import jakarta.inject.Provider; -import jakarta.inject.Singleton; - -import static io.helidon.pico.api.ServiceInfoBasics.DEFAULT_PICO_WEIGHT; - -/** - * Serves as an exemplar of what will is normally code generated. - */ -@Generated(value = "example", comments = "API Version: N") -@Singleton -@Weight(DEFAULT_PICO_WEIGHT) -@SuppressWarnings({"unchecked", "checkstyle:TypeName"}) -public class HelloPicoImpl$$picoActivator extends AbstractServiceProvider { - - private static final ServiceInfo serviceInfo = - ServiceInfo.builder() - .serviceTypeName(HelloPicoWorldImpl.class) - .activatorTypeName(HelloPicoImpl$$picoActivator.class) - .addContractImplemented(HelloPicoWorld.class) - .addScopeTypeName(Singleton.class) - .declaredRunLevel(0) - .build(); - - public static final HelloPicoImpl$$picoActivator INSTANCE = new HelloPicoImpl$$picoActivator(); - - public HelloPicoImpl$$picoActivator() { - serviceInfo(serviceInfo); - } - - @Override - public Class serviceType() { - return HelloPicoWorldImpl.class; - } - - @Override - public DependenciesInfo dependencies() { - DependenciesInfo deps = Dependencies.builder(HelloPicoWorldImpl.class) - .add("world", PicoWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE).ipName("world").ipType(TypeName.create(PicoWorld.class)) - .add("worldRef", PicoWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) - .providerWrapped().ipName("worldRef").ipType(TypeName.create(Provider.class)) - .add("listOfWorlds", PicoWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) - .listWrapped().ipName("listOfWorlds").ipType(TypeName.create(List.class)) - .add("listOfWorldRefs", PicoWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) - .listWrapped().providerWrapped().ipName("listOfWorldRefs").ipType(TypeName.create(List.class)) - .add("redWorld", PicoWorld.class, ElementKind.FIELD, AccessModifier.PACKAGE_PRIVATE) - .named("red").optionalWrapped().ipName("redWorld").ipType(TypeName.create(Optional.class)) - .add("world", PicoWorld.class, ElementKind.METHOD, 1, AccessModifier.PACKAGE_PRIVATE) - .elemOffset(1).ipName("world").ipType(TypeName.create(PicoWorld.class)) - .build(); - return Dependencies.combine(super.dependencies(), deps); - } - - @Override - protected HelloPicoWorldImpl createServiceProvider(Map deps) { - return new HelloPicoWorldImpl(); - } - - @Override - protected void doInjectingFields(Object t, Map deps, Set injections, TypeName forServiceType) { - super.doInjectingFields(t, deps, injections, forServiceType); - HelloPicoWorldImpl target = (HelloPicoWorldImpl) t; - target.world = Objects.requireNonNull( - (PicoWorld) deps.get(PicoWorld.class.getPackageName() + ".world"), "world"); - target.worldRef = Objects.requireNonNull( - (Provider) deps.get(PicoWorld.class.getPackageName() + ".worldRef"), "worldRef"); - target.listOfWorldRefs = Objects.requireNonNull( - (List>) deps.get(PicoWorld.class.getPackageName() + ".listOfWorldRefs"), "listOfWorldRefs"); - target.listOfWorlds = Objects.requireNonNull( - (List) deps.get(PicoWorld.class.getPackageName() + ".listOfWorlds"), "listOfWorlds"); - target.redWorld = Objects.requireNonNull( - (Optional) deps.get(PicoWorld.class.getPackageName() + ".redWorld"), "redWorld"); - } - - @Override - protected void doInjectingMethods(Object t, Map deps, Set injections, TypeName forServiceType) { - super.doInjectingMethods(t, deps, injections, forServiceType); - HelloPicoWorldImpl target = (HelloPicoWorldImpl)t; - target.world(Objects.requireNonNull( - (PicoWorld) deps.get(PicoWorld.class.getPackageName() + ".world|1(1)"))); - } - - @Override - public Optional postConstructMethod() { - HelloPicoWorldImpl impl = serviceRef().get(); - return Optional.of(impl::postConstruct); - } - - @Override - public Optional preDestroyMethod() { - HelloPicoWorldImpl impl = serviceRef().get(); - return Optional.of(impl::preDestroy); - } - -} diff --git a/pico/tools/src/main/java/io/helidon/pico/tools/package-info.java b/pico/tools/src/main/java/io/helidon/pico/tools/package-info.java deleted file mode 100644 index 60196f0c5dd..00000000000 --- a/pico/tools/src/main/java/io/helidon/pico/tools/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Pico Tools. - */ -package io.helidon.pico.tools; diff --git a/pico/tools/src/main/java/module-info.java b/pico/tools/src/main/java/module-info.java deleted file mode 100644 index 44668680ccb..00000000000 --- a/pico/tools/src/main/java/module-info.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * The Pico Tools module. - */ -module io.helidon.pico.tools { - requires static io.helidon.config.metadata; - requires static jakarta.annotation; - - requires java.compiler; - requires jakarta.inject; - requires handlebars; - requires io.github.classgraph; - requires io.helidon.builder.api; - requires io.helidon.common; - requires io.helidon.common.config; - requires io.helidon.common.processor; - requires transitive io.helidon.common.types; - requires transitive io.helidon.pico.runtime; - - exports io.helidon.pico.tools; - exports io.helidon.pico.tools.spi; - - uses io.helidon.pico.tools.spi.InterceptorCreator; - uses io.helidon.pico.tools.spi.ApplicationCreator; - uses io.helidon.pico.tools.spi.CustomAnnotationTemplateCreator; - uses io.helidon.pico.tools.spi.ExternalModuleCreator; - uses io.helidon.pico.tools.spi.ActivatorCreator; - uses io.helidon.pico.tools.spi.ModuleComponentNamer; - - provides io.helidon.pico.tools.spi.ActivatorCreator - with io.helidon.pico.tools.ActivatorCreatorDefault; - provides io.helidon.pico.tools.spi.ApplicationCreator - with io.helidon.pico.tools.ApplicationCreatorDefault; - provides io.helidon.pico.tools.spi.ExternalModuleCreator - with io.helidon.pico.tools.ExternalModuleCreatorDefault; - provides io.helidon.pico.tools.spi.InterceptorCreator - with io.helidon.pico.tools.InterceptorCreatorDefault; -} diff --git a/pom.xml b/pom.xml index 710a7559efd..184572b708f 100644 --- a/pom.xml +++ b/pom.xml @@ -202,7 +202,7 @@ nima reactive cors - pico + inject builder @@ -1197,7 +1197,7 @@ commons-io ${version.lib.commons-io} - + jakarta.inject jakarta.inject-tck diff --git a/tests/integration/native-image/mp-1/pom.xml b/tests/integration/native-image/mp-1/pom.xml index 54e0fc67f42..873134df268 100644 --- a/tests/integration/native-image/mp-1/pom.xml +++ b/tests/integration/native-image/mp-1/pom.xml @@ -52,8 +52,8 @@ helidon-security-providers-oidc - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime true diff --git a/tests/integration/native-image/mp-1/src/main/java/module-info.java b/tests/integration/native-image/mp-1/src/main/java/module-info.java index 67e3d22b0d4..13a313b1ec9 100644 --- a/tests/integration/native-image/mp-1/src/main/java/module-info.java +++ b/tests/integration/native-image/mp-1/src/main/java/module-info.java @@ -41,8 +41,8 @@ requires io.opentracing.api; requires io.opentracing.util; - // needed to compile pico generated classes - requires static io.helidon.pico.runtime; + // needed to compile injection generated classes + requires static io.helidon.inject.runtime; exports io.helidon.tests.integration.nativeimage.mp1; exports io.helidon.tests.integration.nativeimage.mp1.other; diff --git a/tests/integration/native-image/mp-3/pom.xml b/tests/integration/native-image/mp-3/pom.xml index ba3c13f5d6a..97010f74bca 100644 --- a/tests/integration/native-image/mp-3/pom.xml +++ b/tests/integration/native-image/mp-3/pom.xml @@ -39,8 +39,8 @@ helidon-microprofile - io.helidon.pico - helidon-pico-runtime + io.helidon.inject + helidon-inject-runtime true From 09272806eff247030cfec558b25f6aba0e0bb084 Mon Sep 17 00:00:00 2001 From: Jeff Trent Date: Wed, 12 Jul 2023 07:15:44 -0400 Subject: [PATCH 2/5] checkstyles --- .../io/helidon/inject/api/ActivationLog.java | 2 +- .../api/ActivationLogEntryBlueprint.java | 2 +- .../inject/api/ActivationLogQuery.java | 2 +- .../inject/api/ActivationPhaseReceiver.java | 2 +- .../api/ActivationRequestBlueprint.java | 2 +- .../inject/api/ActivationResultBlueprint.java | 2 +- .../helidon/inject/api/ActivationStatus.java | 2 +- .../java/io/helidon/inject/api/Activator.java | 2 +- .../io/helidon/inject/api/Application.java | 2 +- .../inject/api/BootstrapBlueprint.java | 2 +- .../api/ContextualServiceQueryBlueprint.java | 2 +- .../java/io/helidon/inject/api/Contract.java | 2 +- .../api/DeActivationRequestBlueprint.java | 2 +- .../io/helidon/inject/api/DeActivator.java | 2 +- .../inject/api/DependenciesInfoBlueprint.java | 2 +- .../inject/api/DependencyInfoBlueprint.java | 2 +- .../inject/api/ElementInfoBlueprint.java | 2 +- .../helidon/inject/api/ExternalContracts.java | 2 +- .../inject/api/InjectionException.java | 2 +- .../api/InjectionPointInfoBlueprint.java | 2 +- .../inject/api/InjectionPointProvider.java | 2 +- .../InjectionServiceProviderException.java | 2 +- .../helidon/inject/api/InjectionServices.java | 2 +- .../api/InjectionServicesConfigBlueprint.java | 2 +- .../inject/api/InjectionServicesHolder.java | 2 +- .../java/io/helidon/inject/api/Injector.java | 2 +- .../inject/api/InjectorOptionsBlueprint.java | 2 +- .../io/helidon/inject/api/Intercepted.java | 2 +- .../inject/api/InterceptedTrigger.java | 2 +- .../io/helidon/inject/api/Interceptor.java | 2 +- .../api/InvocationContextBlueprint.java | 2 +- .../inject/api/InvocationException.java | 2 +- .../helidon/inject/api/MetricsBlueprint.java | 2 +- .../helidon/inject/api/ModuleComponent.java | 2 +- .../helidon/inject/api/OptionallyNamed.java | 2 +- .../java/io/helidon/inject/api/Phase.java | 2 +- .../inject/api/PostConstructMethod.java | 2 +- .../helidon/inject/api/PreDestroyMethod.java | 2 +- .../inject/api/QualifierBlueprint.java | 2 +- .../io/helidon/inject/api/Resettable.java | 2 +- .../java/io/helidon/inject/api/RunLevel.java | 2 +- .../io/helidon/inject/api/ServiceBinder.java | 2 +- .../api/ServiceInfoBasicsBlueprint.java | 2 +- .../inject/api/ServiceInfoBlueprint.java | 2 +- .../api/ServiceInfoCriteriaBlueprint.java | 2 +- .../api/ServiceInjectionPlanBinder.java | 2 +- .../helidon/inject/api/ServiceProvider.java | 2 +- .../inject/api/ServiceProviderBindable.java | 2 +- .../ServiceProviderInjectionException.java | 2 +- .../inject/api/ServiceProviderProvider.java | 2 +- .../java/io/helidon/inject/api/Services.java | 2 +- .../io/helidon/inject/api/package-info.java | 2 +- .../helidon/inject/spi/InjectionResolver.java | 2 +- .../inject/spi/InjectionServicesProvider.java | 2 +- .../io/helidon/inject/spi/package-info.java | 2 +- .../inject/api/InjectionServicesTest.java | 2 +- .../PriorityAndServiceTypeComparatorTest.java | 2 +- .../AbstractInjectionServices.java | 2 +- .../api/testsubjects/InjectionServices1.java | 2 +- .../InjectionServices1Provider.java | 2 +- .../api/testsubjects/InjectionServices2.java | 2 +- .../InjectionServices2Provider.java | 2 +- .../api/testsubjects/InjectionServices3.java | 2 +- .../InjectionServices3Provider.java | 2 +- .../runtime/UnconfiguredServiceProvider.java | 4 +-- .../runtime/AbstractServiceProvider.java | 26 +++++++++---------- .../inject/runtime/DefaultActivationLog.java | 2 +- .../inject/runtime/DefaultInjectionPlans.java | 12 ++++----- .../DefaultInjectionServicesProvider.java | 2 +- .../inject/runtime/DefaultServices.java | 2 +- ...ava => HelidonInjectionPlanBlueprint.java} | 2 +- .../runtime/NonSingletonServiceProvider.java | 2 +- .../runtime/DefaultActivationLogTest.java | 2 +- .../DefaultInjectionServicesConfigTest.java | 2 +- .../testing/InjectionTestingSupport.java | 2 +- .../api/InjectionServicesConfigTest.java | 2 +- .../tools/ApplicationCreatorDefault.java | 6 ++--- .../io/helidon/inject/tools/CommonUtils.java | 2 +- .../inject/tools/InjectionSupported.java | 2 +- .../tools/ModuleInfoDescriptorBlueprint.java | 2 +- .../inject/tools/ModuleInfoItemBlueprint.java | 2 +- .../helidon/inject/tools/TemplateHelper.java | 2 +- .../helidon/inject/tools/ToolsException.java | 2 +- .../io/helidon/inject/tools/TypeTools.java | 2 +- .../io/helidon/inject/tools/package-info.java | 2 +- .../tools/ActivatorCreatorDefaultTest.java | 4 +-- .../tools/ModuleInfoDescriptorTest.java | 2 +- .../inject/tools/TemplateHelperTest.java | 2 +- 88 files changed, 109 insertions(+), 109 deletions(-) rename inject/runtime/src/main/java/io/helidon/inject/runtime/{HeldionInjectionPlanBlueprint.java => HelidonInjectionPlanBlueprint.java} (95%) diff --git a/inject/api/src/main/java/io/helidon/inject/api/ActivationLog.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationLog.java index 7bc874e01b7..bd67ebc1c81 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ActivationLog.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ActivationLogEntryBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogEntryBlueprint.java index 3f0736bbbc7..e47fd03b739 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ActivationLogEntryBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogEntryBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ActivationLogQuery.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogQuery.java index 4ccda044763..9526fcecad0 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ActivationLogQuery.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationLogQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ActivationPhaseReceiver.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationPhaseReceiver.java index a9585341898..3d619719644 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ActivationPhaseReceiver.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationPhaseReceiver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ActivationRequestBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationRequestBlueprint.java index ce18375bcd7..3a826bf49f1 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ActivationRequestBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationRequestBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ActivationResultBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationResultBlueprint.java index 0d03625b388..b659a5008e3 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ActivationResultBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationResultBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ActivationStatus.java b/inject/api/src/main/java/io/helidon/inject/api/ActivationStatus.java index 8b8ba926474..a25dd82be22 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ActivationStatus.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ActivationStatus.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Activator.java b/inject/api/src/main/java/io/helidon/inject/api/Activator.java index f72d5479280..a58aecc1548 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Activator.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Activator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Application.java b/inject/api/src/main/java/io/helidon/inject/api/Application.java index b83ac0d9c0f..650ee9a6a62 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Application.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Application.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java index 3c694f2c4d1..4ad66ffb244 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ContextualServiceQueryBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ContextualServiceQueryBlueprint.java index fe87a82f44b..c5a36aced0d 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ContextualServiceQueryBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ContextualServiceQueryBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Contract.java b/inject/api/src/main/java/io/helidon/inject/api/Contract.java index 9d7c0928bed..3560e7425a2 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Contract.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Contract.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/DeActivationRequestBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/DeActivationRequestBlueprint.java index 96d2ecd0c0d..9355c9e572c 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/DeActivationRequestBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DeActivationRequestBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/DeActivator.java b/inject/api/src/main/java/io/helidon/inject/api/DeActivator.java index 07314510d4f..fe2fe0b3ae5 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/DeActivator.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DeActivator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/DependenciesInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/DependenciesInfoBlueprint.java index c4988dacf57..47db2f20921 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/DependenciesInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DependenciesInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoBlueprint.java index 6e9c37d3103..5e24f062f62 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/DependencyInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ElementInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ElementInfoBlueprint.java index a572aeda3aa..516193f60c2 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ElementInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ElementInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ExternalContracts.java b/inject/api/src/main/java/io/helidon/inject/api/ExternalContracts.java index 1cfc422b49f..256d162fc98 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ExternalContracts.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ExternalContracts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectionException.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionException.java index 41bc5203d0f..3b8c6d6d133 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectionException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectionPointInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointInfoBlueprint.java index f098185e970..eebaa59451b 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectionPointInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectionPointProvider.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointProvider.java index 9529ac8e7d3..eff099bfce2 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectionPointProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionPointProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java index 3a11123052f..c57c736df8f 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServiceProviderException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java index e3a2fc7f609..9678bb041f0 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java index f93bb2c7ddd..4e11df81a75 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesConfigBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java index 60d1ce1c760..3864515c121 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectionServicesHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Injector.java b/inject/api/src/main/java/io/helidon/inject/api/Injector.java index ff0948e5a75..65c9a3e0ad2 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Injector.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Injector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InjectorOptionsBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InjectorOptionsBlueprint.java index e981e4eca5e..d38fef40e5b 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InjectorOptionsBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InjectorOptionsBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Intercepted.java b/inject/api/src/main/java/io/helidon/inject/api/Intercepted.java index acfcafb83bf..a290819d666 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Intercepted.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Intercepted.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InterceptedTrigger.java b/inject/api/src/main/java/io/helidon/inject/api/InterceptedTrigger.java index 086a90db79d..f941c84e528 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InterceptedTrigger.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InterceptedTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Interceptor.java b/inject/api/src/main/java/io/helidon/inject/api/Interceptor.java index 9d8bbeb641e..6188bc713f3 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Interceptor.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Interceptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InvocationContextBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/InvocationContextBlueprint.java index 172e83ffdbf..90edc3b245c 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InvocationContextBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InvocationContextBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/InvocationException.java b/inject/api/src/main/java/io/helidon/inject/api/InvocationException.java index 6d176ff5b28..6a335d6d8f7 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/InvocationException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/InvocationException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/MetricsBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/MetricsBlueprint.java index a94068226a3..647475a43ae 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/MetricsBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/MetricsBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ModuleComponent.java b/inject/api/src/main/java/io/helidon/inject/api/ModuleComponent.java index c5a657547aa..4eba1d35f57 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ModuleComponent.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ModuleComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/OptionallyNamed.java b/inject/api/src/main/java/io/helidon/inject/api/OptionallyNamed.java index 61165c9c7f7..a03f9fcea3d 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/OptionallyNamed.java +++ b/inject/api/src/main/java/io/helidon/inject/api/OptionallyNamed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Phase.java b/inject/api/src/main/java/io/helidon/inject/api/Phase.java index 148b31cbc69..39aca2640d1 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Phase.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Phase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/PostConstructMethod.java b/inject/api/src/main/java/io/helidon/inject/api/PostConstructMethod.java index 704a7b2df4a..5f4eda32263 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/PostConstructMethod.java +++ b/inject/api/src/main/java/io/helidon/inject/api/PostConstructMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/PreDestroyMethod.java b/inject/api/src/main/java/io/helidon/inject/api/PreDestroyMethod.java index c8df0b5d44d..f79834bbd4e 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/PreDestroyMethod.java +++ b/inject/api/src/main/java/io/helidon/inject/api/PreDestroyMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java index fa65aad1dea..62ed8cf1627 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Resettable.java b/inject/api/src/main/java/io/helidon/inject/api/Resettable.java index 880f72ebbc0..b03dc13171b 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Resettable.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Resettable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/RunLevel.java b/inject/api/src/main/java/io/helidon/inject/api/RunLevel.java index e51bbe46c30..ee3960bda4c 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/RunLevel.java +++ b/inject/api/src/main/java/io/helidon/inject/api/RunLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceBinder.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceBinder.java index 865043ece6f..489c9970c52 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceBinder.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceBinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBasicsBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBasicsBlueprint.java index 5e0ae9399e0..777a51164f9 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBasicsBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBasicsBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBlueprint.java index 0e36179ef93..cf45f36ec8e 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoCriteriaBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoCriteriaBlueprint.java index fd4792ffc26..eb43f2e171a 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoCriteriaBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInfoCriteriaBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceInjectionPlanBinder.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceInjectionPlanBinder.java index 3c5c8b8434d..7a1251f37d1 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceInjectionPlanBinder.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceInjectionPlanBinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceProvider.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProvider.java index cbc0b5778e2..ccac4e287a9 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderBindable.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderBindable.java index c18cc1b6d78..0fb8321c89c 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderBindable.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderBindable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java index e9657a108fb..d30b94cd87e 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderInjectionException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderProvider.java b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderProvider.java index b524d01a1ad..935c0b4b662 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/api/ServiceProviderProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/Services.java b/inject/api/src/main/java/io/helidon/inject/api/Services.java index 5e733b29211..064588382b6 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Services.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Services.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/api/package-info.java b/inject/api/src/main/java/io/helidon/inject/api/package-info.java index 32d16507709..b290063a567 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/package-info.java +++ b/inject/api/src/main/java/io/helidon/inject/api/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/spi/InjectionResolver.java b/inject/api/src/main/java/io/helidon/inject/spi/InjectionResolver.java index 0ff7127a83e..bcb08706d14 100644 --- a/inject/api/src/main/java/io/helidon/inject/spi/InjectionResolver.java +++ b/inject/api/src/main/java/io/helidon/inject/spi/InjectionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java b/inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java index 76fd1ecba78..5d0a5581497 100644 --- a/inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java +++ b/inject/api/src/main/java/io/helidon/inject/spi/InjectionServicesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/main/java/io/helidon/inject/spi/package-info.java b/inject/api/src/main/java/io/helidon/inject/spi/package-info.java index a3950aba365..bc1fe0eb3f8 100644 --- a/inject/api/src/main/java/io/helidon/inject/spi/package-info.java +++ b/inject/api/src/main/java/io/helidon/inject/spi/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java b/inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java index 0919c239b9c..8f876bf8c95 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java +++ b/inject/api/src/test/java/io/helidon/inject/api/InjectionServicesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/PriorityAndServiceTypeComparatorTest.java b/inject/api/src/test/java/io/helidon/inject/api/PriorityAndServiceTypeComparatorTest.java index 943f57a1ca3..aed8ef2f21b 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/PriorityAndServiceTypeComparatorTest.java +++ b/inject/api/src/test/java/io/helidon/inject/api/PriorityAndServiceTypeComparatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java index 9c920b4a9b5..6c527bbacc3 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/AbstractInjectionServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java index 891ee3809b2..2bcbabf7753 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java index 199b6eb1e71..0a95f3c8a5a 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices1Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java index f448b3c883f..daa5ff6a78f 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java index 222fc4e9124..aa6cdaeea3d 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices2Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java index bfd909da038..3f163af453e 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java index b216b03923b..629a32d4eca 100644 --- a/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java +++ b/inject/api/src/test/java/io/helidon/inject/api/testsubjects/InjectionServices3Provider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/UnconfiguredServiceProvider.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/UnconfiguredServiceProvider.java index e3134214163..951af90e486 100644 --- a/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/UnconfiguredServiceProvider.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/UnconfiguredServiceProvider.java @@ -29,7 +29,7 @@ import io.helidon.inject.api.ServiceInfo; import io.helidon.inject.api.ServiceProviderBindable; import io.helidon.inject.configdriven.api.NamedInstance; -import io.helidon.inject.runtime.HeldionInjectionPlan; +import io.helidon.inject.runtime.HelidonInjectionPlan; /** * Used by root service providers when there are no services that have been configured. @@ -115,7 +115,7 @@ public Class serviceType() { } @Override - public Map getOrCreateInjectionPlan(boolean resolveIps) { + public Map getOrCreateInjectionPlan(boolean resolveIps) { return super.getOrCreateInjectionPlan(resolveIps); } diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java index 5acce8f2eca..2224da82af6 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java @@ -87,7 +87,7 @@ public abstract class AbstractServiceProvider private ActivationLog log; private ServiceInfo serviceInfo; private DependenciesInfo dependencies; - private Map injectionPlan; + private Map injectionPlan; private ServiceProvider interceptor; private boolean thisIsAnInterceptor; @@ -496,7 +496,7 @@ public Optional injectionPlanBinder() { } })); - ConcurrentHashMap injectionPlan = new ConcurrentHashMap<>(); + ConcurrentHashMap injectionPlan = new ConcurrentHashMap<>(); AbstractServiceProvider self = AbstractServiceProvider.this; ServiceInjectionPlanBinder.Binder result = new ServiceInjectionPlanBinder.Binder() { private InjectionPointInfo ipInfo; @@ -504,7 +504,7 @@ public Optional injectionPlanBinder() { @Override public ServiceInjectionPlanBinder.Binder bind(String id, ServiceProvider serviceProvider) { - HeldionInjectionPlan plan = createBuilder(id) + HelidonInjectionPlan plan = createBuilder(id) .injectionPointQualifiedServiceProviders(List.of(bind(serviceProvider))) .build(); Object prev = injectionPlan.put(id, plan); @@ -515,7 +515,7 @@ public ServiceInjectionPlanBinder.Binder bind(String id, @Override public ServiceInjectionPlanBinder.Binder bindMany(String id, ServiceProvider... serviceProviders) { - HeldionInjectionPlan plan = createBuilder(id) + HelidonInjectionPlan plan = createBuilder(id) .injectionPointQualifiedServiceProviders(bind(Arrays.asList(serviceProviders))) .build(); Object prev = injectionPlan.put(id, plan); @@ -541,7 +541,7 @@ public ServiceInjectionPlanBinder.Binder resolvedBind(String id, .dependencyToServiceInfo(serviceInfo); Object resolved = Objects.requireNonNull( resolver.resolve(ipInfo, requiredInjectionServices(), AbstractServiceProvider.this, false)); - HeldionInjectionPlan plan = createBuilder(id) + HelidonInjectionPlan plan = createBuilder(id) .unqualifiedProviders(List.of(resolved)) .resolved(false) .build(); @@ -585,9 +585,9 @@ private InjectionPointInfo safeGetIpInfo(String id) { return ipInfo; } - private HeldionInjectionPlan.Builder createBuilder(String id) { + private HelidonInjectionPlan.Builder createBuilder(String id) { ipInfo = safeGetIpInfo(id); - return HeldionInjectionPlan.builder() + return HelidonInjectionPlan.builder() .injectionPointInfo(ipInfo) .serviceProvider(self); } @@ -602,7 +602,7 @@ private HeldionInjectionPlan.Builder createBuilder(String id) { * @param resolveIps true if the injection points should also be activated/resolved. * @return the injection plan */ - public Map getOrCreateInjectionPlan(boolean resolveIps) { + public Map getOrCreateInjectionPlan(boolean resolveIps) { if (this.injectionPlan != null) { return this.injectionPlan; } @@ -611,7 +611,7 @@ public Map getOrCreateInjectionPlan(boolean resolv dependencies(dependencies()); } - Map plan = DefaultInjectionPlans + Map plan = DefaultInjectionPlans .createInjectionPlans(requiredInjectionServices(), this, dependencies, resolveIps, logger()); assert (this.injectionPlan == null); this.injectionPlan = Objects.requireNonNull(plan); @@ -1073,7 +1073,7 @@ protected void startTransitionCurrentActivationPhase(LogEntryAndResult logEntryA onPhaseEvent(Event.STARTING, this.phase); } - Map resolveDependencies(Map mutablePlans) { + Map resolveDependencies(Map mutablePlans) { Map result = new LinkedHashMap<>(); Map.copyOf(mutablePlans).forEach((key, value) -> { @@ -1097,7 +1097,7 @@ Map resolveDependencies(Map mutabl if (value.resolved().isEmpty()) { // update the original plans map to properly reflect the resolved value - mutablePlans.put(key, HeldionInjectionPlan.builder(value) + mutablePlans.put(key, HelidonInjectionPlan.builder(value) .wasResolved(true) .update(builder -> { if (resolved != null) { @@ -1220,7 +1220,7 @@ private void doStartingLifecycle(LogEntryAndResult logEntryAndResult) { private void doGatheringDependencies(LogEntryAndResult logEntryAndResult) { startTransitionCurrentActivationPhase(logEntryAndResult, Phase.GATHERING_DEPENDENCIES); - Map plans = Objects.requireNonNull(getOrCreateInjectionPlan(false)); + Map plans = Objects.requireNonNull(getOrCreateInjectionPlan(false)); Map deps = resolveDependencies(plans); if (!deps.isEmpty()) { logEntryAndResult.activationResult.resolvedDependencies(deps); @@ -1231,7 +1231,7 @@ private void doGatheringDependencies(LogEntryAndResult logEntryAndResult) { } @SuppressWarnings("unchecked") - private Object resolveOptional(HeldionInjectionPlan plan, + private Object resolveOptional(HelidonInjectionPlan plan, Object resolved) { if (!plan.injectionPointInfo().optionalWrapped() && resolved instanceof Optional) { return ((Optional) resolved).orElse(null); diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultActivationLog.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultActivationLog.java index 4caa8ec75b1..8717afa5a9a 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultActivationLog.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultActivationLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java index b6bb7fe2769..2cc03f855e9 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java @@ -64,12 +64,12 @@ private DefaultInjectionPlans() { * @param logger the logger to use for any logging * @return the injection plan per element identity belonging to the service provider */ - static Map createInjectionPlans(InjectionServices injectionServices, + static Map createInjectionPlans(InjectionServices injectionServices, ServiceProvider self, DependenciesInfo dependencies, boolean resolveIps, System.Logger logger) { - Map result = new LinkedHashMap<>(); + Map result = new LinkedHashMap<>(); if (dependencies.allDependencies().isEmpty()) { return result; } @@ -254,7 +254,7 @@ static Object resolve(ServiceProvider self, @SuppressWarnings("unchecked") private static void accumulate(DependencyInfo dep, - Map result, + Map result, InjectionServices injectionServices, ServiceProvider self, boolean resolveIps, @@ -280,7 +280,7 @@ private static void accumulate(DependencyInfo dep, Object target = (resolved instanceof Optional) ? ((Optional) resolved).orElse(null) : resolved; if (target != null) { - HeldionInjectionPlan.Builder planBuilder = HeldionInjectionPlan.builder() + HelidonInjectionPlan.Builder planBuilder = HelidonInjectionPlan.builder() .serviceProvider(self) .injectionPointInfo(ipInfo) .injectionPointQualifiedServiceProviders(toIpQualified(target)) @@ -299,7 +299,7 @@ private static void accumulate(DependencyInfo dep, } } - HeldionInjectionPlan plan = planBuilder.build(); + HelidonInjectionPlan plan = planBuilder.build(); Object prev = result.put(id, plan); assert (prev == null) : ipInfo; } @@ -340,7 +340,7 @@ private static void accumulate(DependencyInfo dep, throw DefaultServices.resolutionBasedInjectionError( ipInfo.dependencyToServiceInfo()); } - HeldionInjectionPlan plan = HeldionInjectionPlan.builder() + HelidonInjectionPlan plan = HelidonInjectionPlan.builder() .injectionPointInfo(ipInfo) .injectionPointQualifiedServiceProviders(serviceProviders) .serviceProvider(self) diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java index 8985e3a2486..11efa750d2f 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServicesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultServices.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultServices.java index 60dcba75410..6266a88fb72 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultServices.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/HeldionInjectionPlanBlueprint.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionPlanBlueprint.java similarity index 95% rename from inject/runtime/src/main/java/io/helidon/inject/runtime/HeldionInjectionPlanBlueprint.java rename to inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionPlanBlueprint.java index 2c3c56bb0f1..0120881c68c 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/HeldionInjectionPlanBlueprint.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionPlanBlueprint.java @@ -29,7 +29,7 @@ * loaded. */ @Prototype.Blueprint -interface HeldionInjectionPlanBlueprint extends InjectionPlan { +interface HelidonInjectionPlanBlueprint extends InjectionPlan { /** * The list of services/providers that are unqualified to satisfy the given injection point but were considered. diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/NonSingletonServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/NonSingletonServiceProvider.java index 14d3438bf44..5311d837e7c 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/NonSingletonServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/NonSingletonServiceProvider.java @@ -47,7 +47,7 @@ static T createAndActivate(AbstractServiceProvider delegate) { serviceProvider.startAndFinishTransitionCurrentActivationPhase(logEntryAndResult, Phase.ACTIVATION_STARTING); serviceProvider.startTransitionCurrentActivationPhase(logEntryAndResult, Phase.GATHERING_DEPENDENCIES); - Map plans = delegate.getOrCreateInjectionPlan(false); + Map plans = delegate.getOrCreateInjectionPlan(false); logEntryAndResult.activationResult().injectionPlans(plans); Map deps = delegate.resolveDependencies(plans); logEntryAndResult.activationResult().resolvedDependencies(deps); diff --git a/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultActivationLogTest.java b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultActivationLogTest.java index 64b01f18ae3..7dd88ea18c8 100644 --- a/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultActivationLogTest.java +++ b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultActivationLogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java index e3eaa65c1ec..d2afde46c65 100644 --- a/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java +++ b/inject/runtime/src/test/java/io/helidon/inject/runtime/DefaultInjectionServicesConfigTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java b/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java index 65994d2a1ea..fc3effc2c3f 100644 --- a/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java +++ b/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java b/inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java index 6397d687410..f0ba5f110d8 100644 --- a/inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java +++ b/inject/tests/api/src/test/java/io/helidon/inject/api/InjectionServicesConfigTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorDefault.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorDefault.java index d373808b615..90d61110302 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorDefault.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorDefault.java @@ -42,7 +42,7 @@ import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.api.Services; import io.helidon.inject.runtime.AbstractServiceProvider; -import io.helidon.inject.runtime.HeldionInjectionPlan; +import io.helidon.inject.runtime.HelidonInjectionPlan; import io.helidon.inject.runtime.ServiceBinderDefault; import io.helidon.inject.tools.spi.ApplicationCreator; @@ -341,8 +341,8 @@ List toInjectionPlanBindings(ServiceProvider sp) { } List plan = new ArrayList<>(deps.allDependencies().size()); - Map injectionPlan = asp.getOrCreateInjectionPlan(false); - for (Map.Entry e : injectionPlan.entrySet()) { + Map injectionPlan = asp.getOrCreateInjectionPlan(false); + for (Map.Entry e : injectionPlan.entrySet()) { StringBuilder line = new StringBuilder(); InjectionPointInfo ipInfo = e.getValue().injectionPointInfo(); List> ipQualified = e.getValue().injectionPointQualifiedServiceProviders(); diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/CommonUtils.java b/inject/tools/src/main/java/io/helidon/inject/tools/CommonUtils.java index f2601f22131..f9775fb5d5d 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/CommonUtils.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CommonUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java b/inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java index 6c410f1059b..57d3670161e 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InjectionSupported.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorBlueprint.java index 30311dd1645..7160e2ae0d3 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoDescriptorBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoItemBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoItemBlueprint.java index f419e3e9dba..35b0889bd82 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoItemBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoItemBlueprint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/TemplateHelper.java b/inject/tools/src/main/java/io/helidon/inject/tools/TemplateHelper.java index 93b9275d5e3..0dd6c743a91 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/TemplateHelper.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/TemplateHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ToolsException.java b/inject/tools/src/main/java/io/helidon/inject/tools/ToolsException.java index 9950aea1096..f257c3d3470 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ToolsException.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ToolsException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java b/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java index 7ce55f99858..b6b9d455fe2 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/package-info.java b/inject/tools/src/main/java/io/helidon/inject/tools/package-info.java index 132ab3fc839..c3b92fe03f8 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/package-info.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/test/java/io/helidon/inject/tools/ActivatorCreatorDefaultTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/ActivatorCreatorDefaultTest.java index e9a076e0e3d..493766d4f19 100644 --- a/inject/tools/src/test/java/io/helidon/inject/tools/ActivatorCreatorDefaultTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/ActivatorCreatorDefaultTest.java @@ -59,7 +59,7 @@ void codegenHelloActivator() { ActivatorCreatorCodeGen codeGen = ActivatorCreatorCodeGen.builder().build(); ActivatorCreatorRequest req = ActivatorCreatorRequest.builder() .serviceTypeNames(List.of(TypeName.create(HelloInjectionWorldImpl.class))) - .generatedServiceTypeNames(List.of(TypeName.create(HelloPicoWorldImpl.class))) + .generatedServiceTypeNames(List.of(TypeName.create(HelloInjectionWorldImpl.class))) .codeGen(codeGen) .codeGenPaths(codeGenPaths) .configOptions(ActivatorCreatorConfigOptions.builder().build()) @@ -71,7 +71,7 @@ void codegenHelloActivator() { ActivatorCreatorRequest req2 = ActivatorCreatorRequest.builder() .serviceTypeNames(Collections.singletonList(TypeName.create(HelloInjectionWorldImpl.class))) - .generatedServiceTypeNames(Collections.singletonList(TypeName.create(HelloPicoWorldImpl.class))) + .generatedServiceTypeNames(Collections.singletonList(TypeName.create(HelloInjectionWorldImpl.class))) .codeGenPaths(CodeGenPaths.builder().build()) .throwIfError(Boolean.FALSE) .codeGen(codeGen) diff --git a/inject/tools/src/test/java/io/helidon/inject/tools/ModuleInfoDescriptorTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/ModuleInfoDescriptorTest.java index 30f44adeff8..d1a3ed916fd 100644 --- a/inject/tools/src/test/java/io/helidon/inject/tools/ModuleInfoDescriptorTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/ModuleInfoDescriptorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inject/tools/src/test/java/io/helidon/inject/tools/TemplateHelperTest.java b/inject/tools/src/test/java/io/helidon/inject/tools/TemplateHelperTest.java index 6065bfd4239..d28dcc9d382 100644 --- a/inject/tools/src/test/java/io/helidon/inject/tools/TemplateHelperTest.java +++ b/inject/tools/src/test/java/io/helidon/inject/tools/TemplateHelperTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From c019042776b286c9dce19f61b9ca0b76aa31cbba Mon Sep 17 00:00:00 2001 From: Jeff Trent Date: Wed, 12 Jul 2023 10:57:44 -0400 Subject: [PATCH 3/5] more checkstyle fixes --- .../inject/api/BootstrapBlueprint.java | 9 ++--- .../inject/api/QualifierBlueprint.java | 3 ++ .../java/io/helidon/inject/api/Services.java | 4 +- .../ConfigDrivenServiceProviderBase.java | 4 +- .../maven/plugin/ApplicationCreatorMojo.java | 2 +- .../inject/maven/plugin/MavenPluginUtils.java | 4 +- .../InjectionAnnotationProcessor.java | 17 ++++++--- .../processor/ProcessingEventBlueprint.java | 3 +- .../runtime/AbstractServiceProvider.java | 38 ++++++++++++------- .../runtime/DefaultInjectionPlanBinder.java | 2 +- .../inject/runtime/DefaultInjectionPlans.java | 10 ++--- .../runtime/DefaultInjectionServices.java | 5 ++- .../inject/runtime/DefaultInjector.java | 2 +- .../HelidonInjectionPlanBlueprint.java | 3 +- .../InjectionApplicationServiceProvider.java | 2 +- .../InjectionModuleServiceProvider.java | 2 +- .../testing/InjectionTestingSupport.java | 6 +-- ...flectionBasedSingletonServiceProvider.java | 6 +-- .../ActivatorCodeGenDetailBlueprint.java | 3 +- .../ActivatorCreatorCodeGenBlueprint.java | 25 +++++------- ...ctivatorCreatorConfigOptionsBlueprint.java | 12 ++---- .../inject/tools/ActivatorCreatorDefault.java | 4 +- .../ActivatorCreatorRequestBlueprint.java | 6 +-- .../ActivatorCreatorResponseBlueprint.java | 6 +-- .../ApplicationCreatorCodeGenBlueprint.java | 5 +-- ...licationCreatorConfigOptionsBlueprint.java | 3 +- .../ApplicationCreatorRequestBlueprint.java | 3 +- .../ApplicationCreatorResponseBlueprint.java | 8 ++-- .../io/helidon/inject/tools/CodeGenFiler.java | 3 +- .../CodeGenInterceptorRequestBlueprint.java | 3 +- .../inject/tools/CodeGenPathsBlueprint.java | 3 +- ...tomAnnotationTemplateRequestBlueprint.java | 5 +-- ...omAnnotationTemplateResponseBlueprint.java | 3 +- .../tools/ExternalModuleCreatorDefault.java | 6 +-- ...ExternalModuleCreatorRequestBlueprint.java | 3 +- ...xternalModuleCreatorResponseBlueprint.java | 6 +-- .../tools/GeneralCodeGenNamesBlueprint.java | 8 ++-- .../tools/GeneralCreatorRequestBlueprint.java | 4 +- .../tools/InterceptedElementBlueprint.java | 10 ++--- .../tools/InterceptionPlanBlueprint.java | 5 +-- .../tools/MethodElementInfoBlueprint.java | 3 +- .../inject/tools/ModuleDetailBlueprint.java | 3 +- .../ModuleInfoCreatorRequestBlueprint.java | 14 +++---- .../io/helidon/inject/tools/TypeTools.java | 2 +- .../inject/tools/spi/ActivatorCreator.java | 2 +- .../inject/tools/spi/InterceptorCreator.java | 2 +- .../oci/sdk/runtime/OciRegionProvider.java | 2 +- .../nima/faulttolerance/AsyncInterceptor.java | 2 +- .../faulttolerance/FallbackInterceptor.java | 2 +- .../nima/http-endpoint.java.hbs | 0 .../nima/http-method.java.hbs | 0 .../io/helidon/nima/webserver/LoomServer.java | 6 +-- .../io/helidon/nima/webserver/WebServer.java | 2 +- .../nima/webserver/http/HttpFeature.java | 2 +- 54 files changed, 140 insertions(+), 158 deletions(-) rename nima/http/processor/src/main/resources/templates/{pico => inject}/nima/http-endpoint.java.hbs (100%) rename nima/http/processor/src/main/resources/templates/{pico => inject}/nima/http-method.java.hbs (100%) diff --git a/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java index 4ad66ffb244..c09e0a4e4c3 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/BootstrapBlueprint.java @@ -20,19 +20,18 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.config.Config; -import io.helidon.inject.spi.InjectionServicesProvider; /** * This is the bootstrap needed to provide to {@code Services} initialization. * - * @see InjectionServicesProvider - * @see InjectionServices#globalBootstrap() + * @see io.helidon.inject.spi.InjectionServicesProvider + * @see io.helidon.inject.api.InjectionServices#globalBootstrap() */ @Prototype.Blueprint interface BootstrapBlueprint { /** - * Provides the base primordial bootstrap configuration to the {@link InjectionServicesProvider}. + * Provides the base primordial bootstrap configuration to the {@link io.helidon.inject.spi.InjectionServicesProvider}. * The provider will then bootstrap {@link InjectionServices} using this bootstrap instance. * then default values will be used accordingly. * @@ -43,7 +42,7 @@ interface BootstrapBlueprint { /** * In certain conditions Injection services should be initialized but not started (i.e., avoiding calls to {@code PostConstruct} * etc.). This can be used in special cases where the normal Injection startup should limit lifecycle up to a given phase. Normally - * one should not use this feature - it is mainly used in Injection tooling (e.g., the injection maven-plugin). + * one should not use this feature - it is mainly used in Injection tooling (e.g., the injection maven-plugin). * * @return the phase to stop at during lifecycle */ diff --git a/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java b/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java index 62ed8cf1627..bd64dd88841 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java +++ b/inject/api/src/main/java/io/helidon/inject/api/QualifierBlueprint.java @@ -35,6 +35,9 @@ @Prototype.Blueprint @Prototype.CustomMethods(QualifierBlueprint.QualifierMethods.class) interface QualifierBlueprint extends Annotation { + /** + * The type name for {@link ClassNamed}. + */ TypeName CLASS_NAMED = TypeName.create(ClassNamed.class); /** diff --git a/inject/api/src/main/java/io/helidon/inject/api/Services.java b/inject/api/src/main/java/io/helidon/inject/api/Services.java index 064588382b6..0cd9a00bfbe 100644 --- a/inject/api/src/main/java/io/helidon/inject/api/Services.java +++ b/inject/api/src/main/java/io/helidon/inject/api/Services.java @@ -64,7 +64,7 @@ public interface Services { */ default ServiceProvider lookup(Class type) { return lookupFirst(type, true) - .orElseThrow(() -> new InjectionException("There are no service providers for service of type " + type.getName())); + .orElseThrow(() -> new InjectionException("There are no service providers for service of type " + type.getName())); } /** @@ -80,7 +80,7 @@ default ServiceProvider lookup(Class type) { default ServiceProvider lookup(Class type, String name) { return lookupFirst(type, name, true) - .orElseThrow(() -> new InjectionException("There are no service providers for service of type " + type.getName())); + .orElseThrow(() -> new InjectionException("There are no service providers for service of type " + type.getName())); } /** diff --git a/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigDrivenServiceProviderBase.java b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigDrivenServiceProviderBase.java index 104e0a8207e..bc52c98d666 100644 --- a/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigDrivenServiceProviderBase.java +++ b/inject/configdriven/runtime/src/main/java/io/helidon/inject/configdriven/runtime/ConfigDrivenServiceProviderBase.java @@ -36,10 +36,9 @@ import io.helidon.inject.api.CallingContext; import io.helidon.inject.api.ContextualServiceQuery; import io.helidon.inject.api.Event; -import io.helidon.inject.api.InjectionServiceProviderException; -import io.helidon.inject.api.ServiceProviderInjectionException; import io.helidon.inject.api.InjectionPointInfo; import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.InjectionServiceProviderException; import io.helidon.inject.api.InjectionServices; import io.helidon.inject.api.Phase; import io.helidon.inject.api.Qualifier; @@ -47,6 +46,7 @@ import io.helidon.inject.api.ServiceInfoCriteria; import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.api.ServiceProviderInjectionException; import io.helidon.inject.api.ServiceProviderProvider; import io.helidon.inject.configdriven.api.ConfigDriven; import io.helidon.inject.configdriven.api.NamedInstance; diff --git a/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ApplicationCreatorMojo.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ApplicationCreatorMojo.java index cdd46308aca..0a1f5ffe970 100644 --- a/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ApplicationCreatorMojo.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/ApplicationCreatorMojo.java @@ -19,8 +19,8 @@ import java.io.File; import io.helidon.inject.api.Application; -import io.helidon.inject.tools.spi.ApplicationCreator; import io.helidon.inject.tools.ApplicationCreatorDefault; +import io.helidon.inject.tools.spi.ApplicationCreator; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; diff --git a/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/MavenPluginUtils.java b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/MavenPluginUtils.java index 10503d29375..9173eaedea1 100644 --- a/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/MavenPluginUtils.java +++ b/inject/maven-plugin/src/main/java/io/helidon/inject/maven/plugin/MavenPluginUtils.java @@ -27,13 +27,13 @@ import io.helidon.common.LazyValue; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.inject.api.Services; import io.helidon.inject.api.Bootstrap; import io.helidon.inject.api.InjectionServices; -import io.helidon.inject.api.Phase; import io.helidon.inject.api.InjectionServicesHolder; +import io.helidon.inject.api.Phase; import io.helidon.inject.api.Resettable; import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; import io.helidon.inject.configdriven.runtime.ConfigBeanRegistry; import io.helidon.inject.tools.spi.ActivatorCreator; import io.helidon.inject.tools.spi.ApplicationCreator; diff --git a/inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java b/inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java index 695002b7cd4..43ec0c9354d 100644 --- a/inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/InjectionAnnotationProcessor.java @@ -50,12 +50,12 @@ import io.helidon.common.types.TypeValues; import io.helidon.common.types.TypedElementInfo; import io.helidon.inject.api.AccessModifier; -import io.helidon.inject.api.ModuleComponent; import io.helidon.inject.api.Activator; import io.helidon.inject.api.Contract; import io.helidon.inject.api.DependenciesInfo; import io.helidon.inject.api.ElementKind; import io.helidon.inject.api.ExternalContracts; +import io.helidon.inject.api.ModuleComponent; import io.helidon.inject.api.Qualifier; import io.helidon.inject.api.ServiceInfoBasics; import io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver; @@ -176,8 +176,8 @@ public final boolean process(Set annotations, } } - protected boolean doProcess(Set annotations, - RoundEnvironment roundEnv) { + private boolean doProcess(Set ignoredAnnotations, + RoundEnvironment roundEnv) { utils().roundEnv(roundEnv); if (disableBaseProcessing && getClass() == InjectionAnnotationProcessor.class) { @@ -431,6 +431,11 @@ protected void processBasics(ServicesToProcess services, gatherContractsIntoServicesToProcess(services, service); } + /** + * The set of annotations that define the service. + * + * @return the set of annotations that define the service + */ protected Set serviceDefiningAnnotations() { return SERVICE_DEFINING_ANNOTATIONS; } @@ -534,7 +539,8 @@ private static ServiceLoader observerLoade } catch (ServiceConfigurationError e) { // see issue #6261 - running inside the IDE? // this version will use the thread ctx classloader - System.getLogger(InjectionAnnotationProcessorObserver.class.getName()).log(System.Logger.Level.WARNING, e.getMessage(), e); + System.getLogger(InjectionAnnotationProcessorObserver.class.getName()) + .log(System.Logger.Level.WARNING, e.getMessage(), e); return ServiceLoader.load(InjectionAnnotationProcessorObserver.class); } } @@ -896,7 +902,8 @@ private void notifyObservers() { } private Path trackerStatePath() { - return scratchClassOutputPath(targetClassOutputPath(processingEnv.getFiler())).resolve(ProcessingTracker.DEFAULT_SCRATCH_FILE_NAME); + return scratchClassOutputPath(targetClassOutputPath(processingEnv.getFiler())) + .resolve(ProcessingTracker.DEFAULT_SCRATCH_FILE_NAME); } } diff --git a/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingEventBlueprint.java b/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingEventBlueprint.java index f6deaba787c..fbc7f8208e6 100644 --- a/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingEventBlueprint.java +++ b/inject/processor/src/main/java/io/helidon/inject/processor/ProcessingEventBlueprint.java @@ -23,10 +23,9 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypedElementInfo; -import io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver; /** - * Attributes that can be observed via {@link InjectionAnnotationProcessorObserver}. + * Attributes that can be observed via {@link io.helidon.inject.processor.spi.InjectionAnnotationProcessorObserver}. */ @Prototype.Blueprint interface ProcessingEventBlueprint { diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java index 2224da82af6..f884b60c7fc 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/AbstractServiceProvider.java @@ -44,12 +44,11 @@ import io.helidon.inject.api.DeActivator; import io.helidon.inject.api.DependenciesInfo; import io.helidon.inject.api.Event; -import io.helidon.inject.api.InjectionServiceProviderException; -import io.helidon.inject.api.InjectionServicesConfig; -import io.helidon.inject.api.ServiceProviderInjectionException; import io.helidon.inject.api.InjectionPointInfo; import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.InjectionServiceProviderException; import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesConfig; import io.helidon.inject.api.Phase; import io.helidon.inject.api.PostConstructMethod; import io.helidon.inject.api.PreDestroyMethod; @@ -59,6 +58,7 @@ import io.helidon.inject.api.ServiceInjectionPlanBinder; import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.api.ServiceProviderInjectionException; import io.helidon.inject.spi.InjectionResolver; import jakarta.inject.Provider; @@ -929,8 +929,10 @@ protected void doConstructing(LogEntryAndResult logEntryAndResult) { * normally should */ protected T createServiceProvider(Map resolvedDeps) { - ServiceProviderInjectionException e = new ServiceProviderInjectionException("Don't know how to create an instance of " + serviceInfo() - + ". Was the Activator generated?", this); + ServiceProviderInjectionException e = + new ServiceProviderInjectionException("Don't know how to create an instance of " + serviceInfo() + + ". Was the Activator generated?", + this); activationLog().ifPresent(e::activationLog); throw e; } @@ -1026,8 +1028,9 @@ protected void doDestroying(LogEntryAndResult logEntryAndResult) { * @return the injection exception */ protected ServiceProviderInjectionException expectedQualifiedServiceError(ContextualServiceQuery ctx) { - ServiceProviderInjectionException e = new ServiceProviderInjectionException("Expected to return a non-null instance for: " + ctx.injectionPointInfo() - + "; with criteria matching: " + ctx.serviceInfoCriteria(), this); + ServiceProviderInjectionException e = new ServiceProviderInjectionException("Expected to return a non-null instance for: " + + ctx.injectionPointInfo() + + "; with criteria matching: " + ctx.serviceInfoCriteria(), this); activationLog().ifPresent(e::activationLog); return e; } @@ -1262,7 +1265,7 @@ private void doInjecting(LogEntryAndResult logEntryAndResult) { doInjectingMethods(target, deps, injections, forServiceType); } catch (Throwable t) { throw new ServiceProviderInjectionException("Failed to activate/inject: " + this - + "; dependency map was: " + deps, t, this); + + "; dependency map was: " + deps, t, this); } }); @@ -1279,7 +1282,8 @@ private void doActivationActive(LogEntryAndResult logEntryAndResult) { private ServiceProviderInjectionException recursiveActivationInjectionError(ActivationLogEntry.Builder entry) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - ServiceProviderInjectionException e = new ServiceProviderInjectionException("A circular dependency found during activation of " + targetServiceProvider, + ServiceProviderInjectionException e = + new ServiceProviderInjectionException("A circular dependency found during activation of " + targetServiceProvider, targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); @@ -1288,7 +1292,8 @@ private ServiceProviderInjectionException recursiveActivationInjectionError(Acti private ServiceProviderInjectionException timedOutActivationInjectionError(ActivationLogEntry.Builder entry) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - ServiceProviderInjectionException e = new ServiceProviderInjectionException("Timed out during activation of " + targetServiceProvider, + ServiceProviderInjectionException e = + new ServiceProviderInjectionException("Timed out during activation of " + targetServiceProvider, targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); @@ -1297,7 +1302,8 @@ private ServiceProviderInjectionException timedOutActivationInjectionError(Activ private ServiceProviderInjectionException timedOutDeActivationInjectionError(ActivationLogEntry.Builder entry) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - ServiceProviderInjectionException e = new ServiceProviderInjectionException("Timed out during deactivation of " + targetServiceProvider, + ServiceProviderInjectionException e = + new ServiceProviderInjectionException("Timed out during deactivation of " + targetServiceProvider, targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); @@ -1307,15 +1313,19 @@ private ServiceProviderInjectionException timedOutDeActivationInjectionError(Act private ServiceProviderInjectionException interruptedPreActivationInjectionError(ActivationLogEntry.Builder entry, Throwable cause) { ServiceProvider targetServiceProvider = entry.serviceProvider().orElseThrow(); - ServiceProviderInjectionException e = new ServiceProviderInjectionException("A circular dependency found during activation of " + targetServiceProvider, - cause, targetServiceProvider); + ServiceProviderInjectionException e = new ServiceProviderInjectionException( + "A circular dependency found during activation of " + targetServiceProvider, + cause, + targetServiceProvider); activationLog().ifPresent(e::activationLog); entry.error(e); return e; } private ServiceProviderInjectionException managedServiceInstanceShouldHaveBeenSetException() { - ServiceProviderInjectionException e = new ServiceProviderInjectionException("This managed service instance expected to have been set", this); + ServiceProviderInjectionException e = new ServiceProviderInjectionException( + "This managed service instance expected to have been set", + this); activationLog().ifPresent(e::activationLog); return e; } diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlanBinder.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlanBinder.java index e1fd3b10abb..faa0d849fc3 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlanBinder.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlanBinder.java @@ -39,7 +39,7 @@ public Binder bindTo(ServiceProvider untrustedSp) { if (binder.isEmpty()) { // basically this means this service will not support compile-time injection DefaultInjectionServices.LOGGER.log(System.Logger.Level.WARNING, - "service provider is not capable of being bound to injection points: " + serviceProvider); + "service provider is not capable of being bound to injection points: " + serviceProvider); return this; } else { if (DefaultInjectionServices.LOGGER.isLoggable(System.Logger.Level.DEBUG)) { diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java index 2cc03f855e9..e5d5674c9a8 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionPlans.java @@ -31,17 +31,17 @@ import io.helidon.inject.api.ContextualServiceQuery; import io.helidon.inject.api.DependenciesInfo; import io.helidon.inject.api.DependencyInfo; -import io.helidon.inject.api.InjectionServiceProviderException; -import io.helidon.inject.api.ServiceProviderInjectionException; import io.helidon.inject.api.InjectionPointInfo; import io.helidon.inject.api.InjectionPointProvider; +import io.helidon.inject.api.InjectionServiceProviderException; import io.helidon.inject.api.InjectionServices; -import io.helidon.inject.api.Interceptor; import io.helidon.inject.api.InjectionServicesConfig; +import io.helidon.inject.api.Interceptor; import io.helidon.inject.api.ServiceInfo; import io.helidon.inject.api.ServiceInfoCriteria; import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.api.ServiceProviderBindable; +import io.helidon.inject.api.ServiceProviderInjectionException; import io.helidon.inject.api.ServiceProviderProvider; import io.helidon.inject.api.Services; import io.helidon.inject.spi.InjectionResolver; @@ -204,8 +204,8 @@ static Object resolve(ServiceProvider self, } else { throw new ServiceProviderInjectionException("Expected to resolve a service appropriate for " + ipInfo.serviceTypeName() + "." + ipInfo.elementName(), - DefaultServices.resolutionBasedInjectionError(ipInfo.dependencyToServiceInfo()), - self); + DefaultServices.resolutionBasedInjectionError(ipInfo.dependencyToServiceInfo()), + self); } } else { // "standard" case diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java index e3615e31d86..0fe7975d4ef 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjectionServices.java @@ -49,6 +49,7 @@ import io.helidon.inject.api.CallingContext; import io.helidon.inject.api.CallingContextFactory; import io.helidon.inject.api.Event; +import io.helidon.inject.api.InjectionException; import io.helidon.inject.api.InjectionServices; import io.helidon.inject.api.InjectionServicesConfig; import io.helidon.inject.api.Injector; @@ -56,7 +57,6 @@ import io.helidon.inject.api.Metrics; import io.helidon.inject.api.ModuleComponent; import io.helidon.inject.api.Phase; -import io.helidon.inject.api.InjectionException; import io.helidon.inject.api.Resettable; import io.helidon.inject.api.ServiceInfoCriteria; import io.helidon.inject.api.ServiceProvider; @@ -285,7 +285,8 @@ private void assertNotInitializing() { + isBinding + ", initializingServicesFinished=" + initializingServicesFinished + ")"; String msg = (initializationCallingContext == null) - ? InjectionExceptions.toErrorMessage(desc) : InjectionExceptions.toErrorMessage(initializationCallingContext, desc); + ? InjectionExceptions.toErrorMessage(desc) + : InjectionExceptions.toErrorMessage(initializationCallingContext, desc); throw new InjectionException(msg); } } diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjector.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjector.java index 5fd3b160a07..fcf550582c2 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjector.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/DefaultInjector.java @@ -22,10 +22,10 @@ import io.helidon.inject.api.Activator; import io.helidon.inject.api.DeActivationRequest; import io.helidon.inject.api.DeActivator; +import io.helidon.inject.api.InjectionException; import io.helidon.inject.api.InjectionServiceProviderException; import io.helidon.inject.api.Injector; import io.helidon.inject.api.InjectorOptions; -import io.helidon.inject.api.InjectionException; import io.helidon.inject.api.ServiceProvider; /** diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionPlanBlueprint.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionPlanBlueprint.java index 0120881c68c..1c46b7e98a1 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionPlanBlueprint.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/HelidonInjectionPlanBlueprint.java @@ -19,12 +19,11 @@ import java.util.List; import io.helidon.builder.api.Prototype; -import io.helidon.inject.api.Application; import io.helidon.inject.spi.InjectionPlan; /** * The injection plan for a given service provider and element belonging to that service provider. This plan can be created during - * compile-time, and then just loaded from the {@link Application} during Injection bootstrap initialization, or it + * compile-time, and then just loaded from the {@link io.helidon.inject.api.Application} during Injection bootstrap initialization, or it * can be produced during the same startup processing sequence if the Application was not found, or if it was not permitted to be * loaded. */ diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java index 9cbeda54041..510c3183b56 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionApplicationServiceProvider.java @@ -18,8 +18,8 @@ import io.helidon.common.types.TypeName; import io.helidon.inject.api.Application; -import io.helidon.inject.api.Phase; import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Phase; import io.helidon.inject.api.Qualifier; import io.helidon.inject.api.ServiceInfo; diff --git a/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java index c65902eeb64..894dbacffa4 100644 --- a/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java +++ b/inject/runtime/src/main/java/io/helidon/inject/runtime/InjectionModuleServiceProvider.java @@ -17,8 +17,8 @@ package io.helidon.inject.runtime; import io.helidon.common.types.TypeName; -import io.helidon.inject.api.ModuleComponent; import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.ModuleComponent; import io.helidon.inject.api.Qualifier; import io.helidon.inject.api.ServiceInfo; diff --git a/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java b/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java index fc3effc2c3f..f176c4bdf31 100644 --- a/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java +++ b/inject/testing/src/main/java/io/helidon/inject/testing/InjectionTestingSupport.java @@ -25,13 +25,13 @@ import io.helidon.common.LazyValue; import io.helidon.config.Config; import io.helidon.config.ConfigSources; -import io.helidon.inject.api.InjectionServicesConfig; -import io.helidon.inject.api.ServiceBinder; -import io.helidon.inject.api.Services; import io.helidon.inject.api.Bootstrap; import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.InjectionServicesConfig; import io.helidon.inject.api.InjectionServicesHolder; +import io.helidon.inject.api.ServiceBinder; import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Services; import io.helidon.inject.runtime.ServiceBinderDefault; /** diff --git a/inject/testing/src/main/java/io/helidon/inject/testing/ReflectionBasedSingletonServiceProvider.java b/inject/testing/src/main/java/io/helidon/inject/testing/ReflectionBasedSingletonServiceProvider.java index 732afdf9654..16f25033e0e 100644 --- a/inject/testing/src/main/java/io/helidon/inject/testing/ReflectionBasedSingletonServiceProvider.java +++ b/inject/testing/src/main/java/io/helidon/inject/testing/ReflectionBasedSingletonServiceProvider.java @@ -21,13 +21,13 @@ import java.util.Objects; import io.helidon.common.types.TypeName; -import io.helidon.inject.api.ServiceProviderInjectionException; +import io.helidon.inject.api.InjectionServices; import io.helidon.inject.api.PostConstructMethod; import io.helidon.inject.api.PreDestroyMethod; -import io.helidon.inject.api.ServiceProvider; -import io.helidon.inject.api.InjectionServices; import io.helidon.inject.api.ServiceInfo; import io.helidon.inject.api.ServiceInfoBasics; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.ServiceProviderInjectionException; import io.helidon.inject.runtime.AbstractServiceProvider; /** diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCodeGenDetailBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCodeGenDetailBlueprint.java index 3a453e68056..ca834d187fc 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCodeGenDetailBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCodeGenDetailBlueprint.java @@ -19,12 +19,11 @@ import java.util.Optional; import io.helidon.builder.api.Prototype; -import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.api.DependenciesInfo; import io.helidon.inject.api.ServiceInfoBasics; /** - * The specifics for a single {@link ServiceProvider} that was code generated. + * The specifics for a single {@link io.helidon.inject.api.ServiceProvider} that was code generated. * * @see ActivatorCreatorResponse#serviceTypeDetails() */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorCodeGenBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorCodeGenBlueprint.java index d05bd8a23b1..177df961734 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorCodeGenBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorCodeGenBlueprint.java @@ -24,13 +24,6 @@ import io.helidon.common.types.TypeName; import io.helidon.config.metadata.ConfiguredOption; import io.helidon.inject.api.AccessModifier; -import io.helidon.inject.api.Activator; -import io.helidon.inject.api.Contract; -import io.helidon.inject.api.ExternalContracts; -import io.helidon.inject.api.ModuleComponent; -import io.helidon.inject.api.PostConstructMethod; -import io.helidon.inject.api.PreDestroyMethod; -import io.helidon.inject.api.RunLevel; import io.helidon.inject.api.DependenciesInfo; import io.helidon.inject.api.Qualifier; @@ -83,16 +76,16 @@ interface ActivatorCreatorCodeGenBlueprint { Map serviceTypeIsAbstractTypes(); /** - * The {@link Contract}'s associated with each service type. + * The {@link io.helidon.inject.api.Contract}'s associated with each service type. * - * @return the map of service type names to {@link Contract}'s implemented + * @return the map of service type names to {@link io.helidon.inject.api.Contract}'s implemented */ Map> serviceTypeContracts(); /** - * The {@link ExternalContracts} associated with each service type. + * The {@link io.helidon.inject.api.ExternalContracts} associated with each service type. * - * @return the map of service type names to {@link ExternalContracts} implemented + * @return the map of service type names to {@link io.helidon.inject.api.ExternalContracts} implemented */ Map> serviceTypeExternalContracts(); @@ -114,7 +107,7 @@ interface ActivatorCreatorCodeGenBlueprint { * The {@code PreDestroy} method name for each service type. * * @return the map of service type names to PreDestroy method names - * @see PreDestroyMethod + * @see io.helidon.inject.api.PreDestroyMethod */ Map serviceTypePreDestroyMethodNames(); @@ -122,7 +115,7 @@ interface ActivatorCreatorCodeGenBlueprint { * The {@code PostConstruct} method name for each service type. * * @return the map of service type names to PostConstruct method names - * @see PostConstructMethod + * @see io.helidon.inject.api.PostConstructMethod */ Map serviceTypePostConstructMethodNames(); @@ -134,7 +127,7 @@ interface ActivatorCreatorCodeGenBlueprint { Map serviceTypeWeights(); /** - * The declared {@link RunLevel} value for each service type. + * The declared {@link io.helidon.inject.api.RunLevel} value for each service type. * * @return the map of service type names to declared run level */ @@ -200,8 +193,8 @@ interface ActivatorCreatorCodeGenBlueprint { /** * Used in conjunction with {@link ActivatorCreatorConfigOptions#moduleCreated()}. * If a module is created and this set is - * populated then this set will be used to represent all {@link Activator} type names that should be code - * generated for this {@link ModuleComponent}. + * populated then this set will be used to represent all {@link io.helidon.inject.api.Activator} type names that should be code + * generated for this {@link io.helidon.inject.api.ModuleComponent}. * * @return all module activator type names known for this given module being processed */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorConfigOptionsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorConfigOptionsBlueprint.java index da8d74c270d..d68933bfc3e 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorConfigOptionsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorConfigOptionsBlueprint.java @@ -18,16 +18,12 @@ import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.inject.api.Application; -import io.helidon.inject.api.ModuleComponent; -import io.helidon.inject.api.InjectionServicesConfig; -import io.helidon.inject.tools.spi.ActivatorCreator; /** * These options are expected to have an affinity match to "permit" properties found within - * {@link InjectionServicesConfig}. These are used to fine tune the type of code generated. + * {@link io.helidon.inject.api.InjectionServicesConfig}. These are used to fine tune the type of code generated. * - * @see ActivatorCreator + * @see io.helidon.inject.tools.spi.ActivatorCreator */ @Prototype.Blueprint interface ActivatorCreatorConfigOptionsBlueprint { @@ -46,7 +42,7 @@ interface ActivatorCreatorConfigOptionsBlueprint { boolean supportsJsr330InStrictMode(); /** - * Should a {@link ModuleComponent} be created during activator creation. The default is true. + * Should a {@link io.helidon.inject.api.ModuleComponent} be created during activator creation. The default is true. * * @return true if the module should be created */ @@ -54,7 +50,7 @@ interface ActivatorCreatorConfigOptionsBlueprint { boolean moduleCreated(); /** - * Should a stub {@link Application} be created during activator creation. The default is false. + * Should a stub {@link io.helidon.inject.api.Application} be created during activator creation. The default is false. * This feature can opt'ed in by using {@code inject.application.pre.create}. Pre-req requires that this can * only be enabled if {@link #moduleCreated()} is also enabled. * diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorDefault.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorDefault.java index 1a63368364e..3c105ee756e 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorDefault.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorDefault.java @@ -41,19 +41,19 @@ import io.helidon.inject.api.AccessModifier; import io.helidon.inject.api.Activator; import io.helidon.inject.api.DeActivator; -import io.helidon.inject.api.ModuleComponent; -import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.api.DependenciesInfo; import io.helidon.inject.api.DependencyInfo; import io.helidon.inject.api.DependencyInfoComparator; import io.helidon.inject.api.ElementInfo; import io.helidon.inject.api.ElementKind; import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.ModuleComponent; import io.helidon.inject.api.Qualifier; import io.helidon.inject.api.RunLevel; import io.helidon.inject.api.ServiceInfo; import io.helidon.inject.api.ServiceInfoBasics; import io.helidon.inject.api.ServiceInfoCriteria; +import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.runtime.AbstractServiceProvider; import io.helidon.inject.runtime.Dependencies; import io.helidon.inject.tools.spi.ActivatorCreator; diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorRequestBlueprint.java index 2467965735b..b313c9e712a 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorRequestBlueprint.java @@ -17,12 +17,10 @@ package io.helidon.inject.tools; import io.helidon.builder.api.Prototype; -import io.helidon.inject.api.Activator; -import io.helidon.inject.tools.spi.ActivatorCreator; /** - * Request used in conjunction with {@link ActivatorCreator} to codegen the - * {@link Activator} source artifacts. + * Request used in conjunction with {@link io.helidon.inject.tools.spi.ActivatorCreator} to codegen the + * {@link io.helidon.inject.api.Activator} source artifacts. */ @Prototype.Blueprint interface ActivatorCreatorRequestBlueprint extends GeneralCreatorRequestBlueprint { diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorResponseBlueprint.java index 0344b909beb..5f548dc8a0d 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ActivatorCreatorResponseBlueprint.java @@ -22,11 +22,9 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; -import io.helidon.inject.api.ModuleComponent; -import io.helidon.inject.tools.spi.ActivatorCreator; /** - * The result of calling {@link ActivatorCreator} assuming no errors are thrown. + * The result of calling {@link io.helidon.inject.tools.spi.ActivatorCreator} assuming no errors are thrown. */ @Prototype.Blueprint interface ActivatorCreatorResponseBlueprint extends GeneralCreatorResponseBlueprint { @@ -47,7 +45,7 @@ interface ActivatorCreatorResponseBlueprint extends GeneralCreatorResponseBluepr Map serviceTypeInterceptorPlans(); /** - * The activator types placed in the generated {@link ModuleComponent}. + * The activator types placed in the generated {@link io.helidon.inject.api.ModuleComponent}. * * @return the activator type names placed in the module component */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorCodeGenBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorCodeGenBlueprint.java index af4df737eff..0abd3b7f8c8 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorCodeGenBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorCodeGenBlueprint.java @@ -20,12 +20,11 @@ import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Codegen request options applicable for {@link ApplicationCreator}. + * Codegen request options applicable for {@link io.helidon.inject.tools.spi.ApplicationCreator}. * - * @see ApplicationCreator + * @see io.helidon.inject.tools.spi.ApplicationCreator */ @Prototype.Blueprint interface ApplicationCreatorCodeGenBlueprint { diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorConfigOptionsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorConfigOptionsBlueprint.java index f7289ebeea5..d2378a794ed 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorConfigOptionsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorConfigOptionsBlueprint.java @@ -21,10 +21,9 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Configuration directives and options optionally provided to the {@link ApplicationCreator}. + * Configuration directives and options optionally provided to the {@link io.helidon.inject.tools.spi.ApplicationCreator}. */ @Prototype.Blueprint interface ApplicationCreatorConfigOptionsBlueprint { diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorRequestBlueprint.java index 35202deae6c..d32b647bb1b 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorRequestBlueprint.java @@ -19,10 +19,9 @@ import java.util.Optional; import io.helidon.builder.api.Prototype; -import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Defines the request that will be passed to the {@link ApplicationCreator} in order to produce the + * Defines the request that will be passed to the {@link io.helidon.inject.tools.spi.ApplicationCreator} in order to produce the * codegen artifacts. */ @Prototype.Blueprint diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorResponseBlueprint.java index d47f9aee7ab..e09d71c4a46 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ApplicationCreatorResponseBlueprint.java @@ -17,19 +17,17 @@ package io.helidon.inject.tools; import io.helidon.builder.api.Prototype; -import io.helidon.inject.api.Application; -import io.helidon.inject.tools.spi.ApplicationCreator; /** - * Response from {@link ApplicationCreator}. + * Response from {@link io.helidon.inject.tools.spi.ApplicationCreator}. * - * @see ApplicationCreator + * @see io.helidon.inject.tools.spi.ApplicationCreator */ @Prototype.Blueprint public interface ApplicationCreatorResponseBlueprint extends GeneralCreatorResponseBlueprint { /** - * The basic description for the {@link Application} generated. + * The basic description for the {@link io.helidon.inject.api.Application} generated. * * @return describes the application generated (package and class) */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenFiler.java b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenFiler.java index 91908307c42..8b7486bc966 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenFiler.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenFiler.java @@ -365,7 +365,8 @@ Optional codegenModuleInfoFilerOut(ModuleInfoDescriptor newDeltaDescriptor } if (!newDeltaDescriptor.isUnnamed()) { - ModuleUtils.saveAppPackageName(scratchBaseOutputPath, ModuleUtils.normalizedBaseModuleName(newDeltaDescriptor.name())); + ModuleUtils.saveAppPackageName(scratchBaseOutputPath, + ModuleUtils.normalizedBaseModuleName(newDeltaDescriptor.name())); } return filePath; diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenInterceptorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenInterceptorRequestBlueprint.java index 0d612a06a30..623a2d62198 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenInterceptorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenInterceptorRequestBlueprint.java @@ -20,10 +20,9 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; -import io.helidon.inject.tools.spi.ActivatorCreator; /** - * Used by {@link ActivatorCreator#codegenInterceptors}. + * Used by {@link io.helidon.inject.tools.spi.ActivatorCreator#codegenInterceptors}. */ @Prototype.Blueprint interface CodeGenInterceptorRequestBlueprint { diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenPathsBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenPathsBlueprint.java index 58bdf52c07b..0e3226c46f5 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenPathsBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CodeGenPathsBlueprint.java @@ -20,11 +20,10 @@ import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.inject.tools.spi.ActivatorCreator; /** * Applies only to the output paths that various {@code creators} will use (e.g., - * {@link ActivatorCreator}). + * {@link io.helidon.inject.tools.spi.ActivatorCreator}). */ @Prototype.Blueprint interface CodeGenPathsBlueprint { diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateRequestBlueprint.java index 3802532c69d..3e6c752fd53 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateRequestBlueprint.java @@ -25,11 +25,10 @@ import io.helidon.config.metadata.ConfiguredOption; import io.helidon.inject.api.AccessModifier; import io.helidon.inject.api.ServiceInfoBasics; -import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** * The request will be generated internally and then passed to the appropriate - * {@link CustomAnnotationTemplateCreator} to handle the request. + * {@link io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator} to handle the request. */ @Prototype.Blueprint interface CustomAnnotationTemplateRequestBlueprint { @@ -72,7 +71,7 @@ interface CustomAnnotationTemplateRequestBlueprint { boolean isElementStatic(); /** - * Projects the {@link #enclosingTypeInfo()} as a {@link ServiceInfoBasics} type. + * Projects the {@link #enclosingTypeInfo()} as a {@link io.helidon.inject.api.ServiceInfoBasics} type. * * @return the basic service info of the element being processed */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponseBlueprint.java index 447d68d16aa..1e39c5e9260 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/CustomAnnotationTemplateResponseBlueprint.java @@ -21,10 +21,9 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; -import io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator; /** - * The response from {@link CustomAnnotationTemplateCreator#create(CustomAnnotationTemplateRequest)}. + * The response from {@link io.helidon.inject.tools.spi.CustomAnnotationTemplateCreator#create(CustomAnnotationTemplateRequest)}. */ @Prototype.Blueprint interface CustomAnnotationTemplateResponseBlueprint { diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorDefault.java b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorDefault.java index e792b95c526..ffc3080880d 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorDefault.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorDefault.java @@ -76,7 +76,7 @@ static boolean isInjectionSupported(TypeName serviceTypeName, MethodInfo methodInfo, System.Logger logger) { return InjectionSupported.isSupportedInjectionPoint(logger, serviceTypeName, methodInfo.toString(), - TypeTools.isPrivate(methodInfo.getModifiers()), methodInfo.isStatic()); + TypeTools.isPrivate(methodInfo.getModifiers()), methodInfo.isStatic()); } @Override @@ -313,8 +313,8 @@ private Dependencies.BuilderContinuation continuationProcess(TypeName serviceTyp FieldInfo fieldInfo) { if (TypeTools.hasAnnotation(fieldInfo, TypeNames.JAKARTA_INJECT)) { if (!InjectionSupported.isSupportedInjectionPoint(logger(), - serviceTypeName, fieldInfo.toString(), - TypeTools.isPrivate(fieldInfo.getModifiers()), fieldInfo.isStatic())) { + serviceTypeName, fieldInfo.toString(), + TypeTools.isPrivate(fieldInfo.getModifiers()), fieldInfo.isStatic())) { return continuation; } diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorRequestBlueprint.java index 1591e1591b5..5b12e7d574f 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorRequestBlueprint.java @@ -22,10 +22,9 @@ import io.helidon.builder.api.Prototype; import io.helidon.inject.api.Qualifier; -import io.helidon.inject.tools.spi.ExternalModuleCreator; /** - * The request payload that is used by {@link ExternalModuleCreator}. + * The request payload that is used by {@link io.helidon.inject.tools.spi.ExternalModuleCreator}. *

      * Note that the thread context classloader should be setup appropriately so that service types can be resolved * based upon the packages requested to scan. diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorResponseBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorResponseBlueprint.java index 98bf840bca7..9bcd24ececb 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorResponseBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ExternalModuleCreatorResponseBlueprint.java @@ -17,14 +17,12 @@ package io.helidon.inject.tools; import io.helidon.builder.api.Prototype; -import io.helidon.inject.tools.spi.ActivatorCreator; -import io.helidon.inject.tools.spi.ExternalModuleCreator; /** - * The response from {@link ExternalModuleCreator}. + * The response from {@link io.helidon.inject.tools.spi.ExternalModuleCreator}. *

      * The response, if successful, will contribute to the {@link ActivatorCreatorRequest} - * passed to {@link ActivatorCreator} in any next phase of creation for the external module. + * passed to {@link io.helidon.inject.tools.spi.ActivatorCreator} in any next phase of creation for the external module. */ @Prototype.Blueprint interface ExternalModuleCreatorResponseBlueprint extends GeneralCreatorResponseBlueprint { diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenNamesBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenNamesBlueprint.java index b1b8d291af7..aa9619dff79 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenNamesBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCodeGenNamesBlueprint.java @@ -20,8 +20,6 @@ import io.helidon.builder.api.Prototype; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.inject.api.Application; -import io.helidon.inject.api.ModuleComponent; /** * General code gen information. @@ -39,7 +37,7 @@ interface GeneralCodeGenNamesBlueprint { /** * The module name. - * This name is used primarily to serve as the codegen name for the {@link ModuleComponent} that is + * This name is used primarily to serve as the codegen name for the {@link io.helidon.inject.api.ModuleComponent} that is * generated. * * @return module name @@ -47,8 +45,8 @@ interface GeneralCodeGenNamesBlueprint { Optional moduleName(); /** - * The package name to use for the generated {@link ModuleComponent}, - * {@link Application}, etc. + * The package name to use for the generated {@link io.helidon.inject.api.ModuleComponent}, + * {@link io.helidon.inject.api.Application}, etc. * If one is not provided, one will be determined internally. * * @return the suggested package name, otherwise passing null will delegate package naming to the implementation heuristic diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorRequestBlueprint.java index 9d1f29b6709..351bdce4005 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/GeneralCreatorRequestBlueprint.java @@ -52,7 +52,7 @@ interface GeneralCreatorRequestBlueprint extends GeneralCodeGenNamesBlueprint { Optional compilerOptions(); /** - * The complete list of service type names belonging to the {@link io.helidon.pico.api.ModuleComponent}. + * The complete list of service type names belonging to the {@link io.helidon.inject.api.ModuleComponent}. *

      * Assumptions: *

        @@ -65,7 +65,7 @@ interface GeneralCreatorRequestBlueprint extends GeneralCodeGenNamesBlueprint { List serviceTypeNames(); /** - * The complete list of service type names that should be code generated into {@link io.helidon.pico.api.Activator}'s. + * The complete list of service type names that should be code generated into {@link io.helidon.inject.api.Activator}'s. * * @return the complete list of service type names to code generated */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/InterceptedElementBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptedElementBlueprint.java index 84329559e11..ddc72e1fcef 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/InterceptedElementBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptedElementBlueprint.java @@ -19,21 +19,19 @@ import java.util.Set; import io.helidon.builder.api.Prototype; -import io.helidon.inject.api.ElementKind; -import io.helidon.inject.api.InterceptedTrigger; /** * Used in the interception model described by {@link InterceptionPlan}. An intercepted - * element typically refers to a {@link ElementKind#CONSTRUCTOR} or - * {@link ElementKind#METHOD} that qualifies for interception. If, however, - * the {@link InterceptedTrigger} is applied on the enclosing service type then all public methods. + * element typically refers to a {@link io.helidon.inject.api.ElementKind#CONSTRUCTOR} or + * {@link io.helidon.inject.api.ElementKind#METHOD} that qualifies for interception. If, however, + * the {@link io.helidon.inject.api.InterceptedTrigger} is applied on the enclosing service type then all public methods. * Note that only public methods on Helidon injection-activated services can be intercepted. */ @Prototype.Blueprint interface InterceptedElementBlueprint { /** - * The set of {@link InterceptedTrigger} types that apply to this method/element. + * The set of {@link io.helidon.inject.api.InterceptedTrigger} types that apply to this method/element. * * @return the set of intercepted trigger types that apply to this method/element */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/InterceptionPlanBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptionPlanBlueprint.java index 6195f060daa..a2fa169e5ab 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/InterceptionPlanBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/InterceptionPlanBlueprint.java @@ -22,7 +22,6 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.Annotation; import io.helidon.common.types.TypeName; -import io.helidon.inject.api.ServiceInfoBasics; /** * Once a service type qualifies for interception, the interception plan will be created describing how the service type @@ -36,7 +35,7 @@ interface InterceptionPlanBlueprint { * * @return the intercepted service */ - ServiceInfoBasics interceptedService(); + io.helidon.inject.api.ServiceInfoBasics interceptedService(); /** * Annotations at the service type level. @@ -54,7 +53,7 @@ interface InterceptionPlanBlueprint { /** * The interfaces that this service implements (usually a superset of - * {@link ServiceInfoBasics#contractsImplemented()}). + * {@link io.helidon.inject.api.ServiceInfoBasics#contractsImplemented()}). * * @return the interfaces implemented */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/MethodElementInfoBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/MethodElementInfoBlueprint.java index 1220e848ff1..27aa8087382 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/MethodElementInfoBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/MethodElementInfoBlueprint.java @@ -19,7 +19,6 @@ import java.util.List; import io.helidon.builder.api.Prototype; -import io.helidon.inject.api.ElementKind; import io.helidon.inject.api.ElementInfo; /** @@ -30,7 +29,7 @@ interface MethodElementInfoBlueprint extends ElementInfo { /** * The list of "throws" that the method throws. Applies only to - * {@link ElementKind#METHOD} element types. + * {@link io.helidon.inject.api.ElementKind#METHOD} element types. * * @return the list of throwable types this method may throw */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleDetailBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleDetailBlueprint.java index 908a13fd344..ca90f1f707e 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleDetailBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleDetailBlueprint.java @@ -21,10 +21,9 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; -import io.helidon.inject.api.ModuleComponent; /** - * The specifics for a single {@link ModuleComponent} that was codegen'ed. + * The specifics for a single {@link io.helidon.inject.api.ModuleComponent} that was codegen'ed. * * @see ActivatorCreatorResponse#moduleDetail */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoCreatorRequestBlueprint.java b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoCreatorRequestBlueprint.java index 53d14a428cf..15d2df34b0c 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoCreatorRequestBlueprint.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/ModuleInfoCreatorRequestBlueprint.java @@ -24,13 +24,11 @@ import io.helidon.builder.api.Prototype; import io.helidon.common.types.TypeName; import io.helidon.config.metadata.ConfiguredOption; -import io.helidon.inject.api.Application; -import io.helidon.inject.api.ModuleComponent; /** * Used to represent the parameters that feed into the code generation of a module-info file specifically for Injection in that - * it offers easy ability to add the {@link ModuleComponent} as well as optionally the - * {@link Application}. + * it offers easy ability to add the {@link io.helidon.inject.api.ModuleComponent} as well as optionally the + * {@link io.helidon.inject.api.Application}. */ @Prototype.Blueprint interface ModuleInfoCreatorRequestBlueprint { @@ -43,21 +41,21 @@ interface ModuleInfoCreatorRequestBlueprint { Optional name(); /** - * The {@link ModuleComponent} type name. + * The {@link io.helidon.inject.api.ModuleComponent} type name. * * @return module type name */ TypeName moduleTypeName(); /** - * The {@link Application} type name. + * The {@link io.helidon.inject.api.Application} type name. * * @return application type name */ Optional applicationTypeName(); /** - * Set to true if the {@link ModuleComponent} should be created. + * Set to true if the {@link io.helidon.inject.api.ModuleComponent} should be created. * * @return true if the Module should be created */ @@ -65,7 +63,7 @@ interface ModuleInfoCreatorRequestBlueprint { boolean moduleCreated(); /** - * Set to true if the {@link Application} should be created. + * Set to true if the {@link io.helidon.inject.api.Application} should be created. * * @return true if the Application should be created */ diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java b/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java index b6b9d455fe2..359021894cc 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/TypeTools.java @@ -55,9 +55,9 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypeValues; import io.helidon.inject.api.AccessModifier; -import io.helidon.inject.api.InjectionPointProvider; import io.helidon.inject.api.ElementInfo; import io.helidon.inject.api.InjectionPointInfo; +import io.helidon.inject.api.InjectionPointProvider; import io.helidon.inject.api.Qualifier; import io.helidon.inject.api.ServiceInfoCriteria; import io.helidon.inject.runtime.Dependencies; diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/spi/ActivatorCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ActivatorCreator.java index d0b17553f37..4880e233b0a 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/spi/ActivatorCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/ActivatorCreator.java @@ -18,10 +18,10 @@ import io.helidon.common.types.TypeName; import io.helidon.inject.api.Activator; +import io.helidon.inject.api.Contract; import io.helidon.inject.api.ModuleComponent; import io.helidon.inject.api.ServiceProvider; import io.helidon.inject.api.Services; -import io.helidon.inject.api.Contract; import io.helidon.inject.tools.ActivatorCreatorProvider; import io.helidon.inject.tools.ActivatorCreatorRequest; import io.helidon.inject.tools.ActivatorCreatorResponse; diff --git a/inject/tools/src/main/java/io/helidon/inject/tools/spi/InterceptorCreator.java b/inject/tools/src/main/java/io/helidon/inject/tools/spi/InterceptorCreator.java index ddcec8d80bf..856d27d12df 100644 --- a/inject/tools/src/main/java/io/helidon/inject/tools/spi/InterceptorCreator.java +++ b/inject/tools/src/main/java/io/helidon/inject/tools/spi/InterceptorCreator.java @@ -22,8 +22,8 @@ import javax.annotation.processing.ProcessingEnvironment; -import io.helidon.inject.api.InterceptedTrigger; import io.helidon.inject.api.Contract; +import io.helidon.inject.api.InterceptedTrigger; import io.helidon.inject.api.ServiceInfoBasics; import io.helidon.inject.tools.InterceptionPlan; import io.helidon.inject.tools.InterceptorCreatorProvider; diff --git a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java index 5d5dcdb6d2c..dc03b9b64aa 100644 --- a/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java +++ b/integrations/oci/sdk/runtime/src/main/java/io/helidon/integrations/oci/sdk/runtime/OciRegionProvider.java @@ -19,8 +19,8 @@ import java.util.Optional; import io.helidon.common.Weight; -import io.helidon.inject.api.InjectionPointInfo; import io.helidon.inject.api.ContextualServiceQuery; +import io.helidon.inject.api.InjectionPointInfo; import io.helidon.inject.api.InjectionPointProvider; import io.helidon.inject.api.InjectionServices; import io.helidon.inject.api.ServiceInfoBasics; diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java index 5d5460fdc54..5b222a15546 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/AsyncInterceptor.java @@ -24,8 +24,8 @@ import io.helidon.common.types.Annotation; import io.helidon.common.types.TypedElementInfo; import io.helidon.inject.api.ClassNamed; -import io.helidon.inject.api.Interceptor; import io.helidon.inject.api.InjectionServices; +import io.helidon.inject.api.Interceptor; import jakarta.inject.Singleton; diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java index 035f2ed5b07..363b736677e 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/FallbackInterceptor.java @@ -23,9 +23,9 @@ import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; import io.helidon.inject.api.ClassNamed; +import io.helidon.inject.api.InjectionException; import io.helidon.inject.api.InjectionServices; import io.helidon.inject.api.InvocationContext; -import io.helidon.inject.api.InjectionException; import jakarta.inject.Singleton; diff --git a/nima/http/processor/src/main/resources/templates/pico/nima/http-endpoint.java.hbs b/nima/http/processor/src/main/resources/templates/inject/nima/http-endpoint.java.hbs similarity index 100% rename from nima/http/processor/src/main/resources/templates/pico/nima/http-endpoint.java.hbs rename to nima/http/processor/src/main/resources/templates/inject/nima/http-endpoint.java.hbs diff --git a/nima/http/processor/src/main/resources/templates/pico/nima/http-method.java.hbs b/nima/http/processor/src/main/resources/templates/inject/nima/http-method.java.hbs similarity index 100% rename from nima/http/processor/src/main/resources/templates/pico/nima/http-method.java.hbs rename to nima/http/processor/src/main/resources/templates/inject/nima/http-method.java.hbs diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java index 0beda3654ac..e2e632c056c 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/LoomServer.java @@ -43,15 +43,15 @@ import io.helidon.common.context.Context; import io.helidon.common.features.HelidonFeatures; import io.helidon.common.features.api.HelidonFlavor; +import io.helidon.inject.api.ServiceProvider; +import io.helidon.inject.api.Startable; +import io.helidon.inject.configdriven.api.ConfigDriven; import io.helidon.nima.common.tls.Tls; import io.helidon.nima.http.encoding.ContentEncodingContext; import io.helidon.nima.http.media.MediaContext; import io.helidon.nima.webserver.http.DirectHandlers; import io.helidon.nima.webserver.http.HttpFeature; import io.helidon.nima.webserver.http.HttpRouting; -import io.helidon.inject.api.ServiceProvider; -import io.helidon.inject.api.Startable; -import io.helidon.inject.configdriven.api.ConfigDriven; import jakarta.annotation.PreDestroy; import jakarta.inject.Inject; diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java index acbb488d802..8a80017b68a 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/WebServer.java @@ -20,8 +20,8 @@ import io.helidon.builder.api.RuntimeType; import io.helidon.common.context.Context; -import io.helidon.nima.common.tls.Tls; import io.helidon.inject.api.Contract; +import io.helidon.nima.common.tls.Tls; /** * Server that opens server sockets and handles requests through routing. diff --git a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java index 0262ff845e5..e5beab85a9c 100644 --- a/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java +++ b/nima/webserver/webserver/src/main/java/io/helidon/nima/webserver/http/HttpFeature.java @@ -18,9 +18,9 @@ import java.util.function.Supplier; +import io.helidon.inject.api.Contract; import io.helidon.nima.webserver.ServerLifecycle; import io.helidon.nima.webserver.WebServer; -import io.helidon.inject.api.Contract; /** * Can be registered with {@link io.helidon.nima.webserver.http.HttpRouting.Builder#addFeature(java.util.function.Supplier)}. From e533f0ed82a900617a1dfb5c6e8eba3ed17212f0 Mon Sep 17 00:00:00 2001 From: Jeff Trent Date: Wed, 12 Jul 2023 11:35:08 -0400 Subject: [PATCH 4/5] more fixes --- examples/inject/basics/pom.xml | 2 +- .../java/io/helidon/nima/faulttolerance/InterceptorBase.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/inject/basics/pom.xml b/examples/inject/basics/pom.xml index b4022e9a3aa..9a383beb782 100644 --- a/examples/inject/basics/pom.xml +++ b/examples/inject/basics/pom.xml @@ -62,7 +62,7 @@ -Ainject.autoAddNonContractInterfaces=false - -inject.debug=false + -Dinject.debug=false true diff --git a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java index b5ea1a3e9d6..68787af18cf 100644 --- a/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java +++ b/nima/fault-tolerance/fault-tolerance/src/main/java/io/helidon/nima/faulttolerance/InterceptorBase.java @@ -27,9 +27,9 @@ import io.helidon.common.GenericType; import io.helidon.common.types.TypeName; import io.helidon.common.types.TypedElementInfo; +import io.helidon.inject.api.InjectionException; import io.helidon.inject.api.Interceptor; import io.helidon.inject.api.InvocationContext; -import io.helidon.inject.api.InjectionException; import io.helidon.inject.api.Qualifier; import io.helidon.inject.api.ServiceInfoCriteria; import io.helidon.inject.api.ServiceProvider; From ebfc563d77e23cfe9705d29af8f1658dc0d8c1e9 Mon Sep 17 00:00:00 2001 From: Jeff Trent Date: Wed, 12 Jul 2023 12:26:24 -0400 Subject: [PATCH 5/5] fix example pom --- examples/inject/basics/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inject/basics/pom.xml b/examples/inject/basics/pom.xml index 9a383beb782..779dd882c98 100644 --- a/examples/inject/basics/pom.xml +++ b/examples/inject/basics/pom.xml @@ -62,7 +62,7 @@ -Ainject.autoAddNonContractInterfaces=false - -Dinject.debug=false + -Ainject.debug=false true