org.infinispan.notifications.cachelistener
Class CacheNotifierImpl

java.lang.Object
  extended by org.infinispan.notifications.AbstractListenerImpl
      extended by org.infinispan.notifications.cachelistener.CacheNotifierImpl
All Implemented Interfaces:
CacheNotifier, Listenable

public class CacheNotifierImpl
extends AbstractListenerImpl
implements CacheNotifier

Helper class that handles all notifications to registered listeners.

Since:
4.0
Author:
Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com

Nested Class Summary
 
Nested classes/interfaces inherited from class org.infinispan.notifications.AbstractListenerImpl
AbstractListenerImpl.ListenerInvocation
 
Field Summary
 
Fields inherited from class org.infinispan.notifications.AbstractListenerImpl
asyncProcessor, listenersMap, syncProcessor
 
Constructor Summary
CacheNotifierImpl()
           
 
Method Summary
protected  Map<Class<? extends Annotation>,Class> getAllowedMethodAnnotations()
           
protected  Log getLog()
           
 void notifyCacheEntriesEvicted(Collection<InternalCacheEntry> entries, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntriesEvicted event.
 void notifyCacheEntryActivated(Object key, Object value, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryActivated event.
 void notifyCacheEntryCreated(Object key, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryCreated event.
 void notifyCacheEntryEvicted(Object key, Object value, InvocationContext ctx)
          Syntactic sugar
 void notifyCacheEntryInvalidated(Object key, Object value, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryInvalidated event.
 void notifyCacheEntryLoaded(Object key, Object value, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryLoaded event.
 void notifyCacheEntryModified(Object key, Object value, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryModified event.
 void notifyCacheEntryPassivated(Object key, Object value, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryPassivated event.
 void notifyCacheEntryRemoved(Object key, Object value, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryRemoved event.
 void notifyCacheEntryVisited(Object key, Object value, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a CacheEntryVisited event.
 void notifyDataRehashed(Collection<Address> oldView, Collection<Address> newView, long newViewId, boolean pre)
           
 void notifyTopologyChanged(ConsistentHash oldConsistentHash, ConsistentHash newConsistentHash, 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.
 
Methods inherited from class org.infinispan.notifications.AbstractListenerImpl
addListener, getListenerCollectionForAnnotation, getListeners, removeListener, start, testListenerClassValidity, testListenerMethodValidity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.notifications.Listenable
addListener, getListeners, removeListener
 

Constructor Detail

CacheNotifierImpl

public CacheNotifierImpl()
Method Detail

getLog

protected Log getLog()
Specified by:
getLog in class AbstractListenerImpl

getAllowedMethodAnnotations

protected Map<Class<? extends Annotation>,Class> getAllowedMethodAnnotations()
Specified by:
getAllowedMethodAnnotations in class AbstractListenerImpl

notifyCacheEntryCreated

public void notifyCacheEntryCreated(Object key,
                                    boolean pre,
                                    InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryCreated event.

Specified by:
notifyCacheEntryCreated in interface CacheNotifier

notifyCacheEntryModified

public void notifyCacheEntryModified(Object key,
                                     Object value,
                                     boolean pre,
                                     InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryModified event.

Specified by:
notifyCacheEntryModified in interface CacheNotifier

notifyCacheEntryRemoved

public void notifyCacheEntryRemoved(Object key,
                                    Object value,
                                    boolean pre,
                                    InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryRemoved event.

Specified by:
notifyCacheEntryRemoved in interface CacheNotifier

notifyCacheEntryVisited

public void notifyCacheEntryVisited(Object key,
                                    Object value,
                                    boolean pre,
                                    InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryVisited event.

Specified by:
notifyCacheEntryVisited in interface CacheNotifier

notifyCacheEntriesEvicted

public void notifyCacheEntriesEvicted(Collection<InternalCacheEntry> entries,
                                      InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntriesEvicted event.

Specified by:
notifyCacheEntriesEvicted in interface CacheNotifier

notifyCacheEntryEvicted

public void notifyCacheEntryEvicted(Object key,
                                    Object value,
                                    InvocationContext ctx)
Description copied from interface: CacheNotifier
Syntactic sugar

Specified by:
notifyCacheEntryEvicted in interface CacheNotifier
Parameters:
key - key evicted
value - value evicted
ctx - context

notifyCacheEntryInvalidated

public void notifyCacheEntryInvalidated(Object key,
                                        Object value,
                                        boolean pre,
                                        InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryInvalidated event.

Specified by:
notifyCacheEntryInvalidated in interface CacheNotifier

notifyCacheEntryLoaded

public void notifyCacheEntryLoaded(Object key,
                                   Object value,
                                   boolean pre,
                                   InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryLoaded event.

Specified by:
notifyCacheEntryLoaded in interface CacheNotifier

notifyCacheEntryActivated

public void notifyCacheEntryActivated(Object key,
                                      Object value,
                                      boolean pre,
                                      InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryActivated event.

Specified by:
notifyCacheEntryActivated in interface CacheNotifier

notifyCacheEntryPassivated

public void notifyCacheEntryPassivated(Object key,
                                       Object value,
                                       boolean pre,
                                       InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a CacheEntryPassivated event.

Specified by:
notifyCacheEntryPassivated in interface CacheNotifier

notifyTransactionCompleted

public void notifyTransactionCompleted(GlobalTransaction transaction,
                                       boolean successful,
                                       InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a transaction completion event.

Specified by:
notifyTransactionCompleted in interface CacheNotifier
Parameters:
transaction - the transaction that has just completed
successful - if true, the transaction committed. If false, this is a rollback event

notifyTransactionRegistered

public void notifyTransactionRegistered(GlobalTransaction globalTransaction,
                                        InvocationContext ctx)
Description copied from interface: CacheNotifier
Notifies all registered listeners of a transaction registration event.

Specified by:
notifyTransactionRegistered in interface CacheNotifier

notifyDataRehashed

public void notifyDataRehashed(Collection<Address> oldView,
                               Collection<Address> newView,
                               long newViewId,
                               boolean pre)
Specified by:
notifyDataRehashed in interface CacheNotifier

notifyTopologyChanged

public void notifyTopologyChanged(ConsistentHash oldConsistentHash,
                                  ConsistentHash newConsistentHash,
                                  boolean pre)
Specified by:
notifyTopologyChanged in interface CacheNotifier

-->

Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.