public class CoherenceBasedCacheManager extends Object implements javax.cache.CacheManager, com.oracle.coherence.common.base.Disposable
CacheManager
.Constructor and Description |
---|
CoherenceBasedCacheManager(CoherenceBasedCachingProvider provider,
ConfigurableCacheFactory ccf,
URI uri,
ClassLoader classLoader,
Properties properties)
Constructs a new
CoherenceBasedCacheManager . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Default implementation invokes
Disposable.dispose() , it is not recommended that this be overridden. |
<K,V,C extends javax.cache.configuration.Configuration<K,V>> |
createCache(String sJCacheName,
C cfgJCache) |
void |
destroyCache(String sName) |
void |
dispose()
Invoked when all resources owned by the implementer can safely be
released.
|
void |
enableManagement(String sName,
boolean fEnabled) |
void |
enableStatistics(String sName,
boolean fEnabled) |
javax.cache.Cache |
getCache(String sJCacheName) |
<K,V> javax.cache.Cache<K,V> |
getCache(String sJCacheName,
Class<K> clzKey,
Class<V> clzType) |
Iterable<String> |
getCacheNames() |
CoherenceBasedCompleteConfiguration |
getCacheToConfigurationMapping(JCacheIdentifier cacheId)
Provide access to meta cache that maps JCache cache names to JCache configuration.
|
javax.cache.spi.CachingProvider |
getCachingProvider() |
ClassLoader |
getClassLoader() |
ConfigurableCacheFactory |
getConfigurableCacheFactory()
Get ConfigurableCacheFactory context.
|
Properties |
getProperties() |
URI |
getURI() |
boolean |
isClosed() |
void |
putCacheToConfigurationMapping(JCacheIdentifier cacheId,
CoherenceBasedCompleteConfiguration config)
put entry with key of sName
|
void |
releaseCache(String sName)
release cache named
sName |
void |
removeCacheToConfigurationMapping(JCacheIdentifier cacheId)
remove entry with key of sName
|
String |
toString() |
<T> T |
unwrap(Class<T> clz) |
boolean |
validate()
Validate if configurations map is valid with this instance.
|
public CoherenceBasedCacheManager(CoherenceBasedCachingProvider provider, ConfigurableCacheFactory ccf, URI uri, ClassLoader classLoader, Properties properties)
CoherenceBasedCacheManager
.provider
- the CachingProvider
that owns the CacheManager
ccf
- the ConfigurableCacheFactory
to use for CoherenceBasedCache
suri
- the URI
of the CacheManager
(this must point to a valid Coherence Cache configuration file)classLoader
- the ClassLoader
to use for loading Cache
resources, including keys, values, loaders, writers etcproperties
- the custom configuration Properties
public CoherenceBasedCompleteConfiguration getCacheToConfigurationMapping(JCacheIdentifier cacheId)
cacheId
- JCache unique identifierpublic void putCacheToConfigurationMapping(JCacheIdentifier cacheId, CoherenceBasedCompleteConfiguration config)
cacheId
- key of entry to put into _metaJCacheNameToConfigpublic void removeCacheToConfigurationMapping(JCacheIdentifier cacheId)
cacheId
- key of entry to remove from _metaJCacheNameToConfigpublic javax.cache.spi.CachingProvider getCachingProvider()
getCachingProvider
in interface javax.cache.CacheManager
public URI getURI()
getURI
in interface javax.cache.CacheManager
public Properties getProperties()
getProperties
in interface javax.cache.CacheManager
public ClassLoader getClassLoader()
getClassLoader
in interface javax.cache.CacheManager
public <K,V,C extends javax.cache.configuration.Configuration<K,V>> javax.cache.Cache<K,V> createCache(String sJCacheName, C cfgJCache) throws IllegalArgumentException
createCache
in interface javax.cache.CacheManager
IllegalArgumentException
public <K,V> javax.cache.Cache<K,V> getCache(String sJCacheName, Class<K> clzKey, Class<V> clzType)
getCache
in interface javax.cache.CacheManager
public javax.cache.Cache getCache(String sJCacheName)
getCache
in interface javax.cache.CacheManager
public Iterable<String> getCacheNames()
getCacheNames
in interface javax.cache.CacheManager
public void destroyCache(String sName)
destroyCache
in interface javax.cache.CacheManager
public void enableStatistics(String sName, boolean fEnabled)
enableStatistics
in interface javax.cache.CacheManager
public void enableManagement(String sName, boolean fEnabled)
enableManagement
in interface javax.cache.CacheManager
public void close()
com.oracle.coherence.common.base.Disposable
Disposable.dispose()
, it is not recommended that this be overridden.close
in interface com.oracle.coherence.common.base.Disposable
close
in interface Closeable
close
in interface AutoCloseable
close
in interface javax.cache.CacheManager
public void dispose()
com.oracle.coherence.common.base.Disposable
Once disposed of the object should no longer be considered to be usable.
Note the Disposable interface is compatible with try-with-resources which will automatically invoke this method.
dispose
in interface com.oracle.coherence.common.base.Disposable
public boolean isClosed()
isClosed
in interface javax.cache.CacheManager
public <T> T unwrap(Class<T> clz)
unwrap
in interface javax.cache.CacheManager
public ConfigurableCacheFactory getConfigurableCacheFactory()
ConfigurableCacheFactory
public void releaseCache(String sName)
sName
sName
- JCache Adapter map to releasepublic boolean validate()