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 MapEvent
s
to a CDI observer.- Since:
- 20.06
- Author:
- Aleks Seovic 2020.04.14
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A producer ofFilter
instances.static interface
static interface
A producer ofMapEventTransformer
instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The 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 TypeMethodDescriptionint
compareTo
(AnnotatedMapListener<?, ?> other) void
entryDeleted
(MapEvent<K, V> event) Invoked when a map entry has been removed.void
entryInserted
(MapEvent<K, V> event) Invoked when a map entry has been inserted.void
entryUpdated
(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 theFilter
that should be used when registering this listener.Return the name of the scope this listener is for, ornull
if 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 theMapEventTransformer
that should be used when registering this listener.boolean
Returnstrue
if this listener has a filter annotation to resolve.boolean
Returnstrue
if this listener has a transformer annotation to resolve.boolean
isLite()
Returntrue
if this is lite event listener.boolean
Returntrue
if this is synchronous event listener.boolean
Returntrue
if this listener is for a wild-card cache name.boolean
Returntrue
if this listener is for a wild-card cache name.void
Resolve this listener's filter annotation into aFilter
instance.void
Resolve this listener's transformer annotation into aMapEventTransformer
instance.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:MapListener
Invoked when a map entry has been inserted.- Specified by:
entryInserted
in interfaceMapListener<K,
V> - Parameters:
event
- the MapEvent carrying the insert information
-
entryUpdated
Description copied from interface:MapListener
Invoked when a map entry has been updated.- Specified by:
entryUpdated
in interfaceMapListener<K,
V> - Parameters:
event
- the MapEvent carrying the update information
-
entryDeleted
Description copied from interface:MapListener
Invoked when a map entry has been removed.- Specified by:
entryDeleted
in interfaceMapListener<K,
V> - Parameters:
event
- the MapEvent carrying the delete information
-
compareTo
- Specified by:
compareTo
in 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()Returnstrue
if this listener has a filter annotation to resolve.- Returns:
true
if this listener has a filter annotation to resolve
-
resolveFilter
Resolve this listener's filter annotation into aFilter
instance.If this listener's filter has already been resolved this operation is a no-op.
- Parameters:
producer
- theAnnotatedMapListener.FilterProducer
to use to resolve theFilter
-
hasTransformerAnnotation
public boolean hasTransformerAnnotation()Returnstrue
if this listener has a transformer annotation to resolve.- Returns:
true
if this listener has a transformer annotation to resolve
-
resolveTransformer
Resolve this listener's transformer annotation into aMapEventTransformer
instance.If this listener's transformer has already been resolved this method is a no-op
- Parameters:
producer
- theAnnotatedMapListener.MapEventTransformerProducer
to use to resolve theMapEventTransformer
-
getFilter
Obtain theFilter
that should be used when registering this listener.- Returns:
- the
Filter
that should be used when registering this listener
-
getTransformer
Obtain theMapEventTransformer
that should be used when registering this listener.- Returns:
- the
MapEventTransformer
that 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()Returntrue
if this listener is for a wild-card cache name.- Returns:
true
if 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()Returntrue
if this listener is for a wild-card cache name.- Returns:
true
if this listener is for a wild-card cache name
-
getScopeName
Return the name of the scope this listener is for, ornull
if it should be registered regardless of the scope name.- Returns:
- the name of the cache this listener is for
-
isLite
public boolean isLite()Returntrue
if this is lite event listener.- Returns:
true
if this is lite event listener
-
isSynchronous
public boolean isSynchronous()Returntrue
if this is synchronous event listener.- Specified by:
isSynchronous
in interfaceMapListener<K,
V> - Returns:
true
if this is synchronous event listener
-
toString
-