K - key typeV - value typepublic class ClientCacheProxy<K,V> extends ClientProxy
| Modifier and Type | Field and Description |
|---|---|
protected CacheConfig<K,V> |
cacheConfig |
protected HazelcastClientCacheManager |
cacheManager |
protected boolean |
cacheOnUpdate |
protected ClientContext |
clientContext |
protected ILogger |
logger |
protected String |
name |
protected String |
nameWithPrefix |
protected NearCache<Data,Object> |
nearCache |
protected NearCacheManager |
nearCacheManager |
protected String |
nearCacheMembershipRegistrationId |
protected ClientCacheStatisticsImpl |
statistics |
protected boolean |
statisticsEnabled |
| Constructor and Description |
|---|
ClientCacheProxy(CacheConfig<K,V> cacheConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addListenerLocally(String regId,
javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
String |
addPartitionLostListener(CachePartitionLostListener listener) |
void |
clear() |
protected void |
clearInternal() |
void |
close() |
protected void |
closeListeners() |
boolean |
containsKey(K key) |
void |
countDownCompletionLatch(int countDownLatchId) |
protected ICompletableFuture |
createCompletedFuture(Object value) |
protected EventHandler |
createHandler(CacheEventListenerAdaptor<K,V> adaptor) |
void |
deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
protected void |
deregisterCompletionLatch(Integer countDownLatchId) |
protected void |
ensureOpen() |
V |
get(K key) |
V |
get(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
Map<K,V> |
getAll(Set<? extends K> keys) |
Map<K,V> |
getAll(Set<? extends K> keys,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
V |
getAndPut(K key,
V value) |
V |
getAndPut(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
ICompletableFuture<V> |
getAndPutAsync(K key,
V value) |
ICompletableFuture<V> |
getAndPutAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
V |
getAndRemove(K key) |
ICompletableFuture<V> |
getAndRemoveAsync(K key) |
protected <T> ICompletableFuture<T> |
getAndRemoveAsyncInternal(K key,
boolean withCompletionEvent,
boolean async) |
V |
getAndReplace(K key,
V value) |
V |
getAndReplace(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
ICompletableFuture<V> |
getAndReplaceAsync(K key,
V value) |
ICompletableFuture<V> |
getAndReplaceAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
ICompletableFuture<V> |
getAsync(K key) |
ICompletableFuture<V> |
getAsync(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
javax.cache.CacheManager |
getCacheManager() |
<C extends javax.cache.configuration.Configuration<K,V>> |
getConfiguration(Class<C> clazz) |
protected String |
getDistributedObjectName() |
protected Object |
getFromNearCache(Data keyData,
boolean async) |
protected Object |
getInternal(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean async) |
protected String |
getListenerIdLocal(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
CacheStatistics |
getLocalCacheStatistics() |
String |
getNameWithPrefix()
Deprecated.
use #getPrefixedName instead
|
NearCache |
getNearCache() |
String |
getPrefixedName() |
protected <T> T |
getSafely(Future<T> future) |
protected void |
handleStatisticsOnGet(long start,
Object response) |
protected void |
handleStatisticsOnPut(boolean isGet,
long start,
Object response) |
protected void |
handleStatisticsOnPutIfAbsent(long start,
boolean saved) |
protected void |
handleStatisticsOnRemove(boolean isGet,
long start,
Object response) |
protected void |
handleStatisticsOnReplace(boolean isGet,
long start,
Object response) |
protected void |
injectDependencies(Object obj) |
protected void |
invalidateNearCache(Data key) |
protected ClientMessage |
invoke(ClientMessage clientMessage) |
protected ClientMessage |
invoke(ClientMessage clientMessage,
Data keyData) |
protected ClientInvocationFuture |
invoke(ClientMessage req,
Data keyData,
int completionId) |
protected ClientInvocationFuture |
invoke(ClientMessage req,
int partitionId,
int completionId) |
<T> T |
invoke(K key,
javax.cache.processor.EntryProcessor<K,V,T> entryProcessor,
Object... arguments) |
<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() |
boolean |
isDestroyed() |
Iterator<javax.cache.Cache.Entry<K,V>> |
iterator() |
Iterator<javax.cache.Cache.Entry<K,V>> |
iterator(int fetchSize) |
Iterator<javax.cache.Cache.Entry<K,V>> |
iterator(int fetchSize,
int partitionId,
boolean prefetchValues) |
void |
loadAll(Set<? extends K> keys,
boolean replaceExistingValues,
javax.cache.integration.CompletionListener completionListener) |
protected int |
nextCompletionId() |
protected void |
onDestroy()
Called before proxy is destroyed.
|
protected void |
onInitialize()
Called when proxy is created.
|
protected void |
onLoadAll(Set<Data> keys,
Object response,
long start,
long end) |
void |
open() |
protected void |
postDestroy()
Called after proxy is destroyed.
|
protected boolean |
preDestroy()
Called before proxy is destroyed and determines whether destroy should be done.
|
void |
put(K key,
V value) |
void |
put(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
void |
putAll(Map<? extends K,? extends V> map) |
void |
putAll(Map<? extends K,? extends V> map,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
ICompletableFuture<Void> |
putAsync(K key,
V value) |
ICompletableFuture<Void> |
putAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
boolean |
putIfAbsent(K key,
V value) |
boolean |
putIfAbsent(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
ICompletableFuture<Boolean> |
putIfAbsentAsync(K key,
V value) |
ICompletableFuture<Boolean> |
putIfAbsentAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
protected Object |
putIfAbsentInternal(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean withCompletionEvent,
boolean async) |
protected Object |
putInternal(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean isGet,
boolean withCompletionEvent,
boolean async) |
void |
registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
protected Integer |
registerCompletionLatch(Integer countDownLatchId,
int count) |
boolean |
remove(K key) |
boolean |
remove(K key,
V oldValue) |
void |
removeAll() |
void |
removeAll(Set<? extends K> keys) |
protected void |
removeAllInternal() |
protected void |
removeAllKeysInternal(Set<? extends K> keys) |
ICompletableFuture<Boolean> |
removeAsync(K key) |
ICompletableFuture<Boolean> |
removeAsync(K key,
V oldValue) |
protected <T> ICompletableFuture<T> |
removeAsyncInternal(K key,
V oldValue,
boolean hasOldValue,
boolean withCompletionEvent,
boolean async) |
protected String |
removeListenerLocally(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
boolean |
removePartitionLostListener(String id) |
boolean |
replace(K key,
V value) |
boolean |
replace(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
boolean |
replace(K key,
V oldValue,
V newValue) |
boolean |
replace(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
protected <T> ICompletableFuture<T> |
replaceAndGetAsyncInternal(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean hasOldValue,
boolean withCompletionEvent,
boolean async) |
ICompletableFuture<Boolean> |
replaceAsync(K key,
V value) |
ICompletableFuture<Boolean> |
replaceAsync(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
ICompletableFuture<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue) |
ICompletableFuture<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
protected <T> ICompletableFuture<T> |
replaceInternal(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean hasOldValue,
boolean withCompletionEvent,
boolean async) |
int |
size() |
protected void |
storeInNearCache(Data key,
Data valueData,
V value) |
protected void |
submitLoadAllTask(ClientMessage request,
javax.cache.integration.CompletionListener completionListener,
Set<Data> keys) |
protected Data |
toData(Object o) |
protected <T> T |
toObject(Object data) |
<T> T |
unwrap(Class<T> clazz) |
protected void |
updateCacheListenerConfigOnOtherNodes(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration,
boolean isRegister) |
protected void |
waitCompletionLatch(Integer countDownLatchId,
ICompletableFuture future) |
deregisterListener, destroy, equals, getClient, getContext, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invokeOnPartition, invokeOnPartitionInterruptibly, onShutdown, registerListener, setContextclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitopendestroy, isDestroyedgetPrefixedNamegetName, getPartitionKey, getServiceNameprotected HazelcastClientCacheManager cacheManager
protected NearCacheManager nearCacheManager
protected String nearCacheMembershipRegistrationId
protected ClientCacheStatisticsImpl statistics
protected boolean statisticsEnabled
protected boolean cacheOnUpdate
protected ClientContext clientContext
protected final CacheConfig<K,V> cacheConfig
protected final String name
protected final String nameWithPrefix
protected ILogger logger
public ClientCacheProxy(CacheConfig<K,V> cacheConfig)
public NearCache getNearCache()
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.EntryProcessorExceptionpublic <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)
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 Iterator<javax.cache.Cache.Entry<K,V>> iterator(int fetchSize, int partitionId, boolean prefetchValues)
public String addPartitionLostListener(CachePartitionLostListener listener)
public boolean removePartitionLostListener(String id)
protected Object getInternal(K key, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean async)
protected void handleStatisticsOnGet(long start,
Object response)
public ICompletableFuture<V> getAsync(K key)
public ICompletableFuture<V> getAsync(K key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
public ICompletableFuture<Void> putAsync(K key, V value)
public ICompletableFuture<Void> putAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
public ICompletableFuture<Boolean> putIfAbsentAsync(K key, V value)
putIfAbsentAsync in interface ICache<K,V>public ICompletableFuture<Boolean> putIfAbsentAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
putIfAbsentAsync in interface ICache<K,V>public ICompletableFuture<V> getAndPutAsync(K key, V value)
getAndPutAsync in interface ICache<K,V>public ICompletableFuture<V> getAndPutAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAndPutAsync in interface ICache<K,V>public ICompletableFuture<Boolean> removeAsync(K key)
removeAsync in interface ICache<K,V>public ICompletableFuture<Boolean> removeAsync(K key, V oldValue)
removeAsync in interface ICache<K,V>public ICompletableFuture<V> getAndRemoveAsync(K key)
getAndRemoveAsync in interface ICache<K,V>public ICompletableFuture<Boolean> replaceAsync(K key, V value)
replaceAsync in interface ICache<K,V>public ICompletableFuture<Boolean> replaceAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
replaceAsync in interface ICache<K,V>public ICompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue)
replaceAsync in interface ICache<K,V>public ICompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy)
replaceAsync in interface ICache<K,V>public ICompletableFuture<V> getAndReplaceAsync(K key, V value)
getAndReplaceAsync in interface ICache<K,V>public ICompletableFuture<V> getAndReplaceAsync(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAndReplaceAsync in interface ICache<K,V>public void putAll(Map<? extends K,? extends V> map, javax.cache.expiry.ExpiryPolicy expiryPolicy)
public boolean putIfAbsent(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
putIfAbsent in interface ICache<K,V>public boolean replace(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy)
public V getAndReplace(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy)
getAndReplace in interface ICache<K,V>public CacheStatistics getLocalCacheStatistics()
getLocalCacheStatistics in interface ICache<K,V>protected void onInitialize()
ClientProxyprotected void postDestroy()
ClientProxypostDestroy in class ClientProxypublic void close()
protected void onDestroy()
ClientProxyonDestroy in class ClientProxyprotected ClientInvocationFuture invoke(ClientMessage req, int partitionId, int completionId)
protected ClientInvocationFuture invoke(ClientMessage req, Data keyData, int completionId)
protected <T> T getSafely(Future<T> future)
protected <T> ICompletableFuture<T> getAndRemoveAsyncInternal(K key, boolean withCompletionEvent, boolean async)
protected <T> ICompletableFuture<T> removeAsyncInternal(K key, V oldValue, boolean hasOldValue, boolean withCompletionEvent, boolean async)
protected void handleStatisticsOnRemove(boolean isGet,
long start,
Object response)
protected <T> ICompletableFuture<T> replaceInternal(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean hasOldValue, boolean withCompletionEvent, boolean async)
protected <T> ICompletableFuture<T> replaceAndGetAsyncInternal(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean hasOldValue, boolean withCompletionEvent, boolean async)
protected void handleStatisticsOnReplace(boolean isGet,
long start,
Object response)
protected Object putInternal(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean isGet, boolean withCompletionEvent, boolean async)
protected void handleStatisticsOnPut(boolean isGet,
long start,
Object response)
protected Object putIfAbsentInternal(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean withCompletionEvent, boolean async)
protected void handleStatisticsOnPutIfAbsent(long start,
boolean saved)
protected void removeAllInternal()
protected void clearInternal()
protected void invalidateNearCache(Data key)
protected void addListenerLocally(String regId, javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
protected String removeListenerLocally(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
protected String getListenerIdLocal(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
protected void closeListeners()
public void countDownCompletionLatch(int countDownLatchId)
countDownCompletionLatch in interface CacheSyncListenerCompleterprotected Integer registerCompletionLatch(Integer countDownLatchId, int count)
protected void deregisterCompletionLatch(Integer countDownLatchId)
protected void waitCompletionLatch(Integer countDownLatchId, ICompletableFuture future) throws ExecutionException
ExecutionExceptionprotected EventHandler createHandler(CacheEventListenerAdaptor<K,V> adaptor)
protected ICompletableFuture createCompletedFuture(Object value)
protected void injectDependencies(Object obj)
protected String getDistributedObjectName()
getDistributedObjectName in class ClientProxyprotected int nextCompletionId()
protected void ensureOpen()
protected boolean preDestroy()
ClientProxypreDestroy in class ClientProxytrue if destroy should be done, otherwise falsepublic boolean isDestroyed()
isDestroyed in interface ICache<K,V>public void open()
open in interface ICacheInternal<K,V>public String getPrefixedName()
getPrefixedName in interface PrefixedDistributedObject@Deprecated public String getNameWithPrefix()
protected <T> T toObject(Object data)
toObject in class ClientProxyprotected Data toData(Object o)
toData in class ClientProxyprotected ClientMessage invoke(ClientMessage clientMessage)
invoke in class ClientProxyprotected ClientMessage invoke(ClientMessage clientMessage, Data keyData)
protected void submitLoadAllTask(ClientMessage request, javax.cache.integration.CompletionListener completionListener, Set<Data> keys)
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.