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

Makes ApplicationPath a bean defining annotation #9582

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spericas
Copy link
Member

@spericas spericas commented Dec 10, 2024

Description

Makes @ApplicationPath a bean defining annotation. New functional test that shows support for this new feature.

See #8502

Documentation

Needs to be updated

@spericas spericas added enhancement New feature or request webserver 4.x Version 4.x labels Dec 10, 2024
@spericas spericas added this to the 4.x milestone Dec 10, 2024
@spericas spericas self-assigned this Dec 10, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 10, 2024
@spericas spericas marked this pull request as draft December 10, 2024 21:06

/**
* Use {@link ApplicationPath} as a bean-defining annotation (BDA). Note that
* there is no CDI scope annotation on the class.
Copy link
Member

@ljnelson ljnelson Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(…which normally means it is therefore in @Dependent scope, since you've made it a bean. Is that OK? Maybe @ApplicationPath should be a CDI stereotype, which can explicitly include scopes?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the same way resources are in @Dependent scope by default. Jersey should still create an instance "per application".

@ljnelson
Copy link
Member

Personally I'm mildly -1 for these kinds of changes, as making @Path and @ApplicationPath and so on bean-defining annotations is a little bit mysterious. I think everything we do via this mechanism could be done using stereotypes instead, which are inherently bean-defining and can be tested, inspected, etc. at runtime, but I'm not honestly sure.

@spericas
Copy link
Member Author

Personally I'm mildly -1 for these kinds of changes, as making @Path and @ApplicationPath and so on bean-defining annotations is a little bit mysterious. I think everything we do via this mechanism could be done using stereotypes instead, which are inherently bean-defining and can be tested, inspected, etc. at runtime, but I'm not honestly sure.

I understand, but as @romain-grecourt pointed out, it is inconsistent the way it is now between @Path and @ApplicationPath, and that's confusing for developers. Going back on @Path would be backward incompatible.

@spericas spericas marked this pull request as ready for review December 11, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x enhancement New feature or request OCA Verified All contributors have signed the Oracle Contributor Agreement. webserver
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants