Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.x: Helidon Services Inject #8400

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tomas-langer
Copy link
Member

@tomas-langer tomas-langer commented Feb 20, 2024

Resolves #7957
Resolves #6647
Resolves #5697
Resolves #8222
Resolves #7083
Resolves #7052
Resolves #6768
Resolves #6646
Resolves #6620

Description

Helidon services provides a replacement for service loader with some additional features - module helidon-service-registry
In addition we have a module with full injection, config driven, and interception support - helidon-service-inject-api and helidon-service-inject (API and implementation)

Best place to check the features and generated code is in the service/tests and service/tests/inject modules.

The PR contains also initial code for Helidon declarative, though that is not yet fully done.

This PR is ready for review of the concepts, generated code, module structure (service module and its children).

Removed the requirement to modify module-info.java by the user, as we use our own way of discovering and loading services.

Request scope is now an optional feature even when using HTTP. This is achieved by compile time extension to support parameters through source code + additional set of services that support the same using request scope

Known Todos

  • create a declarative startup class (so we can use io.helidon.Main)
  • services in HTTP, webserver, security, and config module are experimental, and cause some issues, will revisit
  • done: add support for native image to make our service loader work without any user configuration
  • done: renaming within service-codegen, as it still uses the old inject based naming

New stuff unrelated to services

  • service module uses dependency checking maven plugin
  • service module is configured to fail on javadoc warning

@tomas-langer tomas-langer self-assigned this Feb 20, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 20, 2024
@tomas-langer
Copy link
Member Author

Rebased
Added support for interception based on annotated interface methods

* Renamed Dependent to Instance as that better describes the behavior (dependent implies full lifecycle)
* Added tests for core supplier services to injection tests to verify behavior is aligned
@tomas-langer tomas-langer changed the title 5.x: Helidon Services 5.x: Helidon Services Inject Jun 26, 2024
@tomas-langer
Copy link
Member Author

Rebased on main, now only inject and maven-plugin modules (+ tests).
I will re-introduce the declarative sections when I am sure how we want to attack it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
2 participants