org.datanucleus.state
Class CacheState

java.lang.Object
  extended by org.datanucleus.state.FetchPlanState
      extended by org.datanucleus.state.CacheState

public class CacheState
extends FetchPlanState

Holder for the state information for the (Level2) cache process. This is used when we are preparing a graph of objects for caching in the L2 cache. The persistence process requests that object X is cached in the L2 cache, and we process that object down the fetch plan finding a collection of objects that can be cached with it (following what the user has defined in MetaData for the fields that can be cached).


Field Summary
 
Fields inherited from class org.datanucleus.state.FetchPlanState
fetchFieldNames
 
Constructor Summary
CacheState()
          Constructor.
 
Method Summary
 void addCacheableObject(java.lang.Object id, CachedPC cacheablePC)
          Method to add an object to be cached.
 boolean contains(java.lang.Object id)
          Accessor for whether the object with the supplied identity is already to be cached.
 CachedPC getCacheableObject(java.lang.Object id)
          Accessor for the cacheable object for this id (if any).
 java.util.Map getCacheableObjectsIdMap()
          Accessor for the cacheable objects as a Map with the key being the identity.
 
Methods inherited from class org.datanucleus.state.FetchPlanState
addFieldName, getCurrentFetchDepth, getObjectDepthForType, removeLatestFieldName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheState

public CacheState()
Constructor.

Method Detail

addCacheableObject

public void addCacheableObject(java.lang.Object id,
                               CachedPC cacheablePC)
Method to add an object to be cached.

Parameters:
id - Id of the object
cacheablePC - the cacheable persistable object

getCacheableObject

public CachedPC getCacheableObject(java.lang.Object id)
Accessor for the cacheable object for this id (if any). Returns the object reference that will be put in the (level2) cache when this process completes.

Parameters:
id - The identity
Returns:
The cacheable object (CachedPC)

contains

public boolean contains(java.lang.Object id)
Accessor for whether the object with the supplied identity is already to be cached.

Parameters:
id - Identity of the object
Returns:
Whether it is already in the map

getCacheableObjectsIdMap

public java.util.Map getCacheableObjectsIdMap()
Accessor for the cacheable objects as a Map with the key being the identity.

Returns:
the cacheable objects map


Copyright © 2009. All Rights Reserved.