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 booleanhasListener(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 aCacheEntriesEvictedEventevent.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 aCacheEntryActivatedEventevent.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 aCacheEntryCreatedEventevent.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 aCacheEntryInvalidatedEventevent.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 aCacheEntryLoadedEventevent.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 aCacheEntryModifiedEventevent.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 aCacheEntryPassivatedEventevent.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 aCacheEntryRemovedEventevent.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 aCacheEntryVisitedEventevent.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 aCacheEntryCreatedEventevent.
-
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 aCacheEntryModifiedEventevent.
-
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 aCacheEntryRemovedEventevent.
-
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 aCacheEntryVisitedEventevent.
-
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 aCacheEntriesEvictedEventevent.
-
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 aCacheEntryInvalidatedEventevent.
-
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 aCacheEntryLoadedEventevent.
-
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 aCacheEntryActivatedEventevent.
-
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 aCacheEntryPassivatedEventevent.
-
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
-
-