Class AnnotatedMapListener<K,V>

java.lang.Object
com.oracle.coherence.cdi.events.AnnotatedMapListener<K,V>
Type Parameters:
K - the type of the map entry keys
V - the type of the map entry values
All Implemented Interfaces:
MapListener<K,V>, Comparable<AnnotatedMapListener<?,?>>, EventListener

public class AnnotatedMapListener<K,V> extends Object implements MapListener<K,V>, Comparable<AnnotatedMapListener<?,?>>
MapListener implementation that dispatches MapEvents to a CDI observer.
Since:
20.06
Author:
Aleks Seovic 2020.04.14
  • Field Details

  • Constructor Details

  • Method Details

    • entryInserted

      public void entryInserted(MapEvent<K,V> event)
      Description copied from interface: MapListener
      Invoked when a map entry has been inserted.
      Specified by:
      entryInserted in interface MapListener<K,V>
      Parameters:
      event - the MapEvent carrying the insert information
    • entryUpdated

      public void entryUpdated(MapEvent<K,V> event)
      Description copied from interface: MapListener
      Invoked when a map entry has been updated.
      Specified by:
      entryUpdated in interface MapListener<K,V>
      Parameters:
      event - the MapEvent carrying the update information
    • entryDeleted

      public void entryDeleted(MapEvent<K,V> event)
      Description copied from interface: MapListener
      Invoked when a map entry has been removed.
      Specified by:
      entryDeleted in interface MapListener<K,V>
      Parameters:
      event - the MapEvent carrying the delete information
    • compareTo

      public int compareTo(AnnotatedMapListener<?,?> other)
      Specified by:
      compareTo in interface Comparable<K>
    • getSessionName

      public String getSessionName()
      Return the name of the session that this listener is for
      Returns:
      the name of the session this listener is for
    • hasFilterAnnotation

      public boolean hasFilterAnnotation()
      Returns true if this listener has a filter annotation to resolve.
      Returns:
      true if this listener has a filter annotation to resolve
    • resolveFilter

      public void resolveFilter(AnnotatedMapListener.FilterProducer producer)
      Resolve this listener's filter annotation into a Filter instance.

      If this listener's filter has already been resolved this operation is a no-op.

      Parameters:
      producer - the AnnotatedMapListener.FilterProducer to use to resolve the Filter
    • hasTransformerAnnotation

      public boolean hasTransformerAnnotation()
      Returns true if this listener has a transformer annotation to resolve.
      Returns:
      true if this listener has a transformer annotation to resolve
    • resolveTransformer

      public void resolveTransformer(AnnotatedMapListener.MapEventTransformerProducer producer)
      Resolve this listener's transformer annotation into a MapEventTransformer instance.

      If this listener's transformer has already been resolved this method is a no-op

      Parameters:
      producer - the AnnotatedMapListener.MapEventTransformerProducer to use to resolve the MapEventTransformer
    • getFilter

      public Filter<?> getFilter()
      Obtain the Filter that should be used when registering this listener.
      Returns:
      the Filter that should be used when registering this listener
    • getTransformer

      public MapEventTransformer getTransformer()
      Obtain the MapEventTransformer that should be used when registering this listener.
      Returns:
      the MapEventTransformer that should be used when registering this listener
    • getCacheName

      public String getCacheName()
      Return the name of the cache this listener is for, or '*' if it should be registered regardless of the cache name.
      Returns:
      the name of the cache this listener is for
    • isWildCardCacheName

      public boolean isWildCardCacheName()
      Return true if this listener is for a wild-card cache name.
      Returns:
      true if this listener is for a wild-card cache name
    • getServiceName

      public String getServiceName()
      Return the name of the service this listener is for, or '*' if it should be registered regardless of the service name.
      Returns:
      the name of the cache this listener is for
    • isWildCardServiceName

      public boolean isWildCardServiceName()
      Return true if this listener is for a wild-card cache name.
      Returns:
      true if this listener is for a wild-card cache name
    • getScopeName

      public String getScopeName()
      Return the name of the scope this listener is for, or null if it should be registered regardless of the scope name.
      Returns:
      the name of the cache this listener is for
    • isLite

      public boolean isLite()
      Return true if this is lite event listener.
      Returns:
      true if this is lite event listener
    • isSynchronous

      public boolean isSynchronous()
      Return true if this is synchronous event listener.
      Specified by:
      isSynchronous in interface MapListener<K,V>
      Returns:
      true if this is synchronous event listener
    • toString

      public String toString()
      Overrides:
      toString in class Object