public class CacheInterceptorAdapter<K,V> extends Object implements CacheInterceptor<K,V>
| Constructor and Description |
|---|
CacheInterceptorAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
onAfterPut(K key,
V val)
This method is called after new value has been stored.
|
void |
onAfterRemove(K key,
V val)
This method is called after value has been removed.
|
V |
onBeforePut(K key,
V oldVal,
V newVal)
This method is called within
CacheProjection.put(Object, Object, IgnitePredicate[])
and similar operations before new value is stored in cache. |
IgniteBiTuple<Boolean,V> |
onBeforeRemove(K key,
V val)
This method is called within
CacheProjection.remove(Object, IgnitePredicate[])
and similar operations to provide control over returned value. |
V |
onGet(K key,
V val)
This method is called within
CacheProjection.get(Object)
and similar operations to provide control over returned value. |
@Nullable public V onGet(K key, V val)
CacheProjection.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.CacheProjection.get(Object)@Nullable public V onBeforePut(K key, @Nullable V oldVal, V newVal)
CacheProjection.put(Object, Object, IgnitePredicate[])
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>key - Key.oldVal - Old value.newVal - New value.null cancels the update.CacheProjection.put(Object, Object, IgnitePredicate[])public void onAfterPut(K key, V val)
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>key - Key.val - Current value.@Nullable public IgniteBiTuple<Boolean,V> onBeforeRemove(K key, @Nullable V val)
CacheProjection.remove(Object, IgnitePredicate[])
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>key - Key.val - Old value.remove() operation,
may be null.CacheProjection.remove(Object, IgnitePredicate[])public void onAfterRemove(K key, V val)
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>key - Key.val - Removed value.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 17 2015