public class DefaultNearCacheManager extends Object implements NearCacheManager
Modifier and Type | Field and Description |
---|---|
protected ClassLoader |
classLoader |
protected HazelcastProperties |
properties |
protected TaskScheduler |
scheduler |
protected SerializationService |
serializationService |
Constructor and Description |
---|
DefaultNearCacheManager(SerializationService ss,
TaskScheduler es,
ClassLoader classLoader,
HazelcastProperties properties) |
Modifier and Type | Method and Description |
---|---|
void |
clearAllNearCaches()
Clears all defined
NearCache instances. |
boolean |
clearNearCache(String name)
Clears
NearCache instance associated with given name but not removes it. |
protected <K,V> NearCache<K,V> |
createNearCache(String name,
NearCacheConfig nearCacheConfig) |
void |
destroyAllNearCaches()
Destroys all defined
NearCache instances. |
boolean |
destroyNearCache(String name)
Destroys
NearCache instance associated with given name and also removes it. |
protected ClassLoader |
getClassLoader() |
<K,V> NearCache<K,V> |
getNearCache(String name)
Gets the
NearCache instance associated with given name . |
<K,V> NearCache<K,V> |
getOrCreateNearCache(String name,
NearCacheConfig nearCacheConfig)
Creates a new
NearCache with given configurations
or returns existing one. |
<K,V> NearCache<K,V> |
getOrCreateNearCache(String name,
NearCacheConfig nearCacheConfig,
DataStructureAdapter dataStructureAdapter)
Creates a new
NearCache with given configurations or returns existing one. |
protected TaskScheduler |
getScheduler() |
protected SerializationService |
getSerializationService() |
Collection<NearCache> |
listAllNearCaches()
Lists all existing
NearCache instances. |
protected final TaskScheduler scheduler
protected final ClassLoader classLoader
protected final HazelcastProperties properties
protected final SerializationService serializationService
public DefaultNearCacheManager(SerializationService ss, TaskScheduler es, ClassLoader classLoader, HazelcastProperties properties)
public <K,V> NearCache<K,V> getNearCache(String name)
NearCacheManager
NearCache
instance associated with given name
.getNearCache
in interface NearCacheManager
K
- the type of the key for Near CacheV
- the type of the value for Near Cachename
- the name of the NearCache
instance will be gotNearCache
instance
associated with given name
public <K,V> NearCache<K,V> getOrCreateNearCache(String name, NearCacheConfig nearCacheConfig)
NearCacheManager
NearCache
with given configurations
or returns existing one.getOrCreateNearCache
in interface NearCacheManager
K
- the key type of the NearCache
V
- the value type of the NearCache
name
- the name of the NearCache
to be created or existing onenearCacheConfig
- the NearCacheConfig
of the NearCache
to be createdNearCache
instance associated with given name
public <K,V> NearCache<K,V> getOrCreateNearCache(String name, NearCacheConfig nearCacheConfig, DataStructureAdapter dataStructureAdapter)
NearCacheManager
NearCache
with given configurations or returns existing one.
Triggers the pre-loading of the created NearCache
via the supplied DataStructureAdapter
.getOrCreateNearCache
in interface NearCacheManager
K
- the key type of the NearCache
V
- the value type of the NearCache
name
- the name of the NearCache
to be created or existing onenearCacheConfig
- the NearCacheConfig
of the NearCache
to be createddataStructureAdapter
- the DataStructureAdapter
of the NearCache
to be createdNearCache
instance associated with given name
protected <K,V> NearCache<K,V> createNearCache(String name, NearCacheConfig nearCacheConfig)
public Collection<NearCache> listAllNearCaches()
NearCacheManager
NearCache
instances.listAllNearCaches
in interface NearCacheManager
NearCache
instancespublic boolean clearNearCache(String name)
NearCacheManager
NearCache
instance associated with given name
but not removes it.clearNearCache
in interface NearCacheManager
name
- name of the NearCache
to be clearedtrue
if NearCache
was found and cleared, false
otherwisepublic void clearAllNearCaches()
NearCacheManager
NearCache
instances.clearAllNearCaches
in interface NearCacheManager
public boolean destroyNearCache(String name)
NearCacheManager
NearCache
instance associated with given name
and also removes it.destroyNearCache
in interface NearCacheManager
name
- name of the NearCache
to be destroyedtrue
if NearCache
was found and destroyed, false
otherwisepublic void destroyAllNearCaches()
NearCacheManager
NearCache
instances.destroyAllNearCaches
in interface NearCacheManager
protected SerializationService getSerializationService()
protected TaskScheduler getScheduler()
protected ClassLoader getClassLoader()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.