|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.cache.impl.AbstractHazelcastCacheManager
public abstract class AbstractHazelcastCacheManager
Abstract CacheManager implementation provides shared functionality to server and client cache managers.
There are two cache managers which can be accessed via their providers.
AbstractHazelcastCacheManager manages the lifecycle of the caches created or accessed through itself.
CacheManager| Field Summary | |
|---|---|
protected String |
cacheNamePrefix
|
protected ConcurrentMap<String,ICache<?,?>> |
caches
|
protected javax.cache.spi.CachingProvider |
cachingProvider
|
protected WeakReference<ClassLoader> |
classLoaderReference
|
protected HazelcastInstance |
hazelcastInstance
|
protected boolean |
isDefaultClassLoader
|
protected boolean |
isDefaultURI
|
protected Properties |
properties
|
protected URI |
uri
|
| Constructor Summary | |
|---|---|
AbstractHazelcastCacheManager(javax.cache.spi.CachingProvider cachingProvider,
HazelcastInstance hazelcastInstance,
URI uri,
ClassLoader classLoader,
Properties properties)
|
|
| Method Summary | ||
|---|---|---|
protected abstract
|
addCacheConfigIfAbsentToLocal(CacheConfig<K,V> cacheConfig)
|
|
protected String |
cacheNamePrefix()
This method calculates a fixed string based on the URI and classloader using the formula: |
|
protected void |
checkIfManagerNotClosed()
|
|
void |
close()
|
|
|
createCache(String cacheName,
C configuration)
|
|
protected
|
createCacheConfig(String cacheName,
C configuration)
|
|
protected abstract
|
createCacheProxy(CacheConfig<K,V> cacheConfig)
|
|
protected abstract
|
createConfigOnPartition(CacheConfig<K,V> cacheConfig)
|
|
void |
destroy()
Destroy all managed caches. |
|
void |
destroyCache(String cacheName)
|
|
|
getCache(String cacheName)
|
|
|
getCache(String cacheName,
Class<K> keyType,
Class<V> valueType)
|
|
protected abstract
|
getCacheConfigFromPartition(String cacheName,
String simpleCacheName)
|
|
protected abstract
|
getCacheConfigLocal(String cacheName)
|
|
Iterable<String> |
getCacheNames()
|
|
protected String |
getCacheNameWithPrefix(String name)
|
|
protected
|
getCacheUnchecked(String cacheName)
|
|
javax.cache.spi.CachingProvider |
getCachingProvider()
|
|
ClassLoader |
getClassLoader()
|
|
Properties |
getProperties()
|
|
URI |
getURI()
|
|
boolean |
isClosed()
|
|
protected abstract void |
postClose()
|
|
protected
|
registerListeners(CacheConfig<K,V> cacheConfig,
ICache<K,V> source)
|
|
protected void |
removeCacheConfigFromLocal(String cacheName)
Removes the local copy of the cache configuration if one exists. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.cache.CacheManager |
|---|
enableManagement, enableStatistics, unwrap |
| Field Detail |
|---|
protected final ConcurrentMap<String,ICache<?,?>> caches
protected final URI uri
protected final WeakReference<ClassLoader> classLoaderReference
protected final Properties properties
protected final String cacheNamePrefix
protected final boolean isDefaultURI
protected final boolean isDefaultClassLoader
protected final javax.cache.spi.CachingProvider cachingProvider
protected final HazelcastInstance hazelcastInstance
| Constructor Detail |
|---|
public AbstractHazelcastCacheManager(javax.cache.spi.CachingProvider cachingProvider,
HazelcastInstance hazelcastInstance,
URI uri,
ClassLoader classLoader,
Properties properties)
| Method Detail |
|---|
public <K,V,C extends javax.cache.configuration.Configuration<K,V>> ICache<K,V> createCache(String cacheName,
C configuration)
throws IllegalArgumentException
createCache in interface javax.cache.CacheManagerIllegalArgumentExceptionpublic javax.cache.spi.CachingProvider getCachingProvider()
getCachingProvider in interface javax.cache.CacheManagerpublic URI getURI()
getURI in interface javax.cache.CacheManagerpublic ClassLoader getClassLoader()
getClassLoader in interface javax.cache.CacheManagerpublic Properties getProperties()
getProperties in interface javax.cache.CacheManager
public <K,V> ICache<K,V> getCache(String cacheName,
Class<K> keyType,
Class<V> valueType)
getCache in interface javax.cache.CacheManagerpublic <K,V> ICache<K,V> getCache(String cacheName)
getCache in interface javax.cache.CacheManagerprotected <K,V> ICache<?,?> getCacheUnchecked(String cacheName)
public Iterable<String> getCacheNames()
getCacheNames in interface javax.cache.CacheManagerpublic void destroyCache(String cacheName)
destroyCache in interface javax.cache.CacheManagerprotected void removeCacheConfigFromLocal(String cacheName)
cacheName - cache name.public void close()
close in interface Closeableclose in interface javax.cache.CacheManagerprotected abstract void postClose()
public void destroy()
public boolean isClosed()
isClosed in interface javax.cache.CacheManagerprotected void checkIfManagerNotClosed()
public String toString()
toString in class Objectprotected String cacheNamePrefix()
/hz[/uri][/classloader]/
URI and classloader are dropped if they have default values.
protected String getCacheNameWithPrefix(String name)
protected <K,V,C extends javax.cache.configuration.Configuration<K,V>> CacheConfig<K,V> createCacheConfig(String cacheName,
C configuration)
protected abstract <K,V> CacheConfig<K,V> getCacheConfigLocal(String cacheName)
protected abstract <K,V> CacheConfig<K,V> createConfigOnPartition(CacheConfig<K,V> cacheConfig)
protected abstract <K,V> void addCacheConfigIfAbsentToLocal(CacheConfig<K,V> cacheConfig)
protected abstract <K,V> ICache<K,V> createCacheProxy(CacheConfig<K,V> cacheConfig)
protected abstract <K,V> CacheConfig<K,V> getCacheConfigFromPartition(String cacheName,
String simpleCacheName)
protected <K,V> void registerListeners(CacheConfig<K,V> cacheConfig,
ICache<K,V> source)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||