Package com.oracle.coherence.cdi.events
Class AnnotatedMapListener<K,V>
java.lang.Object
com.oracle.coherence.cdi.events.AnnotatedMapListener<K,V>
- Type Parameters:
K- the type of the map entry keysV- 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA producer ofFilterinstances.static interfacestatic interfaceA producer ofMapEventTransformerinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe wild-card value for cache and service names;Fields inherited from interface com.tangosol.util.MapListener
ASYNCHRONOUS, SYNCHRONOUS, VERSION_AWARE -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedMapListener(AnnotatedMapListener.MapEventObserver<K, V> observer, Set<Annotation> annotations) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AnnotatedMapListener<?, ?> other) voidentryDeleted(MapEvent<K, V> event) Invoked when a map entry has been removed.voidentryInserted(MapEvent<K, V> event) Invoked when a map entry has been inserted.voidentryUpdated(MapEvent<K, V> event) Invoked when a map entry has been updated.Return the name of the cache this listener is for, or'*'if it should be registered regardless of the cache name.Filter<?> Obtain theFilterthat should be used when registering this listener.Return the name of the scope this listener is for, ornullif it should be registered regardless of the scope name.Return the name of the service this listener is for, or'*'if it should be registered regardless of the service name.Return the name of the session that this listener is forObtain theMapEventTransformerthat should be used when registering this listener.booleanReturnstrueif this listener has a filter annotation to resolve.booleanReturnstrueif this listener has a transformer annotation to resolve.booleanisLite()Returntrueif this is lite event listener.booleanReturntrueif this is synchronous event listener.booleanReturntrueif this listener is for a wild-card cache name.booleanReturntrueif this listener is for a wild-card cache name.voidResolve this listener's filter annotation into aFilterinstance.voidResolve this listener's transformer annotation into aMapEventTransformerinstance.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.tangosol.util.MapListener
characteristics, isAsynchronous, isVersionAware, synchronous
-
Field Details
-
WILD_CARD
The wild-card value for cache and service names;- See Also:
-
-
Constructor Details
-
AnnotatedMapListener
public AnnotatedMapListener(AnnotatedMapListener.MapEventObserver<K, V> observer, Set<Annotation> annotations)
-
-
Method Details
-
entryInserted
Description copied from interface:MapListenerInvoked when a map entry has been inserted.- Specified by:
entryInsertedin interfaceMapListener<K,V> - Parameters:
event- the MapEvent carrying the insert information
-
entryUpdated
Description copied from interface:MapListenerInvoked when a map entry has been updated.- Specified by:
entryUpdatedin interfaceMapListener<K,V> - Parameters:
event- the MapEvent carrying the update information
-
entryDeleted
Description copied from interface:MapListenerInvoked when a map entry has been removed.- Specified by:
entryDeletedin interfaceMapListener<K,V> - Parameters:
event- the MapEvent carrying the delete information
-
compareTo
- Specified by:
compareToin interfaceComparable<K>
-
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()Returnstrueif this listener has a filter annotation to resolve.- Returns:
trueif this listener has a filter annotation to resolve
-
resolveFilter
Resolve this listener's filter annotation into aFilterinstance.If this listener's filter has already been resolved this operation is a no-op.
- Parameters:
producer- theAnnotatedMapListener.FilterProducerto use to resolve theFilter
-
hasTransformerAnnotation
public boolean hasTransformerAnnotation()Returnstrueif this listener has a transformer annotation to resolve.- Returns:
trueif this listener has a transformer annotation to resolve
-
resolveTransformer
Resolve this listener's transformer annotation into aMapEventTransformerinstance.If this listener's transformer has already been resolved this method is a no-op
- Parameters:
producer- theAnnotatedMapListener.MapEventTransformerProducerto use to resolve theMapEventTransformer
-
getFilter
Obtain theFilterthat should be used when registering this listener.- Returns:
- the
Filterthat should be used when registering this listener
-
getTransformer
Obtain theMapEventTransformerthat should be used when registering this listener.- Returns:
- the
MapEventTransformerthat should be used when registering this listener
-
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()Returntrueif this listener is for a wild-card cache name.- Returns:
trueif this listener is for a wild-card cache name
-
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()Returntrueif this listener is for a wild-card cache name.- Returns:
trueif this listener is for a wild-card cache name
-
getScopeName
Return the name of the scope this listener is for, ornullif it should be registered regardless of the scope name.- Returns:
- the name of the cache this listener is for
-
isLite
public boolean isLite()Returntrueif this is lite event listener.- Returns:
trueif this is lite event listener
-
isSynchronous
public boolean isSynchronous()Returntrueif this is synchronous event listener.- Specified by:
isSynchronousin interfaceMapListener<K,V> - Returns:
trueif this is synchronous event listener
-
toString
-