org.jboss.cache.invalidation
Class InvalidationManager
java.lang.Object
org.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.cache.invalidation.InvalidationManager
- All Implemented Interfaces:
- MBeanRegistration, NotificationBroadcaster, NotificationEmitter, InvalidationManagerMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean
public class InvalidationManager
- extends ServiceMBeanSupport
- implements InvalidationManagerMBean
Implementation of InvalidationManagerMBean
- Version:
- $Revision: 81030 $
- Author:
- Sacha Labourey.
- See Also:
InvalidationManagerMBean
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 |
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, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext |
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
InvalidationManager
public InvalidationManager()
startService
public void startService()
throws Exception
- Overrides:
startService
in class ServiceMBeanSupport
- Throws:
Exception
stopService
public void stopService()
- Overrides:
stopService
in class 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 messagesasynchronous
- 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 nameasync
- 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 © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.