You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on adding per-request caching in my application. It looks like I
can do this using the resolverFactory argument for @Cacheable.
However, this appears inflexible as I will have to make the same change to all
@Cacheable entries that I want on a per-request basis:
@Cacheable(cacheName = "valuationCalendar",
resolverFactory=@ResolverFactory(name =
"ch.hedgesphere.core.ehcache.RequestScopeCacheResolverFactory"))
...
@Cacheable(cacheName = "positions", resolverFactory=@ResolverFactory(name =
"ch.hedgesphere.core.ehcache.RequestScopeCacheResolverFactory"))
If the @ResolverFactory annotation was split out:
@ResolverFactory("ch.hedgesphere.core.ehcache.RequestScopeCacheResolverFactory")
@Cacheable(cacheName = "valuationCalendar")
I could then wrap the @ResolverFactory in another annotation:
@Retention(RUNTIME)
@Target( { METHOD })
@ResolverFactory("ch.hedgesphere.core.ehcache.RequestScopeCacheResolverFactory")
public @interface RequestScopedCache {}
Which leads to the cleaner declaration of:
@RequestScopedCache
@Cacheable(cacheName = "valuationCalendar")
Original issue reported on code.google.com by [email protected] on 1 Nov 2011 at 2:33
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 1 Nov 2011 at 2:33The text was updated successfully, but these errors were encountered: