Interface MapListener<K,V>

Type Parameters:
K - the type of the cache entry keys
V - 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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    A flag that indicates this MapListener can be fired asynchronously.
    static final int
    A flag that indicates this MapListener should be fired synchronously.
    static final int
    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

    Modifier and Type
    Method
    Description
    default int
    A bit mask representing the set of characteristics of this listener.
    void
    Invoked when a map entry has been removed.
    void
    Invoked when a map entry has been inserted.
    void
    Invoked when a map entry has been updated.
    default boolean
    Returns true if this listener should be fired asynchronously.
    default boolean
    Returns true if this listener should be fired synchronously.
    default boolean
    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>
    Make this MapListener synchronous.
  • Field Details

    • ASYNCHRONOUS

      static final int ASYNCHRONOUS
      A flag that indicates this MapListener can be fired asynchronously.
      See Also:
    • SYNCHRONOUS

      static final int SYNCHRONOUS
      A flag that indicates this MapListener should be fired synchronously.
      See Also:
    • 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:
  • Method Details

    • 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:
    • 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:
    • 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