K
- the type of key.V
- the type of value.public class NearCachedClientCacheProxy<K,V> extends ClientCacheProxy<K,V>
ICacheInternal
implementation which handles Near Cache specific behaviour of methods.Modifier and Type | Field and Description |
---|---|
protected CacheConfig<K,V> |
cacheConfig |
protected String |
name |
protected String |
nameWithPrefix |
protected int |
partitionCount |
Modifier and Type | Method and Description |
---|---|
protected void |
addListenerLocally(UUID regId,
javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration,
CacheEventListenerAdaptor<K,V> adaptor) |
UUID |
addNearCacheInvalidationListener(EventHandler eventHandler) |
void |
clear() |
protected void |
clearInternal() |
void |
close() |
protected boolean |
containsKeyInternal(Object key) |
void |
countDownCompletionLatch(int countDownLatchId) |
protected void |
ensureOpen() |
protected void |
getAllInternal(Set<? extends K> keys,
Collection<Data> dataKeys,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
List<Object> resultingKeyValuePairs,
long startNanos) |
protected <T> InternalCompletableFuture<T> |
getAndRemoveAsyncInternal(K key) |
protected <T> ClientDelegatingFuture<T> |
getAndRemoveSyncInternal(K key) |
protected InternalCompletableFuture<V> |
getAsyncInternal(Object key,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
BiConsumer<V,Throwable> callback) |
javax.cache.CacheManager |
getCacheManager() |
protected String |
getDistributedObjectName() |
protected UUID |
getListenerIdLocal(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
protected ILogger |
getLogger() |
NearCache |
getNearCache() |
String |
getPrefixedName()
Returns the unique prefixed name for this DistributedObject.
|
protected V |
getSyncInternal(Object key,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
protected void |
injectDependencies(Object obj) |
protected <T> T |
invoke(ClientMessage clientMessage) |
protected ClientInvocationFuture |
invoke(ClientMessage req,
Data keyData,
int completionId) |
protected ClientInvocationFuture |
invoke(ClientMessage req,
int partitionId,
int completionId) |
protected Object |
invokeInternal(Object key,
Data epData,
Object[] arguments) |
boolean |
isClosed() |
boolean |
isDestroyed()
Determines whether this Cache instance has been destroyed.
|
protected void |
loadAllInternal(Set<? extends K> keys,
List<Data> dataKeys,
boolean replaceExistingValues,
javax.cache.integration.CompletionListener completionListener) |
protected BiConsumer<V,Throwable> |
newStatsCallbackOrNull(boolean isGet) |
protected long |
nowInNanosOrDefault() |
protected void |
onDestroy()
Called before proxy is destroyed.
|
protected <T> void |
onGetAndRemoveAsyncInternal(K key,
Data keyData,
ClientDelegatingFuture<T> delegatingFuture,
BiConsumer<T,Throwable> callback) |
protected void |
onInitialize()
Called when proxy is created.
|
protected void |
onPutIfAbsentAsyncInternal(K key,
V value,
Data keyData,
Data valueData,
ClientDelegatingFuture<Boolean> delegatingFuture,
BiConsumer<Boolean,Throwable> callback) |
protected void |
onPutIfAbsentSyncInternal(K key,
V value,
Data keyData,
Data valueData) |
protected void |
onPutSyncInternal(K key,
V value,
Data keyData,
Data valueData) |
protected void |
onRemoveAsyncInternal(Object key,
Data keyData,
ClientDelegatingFuture future,
BiConsumer<Object,Throwable> callback) |
void |
onRemoveSyncInternal(Object key,
Data keyData) |
protected <T> void |
onReplaceAndGetAsync(K key,
V value,
Data keyData,
Data valueData,
ClientDelegatingFuture<T> delegatingFuture,
BiConsumer<T,Throwable> callback) |
protected <T> void |
onReplaceInternalAsync(K key,
V value,
Data keyData,
Data valueData,
ClientDelegatingFuture<T> delegatingFuture,
BiConsumer<T,Throwable> callback) |
void |
open()
Opens cache if available (not destroyed).
|
protected void |
postDestroy()
Called after proxy is destroyed.
|
protected boolean |
preDestroy()
Called before proxy is destroyed and determines whether destroy should be done.
|
protected void |
putAllInternal(Map<? extends K,? extends V> map,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
Map<Object,Data> keyMap,
List<Map.Entry<Data,Data>>[] entriesPerPartition,
long startNanos) |
protected ClientDelegatingFuture |
putAsyncInternal(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean isGet,
boolean withCompletionEvent,
BiConsumer<V,Throwable> callback) |
protected Object |
putIfAbsentInternal(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean withCompletionEvent,
boolean async) |
protected V |
putSyncInternal(K key,
V value,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean isGet) |
void |
removeAll() |
protected void |
removeAllInternal() |
protected void |
removeAllKeysInternal(Set<? extends K> keys,
Collection<Data> dataKeys,
long startNanos) |
protected Object |
removeAsyncInternal(K key,
V oldValue,
boolean hasOldValue,
boolean withCompletionEvent,
boolean async) |
protected void |
removeListenerLocally(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration) |
protected <T> InternalCompletableFuture<T> |
replaceAndGetAsyncInternal(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean hasOldValue,
boolean withCompletionEvent,
boolean async) |
protected <T> InternalCompletableFuture<T> |
replaceAsyncInternal(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean hasOldValue,
boolean withCompletionEvent,
boolean async) |
protected boolean |
replaceSyncInternal(K key,
V oldValue,
V newValue,
javax.cache.expiry.ExpiryPolicy expiryPolicy,
boolean hasOldValue) |
void |
resetCacheManager()
Reset cache manager of this cache proxy to
null . |
void |
setCacheManager(HazelcastCacheManager cacheManager)
Sets relevant
HazelcastCacheManager to client/server. |
protected boolean |
setExpiryPolicyInternal(K key,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
void |
setExpiryPolicyInternal(Set<? extends K> keys,
javax.cache.expiry.ExpiryPolicy expiryPolicy) |
protected void |
setExpiryPolicyInternal(Set<? extends K> keys,
javax.cache.expiry.ExpiryPolicy policy,
Set<Data> serializedKeys) |
protected void |
updateCacheListenerConfigOnOtherNodes(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration,
boolean isRegister) |
protected ClientDelegatingFuture<V> |
wrapPutAsyncFuture(K key,
V value,
Data keyData,
Data valueData,
ClientInvocationFuture invocationFuture,
BiConsumer<V,Throwable> callback) |
addPartitionLostListener, containsKey, deregisterCacheEntryListener, get, get, getAll, getAll, getAndPut, getAndPut, getAndPutAsync, getAndPutAsync, getAndRemove, getAndRemoveAsync, getAndReplace, getAndReplace, getAndReplaceAsync, getAndReplaceAsync, getAsync, getAsync, getConfiguration, getLocalCacheStatistics, invoke, invokeAll, iterator, iterator, iterator, loadAll, onLoadAll, put, put, putAll, putAll, putAsync, putAsync, putIfAbsent, putIfAbsent, putIfAbsentAsync, putIfAbsentAsync, readFromEventJournal, registerCacheEntryListener, registerCacheEntryListener, remove, remove, removeAll, removeAsync, removeAsync, removePartitionLostListener, replace, replace, replace, replace, replaceAsync, replaceAsync, replaceAsync, replaceAsync, setExpiryPolicy, setExpiryPolicy, size, subscribeToEventJournal, unwrap
deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getContext, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onShutdown, registerListener, toData, toObject
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
countDownCompletionLatch
forEach, spliterator
getName, getPartitionKey, getServiceName
protected final String name
protected final String nameWithPrefix
protected final CacheConfig<K,V> cacheConfig
protected int partitionCount
public NearCache getNearCache()
protected void onInitialize()
ClientProxy
onInitialize
in class ClientCacheProxy<K,V>
protected V getSyncInternal(Object key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
protected InternalCompletableFuture<V> getAsyncInternal(Object key, javax.cache.expiry.ExpiryPolicy expiryPolicy, BiConsumer<V,Throwable> callback)
protected void onPutIfAbsentSyncInternal(K key, V value, Data keyData, Data valueData)
protected void onPutIfAbsentAsyncInternal(K key, V value, Data keyData, Data valueData, ClientDelegatingFuture<Boolean> delegatingFuture, BiConsumer<Boolean,Throwable> callback)
protected ClientDelegatingFuture<V> wrapPutAsyncFuture(K key, V value, Data keyData, Data valueData, ClientInvocationFuture invocationFuture, BiConsumer<V,Throwable> callback)
protected <T> void onGetAndRemoveAsyncInternal(K key, Data keyData, ClientDelegatingFuture<T> delegatingFuture, BiConsumer<T,Throwable> callback)
protected <T> void onReplaceInternalAsync(K key, V value, Data keyData, Data valueData, ClientDelegatingFuture<T> delegatingFuture, BiConsumer<T,Throwable> callback)
protected <T> void onReplaceAndGetAsync(K key, V value, Data keyData, Data valueData, ClientDelegatingFuture<T> delegatingFuture, BiConsumer<T,Throwable> callback)
protected void getAllInternal(Set<? extends K> keys, Collection<Data> dataKeys, javax.cache.expiry.ExpiryPolicy expiryPolicy, List<Object> resultingKeyValuePairs, long startNanos)
public void setExpiryPolicyInternal(Set<? extends K> keys, javax.cache.expiry.ExpiryPolicy expiryPolicy)
protected boolean setExpiryPolicyInternal(K key, javax.cache.expiry.ExpiryPolicy expiryPolicy)
protected void putAllInternal(Map<? extends K,? extends V> map, javax.cache.expiry.ExpiryPolicy expiryPolicy, Map<Object,Data> keyMap, List<Map.Entry<Data,Data>>[] entriesPerPartition, long startNanos)
protected boolean containsKeyInternal(Object key)
protected void loadAllInternal(Set<? extends K> keys, List<Data> dataKeys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)
protected void removeAllKeysInternal(Set<? extends K> keys, Collection<Data> dataKeys, long startNanos)
protected void onRemoveAsyncInternal(Object key, Data keyData, ClientDelegatingFuture future, BiConsumer<Object,Throwable> callback)
public void removeAll()
public void clear()
public void close()
protected void postDestroy()
ClientProxy
public UUID addNearCacheInvalidationListener(EventHandler eventHandler)
protected String getDistributedObjectName()
getDistributedObjectName
in class ClientProxy
protected boolean preDestroy()
ClientProxy
preDestroy
in class ClientProxy
true
if destroy should be done, otherwise false
public boolean isClosed()
isClosed
in interface javax.cache.Cache<K,V>
public boolean isDestroyed()
ICache
isDestroyed
in interface ICache<K,V>
true
if this Cache instance is destroyed; false
if it is still open.public void open()
ICacheInternal
open
in interface ICacheInternal<K,V>
public String getPrefixedName()
PrefixedDistributedObject
getPrefixedName
in interface PrefixedDistributedObject
protected <T> T invoke(ClientMessage clientMessage)
invoke
in class ClientProxy
public void countDownCompletionLatch(int countDownLatchId)
countDownCompletionLatch
in interface CacheSyncListenerCompleter
public javax.cache.CacheManager getCacheManager()
getCacheManager
in interface javax.cache.Cache<K,V>
public void setCacheManager(HazelcastCacheManager cacheManager)
ICacheInternal
HazelcastCacheManager
to client/server.setCacheManager
in interface ICacheInternal<K,V>
cacheManager
- client or server HazelcastCacheManager
public void resetCacheManager()
ICacheInternal
null
. Whenever a Cache is not managed any more
(for example after Cache.close()
has been called), its CacheManager
should be reset.resetCacheManager
in interface ICacheInternal<K,V>
protected void onDestroy()
ClientProxy
onDestroy
in class ClientProxy
protected void ensureOpen()
protected void injectDependencies(Object obj)
protected long nowInNanosOrDefault()
protected ClientInvocationFuture invoke(ClientMessage req, int partitionId, int completionId)
protected ClientInvocationFuture invoke(ClientMessage req, Data keyData, int completionId)
protected <T> InternalCompletableFuture<T> getAndRemoveAsyncInternal(K key)
protected <T> ClientDelegatingFuture<T> getAndRemoveSyncInternal(K key)
protected Object removeAsyncInternal(K key, V oldValue, boolean hasOldValue, boolean withCompletionEvent, boolean async)
protected boolean replaceSyncInternal(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean hasOldValue)
protected <T> InternalCompletableFuture<T> replaceAsyncInternal(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean hasOldValue, boolean withCompletionEvent, boolean async)
protected <T> InternalCompletableFuture<T> replaceAndGetAsyncInternal(K key, V oldValue, V newValue, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean hasOldValue, boolean withCompletionEvent, boolean async)
protected V putSyncInternal(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean isGet)
protected ClientDelegatingFuture putAsyncInternal(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean isGet, boolean withCompletionEvent, BiConsumer<V,Throwable> callback)
protected BiConsumer<V,Throwable> newStatsCallbackOrNull(boolean isGet)
protected Object putIfAbsentInternal(K key, V value, javax.cache.expiry.ExpiryPolicy expiryPolicy, boolean withCompletionEvent, boolean async)
protected void removeAllInternal()
protected void clearInternal()
protected void addListenerLocally(UUID regId, javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration, CacheEventListenerAdaptor<K,V> adaptor)
protected void removeListenerLocally(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
protected UUID getListenerIdLocal(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration)
protected void setExpiryPolicyInternal(Set<? extends K> keys, javax.cache.expiry.ExpiryPolicy policy, Set<Data> serializedKeys)
protected void updateCacheListenerConfigOnOtherNodes(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration, boolean isRegister)
protected ILogger getLogger()
Copyright © 2019 Hazelcast, Inc.. All rights reserved.