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

Make Application subclasses available via our context during Feature executions #4745

Merged
merged 3 commits into from Aug 22, 2022

Conversation

spericas
Copy link
Member

A global/shared Feature is executed for each Application subclass. This change makes the Application subclass available to the Feature during its execution. Just like for requests, the availability is through the Helidon context. Updated functional tests for multiple apps.

…is change makes the Application subclass available to the Feature during its execution. Just like for requests, the availability is through the Helidon context. Updated functional tests for multiple apps.
@spericas spericas added MP jax-rs JAX-RS and Jersey related issues wip labels Aug 16, 2022
@spericas spericas added this to the 2.5.2 milestone Aug 16, 2022
@spericas spericas self-assigned this Aug 16, 2022
@tjquinno
Copy link
Member

IIUC the developer's code (if it cares) needs to check which app the feature corresponds to. I see that the changes to the main (non-test) Helidon code now set the app subclass in the context but only the tests (i.e., the user code) retrieve it.

Or put another way, there is no other Helidon code that directly uses features and therefore might need to look at the app subclass?

@spericas
Copy link
Member Author

IIUC the developer's code (if it cares) needs to check which app the feature corresponds to.

Yes, a Feature is executed for each app for which it is part of.

I see that the changes to the main (non-test) Helidon code now set the app subclass in the context but only the tests (i.e., the user code) retrieve it.

Yes, this is mostly for user's logic. We already make it available during execution (e.g. in a request filter) and also as part of the Helidon context.

Or put another way, there is no other Helidon code that directly uses features and therefore might need to look at the app subclass?

Right, I don't believe we use Features in Helidon (we use AutoDiscoverable from Jersey). This is mostly for app developers.

@spericas spericas merged commit 837f08a into helidon-io:helidon-2.x Aug 22, 2022
spericas added a commit that referenced this pull request Aug 24, 2022
…executions (#4745)

* A global/shared Feature is executed for each Application subclass. This change makes the Application subclass available to the Feature during its execution. Just like for requests, the availability is through the Helidon context. Updated functional tests for multiple apps.

* Small code improvement and fixed typo in copyright.

* Handle case when Application subclass is not available via CDI.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
spericas added a commit that referenced this pull request Aug 24, 2022
…executions (3.x) (#4786)

* Make Application subclasses available via our context during Feature executions (#4745)

* A global/shared Feature is executed for each Application subclass. This change makes the Application subclass available to the Feature during its execution. Just like for requests, the availability is through the Helidon context. Updated functional tests for multiple apps.

* Small code improvement and fixed typo in copyright.

* Handle case when Application subclass is not available via CDI.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>

* Switched to jakarta packages.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
@spericas spericas added this to Done in 2.5.3 Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jax-rs JAX-RS and Jersey related issues MP
Projects
Backlog
  
Awaiting triage
2.5.3
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants