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 TypeMethodDescriptionbooleanhasListener(Class<? extends Annotation> annotationClass) Returns whether there is at least one listener regitstered for the given annotationbooleannotifyCacheEntriesEvicted(Collection<Map.Entry<K, V>> entries, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntriesEvictedEventevent.notifyCacheEntryActivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryActivatedEventevent.notifyCacheEntryCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryCreatedEventevent.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 aCacheEntryInvalidatedEventevent.notifyCacheEntryLoaded(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryLoadedEventevent.notifyCacheEntryModified(K key, V value, Metadata metadata, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryModifiedEventevent.notifyCacheEntryPassivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryPassivatedEventevent.notifyCacheEntryRemoved(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryRemovedEventevent.notifyCacheEntryVisited(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryVisitedEventevent.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 ClassLoaderAwareFilteringListenable
addListener, addListenerAsyncMethods inherited from interface ClassLoaderAwareListenable
addListener, addListenerAsyncMethods inherited from interface DataConversionAwareListenable
addFilteredListener, addFilteredListenerAsync, addListener, addListenerAsyncMethods inherited from interface FilteringListenable
addFilteredListener, addFilteredListenerAsync, addListener, addListenerAsync, addStorageFormatFilteredListener, addStorageFormatFilteredListenerAsyncMethods inherited from interface 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 aCacheEntryCreatedEventevent. -
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 aCacheEntryModifiedEventevent. -
notifyCacheEntryRemoved
CompletionStage<Void> notifyCacheEntryRemoved(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryRemovedEventevent. -
notifyCacheEntryVisited
CompletionStage<Void> notifyCacheEntryVisited(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryVisitedEventevent. -
notifyCacheEntriesEvicted
CompletionStage<Void> notifyCacheEntriesEvicted(Collection<Map.Entry<K, V>> entries, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntriesEvictedEventevent. -
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 aCacheEntryInvalidatedEventevent. -
notifyCacheEntryLoaded
CompletionStage<Void> notifyCacheEntryLoaded(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryLoadedEventevent. -
notifyCacheEntryActivated
CompletionStage<Void> notifyCacheEntryActivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryActivatedEventevent. -
notifyCacheEntryPassivated
CompletionStage<Void> notifyCacheEntryPassivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) Notifies all registered listeners of aCacheEntryPassivatedEventevent. -
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
-