org.jboss.cache.notifications
Interface Notifier

All Known Implementing Classes:
NotifierImpl

public interface Notifier

Public interface with all allowed notifications.

Since:
2.2
Author:
Mircea.Markus@jboss.com

Method Summary
 void addCacheListener(Object listener)
          Adds a cache listener to the list of cache listeners registered.
 Set<Object> getCacheListeners()
           
 void notifyBuddyGroupChange(BuddyGroup buddyGroup, boolean pre)
          Notifies all registered listeners of a buddy group change event.
 void notifyCacheBlocked(boolean pre)
           
 void notifyCacheUnblocked(boolean pre)
           
 void notifyNodeActivated(Fqn fqn, boolean pre, Map data, InvocationContext ctx)
          Notifies all registered listeners of a nodeActivated event.
 void notifyNodeCreated(Fqn fqn, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a nodeCreated event.
 void notifyNodeEvicted(Fqn fqn, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a nodeEvicted event.
 void notifyNodeInvalidated(Fqn fqn, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a nodeInvalidated event.
 void notifyNodeLoaded(Fqn fqn, boolean pre, Map data, InvocationContext ctx)
          Notifies all registered listeners of a nodeLoaded event.
 void notifyNodeModified(Fqn fqn, boolean pre, NodeModifiedEvent.ModificationType modificationType, Map data, InvocationContext ctx)
          Notifies all registered listeners of a nodeModified event.
 void notifyNodeMoved(Fqn originalFqn, Fqn newFqn, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a nodeMoved event.
 void notifyNodePassivated(Fqn fqn, boolean pre, Map data, InvocationContext ctx)
          Notifies all registered listeners of a nodePassivated event.
 void notifyNodeRemoved(Fqn fqn, boolean pre, Map data, InvocationContext ctx)
          Notifies all registered listeners of a nodeRemoved event.
 void notifyNodeVisited(Fqn fqn, boolean pre, InvocationContext ctx)
          Notifies all registered listeners of a nodeVisited event.
 void notifyTransactionCompleted(Transaction transaction, boolean successful, InvocationContext ctx)
          Notifies all registered listeners of a transaction completion event.
 void notifyTransactionRegistered(Transaction transaction, InvocationContext ctx)
          Notifies all registered listeners of a transaction registration event.
 void notifyViewChange(org.jgroups.View view, InvocationContext ctx)
          Notifies all registered listeners of a viewChange event.
 void removeCacheListener(Object listener)
          Removes a cache listener from the list of cache listeners registered.
 boolean shouldNotifyOnNodeModified()
          When notifying about node modifications, in many scenarios there is a need of building a new Map object.
 

Method Detail

notifyNodeCreated

void notifyNodeCreated(Fqn fqn,
                       boolean pre,
                       InvocationContext ctx)
Notifies all registered listeners of a nodeCreated event.


notifyNodeModified

void notifyNodeModified(Fqn fqn,
                        boolean pre,
                        NodeModifiedEvent.ModificationType modificationType,
                        Map data,
                        InvocationContext ctx)
Notifies all registered listeners of a nodeModified event.


shouldNotifyOnNodeModified

boolean shouldNotifyOnNodeModified()
When notifying about node modifications, in many scenarios there is a need of building a new Map object. If no listeners are registered for notification then it is pointless building this object - so guard the notification with this call.


notifyNodeRemoved

void notifyNodeRemoved(Fqn fqn,
                       boolean pre,
                       Map data,
                       InvocationContext ctx)
Notifies all registered listeners of a nodeRemoved event.


notifyNodeVisited

void notifyNodeVisited(Fqn fqn,
                       boolean pre,
                       InvocationContext ctx)
Notifies all registered listeners of a nodeVisited event.


notifyNodeMoved

void notifyNodeMoved(Fqn originalFqn,
                     Fqn newFqn,
                     boolean pre,
                     InvocationContext ctx)
Notifies all registered listeners of a nodeMoved event.


notifyNodeEvicted

void notifyNodeEvicted(Fqn fqn,
                       boolean pre,
                       InvocationContext ctx)
Notifies all registered listeners of a nodeEvicted event.


notifyNodeInvalidated

void notifyNodeInvalidated(Fqn fqn,
                           boolean pre,
                           InvocationContext ctx)
Notifies all registered listeners of a nodeInvalidated event.


notifyNodeLoaded

void notifyNodeLoaded(Fqn fqn,
                      boolean pre,
                      Map data,
                      InvocationContext ctx)
Notifies all registered listeners of a nodeLoaded event.


notifyNodeActivated

void notifyNodeActivated(Fqn fqn,
                         boolean pre,
                         Map data,
                         InvocationContext ctx)
Notifies all registered listeners of a nodeActivated event.


notifyNodePassivated

void notifyNodePassivated(Fqn fqn,
                          boolean pre,
                          Map data,
                          InvocationContext ctx)
Notifies all registered listeners of a nodePassivated event.


notifyViewChange

void notifyViewChange(org.jgroups.View view,
                      InvocationContext ctx)
Notifies all registered listeners of a viewChange event. Note that viewChange notifications are ALWAYS sent immediately.


notifyBuddyGroupChange

void notifyBuddyGroupChange(BuddyGroup buddyGroup,
                            boolean pre)
Notifies all registered listeners of a buddy group change event. Note that buddy group change notifications are ALWAYS sent immediately.

Parameters:
buddyGroup - buddy group to set
pre - if true, this has occured before the buddy group message is broadcast to the cluster

notifyTransactionCompleted

void notifyTransactionCompleted(Transaction transaction,
                                boolean successful,
                                InvocationContext ctx)
Notifies all registered listeners of a transaction completion event.

Parameters:
transaction - the transaction that has just completed
successful - if true, the transaction committed. If false, this is a rollback event

notifyTransactionRegistered

void notifyTransactionRegistered(Transaction transaction,
                                 InvocationContext ctx)
Notifies all registered listeners of a transaction registration event.

Parameters:
transaction - the transaction that has just completed

notifyCacheBlocked

void notifyCacheBlocked(boolean pre)

notifyCacheUnblocked

void notifyCacheUnblocked(boolean pre)

addCacheListener

void addCacheListener(Object listener)
Adds a cache listener to the list of cache listeners registered.

Parameters:
listener -

removeCacheListener

void removeCacheListener(Object listener)
Removes a cache listener from the list of cache listeners registered.

Parameters:
listener -

getCacheListeners

Set<Object> getCacheListeners()
Returns:
Retrieves an (unmodifiable) set of cache listeners registered.


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