|
||||||||||
| 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 HazelcastCacheManager (also CacheManager as indirect) 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.
HazelcastCacheManager,
CacheManager| Field Summary | |
|---|---|
protected String |
cacheNamePrefix
|
protected ConcurrentMap<String,ICacheInternal<?,?>> |
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
|
addCacheConfigIfAbsent(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
|
createConfig(String cacheName,
CacheConfig<K,V> config,
boolean createAlsoOnOthers,
boolean syncCreate)
|
|
protected abstract
|
createConfigOnPartition(CacheConfig<K,V> cacheConfig)
|
|
void |
destroy()
Destroy all managed caches. |
|
void |
destroyCache(String cacheName)
|
|
protected
|
ensureOpenIfAvailable(ICacheInternal<K,V> cache)
|
|
protected abstract
|
findConfig(String cacheName,
String simpleCacheName,
boolean createAlsoOnOthers,
boolean syncCreate)
|
|
|
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()
|
|
String |
getCacheNameWithPrefix(String name)
|
|
protected
|
getCacheUnchecked(String cacheName)
|
|
javax.cache.spi.CachingProvider |
getCachingProvider()
|
|
ClassLoader |
getClassLoader()
|
|
HazelcastInstance |
getHazelcastInstance()
Gets the underlying HazelcastInstance implementation. |
|
|
getOrCreateCache(String cacheName,
CacheConfig<K,V> cacheConfig)
|
|
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,ICacheInternal<?,?>> 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 HazelcastInstance getHazelcastInstance()
HazelcastCacheManagerHazelcastInstance implementation.
getHazelcastInstance in interface HazelcastCacheManagerHazelcastInstance implementation
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.CacheManager
public <K,V> ICache<K,V> getOrCreateCache(String cacheName,
CacheConfig<K,V> cacheConfig)
public <K,V> ICache<K,V> getCache(String cacheName)
getCache in interface javax.cache.CacheManagerprotected <K,V> ICacheInternal<K,V> ensureOpenIfAvailable(ICacheInternal<K,V> cache)
protected <K,V> ICacheInternal<?,?> 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.CacheManagerpublic void destroy()
destroy in interface HazelcastCacheManagerpublic boolean isClosed()
isClosed in interface javax.cache.CacheManagerprotected void checkIfManagerNotClosed()
protected String cacheNamePrefix()
/hz[/uri][/classloader]/
URI and classloader are dropped if they have default values.
public String getCacheNameWithPrefix(String name)
protected <K,V,C extends javax.cache.configuration.Configuration<K,V>> CacheConfig<K,V> createCacheConfig(String cacheName,
C configuration)
protected <K,V> void registerListeners(CacheConfig<K,V> cacheConfig,
ICache<K,V> source)
public String toString()
toString in class Objectprotected abstract <K,V> void addCacheConfigIfAbsent(CacheConfig<K,V> cacheConfig)
protected abstract <K,V> ICacheInternal<K,V> createCacheProxy(CacheConfig<K,V> cacheConfig)
protected abstract <K,V> CacheConfig<K,V> findConfig(String cacheName,
String simpleCacheName,
boolean createAlsoOnOthers,
boolean syncCreate)
protected abstract <K,V> CacheConfig<K,V> createConfig(String cacheName,
CacheConfig<K,V> config,
boolean createAlsoOnOthers,
boolean syncCreate)
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> CacheConfig<K,V> getCacheConfigFromPartition(String cacheName,
String simpleCacheName)
protected abstract void postClose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||