org.jboss.cache.invalidation
Class InvalidationManager

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.cache.invalidation.InvalidationManager
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, InvalidationManagerMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class InvalidationManager
extends org.jboss.system.ServiceMBeanSupport
implements InvalidationManagerMBean

Implementation of InvalidationManagerMBean

Version:
$Revision: 57209 $
Author:
Sacha Labourey.
See Also:
InvalidationManagerMBean

Field Summary
protected  Vector bridgeSubscribers
           
static String DEFAULT_INVALIDERS_JMX_NAME
           
static String DEFAULT_JMX_SERVICE_NAME
           
protected  boolean DEFAULT_TO_ASYNCHRONOUS_MODE
           
protected  Hashtable groups
           
protected  int hashcode
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
InvalidationManager()
           
 
Method Summary
 void batchInvalidate(BatchInvalidation[] invalidations)
          Invalidate a set of IG managed by this IM.
 void batchInvalidate(BatchInvalidation[] invalidations, boolean asynchronous)
          Identical as previous method.
protected  void bridgeGroupInvalidateAllEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, String groupName)
           
protected  void bridgeGroupInvalidationEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, String groupName, Serializable key)
           
protected  void bridgeGroupInvalidationEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, String groupName, Serializable[] keys)
           
protected  InvalidationGroup createGroup(String groupName)
           
protected  void crossDomainBatchInvalidate(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, BatchInvalidation[] invalidations, boolean asynchronous)
           
protected  void crossDomainInvalidateAll(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, String groupName, boolean asynchronous)
           
protected  void doBridgedOnlyInvalidateAll(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource, String groupName)
           
protected  void doBridgedOnlyInvalidation(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource, String groupName, Serializable key)
           
protected  void doBridgedOnlyInvalidation(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource, String groupName, Serializable[] keys)
           
protected  void doLocalOnlyInvalidateAll(String groupName, boolean asynchronous)
           
protected  void doLocalOnlyInvalidation(String groupName, Serializable key, boolean asynchronous)
           
protected  void doLocalOnlyInvalidations(String groupName, Serializable[] keys, boolean asynchronous)
           
 InvalidationGroup getInvalidationGroup(String groupName)
          Returns a given InvalidationGroup instance that is associated with the group name.
 Collection getInvalidationGroups()
          Return the set of all InvalidationGroup currently managed by this IM
 boolean getIsAsynchByDefault()
          Get the is default asynchronous replication mode flag
 int hashCode()
           
 void invalidateAll(String groupName)
          Invalidate all entries for the specified group name.
 void invalidateAll(String groupName, boolean async)
          Invalidate all entries for the specified group name using the specified mode.
protected  void localGroupInvalidateAllEvent(String groupName, boolean asynchronous)
           
protected  void localGroupInvalidationEvent(String groupName, Serializable key, boolean asynchronous)
           
protected  void localGroupInvalidationsEvent(String groupName, Serializable[] keys, boolean asynchronous)
           
 BridgeInvalidationSubscription registerBridgeListener(InvalidationBridgeListener listener)
          Allow the subscription of a given Bridge to this IM
protected  void removeGroup(String groupName)
           
 void setIsAsynchByDefault(boolean flag)
          Set the is default asynchronous replication mode flag
 void startService()
           
 void stopService()
           
protected  void unregisterBridgeListener(BridgeInvalidationSubscription bridgeSubscriber)
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

DEFAULT_JMX_SERVICE_NAME

public static final String DEFAULT_JMX_SERVICE_NAME
See Also:
Constant Field Values

DEFAULT_INVALIDERS_JMX_NAME

public static final String DEFAULT_INVALIDERS_JMX_NAME
See Also:
Constant Field Values

groups

protected Hashtable groups

bridgeSubscribers

protected Vector bridgeSubscribers

hashcode

protected int hashcode

DEFAULT_TO_ASYNCHRONOUS_MODE

protected boolean DEFAULT_TO_ASYNCHRONOUS_MODE
Constructor Detail

InvalidationManager

public InvalidationManager()
Method Detail

startService

public void startService()
                  throws Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

stopService

public void stopService()
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport

getIsAsynchByDefault

public boolean getIsAsynchByDefault()
Description copied from interface: InvalidationManagerMBean
Get the is default asynchronous replication mode flag

Specified by:
getIsAsynchByDefault in interface InvalidationManagerMBean
Returns:

setIsAsynchByDefault

public void setIsAsynchByDefault(boolean flag)
Description copied from interface: InvalidationManagerMBean
Set the is default asynchronous replication mode flag

Specified by:
setIsAsynchByDefault in interface InvalidationManagerMBean
Parameters:
flag - - true for asynch by default

getInvalidationGroups

public Collection getInvalidationGroups()
Description copied from interface: InvalidationManagerMBean
Return the set of all InvalidationGroup currently managed by this IM

Specified by:
getInvalidationGroups in interface InvalidationManagerMBean
Returns:
A collection of InvalidationGroup instances

getInvalidationGroup

public InvalidationGroup getInvalidationGroup(String groupName)
Description copied from interface: InvalidationManagerMBean
Returns a given InvalidationGroup instance that is associated with the group name. All caches that will share the same cache invalidation messages must share the same group name => the group name (or the IG) represents the identifier of a set of caches and invaliders. NOTE: InvalidationGroup.addReference is automatically called when calling this method Thus, there is no need to call it again on the IG. Nevertheless, you are still responsible for calling removeReference to GC IG.

Specified by:
getInvalidationGroup in interface InvalidationManagerMBean
Parameters:
groupName - Name of the group (of the cache for example).
Returns:
The InvalidationGroup associated to the group name i.e. the identifier of the set

registerBridgeListener

public BridgeInvalidationSubscription registerBridgeListener(InvalidationBridgeListener listener)
Description copied from interface: InvalidationManagerMBean
Allow the subscription of a given Bridge to this IM

Specified by:
registerBridgeListener in interface InvalidationManagerMBean
Parameters:
listener - The Bridge registring for invalidation messages
Returns:
A BridgeInvalidationSubscription instance that can is used by the bridge to communicate with the local IM.
See Also:
BridgeInvalidationSubscription

batchInvalidate

public void batchInvalidate(BatchInvalidation[] invalidations)
Description copied from interface: InvalidationManagerMBean
Invalidate a set of IG managed by this IM. This can be used as an optimisation if a bridge will forward requests accross a cluster. In this case, a single message containing all invocations is send accross the wire (it only costs a single network latency). The IM will manage the dispatching of the invalidation messages to the Bridges and to the concerned InvalidationGroups.

Specified by:
batchInvalidate in interface InvalidationManagerMBean
Parameters:
invalidations - A set of BatchcInvalidations. Each BatchInvalidation instance contains invalidations for a given InvalidationGroup.

batchInvalidate

public void batchInvalidate(BatchInvalidation[] invalidations,
                            boolean asynchronous)
Description copied from interface: InvalidationManagerMBean
Identical as previous method. In this case though, it is override the default "asynchronous" tag of each InvalidationGroup and explicitly state if the invalidation messages should be, if possible, be done asynchronously (if implemented by the bridges for example).

Specified by:
batchInvalidate in interface InvalidationManagerMBean
Parameters:
invalidations - Invalidation messages
asynchronous - Indicates if the briges should try to do asynchronous invalidations (accross the network for example) or if a synchronous behaviour is required.

invalidateAll

public void invalidateAll(String groupName)
Description copied from interface: InvalidationManagerMBean
Invalidate all entries for the specified group name.

Specified by:
invalidateAll in interface InvalidationManagerMBean
Parameters:
groupName - invalidation group name

invalidateAll

public void invalidateAll(String groupName,
                          boolean async)
Description copied from interface: InvalidationManagerMBean
Invalidate all entries for the specified group name using the specified mode.

Specified by:
invalidateAll in interface InvalidationManagerMBean
Parameters:
groupName - invalidate group name
async - mode

hashCode

public int hashCode()
Overrides:
hashCode in class Object

createGroup

protected InvalidationGroup createGroup(String groupName)

removeGroup

protected void removeGroup(String groupName)

unregisterBridgeListener

protected void unregisterBridgeListener(BridgeInvalidationSubscription bridgeSubscriber)

doLocalOnlyInvalidation

protected void doLocalOnlyInvalidation(String groupName,
                                       Serializable key,
                                       boolean asynchronous)

doLocalOnlyInvalidations

protected void doLocalOnlyInvalidations(String groupName,
                                        Serializable[] keys,
                                        boolean asynchronous)

doLocalOnlyInvalidateAll

protected void doLocalOnlyInvalidateAll(String groupName,
                                        boolean asynchronous)

doBridgedOnlyInvalidation

protected void doBridgedOnlyInvalidation(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource,
                                         String groupName,
                                         Serializable key)

doBridgedOnlyInvalidation

protected void doBridgedOnlyInvalidation(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource,
                                         String groupName,
                                         Serializable[] keys)

doBridgedOnlyInvalidateAll

protected void doBridgedOnlyInvalidateAll(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource,
                                          String groupName)

localGroupInvalidationEvent

protected void localGroupInvalidationEvent(String groupName,
                                           Serializable key,
                                           boolean asynchronous)

localGroupInvalidationsEvent

protected void localGroupInvalidationsEvent(String groupName,
                                            Serializable[] keys,
                                            boolean asynchronous)

localGroupInvalidateAllEvent

protected void localGroupInvalidateAllEvent(String groupName,
                                            boolean asynchronous)

bridgeGroupInvalidationEvent

protected void bridgeGroupInvalidationEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source,
                                            String groupName,
                                            Serializable key)

bridgeGroupInvalidationEvent

protected void bridgeGroupInvalidationEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source,
                                            String groupName,
                                            Serializable[] keys)

bridgeGroupInvalidateAllEvent

protected void bridgeGroupInvalidateAllEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source,
                                             String groupName)

crossDomainBatchInvalidate

protected void crossDomainBatchInvalidate(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source,
                                          BatchInvalidation[] invalidations,
                                          boolean asynchronous)

crossDomainInvalidateAll

protected void crossDomainInvalidateAll(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source,
                                        String groupName,
                                        boolean asynchronous)


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.