public final class CacheNotifierImpl extends AbstractListenerImpl implements CacheNotifier
AbstractListenerImpl.ListenerInvocation
asyncProcessor, listenersMap, syncProcessor
Constructor and Description |
---|
CacheNotifierImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Object listener,
KeyFilter filter)
Adds a listener to the component.
|
void |
addListener(Object listener,
KeyFilter filter,
ClassLoader classLoader)
Adds a listener to the component.
|
protected Map<Class<? extends Annotation>,Class<?>> |
getAllowedMethodAnnotations() |
protected Log |
getLog() |
boolean |
isNotificationAllowed(FlagAffectedCommand cmd,
List<AbstractListenerImpl.ListenerInvocation> listeners) |
void |
notifyCacheEntriesEvicted(Collection<InternalCacheEntry> entries,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntriesEvicted event.
|
void |
notifyCacheEntryActivated(Object key,
Object value,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryActivated event.
|
void |
notifyCacheEntryCreated(Object key,
Object value,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryCreated event.
|
void |
notifyCacheEntryEvicted(Object key,
Object value,
InvocationContext ctx,
FlagAffectedCommand command)
Syntactic sugar
|
void |
notifyCacheEntryInvalidated(Object key,
Object value,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryInvalidated event.
|
void |
notifyCacheEntryLoaded(Object key,
Object value,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryLoaded event.
|
void |
notifyCacheEntryModified(Object key,
Object value,
boolean created,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryModified event.
|
void |
notifyCacheEntryPassivated(Object key,
Object value,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryPassivated event.
|
void |
notifyCacheEntryRemoved(Object key,
Object value,
Object oldValue,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryRemoved event.
|
void |
notifyCacheEntryVisited(Object key,
Object value,
boolean pre,
InvocationContext ctx,
FlagAffectedCommand command)
Notifies all registered listeners of a CacheEntryVisited event.
|
void |
notifyDataRehashed(ConsistentHash oldCH,
ConsistentHash newCH,
int newTopologyId,
boolean pre) |
void |
notifyTopologyChanged(ConsistentHash oldConsistentHash,
ConsistentHash newConsistentHash,
int newTopologyId,
boolean pre) |
void |
notifyTransactionCompleted(GlobalTransaction transaction,
boolean successful,
InvocationContext ctx)
Notifies all registered listeners of a transaction completion event.
|
void |
notifyTransactionRegistered(GlobalTransaction globalTransaction,
InvocationContext ctx)
Notifies all registered listeners of a transaction registration event.
|
protected void |
resumeIfNeeded(Transaction transaction) |
protected Transaction |
suspendIfNeeded() |
addListener, addListener, getListenerCollectionForAnnotation, getListeners, removeListener, start, testListenerClassValidity, testListenerMethodValidity, validateAndAddListenerInvocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, getListeners, removeListener
addListener
protected Log getLog()
getLog
in class AbstractListenerImpl
protected Map<Class<? extends Annotation>,Class<?>> getAllowedMethodAnnotations()
getAllowedMethodAnnotations
in class AbstractListenerImpl
protected final Transaction suspendIfNeeded()
suspendIfNeeded
in class AbstractListenerImpl
protected final void resumeIfNeeded(Transaction transaction)
resumeIfNeeded
in class AbstractListenerImpl
public void notifyCacheEntryCreated(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryCreated
in interface CacheNotifier
public void notifyCacheEntryModified(Object key, Object value, boolean created, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryModified
in interface CacheNotifier
public void notifyCacheEntryRemoved(Object key, Object value, Object oldValue, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryRemoved
in interface CacheNotifier
public void notifyCacheEntryVisited(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryVisited
in interface CacheNotifier
public void notifyCacheEntriesEvicted(Collection<InternalCacheEntry> entries, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntriesEvicted
in interface CacheNotifier
public void notifyCacheEntryEvicted(Object key, Object value, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryEvicted
in interface CacheNotifier
key
- key evictedvalue
- value evictedctx
- contextpublic void notifyCacheEntryInvalidated(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryInvalidated
in interface CacheNotifier
public void notifyCacheEntryLoaded(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryLoaded
in interface CacheNotifier
public void notifyCacheEntryActivated(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryActivated
in interface CacheNotifier
public void notifyCacheEntryPassivated(Object key, Object value, boolean pre, InvocationContext ctx, FlagAffectedCommand command)
CacheNotifier
notifyCacheEntryPassivated
in interface CacheNotifier
public void notifyTransactionCompleted(GlobalTransaction transaction, boolean successful, InvocationContext ctx)
CacheNotifier
notifyTransactionCompleted
in interface CacheNotifier
transaction
- the transaction that has just completedsuccessful
- if true, the transaction committed. If false, this is a rollback eventpublic void notifyTransactionRegistered(GlobalTransaction globalTransaction, InvocationContext ctx)
CacheNotifier
notifyTransactionRegistered
in interface CacheNotifier
public void notifyDataRehashed(ConsistentHash oldCH, ConsistentHash newCH, int newTopologyId, boolean pre)
notifyDataRehashed
in interface CacheNotifier
public void notifyTopologyChanged(ConsistentHash oldConsistentHash, ConsistentHash newConsistentHash, int newTopologyId, boolean pre)
notifyTopologyChanged
in interface CacheNotifier
public boolean isNotificationAllowed(FlagAffectedCommand cmd, List<AbstractListenerImpl.ListenerInvocation> listeners)
public void addListener(Object listener, KeyFilter filter, ClassLoader classLoader)
ClassLoaderAwareFilteringListenable
Listener
and
further to that, contain methods annotated appropriately, otherwise the listener will not be registered.
See the Listener
annotation for more information.
addListener
in interface ClassLoaderAwareFilteringListenable
listener
- must not be null.classLoader
- class loaderpublic void addListener(Object listener, KeyFilter filter)
FilteringListenable
Listener
and
further to that, contain methods annotated appropriately, otherwise the listener will not be registered.
See the Listener
annotation for more information.
addListener
in interface FilteringListenable
listener
- must not be null.Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.