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

Proposal: Use javax.cache.annotation.CacheDefaults when injecting JCache #1124

Closed
jerrinot opened this issue Oct 6, 2016 · 4 comments
Closed

Comments

@jerrinot
Copy link
Contributor

jerrinot commented Oct 6, 2016

Payara uses CacheDefaults for cache resolution in the CDI interceptor as the spec mandates.

I believe it would make a lot of sense to use CacheDefaults as a cache resolution strategy when injecting JCache via @Inject.

Currently it does use name of a declaring class as a cache name. There is also the @NamedCache but that creates a dependency on Payara-specific code.

@jerrinot jerrinot changed the title IDEA: Use javax.cache.annotation.CacheDefaults for resolve JCache IDEA: Use javax.cache.annotation.CacheDefaults to resolve JCache name Oct 6, 2016
@jerrinot jerrinot changed the title IDEA: Use javax.cache.annotation.CacheDefaults to resolve JCache name IDEA: Use javax.cache.annotation.CacheDefaults when injecting JCache Oct 6, 2016
@jerrinot jerrinot changed the title IDEA: Use javax.cache.annotation.CacheDefaults when injecting JCache Proposal: Use javax.cache.annotation.CacheDefaults when injecting JCache Oct 6, 2016
@smillidge
Copy link
Contributor

Do you fancy making a PR to demonstrate?

@jerrinot
Copy link
Contributor Author

jerrinot commented Oct 6, 2016

I'll have a look at it.

The main issue I can foresee is a potential clash with the official Java EE - JCache integration. If the EG decided to not use the @CacheDefaults as a default name for caches injected via @Inject.

jerrinot added a commit to jerrinot/microprofile-conference that referenced this issue Oct 6, 2016
jerrinot added a commit to jerrinot/Payara that referenced this issue Oct 6, 2016
jerrinot added a commit to jerrinot/microprofile-conference that referenced this issue Oct 6, 2016
@gregrluck
Copy link

Lets cross that bridge when we get to it.

@OndroMih OndroMih added this to the Payara 4.1.1.164 milestone Nov 21, 2016
@Quix0r
Copy link

Quix0r commented Jan 28, 2019

So there is currently no other way to @Inject JCache than with Payara's @NamedCache? I would like to write my WAR project independent (I may call it portable) rather than bounded to a (vendor-)specific container and maybe major/minor version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants