Package io.quarkus.cache
Interface CacheManager
-
- All Known Implementing Classes:
CacheManagerImpl
public interface CacheManagerUse this interface to retrieve all existing
Cachenames and interact with any cache programmatically. It shares the same cache collection the Quarkus caching annotations use. TheCacheNameannotation 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. } }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<Cache>getCache(String name)Gets the cache identified by the given name.Collection<String>getCacheNames()Gets a collection of all cache names.
-
-
-
Method Detail
-
getCacheNames
Collection<String> getCacheNames()
Gets a collection of all cache names.- Returns:
- names of all caches
-
-