public interface CacheManager
Use this interface to retrieve all existing Cache
names and interact with any cache programmatically. It shares the
same cache collection the Quarkus caching annotations use. The CacheName
annotation can also be used to inject and
access a specific cache from its name.
Code example:
@ApplicationScoped public class CachedService { @Inject CacheManager cacheManager; void doSomething() { Cache cache = cacheManager.getCache("my-cache"); // Interact with the cache. } }
Modifier and Type | Method and Description |
---|---|
Optional<Cache> |
getCache(String name)
Gets the cache identified by the given name.
|
Collection<String> |
getCacheNames()
Gets a collection of all cache names.
|
Collection<String> getCacheNames()
Copyright © 2021 JBoss by Red Hat. All rights reserved.