| org.jboss.cache.invalidation.InvalidationGroup
InvalidationGroup | public interface InvalidationGroup (Code) | | An InvalidationGroup (IG) is the meeting point of all caches and invaliders
working for the same cached information.
For example, two entity beans based
on the same database information will share their cache invalidation so that
a modification performed on the bean of one of the deployed EJB will imply
a cache invalidation in the cache of the other EJB.
In this case, we say that both EJBs work in the same InvalidationGroup.
See Also: InvalidationManagerMBean author: Sacha Labourey. version: $Revision: 57209 $ version: Revisions: version: 21 septembre 2002 Sacha Labourey: version: version: - First implementation
version:
|
addReference | public void addReference()(Code) | | Used to know when to definitively remove this IG. Every component using this IG
must increment the counter, otherwise, the group may be dropped while they are still
using it. Exceptions:
- When calling InvalidationManager.getInvalidationGroup, the counter is automatically
called. Consequently, code accessing this IG through this mean must not call
addReference. Nevertheless, they *must* still call removeReference
appropriatly
- When calling InvalidationGroup.unregister, the counter is automatically
decreased
Consequenlty, users such as cache generally don't need to increment or decrement
the reference count because it is automatically done while getting access to the
InvalidationGroup and unsubscribing. Invaliders do need to correctly unsubscribe.
When the reference count drops to 0, the group is removed from the Manager
Thus, any active user of this group should appropriatly increment the reference
count. Passive listener (JMS/JG bridge for example) should not subscribe.
|
getAsynchronousInvalidation | public boolean getAsynchronousInvalidation()(Code) | | Return the default (a-)synchronous communication scheme used
|
getGroupName | public String getGroupName()(Code) | | Return the name (i.e. identifier) of the current IG
Name of the current IG |
getInvalidationManager | public InvalidationManagerMBean getInvalidationManager()(Code) | | Return the InvalidationManager (IM) to which is linked this group (IG)
|
getReferenceCount | public int getReferenceCount()(Code) | | Return the value of the usage counter for this IG.
Actual usage counter |
invalidate | public void invalidate(Serializable key)(Code) | | Invalidate a single key in all caches associated with this IG
Parameters: key - The key to be invalidated |
invalidate | public void invalidate(Serializable key, boolean asynchronous)(Code) | | Invalidate a single key in all caches associated with this IG specifying a
prefered invalidation mode (synchronous vs. asynchronous)
Parameters: key - The key to be invalidated in the cache Parameters: asynchronous - if true, the invalidation will be, if possible, performed asynchronously |
invalidate | public void invalidate(Serializable[] keys)(Code) | | Invalidate a set of keys in all caches associated with this IG
Parameters: keys - Set of keys to be invalidated |
invalidate | public void invalidate(Serializable[] keys, boolean asynchronous)(Code) | | Invalidate a set of keys in all caches associated with this IG specifying a
prefered invalidation mode (synchronous vs. asynchronous)
Parameters: keys - keys to be invalidated Parameters: asynchronous - if true, the invalidation will be, if possible, performed asynchronously |
invalidateAll | public void invalidateAll()(Code) | | All entries in all the caches associated with this invalidation group should be invalidated.
|
invalidateAll | public void invalidateAll(boolean asynchronous)(Code) | | All entries in all the caches associated with this invalidation group should be invalidated
using specified mode.
|
register | public void register(Invalidatable registered)(Code) | | Register an Invalidatable instance has a subscriber of this InvalidationGroup.
Parameters: registered - Subscribing instance |
removeReference | public void removeReference()(Code) | | Decrease the usage counter. When the counter drops to 0, the group is removed.
|
setAsynchronousInvalidation | public void setAsynchronousInvalidation(boolean async)(Code) | | Set the default mode for managing invalidations in this IG: synchronous or
asynchronous.
Note: this is a best effort setting.
Parameters: async - If true, asynchronous communication should be used if possible. |
unregister | public void unregister(Invalidatable registered)(Code) | | Unregister an Invalidatable instance
Parameters: registered - Unsubscribing instance |
|
|