org.jboss.cache.invalidation
Class InvalidationManager

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.cache.invalidation.InvalidationManager
All Implemented Interfaces:
InvalidationManagerMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class InvalidationManager
extends ServiceMBeanSupport (src)
implements InvalidationManagerMBean (src)

Implementation of InvalidationManagerMBean

See Also:
InvalidationManagerMBean (src)

Field Summary
protected  java.util.Vector bridgeSubscribers
           
static java.lang.String DEFAULT_INVALIDERS_JMX_NAME
           
static java.lang.String DEFAULT_JMX_SERVICE_NAME
           
protected  boolean DEFAULT_TO_ASYNCHRONOUS_MODE
           
protected  java.util.Hashtable groups
           
protected  int hashcode
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
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 (src) [] invalidations)
          Invalidate a set of IG managed by this IM.
 void batchInvalidate(BatchInvalidation (src) [] invalidations, boolean asynchronous)
          Identical as previous method.
protected  void bridgeGroupInvalidateAllEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, java.lang.String groupName)
           
protected  void bridgeGroupInvalidationEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, java.lang.String groupName, java.io.Serializable key)
           
protected  void bridgeGroupInvalidationEvent(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, java.lang.String groupName, java.io.Serializable[] keys)
           
protected  InvalidationGroup (src) createGroup(java.lang.String groupName)
           
protected  void crossDomainBatchInvalidate(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, BatchInvalidation (src) [] invalidations, boolean asynchronous)
           
protected  void crossDomainInvalidateAll(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl source, java.lang.String groupName, boolean asynchronous)
           
protected  void doBridgedOnlyInvalidateAll(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource, java.lang.String groupName)
           
protected  void doBridgedOnlyInvalidation(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource, java.lang.String groupName, java.io.Serializable key)
           
protected  void doBridgedOnlyInvalidation(org.jboss.cache.invalidation.InvalidationManager.BridgeInvalidationSubscriptionImpl exceptSource, java.lang.String groupName, java.io.Serializable[] keys)
           
protected  void doLocalOnlyInvalidateAll(java.lang.String groupName, boolean asynchronous)
           
protected  void doLocalOnlyInvalidation(java.lang.String groupName, java.io.Serializable key, boolean asynchronous)
           
protected  void doLocalOnlyInvalidations(java.lang.String groupName, java.io.Serializable[] keys, boolean asynchronous)
           
 InvalidationGroup (src) getInvalidationGroup(java.lang.String groupName)
          Returns a given InvalidationGroup instance that is associated with the group name.
 java.util.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(java.lang.String groupName)
          Invalidate all entries for the specified group name.
 void invalidateAll(java.lang.String groupName, boolean async)
          Invalidate all entries for the specified group name using the specified mode.
protected  void localGroupInvalidateAllEvent(java.lang.String groupName, boolean asynchronous)
           
protected  void localGroupInvalidationEvent(java.lang.String groupName, java.io.Serializable key, boolean asynchronous)
           
protected  void localGroupInvalidationsEvent(java.lang.String groupName, java.io.Serializable[] keys, boolean asynchronous)
           
 BridgeInvalidationSubscription (src) registerBridgeListener(InvalidationBridgeListener (src)  listener)
          Allow the subscription of a given Bridge to this IM
protected  void removeGroup(java.lang.String groupName)
           
 void setIsAsynchByDefault(boolean flag)
          Set the is default asynchronous replication mode flag
 void startService()
          Sub-classes should override this method to provide custum 'start' logic.
 void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
protected  void unregisterBridgeListener(BridgeInvalidationSubscription (src)  bridgeSubscriber)
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, 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 (src)
addNotificationListener, getNotificationInfo, handleNotification, 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 (src)
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Field Detail

DEFAULT_JMX_SERVICE_NAME

public static final java.lang.String DEFAULT_JMX_SERVICE_NAME
See Also:
Constant Field Values (src)

DEFAULT_INVALIDERS_JMX_NAME

public static final java.lang.String DEFAULT_INVALIDERS_JMX_NAME
See Also:
Constant Field Values (src)

groups

protected java.util.Hashtable groups

bridgeSubscribers

protected java.util.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 java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

public void stopService()
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)

getIsAsynchByDefault

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

Specified by:
getIsAsynchByDefault in interface InvalidationManagerMBean (src)
Returns:

setIsAsynchByDefault

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

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

getInvalidationGroups

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

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

getInvalidationGroup

public InvalidationGroup (src)  getInvalidationGroup(java.lang.String groupName)
Description copied from interface: InvalidationManagerMBean (src)
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 (src)
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 (src)  registerBridgeListener(InvalidationBridgeListener (src)  listener)
Description copied from interface: InvalidationManagerMBean (src)
Allow the subscription of a given Bridge to this IM

Specified by:
registerBridgeListener in interface InvalidationManagerMBean (src)
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 (src)

batchInvalidate

public void batchInvalidate(BatchInvalidation (src) [] invalidations)
Description copied from interface: InvalidationManagerMBean (src)
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 (src)
Parameters:
invalidations - A set of BatchcInvalidations. Each BatchInvalidation instance contains invalidations for a given InvalidationGroup.

batchInvalidate

public void batchInvalidate(BatchInvalidation (src) [] invalidations,
                            boolean asynchronous)
Description copied from interface: InvalidationManagerMBean (src)
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 (src)
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(java.lang.String groupName)
Description copied from interface: InvalidationManagerMBean (src)
Invalidate all entries for the specified group name.

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

invalidateAll

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

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

hashCode

public int hashCode()

createGroup

protected InvalidationGroup (src)  createGroup(java.lang.String groupName)

removeGroup

protected void removeGroup(java.lang.String groupName)

unregisterBridgeListener

protected void unregisterBridgeListener(BridgeInvalidationSubscription (src)  bridgeSubscriber)

doLocalOnlyInvalidation

protected void doLocalOnlyInvalidation(java.lang.String groupName,
                                       java.io.Serializable key,
                                       boolean asynchronous)

doLocalOnlyInvalidations

protected void doLocalOnlyInvalidations(java.lang.String groupName,
                                        java.io.Serializable[] keys,
                                        boolean asynchronous)

doLocalOnlyInvalidateAll

protected void doLocalOnlyInvalidateAll(java.lang.String groupName,
                                        boolean asynchronous)

doBridgedOnlyInvalidation

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

doBridgedOnlyInvalidation

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

doBridgedOnlyInvalidateAll

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

localGroupInvalidationEvent

protected void localGroupInvalidationEvent(java.lang.String groupName,
                                           java.io.Serializable key,
                                           boolean asynchronous)

localGroupInvalidationsEvent

protected void localGroupInvalidationsEvent(java.lang.String groupName,
                                            java.io.Serializable[] keys,
                                            boolean asynchronous)

localGroupInvalidateAllEvent

protected void localGroupInvalidateAllEvent(java.lang.String groupName,
                                            boolean asynchronous)

bridgeGroupInvalidationEvent

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

bridgeGroupInvalidationEvent

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

bridgeGroupInvalidateAllEvent

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

crossDomainBatchInvalidate

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

crossDomainInvalidateAll

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