-
Notifications
You must be signed in to change notification settings - Fork 39
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
Provide literals for built-in annotations #82
Comments
* #82 - Added simple annotation literal for AutoApplySession Signed-off-by: arjantijms <[email protected]> * #82 - Literals for built-in annotations Signed-off-by: arjantijms <[email protected]>
Why a no-op An |
With INSTANCE you'd expect a constant. The CDI examples all use There needs to be something to kickoff the builder. Open to suggestions in a followup PR. |
P.s. an alternative I was playing with is:
Where It reads a bit nicer, but you'd have to import these methods, which may be a bit less self-discovery than chaining builders calls. Thoughts? |
I'll propose something along the lines of RememberMe literal = RememberMe.Literal.builder()
.cookieMaxAgeSeconds(100)
.cookieSecureOnly(false)
.cookieHttpOnly(false)
.build(); As the method does not return |
Since CDI 2.0, CDI provides annotation literals for many of its annotations (see https://issues.jboss.org/browse/CDI-485).
Just as the built-in CDI annotations, EE Security annotation literals are also being implemented by projects. As a public example, see https://github.com/javaee-samples/javaee8-samples/blob/master/security/dynamic-rememberme/src/main/java/org/javaee8/security/dynamic/rememberme/util/RememberMeAnnotationLiteral.java
Literals are useful for looking up bean instances using the bean manager, as well as when applying interceptors dynamically.
The text was updated successfully, but these errors were encountered: