K
- key typeV
- value typepublic class CacheProxy<K,V> extends Object
Modifier and Type | Field and Description |
---|---|
protected CacheConfig<K,V> |
cacheConfig |
protected CacheService |
cacheService |
protected ILogger |
logger |
protected String |
name |
protected String |
nameWithPrefix |
protected SerializationService |
serializationService |
Modifier | Constructor and Description |
---|---|
protected |
CacheProxy(CacheConfig cacheConfig,
NodeEngine nodeEngine,
CacheService cacheService,
HazelcastServerCacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
protected void |
addListenerLocally(String regId,
javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
void |
clear() |
void |
close() |
protected void |
closeCacheLoader() |
protected void |
closeListeners() |
boolean |
containsKey(K key) |
protected void |
countDownCompletionLatch(int id) |
void |
deregisterAllCacheEntryListener(Collection<String> listenerRegistrations) |
void |
deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
protected void |
deregisterCompletionLatch(Integer countDownLatchId) |
protected void |
deregisterCompletionListener() |
void |
destroy() |
protected void |
ensureOpen() |
V |
get(K key) |
V |
get(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Get with custom expiry policy
|
Map<K,V> |
getAll(Set<? extends K> keys) |
Map<K,V> |
getAll(Set<? extends K> keys,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAll with custom expiry policy
|
V |
getAndPut(K key,
V value) |
V |
getAndPut(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAndPut with custom expiry policy
|
Future<V> |
getAndPutAsync(K key,
V value)
Asynchronously associates the specified value with the specified key in this cache,
returning an existing value if one existed.
|
Future<V> |
getAndPutAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously associates the specified value with the specified key in this cache,
returning an existing value if one existed using a custom expiry policy
|
V |
getAndRemove(K key) |
Future<V> |
getAndRemoveAsync(K key)
Asynchronously removes the entry for a key returning the removed value if one existed.
|
V |
getAndReplace(K key,
V value) |
V |
getAndReplace(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAndReplace with custom expiry policy
|
Future<V> |
getAndReplaceAsync(K key,
V value)
Asynchronously replaces the entry for a key only if currently mapped to some
|
Future<V> |
getAndReplaceAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously replaces the entry for a key only if currently mapped to some
using custom expiry policy
|
InternalCompletableFuture<V> |
getAsync(K key)
Asynchronously get an entry from cache
|
InternalCompletableFuture<V> |
getAsync(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously get an entry from cache with a provided expiry policy
|
javax.cache.CacheManager |
getCacheManager() |
<C extends javax.cache.configuration.Configuration<K,V>> |
getConfiguration(Class<C> clazz) |
protected String |
getDistributedObjectName() |
CacheStatistics |
getLocalCacheStatistics()
Directly access to local Cache Statistics
|
String |
getName() |
protected NodeEngine |
getNodeEngine() |
protected CacheService |
getService() |
protected String |
getServiceName() |
<T> T |
invoke(K key,
javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
Object... arguments) |
protected <T> InternalCompletableFuture<T> |
invoke(Operation op,
Data keyData,
boolean completionOperation) |
<T> Map<K,javax.cache.processor.EntryProcessorResult<T>> |
invokeAll(Set<? extends K> keys,
javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
Object... arguments) |
boolean |
isClosed() |
Iterator<javax.cache.Cache.Entry<K,V>> |
iterator() |
void |
loadAll(Set<? extends K> keys,
boolean replaceExistingValues,
javax.cache.integration.CompletionListener completionListener) |
void |
put(K key,
V value) |
void |
put(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
put with custom expiry policy
|
void |
putAll(Map<? extends K,? extends V> map) |
void |
putAll(Map<? extends K,? extends V> map,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
putAll with custom expiry policy
|
InternalCompletableFuture<Void> |
putAsync(K key,
V value)
Asynchronously associates the specified value with the specified key in the cache.
|
InternalCompletableFuture<Void> |
putAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously associates the specified value with the specified key in the cache using a
custom expiry policy
|
protected <T> InternalCompletableFuture<T> |
putAsyncInternal(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean isGet,
boolean withCompletionEvent) |
boolean |
putIfAbsent(K key,
V value) |
boolean |
putIfAbsent(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
putIfAbsent with custom expiry policy
|
InternalCompletableFuture<Boolean> |
putIfAbsentAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously associates the specified value with the specified key in the cache if not already exist
using a custom expiry policy
|
protected InternalCompletableFuture<Boolean> |
putIfAbsentAsyncInternal(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean withCompletionEvent) |
void |
registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
protected Integer |
registerCompletionLatch(int count) |
protected void |
registerCompletionListener() |
boolean |
remove(K key) |
boolean |
remove(K key,
V oldValue) |
void |
removeAll() |
void |
removeAll(Set<? extends K> keys) |
protected void |
removeAllInternal(Set<? extends K> keys,
boolean isRemoveAll) |
InternalCompletableFuture<Boolean> |
removeAsync(K key)
Asynchronously removes the mapping for a key from this cache if it is present.
|
InternalCompletableFuture<Boolean> |
removeAsync(K key,
V oldValue)
Asynchronously removes the mapping for a key only if currently mapped to the
given value.
|
protected <T> InternalCompletableFuture<T> |
removeAsyncInternal(K key,
V oldValue,
boolean hasOldValue,
boolean isGet,
boolean withCompletionEvent) |
protected String |
removeListenerLocally(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
boolean |
replace(K key,
V value) |
boolean |
replace(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
replace with custom expiry policy
|
boolean |
replace(K key,
V oldValue,
V newValue) |
boolean |
replace(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
replace with custom expiry policy
|
Future<Boolean> |
replaceAsync(K key,
V value)
Asynchronously replaces the entry for a key
|
Future<Boolean> |
replaceAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously replaces the entry for a key only if currently mapped to some
value.
|
Future<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue)
Asynchronously replaces the entry for a key only if currently mapped to a
given value.
|
Future<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy)
Asynchronously replaces the entry for a key only if currently mapped to a
given value using custom expiry policy
|
protected <T> InternalCompletableFuture<T> |
replaceAsyncInternal(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean hasOldValue,
boolean isGet,
boolean withCompletionEvent) |
int |
size()
total entry count
|
protected void |
submitLoadAllTask(OperationFactory operationFactory,
javax.cache.integration.CompletionListener completionListener) |
<T> T |
unwrap(Class<T> clazz) |
protected void |
updateCacheListenerConfigOnOtherNodes(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration,
boolean isRegister) |
protected void |
validateCacheLoader(javax.cache.integration.CompletionListener completionListener) |
protected void |
waitCompletionLatch(Integer countDownLatchId) |
protected void |
waitCompletionLatch(Integer countDownLatchId,
int offset) |
protected final ILogger logger
protected final CacheConfig<K,V> cacheConfig
protected final String name
protected final String nameWithPrefix
protected final CacheService cacheService
protected final SerializationService serializationService
protected CacheProxy(CacheConfig cacheConfig, NodeEngine nodeEngine, CacheService cacheService, HazelcastServerCacheManager cacheManager)
public boolean containsKey(K key)
public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)
public boolean remove(K key)
public void removeAll()
public void clear()
public <C extends javax.cache.configuration.Configuration<K,V>> C getConfiguration(Class<C> clazz)
public <T> T invoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments) throws javax.cache.processor.EntryProcessorException
javax.cache.processor.EntryProcessorException
public <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)
public String getName()
public javax.cache.CacheManager getCacheManager()
public <T> T unwrap(Class<T> clazz)
public void registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
public void deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
protected void updateCacheListenerConfigOnOtherNodes(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration, boolean isRegister)
public InternalCompletableFuture<V> getAsync(K key)
ICache
key
- the key whose associated value is to be returnedjavax.cache.Cache#get(K)
,
Future
public InternalCompletableFuture<V> getAsync(K key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- the key whose associated value is to be returnedexpiryPolicy
- custom expiry policy for this operationjavax.cache.Cache#get(K)
,
Future
public InternalCompletableFuture<Void> putAsync(K key, V value)
ICache
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyjavax.cache.Cache#put(K,V)
,
Future
public InternalCompletableFuture<Void> putAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#put(K,V)
,
Future
public InternalCompletableFuture<Boolean> putIfAbsentAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyjavax.cache.Cache#putIfAbsent(K,V)
,
Future
public Future<V> getAndPutAsync(K key, V value)
ICache
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyjavax.cache.Cache#getAndPut(K,V)
,
Future
public Future<V> getAndPutAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#getAndPut(K,V)
,
Future
public InternalCompletableFuture<Boolean> removeAsync(K key)
ICache
key
- the key whose associated value is to be returnedjavax.cache.Cache#remove(K)
,
Future
public InternalCompletableFuture<Boolean> removeAsync(K key, V oldValue)
ICache
key
- the key whose associated value is to be returnedoldValue
- value expected to be associated with the specified keyjavax.cache.Cache#remove(K,V)
,
Future
public Future<V> getAndRemoveAsync(K key)
ICache
key
- the key whose associated value is to be returnedjavax.cache.Cache#getAndRemove(K)
,
Future
public Future<Boolean> replaceAsync(K key, V value)
ICache
key
- the key whose associated value is to be returnedvalue
- value to be associated with the specified keyjavax.cache.Cache#replace(K,V)
,
Future
public Future<Boolean> replaceAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#replace(K,V)
,
Future
public Future<Boolean> replaceAsync(K key, V oldValue, V newValue)
ICache
key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified keyjavax.cache.Cache#replace(K,V,V)
,
Future
public Future<Boolean> replaceAsync(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#replace(K,V,V)
,
Future
public Future<V> getAndReplaceAsync(K key, V value)
ICache
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keyjavax.cache.Cache#getAndReplace(K,V)
,
Future
public Future<V> getAndReplaceAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keyexpiryPolicy
- custom expiry Policy for this operationjavax.cache.Cache#getAndReplace(K,V)
,
Future
public V get(K key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- the key whose associated value is to be returnedjavax.cache.Cache#get(K)
,
Future
public Map<K,V> getAll(Set<? extends K> keys, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
keys
- The keys whose associated values are to be returned.Cache.getAll(java.util.Set)
,
Future
public void put(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyjavax.cache.Cache#put(K,V)
,
Future
public V getAndPut(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyjavax.cache.Cache#getAndPut(K,V)
,
Future
public void putAll(Map<? extends K,? extends V> map, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
map
- mappings to be stored in this cacheCache.putAll(java.util.Map)
,
Future
public boolean putIfAbsent(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyjavax.cache.Cache#putIfAbsent(K,V)
,
Future
public boolean replace(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified keyjavax.cache.Cache#replace(K,V,V)
,
Future
public boolean replace(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- the key with which the specified value is associatedvalue
- the value to be associated with the specified keypublic V getAndReplace(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
ICache
key
- key with which the specified value is associatedvalue
- value to be associated with the specified keyjavax.cache.Cache#getAndReplace(K,V)
,
Future
public int size()
ICache
public CacheStatistics getLocalCacheStatistics()
ICache
protected <T> InternalCompletableFuture<T> invoke(Operation op, Data keyData, boolean completionOperation)
protected <T> InternalCompletableFuture<T> removeAsyncInternal(K key, V oldValue, boolean hasOldValue, boolean isGet, boolean withCompletionEvent)
protected <T> InternalCompletableFuture<T> replaceAsyncInternal(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean hasOldValue, boolean isGet, boolean withCompletionEvent)
protected <T> InternalCompletableFuture<T> putAsyncInternal(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean isGet, boolean withCompletionEvent)
protected InternalCompletableFuture<Boolean> putIfAbsentAsyncInternal(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean withCompletionEvent)
protected void removeAllInternal(Set<? extends K> keys, boolean isRemoveAll)
protected void addListenerLocally(String regId, javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
protected String removeListenerLocally(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
public void deregisterAllCacheEntryListener(Collection<String> listenerRegistrations)
protected void closeListeners()
protected void countDownCompletionLatch(int id)
protected Integer registerCompletionLatch(int count)
protected void deregisterCompletionLatch(Integer countDownLatchId)
protected void waitCompletionLatch(Integer countDownLatchId)
protected void waitCompletionLatch(Integer countDownLatchId, int offset)
protected void registerCompletionListener()
protected void deregisterCompletionListener()
protected void ensureOpen()
public void close()
public void destroy()
public boolean isClosed()
protected String getDistributedObjectName()
protected String getServiceName()
protected CacheService getService()
protected NodeEngine getNodeEngine()
protected void validateCacheLoader(javax.cache.integration.CompletionListener completionListener)
protected void closeCacheLoader()
protected void submitLoadAllTask(OperationFactory operationFactory, javax.cache.integration.CompletionListener completionListener)
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.