Interface CacheNotifier<K,V>
- All Superinterfaces:
ClassLoaderAwareFilteringListenable<K,
,V> ClassLoaderAwareListenable
,DataConversionAwareListenable<K,
,V> FilteringListenable<K,
,V> Listenable
- All Known Subinterfaces:
ClusterCacheNotifier<K,
V>
- All Known Implementing Classes:
CacheNotifierImpl
public interface CacheNotifier<K,V>
extends DataConversionAwareListenable<K,V>, ClassLoaderAwareListenable
Public interface with all allowed notifications.
- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasListener
(Class<? extends Annotation> annotationClass) Returns whether there is at least one listener regitstered for the given annotationboolean
notifyCacheEntriesEvicted
(Collection<Map.Entry<K, V>> entries, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntriesEvictedEvent
event.notifyCacheEntryActivated
(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryActivatedEvent
event.notifyCacheEntryCreated
(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryCreatedEvent
event.notifyCacheEntryExpired
(K key, V value, Metadata metadata, InvocationContext ctx) Notifies all registered listeners of a CacheEntryExpired event.notifyCacheEntryInvalidated
(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryInvalidatedEvent
event.notifyCacheEntryLoaded
(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryLoadedEvent
event.notifyCacheEntryModified
(K key, V value, Metadata metadata, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryModifiedEvent
event.notifyCacheEntryPassivated
(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryPassivatedEvent
event.notifyCacheEntryRemoved
(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryRemovedEvent
event.notifyCacheEntryVisited
(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryVisitedEvent
event.notifyDataRehashed
(ConsistentHash oldCH, ConsistentHash newCH, ConsistentHash unionCH, int newTopologyId, boolean pre) notifyPartitionStatusChanged
(AvailabilityMode mode, boolean pre) notifyPersistenceAvailabilityChanged
(boolean available) notifyTopologyChanged
(CacheTopology oldTopology, CacheTopology newTopology, int newTopologyId, boolean pre) notifyTransactionCompleted
(GlobalTransaction transaction, boolean successful, InvocationContext ctx) Notifies all registered listeners of a transaction completion event.notifyTransactionRegistered
(GlobalTransaction globalTransaction, boolean isOriginLocal) Notifies all registered listeners of a transaction registration event.Methods inherited from interface org.infinispan.notifications.ClassLoaderAwareFilteringListenable
addListener, addListenerAsync
Methods inherited from interface org.infinispan.notifications.ClassLoaderAwareListenable
addListener, addListenerAsync
Methods inherited from interface org.infinispan.notifications.DataConversionAwareListenable
addFilteredListener, addFilteredListenerAsync, addListener, addListenerAsync
Methods inherited from interface org.infinispan.notifications.FilteringListenable
addFilteredListener, addFilteredListenerAsync, addListener, addListenerAsync, addStorageFormatFilteredListener, addStorageFormatFilteredListenerAsync
Methods inherited from interface org.infinispan.notifications.Listenable
addListener, addListenerAsync, removeListener, removeListenerAsync
-
Method Details
-
notifyCacheEntryCreated
CompletionStage<Void> notifyCacheEntryCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryCreatedEvent
event. -
notifyCacheEntryModified
CompletionStage<Void> notifyCacheEntryModified(K key, V value, Metadata metadata, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryModifiedEvent
event. -
notifyCacheEntryRemoved
CompletionStage<Void> notifyCacheEntryRemoved(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryRemovedEvent
event. -
notifyCacheEntryVisited
CompletionStage<Void> notifyCacheEntryVisited(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryVisitedEvent
event. -
notifyCacheEntriesEvicted
CompletionStage<Void> notifyCacheEntriesEvicted(Collection<Map.Entry<K, V>> entries, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntriesEvictedEvent
event. -
notifyCacheEntryExpired
CompletionStage<Void> notifyCacheEntryExpired(K key, V value, Metadata metadata, InvocationContext ctx) Notifies all registered listeners of a CacheEntryExpired event. -
notifyCacheEntryInvalidated
CompletionStage<Void> notifyCacheEntryInvalidated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryInvalidatedEvent
event. -
notifyCacheEntryLoaded
CompletionStage<Void> notifyCacheEntryLoaded(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryLoadedEvent
event. -
notifyCacheEntryActivated
CompletionStage<Void> notifyCacheEntryActivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryActivatedEvent
event. -
notifyCacheEntryPassivated
CompletionStage<Void> notifyCacheEntryPassivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryPassivatedEvent
event. -
notifyTransactionCompleted
CompletionStage<Void> notifyTransactionCompleted(GlobalTransaction transaction, boolean successful, InvocationContext ctx) Notifies all registered listeners of a transaction completion event.- Parameters:
transaction
- the transaction that has just completedsuccessful
- if true, the transaction committed. If false, this is a rollback event
-
notifyTransactionRegistered
CompletionStage<Void> notifyTransactionRegistered(GlobalTransaction globalTransaction, boolean isOriginLocal) Notifies all registered listeners of a transaction registration event.- Parameters:
globalTransaction
-
-
notifyDataRehashed
CompletionStage<Void> notifyDataRehashed(ConsistentHash oldCH, ConsistentHash newCH, ConsistentHash unionCH, int newTopologyId, boolean pre) -
notifyTopologyChanged
CompletionStage<Void> notifyTopologyChanged(CacheTopology oldTopology, CacheTopology newTopology, int newTopologyId, boolean pre) -
notifyPartitionStatusChanged
-
notifyPersistenceAvailabilityChanged
-
hasListener
Returns whether there is at least one listener regitstered for the given annotation- Parameters:
annotationClass
- annotation to test for- Returns:
- true if there is a listener mapped to the annotation, otherwise false
-
hasListeners
boolean hasListeners() -
getListeners
-