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(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Returns whether there is at least one listener regitstered for the given annotationjava.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntriesEvicted(java.util.Collection<java.util.Map.Entry<K,V>> entries, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntriesEvictedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryActivated(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryActivatedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryCreatedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryExpired(K key, V value, Metadata metadata, InvocationContext ctx)
Notifies all registered listeners of a CacheEntryExpired event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryInvalidated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryInvalidatedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryLoaded(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryLoadedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryModified(K key, V value, Metadata metadata, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryModifiedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryPassivated(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryPassivatedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryRemoved(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryRemovedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyCacheEntryVisited(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryVisitedEvent
event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyDataRehashed(ConsistentHash oldCH, ConsistentHash newCH, ConsistentHash unionCH, int newTopologyId, boolean pre)
java.util.concurrent.CompletionStage<java.lang.Void>
notifyPartitionStatusChanged(AvailabilityMode mode, boolean pre)
java.util.concurrent.CompletionStage<java.lang.Void>
notifyPersistenceAvailabilityChanged(boolean available)
java.util.concurrent.CompletionStage<java.lang.Void>
notifyTopologyChanged(CacheTopology oldTopology, CacheTopology newTopology, int newTopologyId, boolean pre)
java.util.concurrent.CompletionStage<java.lang.Void>
notifyTransactionCompleted(GlobalTransaction transaction, boolean successful, InvocationContext ctx)
Notifies all registered listeners of a transaction completion event.java.util.concurrent.CompletionStage<java.lang.Void>
notifyTransactionRegistered(GlobalTransaction globalTransaction, boolean isOriginLocal)
Notifies all registered listeners of a transaction registration event.-
Methods inherited from interface org.infinispan.notifications.ClassLoaderAwareFilteringListenable
addListener, addListener, addListenerAsync
-
Methods inherited from interface org.infinispan.notifications.ClassLoaderAwareListenable
addListener, addListenerAsync
-
Methods inherited from interface org.infinispan.notifications.DataConversionAwareListenable
addFilteredListener, addFilteredListenerAsync, addListener, addListener, addListenerAsync
-
Methods inherited from interface org.infinispan.notifications.FilteringListenable
addFilteredListener, addFilteredListenerAsync, addListener, addListener, addListenerAsync, addStorageFormatFilteredListener, addStorageFormatFilteredListenerAsync
-
Methods inherited from interface org.infinispan.notifications.Listenable
addListener, addListenerAsync, getListeners, removeListener, removeListenerAsync
-
-
-
-
Method Detail
-
notifyCacheEntryCreated
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryCreatedEvent
event.
-
notifyCacheEntryModified
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryModified(K key, V value, Metadata metadata, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryModifiedEvent
event.
-
notifyCacheEntryRemoved
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryRemoved(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryRemovedEvent
event.
-
notifyCacheEntryVisited
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryVisited(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryVisitedEvent
event.
-
notifyCacheEntriesEvicted
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntriesEvicted(java.util.Collection<java.util.Map.Entry<K,V>> entries, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntriesEvictedEvent
event.
-
notifyCacheEntryExpired
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryExpired(K key, V value, Metadata metadata, InvocationContext ctx)
Notifies all registered listeners of a CacheEntryExpired event.
-
notifyCacheEntryInvalidated
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryInvalidated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryInvalidatedEvent
event.
-
notifyCacheEntryLoaded
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryLoaded(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryLoadedEvent
event.
-
notifyCacheEntryActivated
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryActivated(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryActivatedEvent
event.
-
notifyCacheEntryPassivated
java.util.concurrent.CompletionStage<java.lang.Void> notifyCacheEntryPassivated(K key, V value, boolean pre, InvocationContext ctx, org.infinispan.commands.FlagAffectedCommand command)
Notifies all registered listeners of aCacheEntryPassivatedEvent
event.
-
notifyTransactionCompleted
java.util.concurrent.CompletionStage<java.lang.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
java.util.concurrent.CompletionStage<java.lang.Void> notifyTransactionRegistered(GlobalTransaction globalTransaction, boolean isOriginLocal)
Notifies all registered listeners of a transaction registration event.- Parameters:
globalTransaction
-
-
notifyDataRehashed
java.util.concurrent.CompletionStage<java.lang.Void> notifyDataRehashed(ConsistentHash oldCH, ConsistentHash newCH, ConsistentHash unionCH, int newTopologyId, boolean pre)
-
notifyTopologyChanged
java.util.concurrent.CompletionStage<java.lang.Void> notifyTopologyChanged(CacheTopology oldTopology, CacheTopology newTopology, int newTopologyId, boolean pre)
-
notifyPartitionStatusChanged
java.util.concurrent.CompletionStage<java.lang.Void> notifyPartitionStatusChanged(AvailabilityMode mode, boolean pre)
-
notifyPersistenceAvailabilityChanged
java.util.concurrent.CompletionStage<java.lang.Void> notifyPersistenceAvailabilityChanged(boolean available)
-
hasListener
boolean hasListener(java.lang.Class<? extends java.lang.annotation.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
-
-