com.ibm.websphere.ejbpersistence

Class PMCacheInvalidationRequest

  1. java.lang.Object
  2. extended bycom.ibm.websphere.ejbpersistence.PMCacheInvalidationRequest
All implemented interfaces:
java.io.Serializable

  1. public class PMCacheInvalidationRequest
  2. extends java.lang.Object
  3. implements java.io.Serializable
An instance of this class represents a request to invalidate one or more CMP beans in the PM cache. When an invalidate occurs, cached data for this bean is removed from the cache; the next time an application tries to find this bean, a fresh copy of the bean data is obtained from the datastore. The ability to invalidate a bean means that a CMP bean may be configured as a long-lifetime bean (see "Lifetime In Cache" in WebSphere documentation) and thus be cached across transactions for much greater performance on future attempts to find this bean. Yet when some outside mechanism updates the bean data, sending an invalidation request will remove stale data from the PM cache so applications that are highly sensitive to stale data do not behave falsely.
See Also:
Serialized Form

Field Summary

Modifier and Type Field and Description
  1. static
  2. int
INVALIDATE_ALL
  1. static
  2. int
INVALIDATE_BEAN_COLLECTION
  1. static
  2. int
INVALIDATE_ONE_BEAN

Constructor Summary

Constructor and Description
PMCacheInvalidationRequest(java.lang.String beanHomeJNDIName)
Constructor used to invalidate all beans of a given type
PMCacheInvalidationRequest(java.lang.String beanHomeJNDIName,java.util.Collection beanKeys)
Constructor used to invalidate a Collection of beans
PMCacheInvalidationRequest(java.lang.String beanHomeJNDIName,java.lang.Object beanKey)
Constructor used to invalidate a single bean

Method Summary

Modifier and Type Method and Description
  1. java.lang.String
getBeanHomeJNDIName()
Gets the beanHomeJNDIName.
  1. int
getInvalidationType()
Gets the invalidationType.
  1. byte[]
getKeyAsByteArray()
INTERNAL USE ONLY: Gets the keyAsByteArray.
  1. java.lang.String
toString()
Return this object as a String, primarily for debug purposes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

INVALIDATE_ONE_BEAN

  1. public static final int INVALIDATE_ONE_BEAN
See Also:

INVALIDATE_BEAN_COLLECTION

  1. public static final int INVALIDATE_BEAN_COLLECTION
See Also:

INVALIDATE_ALL

  1. public static final int INVALIDATE_ALL
See Also:

Constructor Detail

PMCacheInvalidationRequest

  1. public PMCacheInvalidationRequest( java.lang.String beanHomeJNDIName,
  2. java.lang.Object beanKey)
  3. throws java.io.IOException
Constructor used to invalidate a single bean
Parameters:
beanHomeJNDIName - the JNDI name of the bean home. This is the same value used to look up the bean home prior to calling findByPrimaryKey, for example.
beanKey - the primary key of the bean to be invalidated. The actual object type must be the primary key type for this bean type.
Throws:
java.io.IOException

PMCacheInvalidationRequest

  1. public PMCacheInvalidationRequest( java.lang.String beanHomeJNDIName,
  2. java.util.Collection beanKeys)
  3. throws java.io.IOException
Constructor used to invalidate a Collection of beans
Parameters:
beanHomeJNDIName - java.lang.String the JNDI name of the bean home. This is the same value used to look up the bean home prior to calling findByPrimaryKey, for example.
beanKeys - a Collection of the primary keys of the beans to be invalidated. The actual type of each object in the Collection must be the primary key type for this bean type.
Throws:
java.io.IOException

PMCacheInvalidationRequest

  1. public PMCacheInvalidationRequest( java.lang.String beanHomeJNDIName)
Constructor used to invalidate all beans of a given type
Parameters:
beanHomeJNDIName - java.lang.String the JNDI name of the bean home. This is the same value used to look up the bean home prior to calling findByPrimaryKey, for example.

Method Detail

toString

  1. public java.lang.String toString( )
Return this object as a String, primarily for debug purposes
Overrides:
toString in class java.lang.Object

getInvalidationType

  1. public int getInvalidationType( )
Gets the invalidationType.
Returns:
Returns a int

getBeanHomeJNDIName

  1. public java.lang.String getBeanHomeJNDIName( )
Gets the beanHomeJNDIName.
Returns:
Returns a String

getKeyAsByteArray

  1. public byte[] getKeyAsByteArray( )
INTERNAL USE ONLY: Gets the keyAsByteArray.
Returns:
Returns a byte[]