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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasListener(Class<? extends Annotation> annotationClass)
Returns whether there is at least one listener regitstered for the given annotationCompletionStage<Void>
notifyCacheEntriesEvicted(Collection<Map.Entry<K,V>> entries, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntriesEvictedEvent
event.CompletionStage<Void>
notifyCacheEntryActivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryActivatedEvent
event.CompletionStage<Void>
notifyCacheEntryCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryCreatedEvent
event.CompletionStage<Void>
notifyCacheEntryExpired(K key, V value, Metadata metadata, InvocationContext ctx)
Notifies all registered listeners of a CacheEntryExpired event.CompletionStage<Void>
notifyCacheEntryInvalidated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryInvalidatedEvent
event.CompletionStage<Void>
notifyCacheEntryLoaded(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryLoadedEvent
event.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.CompletionStage<Void>
notifyCacheEntryPassivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryPassivatedEvent
event.CompletionStage<Void>
notifyCacheEntryRemoved(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryRemovedEvent
event.CompletionStage<Void>
notifyCacheEntryVisited(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryVisitedEvent
event.CompletionStage<Void>
notifyDataRehashed(ConsistentHash oldCH, ConsistentHash newCH, ConsistentHash unionCH, int newTopologyId, boolean pre)
CompletionStage<Void>
notifyPartitionStatusChanged(AvailabilityMode mode, boolean pre)
CompletionStage<Void>
notifyPersistenceAvailabilityChanged(boolean available)
CompletionStage<Void>
notifyTopologyChanged(CacheTopology oldTopology, CacheTopology newTopology, int newTopologyId, boolean pre)
CompletionStage<Void>
notifyTransactionCompleted(GlobalTransaction transaction, boolean successful, InvocationContext ctx)
Notifies all registered listeners of a transaction completion event.CompletionStage<Void>
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, getListeners, removeListener, removeListenerAsync
-
-
-
-
Method Detail
-
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
CompletionStage<Void> notifyPartitionStatusChanged(AvailabilityMode mode, boolean pre)
-
notifyPersistenceAvailabilityChanged
CompletionStage<Void> notifyPersistenceAvailabilityChanged(boolean available)
-
hasListener
boolean hasListener(Class<? extends Annotation> annotationClass)
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
-
-