站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

InvalidationGroup (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.cache.invalidation
Interface InvalidationGroup


public interface InvalidationGroup

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.

Version:
$Revision: 1.3.6.1 $

Revisions:

21 septembre 2002 Sacha Labourey:

  • First implementation
Author:
Sacha Labourey.
See Also:
InvalidationManagerMBean

Method Summary
 void addReference()
          Used to know when to definitively remove this IG.
 boolean getAsynchronousInvalidation()
          Return the default (a-)synchronous communication scheme used
 String getGroupName()
          Return the name (i.e.
 InvalidationManagerMBean getInvalidationManager()
          Return the InvalidationManager (IM) to which is linked this group (IG)
 int getReferenceCount()
          Return the value of the usage counter for this IG.
 void invalidate(Serializable key)
          Invalidate a single key in all caches associated with this IG
 void invalidate(Serializable[] keys)
          Invalidate a set of keys in all caches associated with this IG
 void invalidate(Serializable[] keys, boolean asynchronous)
          Invalidate a set of keys in all caches associated with this IG specifying a prefered invalidation mode (synchronous vs.
 void invalidate(Serializable key, boolean asynchronous)
          Invalidate a single key in all caches associated with this IG specifying a prefered invalidation mode (synchronous vs.
 void invalidateAll()
          All entries in all the caches associated with this invalidation group should be invalidated.
 void invalidateAll(boolean asynchronous)
          All entries in all the caches associated with this invalidation group should be invalidated using specified mode.
 void register(Invalidatable registered)
          Register an Invalidatable instance has a subscriber of this InvalidationGroup.
 void removeReference()
          Decrease the usage counter.
 void setAsynchronousInvalidation(boolean async)
          Set the default mode for managing invalidations in this IG: synchronous or asynchronous.
 void unregister(Invalidatable registered)
          Unregister an Invalidatable instance
 

Method Detail

getGroupName

public String getGroupName()
Return the name (i.e. identifier) of the current IG

Returns:
Name of the current IG

invalidate

public void invalidate(Serializable key)
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)
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
asynchronous - if true, the invalidation will be, if possible, performed asynchronously

invalidate

public void invalidate(Serializable[] keys)
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)
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
asynchronous - if true, the invalidation will be, if possible, performed asynchronously

invalidateAll

public void invalidateAll()
All entries in all the caches associated with this invalidation group should be invalidated.


invalidateAll

public void invalidateAll(boolean asynchronous)
All entries in all the caches associated with this invalidation group should be invalidated using specified mode.


addReference

public void addReference()
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.


removeReference

public void removeReference()
Decrease the usage counter. When the counter drops to 0, the group is removed.


getReferenceCount

public int getReferenceCount()
Return the value of the usage counter for this IG.

Returns:
Actual usage counter

register

public void register(Invalidatable registered)
Register an Invalidatable instance has a subscriber of this InvalidationGroup.

Parameters:
registered - Subscribing instance

unregister

public void unregister(Invalidatable registered)
Unregister an Invalidatable instance

Parameters:
registered - Unsubscribing instance

setAsynchronousInvalidation

public void setAsynchronousInvalidation(boolean async)
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.

getAsynchronousInvalidation

public boolean getAsynchronousInvalidation()
Return the default (a-)synchronous communication scheme used


getInvalidationManager

public InvalidationManagerMBean getInvalidationManager()
Return the InvalidationManager (IM) to which is linked this group (IG)



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