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

Allow the CaffeineCachingProvider to be used with OSGi DS #447

Closed
raducotescu opened this issue Aug 18, 2020 · 1 comment · Fixed by #448
Closed

Allow the CaffeineCachingProvider to be used with OSGi DS #447

raducotescu opened this issue Aug 18, 2020 · 1 comment · Fixed by #448

Comments

@raducotescu
Copy link
Contributor

Although the jcache module is an OSGi bundle, the CaffeineCachingProvider can only be used directly, by tying the consumer to the com.github.benmanes.caffeine.jcache implementation. If the CaffeineCachingProvider would be an OSGi Component, a consumer would only depend on the javax.cache API and the CaffeineCachingProvider would be an opaque implementation.

Ehcache has a similar approach for their JSR-107 implementation.

raducotescu added a commit to raducotescu/caffeine that referenced this issue Aug 18, 2020
…OSGi DS

* annotated CaffeineCachingProvider to make it an OSGi service
* when running in an OSGi container, set the CaffeineCachingProvider's
classloader as the Thread context classloader for every API call on the
provided CacheManagerImpl - this makes sure that the default config is
read from the bundle; the default classloader will do a fallback to
the app classloader, allowing to override / define configurations
* added an OSGi DS test
* made the bnd build reproducible (no extra bundle headers)
raducotescu added a commit to raducotescu/caffeine that referenced this issue Aug 18, 2020
…OSGi DS

* added Carsten Ziegeler's PGP key for Apache Felix
ben-manes pushed a commit that referenced this issue Aug 18, 2020
* annotated CaffeineCachingProvider to make it an OSGi service
* when running in an OSGi container, set the CaffeineCachingProvider's
classloader as the Thread context classloader for every API call on the
provided CacheManagerImpl - this makes sure that the default config is
read from the bundle; the default classloader will do a fallback to
the app classloader, allowing to override / define configurations
* added an OSGi DS test
* made the bnd build reproducible (no extra bundle headers)
ben-manes pushed a commit that referenced this issue Aug 18, 2020
* added Carsten Ziegeler's PGP key for Apache Felix
@ben-manes
Copy link
Owner

Released in 2.8.6

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

Successfully merging a pull request may close this issue.

2 participants