the factory just delegates to the JCache API to get the manager:

provider = Caching.getCachingProvider(classLoader);
manager = provider.getCacheManager(provider.getDefaultURI(),
classLoader, configuration.getProperties()); // custom config is there

you can add one indirection to get it injected - this would makes
sense actually if you reuse the manager in other parts of the app -
but it is not mandatory.


Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2015-11-18 12:50 GMT-08:00 sgjava <[email protected]>:
> So I created my own CacheResolverFactory, so I can created named caches
> configured via configuration file and have the JCache annotations use that
> CacheManager, etc. The problem is that I do not see a way to get the
> CacheManager from the CacheResolverFactory. I see in
> https://rmannibucau.wordpress.com/2015/08/21/cacheresult-jcache-cdi-to-the-rescue-of-microservices
> you use an @Inject on the constructor. Is this how you are creating the
> CacheManager, etc.? If this is the case I would have to create a bean
> containing the CacheManager, so I would have access to it in my unit tests
> if I wanted?
>
>
>
> --
> View this message in context: 
> http://tomee-openejb.979440.n4.nabble.com/Getting-CacheManager-from-CacheResolverFactory-tp4676849.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to