public class CouchbaseCacheManager extends Object implements javax.cache.CacheManager
The Couchbase implementation for the CacheManager
.
Constructor and Description |
---|
CouchbaseCacheManager(CouchbaseCachingProvider provider,
URI uri,
ClassLoader classLoader,
Properties properties)
Creates a new CouchbaseCacheManager.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
<K,V,C extends javax.cache.configuration.Configuration<K,V>> |
createCache(String cacheName,
C configuration)
Create a new Cache programmatically.
|
void |
destroyCache(String cacheName) |
void |
enableManagement(String cacheName,
boolean enabled) |
void |
enableStatistics(String cacheName,
boolean enabled) |
<K,V> javax.cache.Cache<K,V> |
getCache(String cacheName) |
<K,V> javax.cache.Cache<K,V> |
getCache(String cacheName,
Class<K> keyType,
Class<V> valueType) |
Iterable<String> |
getCacheNames() |
javax.cache.spi.CachingProvider |
getCachingProvider() |
ClassLoader |
getClassLoader() |
Properties |
getProperties() |
URI |
getURI() |
boolean |
isClosed() |
<T> T |
unwrap(Class<T> clazz) |
public CouchbaseCacheManager(CouchbaseCachingProvider provider, URI uri, ClassLoader classLoader, Properties properties)
Creates a new CouchbaseCacheManager.
provider
- the caching provider useduri
- the uri of the managerclassLoader
- the classloader associated with the managerproperties
- the properties used by the managerpublic javax.cache.spi.CachingProvider getCachingProvider()
getCachingProvider
in interface javax.cache.CacheManager
public URI getURI()
getURI
in interface javax.cache.CacheManager
public ClassLoader getClassLoader()
getClassLoader
in interface javax.cache.CacheManager
public Properties getProperties()
getProperties
in interface javax.cache.CacheManager
public <K,V,C extends javax.cache.configuration.Configuration<K,V>> javax.cache.Cache<K,V> createCache(String cacheName, C configuration) throws IllegalArgumentException
Create a new Cache programmatically. Note that this implementation requires a CouchbaseConfiguration
as second parameter.
createCache
in interface javax.cache.CacheManager
cacheName
- the name of the new cache to be createdconfiguration
- the CouchbaseConfiguration
used to configure the cacheIllegalArgumentException
- if the configuration is not of the expected typeCacheManager.createCache(String, javax.cache.configuration.Configuration)
public <K,V> javax.cache.Cache<K,V> getCache(String cacheName, Class<K> keyType, Class<V> valueType)
getCache
in interface javax.cache.CacheManager
public <K,V> javax.cache.Cache<K,V> getCache(String cacheName)
getCache
in interface javax.cache.CacheManager
public Iterable<String> getCacheNames()
getCacheNames
in interface javax.cache.CacheManager
public void destroyCache(String cacheName)
destroyCache
in interface javax.cache.CacheManager
public void enableManagement(String cacheName, boolean enabled)
enableManagement
in interface javax.cache.CacheManager
public void enableStatistics(String cacheName, boolean enabled)
enableStatistics
in interface javax.cache.CacheManager
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface javax.cache.CacheManager
public boolean isClosed()
isClosed
in interface javax.cache.CacheManager
public <T> T unwrap(Class<T> clazz)
unwrap
in interface javax.cache.CacheManager
Copyright © 2014 Couchbase, Inc.