public class GridCacheInterceptorAdapter<K,V> extends Object implements GridCacheInterceptor<K,V>
| Constructor and Description |
|---|
GridCacheInterceptorAdapter() |
| 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
GridCacheProjection.put(Object, Object, GridPredicate[])
and similar operations before new value is stored in cache. |
GridBiTuple<Boolean,V> |
onBeforeRemove(K key,
V val)
This method is called within
GridCacheProjection.remove(Object, GridPredicate[])
and similar operations to provide control over returned value. |
V |
onGet(K key,
V val)
This method is called within
GridCacheProjection.get(Object)
and similar operations to provide control over returned value. |
@Nullable public V onGet(K key, V val)
GridCacheProjection.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 GridCacheInterceptor<K,V>key - Key.val - Value mapped to key at the moment of get() operation.get() operation.GridCacheProjection.get(Object)@Nullable public V onBeforePut(K key, @Nullable V oldVal, V newVal)
GridCacheProjection.put(Object, Object, GridPredicate[])
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 GridCacheInterceptor<K,V>key - Key.oldVal - Old value.newVal - New value.null cancels the update.GridCacheProjection.put(Object, Object, GridPredicate[])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 GridCacheInterceptor<K,V>key - Key.val - Current value.@Nullable public GridBiTuple<Boolean,V> onBeforeRemove(K key, @Nullable V val)
GridCacheProjection.remove(Object, GridPredicate[])
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 GridCacheInterceptor<K,V>key - Key.val - Old value.remove() operation,
may be null.GridCacheProjection.remove(Object, GridPredicate[])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 GridCacheInterceptor<K,V>key - Key.val - Removed value.Copyright © 2014. All rights reserved.