Package com.tangosol.util
Interface MapListener<K,V>
-
- Type Parameters:
K
- the type of the cache entry keysV
- the type of the cache entry values
- All Superinterfaces:
EventListener
- All Known Subinterfaces:
MapListenerSupport.PrimingListener<K,V>
,MapListenerSupport.SynchronousListener<K,V>
,VersionAwareMapListener<K,V>
- All Known Implementing Classes:
AbstractEvictionPolicy
,AbstractMapListener
,AbstractRepositoryBase.MapListenerAdapter
,AnnotatedMapListener
,CachingMap.DeactivationListener
,CachingMap.FrontMapListener
,CachingMap.PrimingListener
,CachingMap.SimpleListener
,ContinuousQueryCache.AddListener
,ContinuousQueryCache.DeactivationListener
,ContinuousQueryCache.EventRouter
,ContinuousQueryCache.InternalMapListener
,ContinuousQueryCache.RemoveListener
,ConverterCollections.ConverterCacheListener
,ConverterCollections.ConverterMapListener
,InvocableMapHelper.IndexAdapter
,LocalCache.InternalListener
,LocalCacheAsynchronousMapListener
,LocalCacheSynchronousMapListener
,MapEventOutput
,MapListenerProxy
,MapListenerProxy.DeactivationListener
,MapListenerProxy.WrapperPrimingListener
,MapListenerSupport.WrapperListener
,MapListenerSupport.WrapperPrimingListener
,MapListenerSupport.WrapperSynchronousListener
,MapTriggerListener
,MultiplexingMapListener
,OverflowMap.BackMapListener
,OverflowMap.FrontMapListener
,PartitionedCacheAsynchronousMapListener
,PartitionedCacheConfigurationMapListener
,PartitionedCacheSynchronousMapListener
,PartitionedCacheSyntheticDeleteMapListener
,PassThroughMapListenerAdapter
,ReadWriteBackingMap.InternalMapListener
,SeppukuMapListener
,SimpleOverflowMap.FrontMapListener
,VersionedBackingMap.InternalMapListener
,VersionedNearCache.VersionCacheListener
,WrapperObservableMap.InternalListener
public interface MapListener<K,V> extends EventListener
The listener interface for receiving MapEvents.- Author:
- gg 2002.02.11, hr 2020.11.07
- See Also:
ObservableMap
,MapEvent
-
-
Field Summary
Fields Modifier and Type Field Description static int
ASYNCHRONOUS
A flag that indicates this MapListener can be fired asynchronously.static int
SYNCHRONOUS
A flag that indicates this MapListener should be fired synchronously.static int
VERSION_AWARE
A flag that indicates this MapListener should track versions thus allow missed versions to be replayed if supported by the source of events.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
characteristics()
A bit mask representing the set of characteristics of this listener.void
entryDeleted(MapEvent<K,V> evt)
Invoked when a map entry has been removed.void
entryInserted(MapEvent<K,V> evt)
Invoked when a map entry has been inserted.void
entryUpdated(MapEvent<K,V> evt)
Invoked when a map entry has been updated.default boolean
isAsynchronous()
Returns true if this listener should be fired asynchronously.default boolean
isSynchronous()
Returns true if this listener should be fired synchronously.default boolean
isVersionAware()
Returns true if this listener should track versions thus allowing missed versions to be replayed if supported by the event source.default MapListener<K,V>
synchronous()
Make this MapListener synchronous.
-
-
-
Field Detail
-
ASYNCHRONOUS
static final int ASYNCHRONOUS
A flag that indicates this MapListener can be fired asynchronously.- See Also:
- Constant Field Values
-
SYNCHRONOUS
static final int SYNCHRONOUS
A flag that indicates this MapListener should be fired synchronously.- See Also:
- Constant Field Values
-
VERSION_AWARE
static final int VERSION_AWARE
A flag that indicates this MapListener should track versions thus allow missed versions to be replayed if supported by the source of events.- See Also:
- Constant Field Values
-
-
Method Detail
-
entryInserted
void entryInserted(MapEvent<K,V> evt)
Invoked when a map entry has been inserted.- Parameters:
evt
- the MapEvent carrying the insert information
-
entryUpdated
void entryUpdated(MapEvent<K,V> evt)
Invoked when a map entry has been updated.- Parameters:
evt
- the MapEvent carrying the update information
-
entryDeleted
void entryDeleted(MapEvent<K,V> evt)
Invoked when a map entry has been removed.- Parameters:
evt
- the MapEvent carrying the delete information
-
synchronous
default MapListener<K,V> synchronous()
Make this MapListener synchronous.This should be considered as a very advanced feature, as a synchronous MapListener must exercise extreme caution during event processing since any delay with return or unhandled exception will cause a delay or complete shutdown of the corresponding service.
- Returns:
- a synchronous MapListener
- See Also:
SynchronousListener
,MapListenerSupport.SynchronousListener
-
characteristics
default int characteristics()
A bit mask representing the set of characteristics of this listener.By default, characteristics suggest this listener is
ASYNCHRONOUS
.- Returns:
- a bit mask representing the set of characteristics of this listener
- See Also:
ASYNCHRONOUS
,SYNCHRONOUS
,VERSION_AWARE
-
isAsynchronous
default boolean isAsynchronous()
Returns true if this listener should be fired asynchronously.- Returns:
- true if this listener should be fired asynchronously
-
isSynchronous
default boolean isSynchronous()
Returns true if this listener should be fired synchronously.- Returns:
- true if this listener should be fired synchronously
-
isVersionAware
default boolean isVersionAware()
Returns true if this listener should track versions thus allowing missed versions to be replayed if supported by the event source.- Returns:
- true if this listener should track versions
-
-