Class CacheManagerImpl
- java.lang.Object
-
- com.github.benmanes.caffeine.jcache.CacheManagerImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,CacheManager
public final class CacheManagerImpl extends Object implements CacheManager
An implementation of JSR-107CacheManagerthat manages Caffeine-based caches.
-
-
Constructor Summary
Constructors Constructor Description CacheManagerImpl(CachingProvider cacheProvider, boolean runsAsAnOsgiBundle, URI uri, ClassLoader classLoader, Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()<K,V,C extends Configuration<K,V>>
Cache<K,V>createCache(String cacheName, C configuration)voiddestroyCache(String cacheName)voidenableManagement(String cacheName, boolean enabled)voidenableStatistics(String cacheName, boolean enabled)<K,V>
CacheProxy<K,V>getCache(String cacheName)<K,V>
@Nullable Cache<K,V>getCache(String cacheName, Class<K> keyType, Class<V> valueType)Collection<String>getCacheNames()CachingProvidergetCachingProvider()@Nullable ClassLoadergetClassLoader()PropertiesgetProperties()URIgetURI()booleanisClosed()<T> Tunwrap(Class<T> clazz)
-
-
-
Constructor Detail
-
CacheManagerImpl
public CacheManagerImpl(CachingProvider cacheProvider, boolean runsAsAnOsgiBundle, URI uri, ClassLoader classLoader, Properties properties)
-
-
Method Detail
-
getCachingProvider
public CachingProvider getCachingProvider()
- Specified by:
getCachingProviderin interfaceCacheManager
-
getURI
public URI getURI()
- Specified by:
getURIin interfaceCacheManager
-
getClassLoader
public @Nullable ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfaceCacheManager
-
getProperties
public Properties getProperties()
- Specified by:
getPropertiesin interfaceCacheManager
-
createCache
public <K,V,C extends Configuration<K,V>> Cache<K,V> createCache(String cacheName, C configuration)
- Specified by:
createCachein interfaceCacheManager
-
getCache
public <K,V> @Nullable Cache<K,V> getCache(String cacheName, Class<K> keyType, Class<V> valueType)
- Specified by:
getCachein interfaceCacheManager
-
getCache
public <K,V> CacheProxy<K,V> getCache(String cacheName)
- Specified by:
getCachein interfaceCacheManager
-
getCacheNames
public Collection<String> getCacheNames()
- Specified by:
getCacheNamesin interfaceCacheManager
-
destroyCache
public void destroyCache(String cacheName)
- Specified by:
destroyCachein interfaceCacheManager
-
enableManagement
public void enableManagement(String cacheName, boolean enabled)
- Specified by:
enableManagementin interfaceCacheManager
-
enableStatistics
public void enableStatistics(String cacheName, boolean enabled)
- Specified by:
enableStatisticsin interfaceCacheManager
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCacheManager- Specified by:
closein interfaceCloseable
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceCacheManager
-
unwrap
public <T> T unwrap(Class<T> clazz)
- Specified by:
unwrapin interfaceCacheManager
-
-