Package io.quarkus.cache
Annotation Type CacheName
-
@Qualifier @Target({FIELD,METHOD,PARAMETER}) @Retention(RUNTIME) public @interface CacheName
Use this annotation on a field, a constructor parameter or a method parameter to inject a
Cacheand interact with it programmatically.Field injection example:
@ApplicationScoped public class CachedService { @CacheName("my-cache") Cache cache; // Interact with the cache. }Constructor parameter injection example:@ApplicationScoped public class CachedService { private Cache cache; public CachedService(@CacheName("my-cache") Cache cache) { this.cache = cache; } // Interact with the cache. }Method parameter injection example:@ApplicationScoped public class CachedService { private Cache cache; @Inject public void setCache(@CacheName("my-cache") Cache cache) { this.cache = cache; } // Interact with the cache. }- See Also:
CacheManager
-
-
Element Detail
-
value
String value
The name of the cache.
-
-