public class IsolatedClientSessionIdentityMapAccessor extends IdentityMapAccessor
identityMapManager, session| Constructor and Description |
|---|
IsolatedClientSessionIdentityMapAccessor(AbstractSession session,
IdentityMapManager identityMapManager)
INTERNAL:
An IdentityMapAccessor sits between the session and the identityMapManager
It needs references in both directions
|
| Modifier and Type | Method and Description |
|---|---|
CacheKey |
acquireDeferredLock(java.util.Vector primaryKey,
java.lang.Class javaClass,
ClassDescriptor descriptor)
INTERNAL:
Deferred lock the identity map for the object, this is used for avoiding deadlock
The return cacheKey should be used to release the deferred lock
|
CacheKey |
acquireLock(java.util.Vector primaryKey,
java.lang.Class domainClass,
boolean forMerge,
ClassDescriptor descriptor)
INTERNAL:
Provides access for setting a concurrency lock on an object in the IdentityMap.
|
CacheKey |
acquireLockNoWait(java.util.Vector primaryKey,
java.lang.Class domainClass,
boolean forMerge,
ClassDescriptor descriptor)
INTERNAL:
Provides access for setting a concurrency lock on an object in the IdentityMap.
|
CacheKey |
acquireReadLockOnCacheKey(java.util.Vector primaryKey,
java.lang.Class domainClass,
ClassDescriptor descriptor)
INTERNAL:
Find the cachekey for the provided primary key and place a readlock on it.
|
CacheKey |
acquireReadLockOnCacheKeyNoWait(java.util.Vector primaryKey,
java.lang.Class domainClass,
ClassDescriptor descriptor)
INTERNAL:
Find the cachekey for the provided primary key and place a readlock on it.
|
boolean |
acquireWriteLock()
INTERNAL:
Lock the entire cache if the cache isolation requires.
|
boolean |
containsKey(java.util.Vector key,
java.lang.Class theClass,
ClassDescriptor descriptor)
INTERNAL:
Return whether the identity maps contain an item of the given class and key
|
boolean |
containsObjectInIdentityMap(java.util.Vector primaryKey,
java.lang.Class theClass,
ClassDescriptor descriptor)
ADVANCED:
Return if their is an object for the primary key.
|
java.util.Vector |
getAllFromIdentityMap(Expression selectionCriteria,
java.lang.Class theClass,
Record translationRow,
InMemoryQueryIndirectionPolicy valueHolderPolicy,
boolean shouldReturnInvalidatedObjects)
ADVANCED:
Query the cache in-memory.
|
CacheKey |
getCacheKeyForObject(java.util.Vector primaryKey,
java.lang.Class myClass,
ClassDescriptor descriptor)
INTERNAL:
Retrieve the cache key for the given identity information
|
java.util.Vector |
getClassesRegistered()
INTERNAL:
This method is used to get a list of those classes with IdentityMaps in the Session.
|
java.lang.Object |
getFromIdentityMap(Expression selectionCriteria,
java.lang.Class theClass,
Record translationRow,
InMemoryQueryIndirectionPolicy valueHolderPolicy,
boolean conforming,
boolean shouldReturnInvalidatedObjects,
ClassDescriptor descriptor)
INTERNAL:
Query the cache in-memory.
|
java.lang.Object |
getFromIdentityMap(java.util.Vector primaryKey,
java.lang.Class theClass,
ClassDescriptor descriptor,
JoinedAttributeManager joinedAttributeManager)
ADVANCED:
Return the object from the identity with the primary and class.
|
java.lang.Object |
getFromIdentityMapWithDeferredLock(java.util.Vector primaryKey,
java.lang.Class theClass,
boolean shouldReturnInvalidatedObjects,
ClassDescriptor descriptor)
INTERNAL:
Return the object from the identity with the primary and class.
|
IdentityMap |
getIdentityMap(ClassDescriptor descriptor)
INTERNAL:
Get the identity map for the given class from the IdentityMapManager
|
IdentityMapManager |
getIdentityMapManager()
INTERNAL:
Get the IdentityMapManager for this IdentityMapAccessor
This method should be used for all IdentityMapManager access since it may
be overridden in sub classes.
|
long |
getRemainingValidTime(java.lang.Object object)
ADVANCED:
Return the remaining life of this object.
|
AbstractSession |
getSession()
INTERNAL:
get the session associated with this IdentityMapAccessor
|
java.lang.Object |
getWrapper(java.util.Vector primaryKey,
java.lang.Class theClass)
INTERNAL:
Get the wrapper object from the cache key associated with the given primary key,
this is used for EJB.
|
WriteLockManager |
getWriteLockManager()
INTERNAL:
Returns the single write Lock manager for this session
|
java.lang.Object |
getWriteLockValue(java.util.Vector primaryKey,
java.lang.Class theClass,
ClassDescriptor descriptor)
ADVANCED:
Extract the write lock value from the identity map.
|
void |
initializeAllIdentityMaps()
PUBLIC:
Reset the entire object cache.
|
void |
initializeIdentityMap(java.lang.Class theClass)
PUBLIC:
Reset the identity map for only the instances of the class.
|
void |
initializeIdentityMaps()
PUBLIC:
Reset the entire local object cache.
|
CacheKey |
internalPutInIdentityMap(java.lang.Object domainObject,
java.util.Vector key,
java.lang.Object writeLockValue,
long readTime,
ClassDescriptor descriptor)
ADVANCED:
Register the object with the identity map.
|
void |
printIdentityMap(java.lang.Class businessClass)
PUBLIC:
Used to print all the objects in the identity map of the passed in class.
|
void |
printIdentityMapLocks()
PUBLIC:
Used to print all the locks in every identity map in this session.
|
void |
printIdentityMaps()
PUBLIC:
Used to print all the objects in every identity map in this session.
|
void |
releaseWriteLock()
INTERNAL:
Lock the entire cache if the cache isolation requires.
|
java.lang.Object |
removeFromIdentityMap(java.util.Vector key,
java.lang.Class theClass,
ClassDescriptor descriptor)
ADVANCED:
Remove the object from the object cache.
|
void |
setIdentityMapManager(IdentityMapManager identityMapManager)
INTERNAL:
Set the IdentityMapManager for this IdentityMapAccessor
|
void |
setWrapper(java.util.Vector primaryKey,
java.lang.Class theClass,
java.lang.Object wrapper)
INTERNAL:
Update the wrapper object the cache key associated with the given primary key,
this is used for EJB.
|
void |
updateWriteLockValue(java.util.Vector primaryKey,
java.lang.Class theClass,
java.lang.Object writeLockValue)
ADVANCED:
Update the write lock value in the identity map.
|
acquireLock, clearQueryCache, clearQueryCache, clearQueryCache, clearQueryCache, containsObjectInIdentityMap, containsObjectInIdentityMap, containsObjectInIdentityMap, extractPrimaryKeyFromRow, getAllFromIdentityMap, getAllFromIdentityMap, getCacheKeyForObject, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMapWithDeferredLock, getIdentityMap, getWriteLockValue, getWriteLockValue, invalidateAll, invalidateClass, invalidateClass, invalidateObject, invalidateObject, invalidateObject, invalidateObjects, invalidateObjects, isValid, isValid, isValid, putInIdentityMap, putInIdentityMap, putInIdentityMap, putInIdentityMap, putInIdentityMap, removeFromIdentityMap, removeFromIdentityMap, updateWriteLockValue, validateCachepublic IsolatedClientSessionIdentityMapAccessor(AbstractSession session, IdentityMapManager identityMapManager)
public CacheKey acquireDeferredLock(java.util.Vector primaryKey, java.lang.Class javaClass, ClassDescriptor descriptor)
acquireDeferredLock in class IdentityMapAccessorpublic CacheKey acquireLock(java.util.Vector primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor)
acquireLock in class IdentityMapAccessorIdentityMap#aquirepublic CacheKey acquireLockNoWait(java.util.Vector primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor)
acquireLockNoWait in class IdentityMapAccessorIdentityMap#aquirepublic CacheKey acquireReadLockOnCacheKey(java.util.Vector primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)
acquireReadLockOnCacheKey in class IdentityMapAccessorpublic CacheKey acquireReadLockOnCacheKeyNoWait(java.util.Vector primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)
acquireReadLockOnCacheKeyNoWait in class IdentityMapAccessorpublic boolean acquireWriteLock()
acquireWriteLock in class IdentityMapAccessorpublic boolean containsKey(java.util.Vector key,
java.lang.Class theClass,
ClassDescriptor descriptor)
containsKey in class IdentityMapAccessorpublic boolean containsObjectInIdentityMap(java.util.Vector primaryKey,
java.lang.Class theClass,
ClassDescriptor descriptor)
containsObjectInIdentityMap in class IdentityMapAccessorpublic java.util.Vector getClassesRegistered()
getClassesRegistered in class IdentityMapAccessorpublic java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean shouldReturnInvalidatedObjects) throws QueryException
getAllFromIdentityMap in interface IdentityMapAccessorgetAllFromIdentityMap in class IdentityMapAccessorselectionCriteria - Expression selecting the Objects to be returnedtheClass - Class to be consideredtranslationRow - RecordvalueHolderPolicy - see
InMemoryQueryIndirectionPolicyshouldReturnInvalidatedObjects - boolean - true if only invalid Objects should be returnedQueryExceptionpublic CacheKey getCacheKeyForObject(java.util.Vector primaryKey, java.lang.Class myClass, ClassDescriptor descriptor)
getCacheKeyForObject in class IdentityMapAccessorVector - the primary key of the cache key to be retrievedClass - the class of the cache key to be retrievedpublic java.lang.Object getFromIdentityMap(java.util.Vector primaryKey,
java.lang.Class theClass,
ClassDescriptor descriptor,
JoinedAttributeManager joinedAttributeManager)
getFromIdentityMap in class IdentityMapAccessorpublic java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean conforming, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)
getFromIdentityMap in class IdentityMapAccessorpublic java.lang.Object getFromIdentityMapWithDeferredLock(java.util.Vector primaryKey,
java.lang.Class theClass,
boolean shouldReturnInvalidatedObjects,
ClassDescriptor descriptor)
getFromIdentityMapWithDeferredLock in class IdentityMapAccessorpublic IdentityMapManager getIdentityMapManager()
getIdentityMapManager in class IdentityMapAccessorpublic IdentityMap getIdentityMap(ClassDescriptor descriptor)
getIdentityMap in class IdentityMapAccessorpublic long getRemainingValidTime(java.lang.Object object)
getRemainingValidTime in interface IdentityMapAccessorgetRemainingValidTime in class IdentityMapAccessorobject - Object under considerationpublic AbstractSession getSession()
getSession in class IdentityMapAccessorpublic java.lang.Object getWrapper(java.util.Vector primaryKey,
java.lang.Class theClass)
getWrapper in class IdentityMapAccessorpublic WriteLockManager getWriteLockManager()
getWriteLockManager in class IdentityMapAccessorpublic java.lang.Object getWriteLockValue(java.util.Vector primaryKey,
java.lang.Class theClass,
ClassDescriptor descriptor)
getWriteLockValue in class IdentityMapAccessorpublic void initializeAllIdentityMaps()
NOTE: be careful using this method. This method blows away both this session's and its parents caches, this includes the server cache or any other cache. This throws away any objects that have been read in. Extream caution should be used before doing this because object identity will no longer be maintained for any objects currently read in. This should only be called if the application knows that it no longer has references to object held in the cache.
initializeAllIdentityMaps in interface IdentityMapAccessorinitializeAllIdentityMaps in class IdentityMapAccessorpublic void initializeIdentityMap(java.lang.Class theClass)
initializeIdentityMap in interface IdentityMapAccessorinitializeIdentityMap in class IdentityMapAccessortheClass - Classpublic void initializeIdentityMaps()
initializeIdentityMaps in interface IdentityMapAccessorinitializeIdentityMaps in class IdentityMapAccessorpublic void printIdentityMap(java.lang.Class businessClass)
printIdentityMap in interface IdentityMapAccessorprintIdentityMap in class IdentityMapAccessorbusinessClass - Classpublic void printIdentityMaps()
printIdentityMaps in interface IdentityMapAccessorprintIdentityMaps in class IdentityMapAccessorpublic void printIdentityMapLocks()
printIdentityMapLocks in interface IdentityMapAccessorprintIdentityMapLocks in class IdentityMapAccessorpublic CacheKey internalPutInIdentityMap(java.lang.Object domainObject, java.util.Vector key, java.lang.Object writeLockValue, long readTime, ClassDescriptor descriptor)
internalPutInIdentityMap in class IdentityMapAccessorpublic void releaseWriteLock()
releaseWriteLock in class IdentityMapAccessorpublic java.lang.Object removeFromIdentityMap(java.util.Vector key,
java.lang.Class theClass,
ClassDescriptor descriptor)
removeFromIdentityMap in class IdentityMapAccessorpublic void setIdentityMapManager(IdentityMapManager identityMapManager)
setIdentityMapManager in class IdentityMapAccessorpublic void setWrapper(java.util.Vector primaryKey,
java.lang.Class theClass,
java.lang.Object wrapper)
setWrapper in class IdentityMapAccessorpublic void updateWriteLockValue(java.util.Vector primaryKey,
java.lang.Class theClass,
java.lang.Object writeLockValue)
updateWriteLockValue in interface IdentityMapAccessorupdateWriteLockValue in class IdentityMapAccessorprimaryKey - VectortheClass - ClasswriteLockValue - Object for versioning