Class CaffeineCachingProvider
- java.lang.Object
-
- com.github.benmanes.caffeine.jcache.spi.CaffeineCachingProvider
-
- All Implemented Interfaces:
Closeable,AutoCloseable,CachingProvider
public final class CaffeineCachingProvider extends Object implements CachingProvider
A provider that produces a JCache implementation backed by Caffeine. Typically, this provider is instantiated usingCaching.getCachingProvider()which discovers this implementation through aServiceLoader.This provider is expected to be used for application life cycle events, like initialization. It is not expected that all requests flow through the provider to obtain the cache manager and cache instances for request operations. Internally, this implementation is synchronized to avoid using excess memory due to its infrequent usage.
-
-
Constructor Summary
Constructors Constructor Description CaffeineCachingProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidclose(ClassLoader classLoader)voidclose(URI uri, ClassLoader classLoader)CacheManagergetCacheManager()CacheManagergetCacheManager(URI uri, ClassLoader classLoader)CacheManagergetCacheManager(URI uri, ClassLoader classLoader, Properties properties)ClassLoadergetDefaultClassLoader()PropertiesgetDefaultProperties()URIgetDefaultURI()booleanisSupported(OptionalFeature optionalFeature)
-
-
-
Method Detail
-
getDefaultClassLoader
public ClassLoader getDefaultClassLoader()
- Specified by:
getDefaultClassLoaderin interfaceCachingProvider
-
getDefaultURI
public URI getDefaultURI()
- Specified by:
getDefaultURIin interfaceCachingProvider
-
getDefaultProperties
public Properties getDefaultProperties()
- Specified by:
getDefaultPropertiesin interfaceCachingProvider
-
getCacheManager
public CacheManager getCacheManager()
- Specified by:
getCacheManagerin interfaceCachingProvider
-
getCacheManager
public CacheManager getCacheManager(URI uri, ClassLoader classLoader)
- Specified by:
getCacheManagerin interfaceCachingProvider
-
getCacheManager
public CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties)
- Specified by:
getCacheManagerin interfaceCachingProvider
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCachingProvider- Specified by:
closein interfaceCloseable
-
close
public void close(ClassLoader classLoader)
- Specified by:
closein interfaceCachingProvider
-
close
public void close(URI uri, ClassLoader classLoader)
- Specified by:
closein interfaceCachingProvider
-
isSupported
public boolean isSupported(OptionalFeature optionalFeature)
- Specified by:
isSupportedin interfaceCachingProvider
-
-