org.jboss.cache.invalidation
Interface InvalidationManagerMBean

All Superinterfaces:
Service (src) , ServiceMBean (src)
All Known Implementing Classes:
InvalidationManager (src)

public interface InvalidationManagerMBean
extends ServiceMBean (src)

Main service dealing with cache invalidation. While more than one instance may be running at the same time, most of the time, only one will be used. Each InvalidationManager (IM) gives access to a set of InvalidationGroup (IG). Each IG concerns a particular cache and links subscribers that listen for cache invalidations messages with cache invaliders that will create invalidation messages. Thus, to start, a given service will first ask for a specific IG to work with. This is an in-VM operation: each cache and invalider works with a *locally* bound IM. If you want to extend the in-VM mode of operation, you need to provide (possibly dynamically), your IM-Bridge. A bridge forwards cache-invalidation messages on other nodes. It may select which IG are bridged. More than one cache can be bound to a given IM. As some applications needs to be able to send in batch invalidation messages that concern more than one cache. To satisfy this need, a global batchInvalidate method is available at the IM level.

See Also:
InvalidationManager (src)

Field Summary
 
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
 
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.
 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
 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.
 BridgeInvalidationSubscription (src) registerBridgeListener(InvalidationBridgeListener (src)  listener)
          Allow the subscription of a given Bridge to this IM
 void setIsAsynchByDefault(boolean flag)
          Set the is default asynchronous replication mode flag
 
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
 

Method Detail

getIsAsynchByDefault

public boolean getIsAsynchByDefault()
Get the is default asynchronous replication mode flag

Returns:

setIsAsynchByDefault

public void setIsAsynchByDefault(boolean flag)
Set the is default asynchronous replication mode flag

Parameters:
flag - - true for asynch by default

getInvalidationGroup

public InvalidationGroup (src)  getInvalidationGroup(java.lang.String groupName)
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.

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

getInvalidationGroups

public java.util.Collection getInvalidationGroups()
Return the set of all InvalidationGroup currently managed by this IM

Returns:
A collection of InvalidationGroup instances

registerBridgeListener

public BridgeInvalidationSubscription (src)  registerBridgeListener(InvalidationBridgeListener (src)  listener)
Allow the subscription of a given Bridge to this IM

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)
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.

Parameters:
invalidations - A set of BatchcInvalidations. Each BatchInvalidation instance contains invalidations for a given InvalidationGroup.

batchInvalidate

public void batchInvalidate(BatchInvalidation (src) [] invalidations,
                            boolean asynchronous)
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).

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)
Invalidate all entries for the specified group name.

Parameters:
groupName - invalidation group name

invalidateAll

public void invalidateAll(java.lang.String groupName,
                          boolean async)
Invalidate all entries for the specified group name using the specified mode.

Parameters:
groupName - invalidate group name
async - mode