public class CacheInterceptorAdapter<K,V> extends Object implements CacheInterceptor<K,V>
Constructor and Description |
---|
CacheInterceptorAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
onAfterPut(javax.cache.Cache.Entry<K,V> entry)
This method is called after new value has been stored.
|
void |
onAfterRemove(javax.cache.Cache.Entry<K,V> entry)
This method is called after value has been removed.
|
V |
onBeforePut(javax.cache.Cache.Entry<K,V> entry,
V newVal)
This method is called within
IgniteCache.put(Object, Object)
and similar operations before new value is stored in cache. |
IgniteBiTuple<Boolean,V> |
onBeforeRemove(javax.cache.Cache.Entry<K,V> entry)
This method is called within
IgniteCache.remove(Object)
and similar operations to provide control over returned value. |
V |
onGet(K key,
V val)
This method is called within
IgniteCache.get(Object)
and similar operations to provide control over returned value. |
@Nullable public V onGet(K key, V val)
IgniteCache.get(Object)
and similar operations to provide control over returned value.
If this method returns null
, then get()
operation
results in null
as well.
This method should not throw any exception.
onGet
in interface CacheInterceptor<K,V>
key
- Key.val
- Value mapped to key
at the moment of get()
operation.get()
operation.Cache.get(Object)
@Nullable public V onBeforePut(javax.cache.Cache.Entry<K,V> entry, V newVal)
IgniteCache.put(Object, Object)
and similar operations before new value is stored in cache.
Implementations should not execute any complex logic, including locking, networking or cache operations, as it may lead to deadlock, since this method is called from sensitive synchronization blocks.
This method should not throw any exception.
onBeforePut
in interface CacheInterceptor<K,V>
entry
- Old entry. If CacheConfiguration.isCopyOnRead()
is true
, then is copy.newVal
- New value.null
cancels the update.IgniteCache.put(Object, Object)
public void onAfterPut(javax.cache.Cache.Entry<K,V> entry)
Implementations should not execute any complex logic, including locking, networking or cache operations, as it may lead to deadlock, since this method is called from sensitive synchronization blocks.
This method should not throw any exception.
onAfterPut
in interface CacheInterceptor<K,V>
entry
- Current entry. If CacheConfiguration.isCopyOnRead()
is true
then is copy.@Nullable public IgniteBiTuple<Boolean,V> onBeforeRemove(javax.cache.Cache.Entry<K,V> entry)
IgniteCache.remove(Object)
and similar operations to provide control over returned value.
Implementations should not execute any complex logic, including locking, networking or cache operations, as it may lead to deadlock, since this method is called from sensitive synchronization blocks.
This method should not throw any exception.
onBeforeRemove
in interface CacheInterceptor<K,V>
entry
- Old entry. If CacheConfiguration.isCopyOnRead()
is true
then is copy.remove()
operation,
may be null
.IgniteCache.remove(Object)
public void onAfterRemove(javax.cache.Cache.Entry<K,V> entry)
Implementations should not execute any complex logic, including locking, networking or cache operations, as it may lead to deadlock, since this method is called from sensitive synchronization blocks.
This method should not throw any exception.
onAfterRemove
in interface CacheInterceptor<K,V>
entry
- Removed entry. If CacheConfiguration.isCopyOnRead()
is true
then is copy.
Follow @ApacheIgnite
Apache Ignite Fabric : ver. 1.0.0 Release Date : March 31 2015