public final class CacheNotifierImpl<K,V> extends AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>> implements ClusterCacheNotifier<K,V>
Modifier and Type | Class and Description |
---|---|
protected static class |
CacheNotifierImpl.BaseCacheEntryListenerInvocation<K,V> |
protected class |
CacheNotifierImpl.CacheInvocationBuilder |
protected static class |
CacheNotifierImpl.ClusteredListenerInvocation<K,V>
This class is to be used with cluster listener invocations only when they have included current state.
|
protected class |
CacheNotifierImpl.DelegatingCacheInvocationBuilder |
AbstractListenerImpl.AbstractInvocationBuilder, AbstractListenerImpl.ListenerInvocationImpl<A>
asyncProcessor, listenersMap
Constructor and Description |
---|
CacheNotifierImpl() |
canApply, composeStageIfNeeded, findListenerCallbacks, getListeners, hasListener, removeListenerFromMaps, resumeOnCPU, testListenerClassValidity, testListenerMethodValidity, validateAndAddFilterListenerInvocations, validateAndAddListenerInvocations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasListener
addFilteredListener, addListener
addListener
addFilteredListener, addListener, addStorageFormatFilteredListener
addListener, getListeners, removeListener
addListener
public void start()
public void stop()
AbstractListenerImpl
stop
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
protected Log getLog()
getLog
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
protected Map<Class<? extends Annotation>,Class<?>> getAllowedMethodAnnotations(Listener l)
getAllowedMethodAnnotations
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
protected final Transaction suspendIfNeeded()
suspendIfNeeded
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
protected final void resumeIfNeeded(Transaction transaction)
resumeIfNeeded
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
public CompletionStage<Void> notifyCacheEntryCreated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryCreatedEvent
event.notifyCacheEntryCreated
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryModified(K key, V value, Metadata metadata, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryModifiedEvent
event.notifyCacheEntryModified
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryRemoved(K key, V previousValue, Metadata previousMetadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryRemovedEvent
event.notifyCacheEntryRemoved
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryVisited(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryVisitedEvent
event.notifyCacheEntryVisited
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntriesEvicted(Collection<Map.Entry<K,V>> entries, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntriesEvictedEvent
event.notifyCacheEntriesEvicted
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryExpired(K key, V value, Metadata metadata, InvocationContext ctx)
CacheNotifier
notifyCacheEntryExpired
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryInvalidated(K key, V value, Metadata metadata, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryInvalidatedEvent
event.notifyCacheEntryInvalidated
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryLoaded(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryLoadedEvent
event.notifyCacheEntryLoaded
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryActivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryActivatedEvent
event.notifyCacheEntryActivated
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyCacheEntryPassivated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
CacheEntryPassivatedEvent
event.notifyCacheEntryPassivated
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyTransactionCompleted(GlobalTransaction transaction, boolean successful, InvocationContext ctx)
CacheNotifier
notifyTransactionCompleted
in interface CacheNotifier<K,V>
transaction
- the transaction that has just completedsuccessful
- if true, the transaction committed. If false, this is a rollback eventpublic CompletionStage<Void> notifyTransactionRegistered(GlobalTransaction globalTransaction, boolean isOriginLocal)
CacheNotifier
notifyTransactionRegistered
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyDataRehashed(ConsistentHash oldCH, ConsistentHash newCH, ConsistentHash unionCH, int newTopologyId, boolean pre)
notifyDataRehashed
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyTopologyChanged(CacheTopology oldTopology, CacheTopology newTopology, int newTopologyId, boolean pre)
notifyTopologyChanged
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyPartitionStatusChanged(AvailabilityMode mode, boolean pre)
notifyPartitionStatusChanged
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyPersistenceAvailabilityChanged(boolean available)
notifyPersistenceAvailabilityChanged
in interface CacheNotifier<K,V>
public CompletionStage<Void> notifyClusterListeners(Collection<ClusterEvent<K,V>> events, UUID uuid)
ClusterCacheNotifier
notifyClusterListeners
in interface ClusterCacheNotifier<K,V>
public Collection<ClusterListenerReplicateCallable<K,V>> retrieveClusterListenerCallablesToInstall()
ClusterCacheNotifier
retrieveClusterListenerCallablesToInstall
in interface ClusterCacheNotifier<K,V>
public boolean isNotificationAllowed(FlagAffectedCommand cmd, List<CacheEntryListenerInvocation<K,V>> listeners)
public CompletionStage<Void> addListenerAsync(Object listener)
Listenable
Listenable.addListener(Object)
addListenerAsync
in interface Listenable
listener
- listener to add, must not be nullpublic CompletionStage<Void> addListenerAsync(Object listener, ClassLoader classLoader)
ClassLoaderAwareListenable
ClassLoaderAwareListenable.addListener(Object, ClassLoader)
addListenerAsync
in interface ClassLoaderAwareListenable
listener
- listener to add, must not be nullclassLoader
- classloader, must not be nullpublic <C> CompletionStage<Void> addListenerAsync(Object listener, CacheEventFilter<? super K,? super V> filter, CacheEventConverter<? super K,? super V,C> converter, ClassLoader classLoader)
addListenerAsync
in interface ClassLoaderAwareFilteringListenable<K,V>
public List<CacheEntryListenerInvocation<K,V>> getListenerCollectionForAnnotation(Class<? extends Annotation> annotation)
getListenerCollectionForAnnotation
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
public <C> CompletionStage<Void> addListenerAsync(Object listener, CacheEventFilter<? super K,? super V> filter, CacheEventConverter<? super K,? super V,C> converter)
FilteringListenable
FilteringListenable.addListener(Object, CacheEventFilter, CacheEventConverter)
addListenerAsync
in interface FilteringListenable<K,V>
listener
- listener to add, must not be nullpublic <C> CompletionStage<Void> addFilteredListenerAsync(Object listener, CacheEventFilter<? super K,? super V> filter, CacheEventConverter<? super K,? super V,C> converter, Set<Class<? extends Annotation>> filterAnnotations)
FilteringListenable
FilteringListenable.addFilteredListener(Object, CacheEventFilter, CacheEventConverter, Set)
addFilteredListenerAsync
in interface FilteringListenable<K,V>
public <C> CompletionStage<Void> addStorageFormatFilteredListenerAsync(Object listener, CacheEventFilter<? super K,? super V> filter, CacheEventConverter<? super K,? super V,C> converter, Set<Class<? extends Annotation>> filterAnnotations)
FilteringListenable
FilteringListenable.addStorageFormatFilteredListener(Object, CacheEventFilter, CacheEventConverter, Set)
addStorageFormatFilteredListenerAsync
in interface FilteringListenable<K,V>
public <C> CompletionStage<Void> addListenerAsync(ListenerHolder listenerHolder, CacheEventFilter<? super K,? super V> filter, CacheEventConverter<? super K,? super V,C> converter, ClassLoader classLoader)
addListenerAsync
in interface DataConversionAwareListenable<K,V>
public <C> CompletionStage<Void> addFilteredListenerAsync(ListenerHolder listenerHolder, CacheEventFilter<? super K,? super V> filter, CacheEventConverter<? super K,? super V,C> converter, Set<Class<? extends Annotation>> filterAnnotations)
addFilteredListenerAsync
in interface DataConversionAwareListenable<K,V>
public CompletionStage<Void> removeListenerAsync(Object listener)
Listenable
Listenable.removeListener(Object)
removeListenerAsync
in interface Listenable
removeListenerAsync
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
listener
- listener to remove, must not be nullprotected Set<CacheEntryListenerInvocation<K,V>> removeListenerInvocation(Class<? extends Annotation> annotation, Object listener)
removeListenerInvocation
in class AbstractListenerImpl<Event<K,V>,CacheEntryListenerInvocation<K,V>>
Copyright © 2021 JBoss by Red Hat. All rights reserved.