public class IsolatedClientSessionIdentityMapAccessor extends IdentityMapAccessor
Constructor and Description |
---|
IsolatedClientSessionIdentityMapAccessor(AbstractSession session)
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.lang.Object primaryKey,
java.lang.Class javaClass,
ClassDescriptor descriptor,
boolean isCacheCheckComplete)
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.lang.Object primaryKey,
java.lang.Class domainClass,
boolean forMerge,
ClassDescriptor descriptor,
boolean isCacheCheckComplete)
INTERNAL:
Provides access for setting a concurrency lock on an object in the IdentityMap.
|
CacheKey |
acquireLockNoWait(java.lang.Object primaryKey,
java.lang.Class domainClass,
boolean forMerge,
ClassDescriptor descriptor)
INTERNAL:
Provides access for setting a concurrency lock on an object in the IdentityMap.
|
CacheKey |
acquireLockWithWait(java.lang.Object primaryKey,
java.lang.Class domainClass,
boolean forMerge,
ClassDescriptor descriptor,
int wait)
INTERNAL:
Provides access for setting a concurrency lock on an object in the IdentityMap.
|
CacheKey |
acquireReadLockOnCacheKey(java.lang.Object 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.lang.Object 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 |
containsObjectInIdentityMap(java.lang.Object 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,
int valueHolderPolicy,
boolean shouldReturnInvalidatedObjects)
ADVANCED:
Query the cache in-memory.
|
CacheKey |
getCacheKeyByIndex(CacheIndex index,
CacheId indexValues,
boolean shouldCheckExpiry,
ClassDescriptor descriptor)
Return the cache key for the cache index or null if not found.
|
CacheKey |
getCacheKeyForObject(java.lang.Object primaryKey,
java.lang.Class myClass,
ClassDescriptor descriptor,
boolean forMerge)
INTERNAL:
Retrieve the cache key for the given identity information.
|
CacheKey |
getCacheKeyForObjectForLock(java.lang.Object 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,
int valueHolderPolicy,
boolean conforming,
boolean shouldReturnInvalidatedObjects,
ClassDescriptor descriptor)
INTERNAL:
Query the cache in-memory.
|
java.lang.Object |
getFromIdentityMap(java.lang.Object primaryKey,
java.lang.Object object,
java.lang.Class theClass,
boolean shouldReturnInvalidatedObjects,
ClassDescriptor descriptor)
ADVANCED:
Return the object from the identity with the primary and class.
|
java.lang.Object |
getFromIdentityMapWithDeferredLock(java.lang.Object primaryKey,
java.lang.Class theClass,
boolean shouldReturnInvalidatedObjects,
ClassDescriptor descriptor)
INTERNAL:
Return the object from the identity with the primary and class.
|
java.lang.Object |
getFromLocalIdentityMap(java.lang.Object primaryKey,
java.lang.Class theClass,
boolean shouldReturnInvalidatedObjects,
ClassDescriptor descriptor)
INTERNAL:
Return the object from the local identity map with the primary and class.
|
IdentityMap |
getIdentityMap(ClassDescriptor descriptor,
boolean returnNullIfMissing)
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.
|
java.lang.Object |
getQueryResult(ReadQuery query,
java.util.List parameters,
boolean checkExpiry)
INTERNAL:
Get the cached results associated with a query.
|
AbstractSession |
getSession()
INTERNAL:
get the session associated with this IdentityMapAccessor
|
java.lang.Object |
getWrapper(java.lang.Object 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.lang.Object 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.lang.Object key,
java.lang.Object writeLockValue,
long readTime,
ClassDescriptor descriptor)
ADVANCED:
Register the object with the identity map.
|
void |
invalidateObjects(Expression selectionCriteria,
java.lang.Class theClass,
Record translationRow,
boolean shouldInvalidateOnException)
ADVANCED:
Queries the cache in-memory with the passed in criteria and invalidates matching Objects.
|
void |
invalidateQueryCache(java.lang.Class classThatChanged)
Invalidate/remove any results for the class from the query cache.
|
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 |
putCacheKeyByIndex(CacheIndex index,
CacheId indexValues,
CacheKey cacheKey,
ClassDescriptor descriptor)
Index the cache key by the index values.
|
void |
putQueryResult(ReadQuery query,
java.util.List parameters,
java.lang.Object results)
INTERNAL:
Set the results for a query.
|
void |
releaseWriteLock()
INTERNAL:
Lock the entire cache if the cache isolation requires.
|
java.lang.Object |
removeFromIdentityMap(java.lang.Object key,
java.lang.Class theClass,
ClassDescriptor descriptor,
java.lang.Object object)
ADVANCED:
Remove the object from the object cache.
|
void |
setIdentityMapManager(IdentityMapManager identityMapManager)
INTERNAL:
Set the IdentityMapManager for this IdentityMapAccessor
|
void |
setWrapper(java.lang.Object 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.lang.Object 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, containsObjectInIdentityMap, getAllCacheKeysFromIdentityMapWithEntityPK, getAllFromIdentityMap, getAllFromIdentityMap, getAllFromIdentityMap, getAllFromIdentityMap, getAllFromIdentityMapWithEntityPK, getCacheKeyForObject, getCacheKeyForObject, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMapWithDeferredLock, getFromLocalIdentityMapWithDeferredLock, getIdentityMap, getIdentityMap, getRemainingValidTime, getWriteLockValue, getWriteLockValue, getWriteLockValue, invalidateAll, invalidateClass, invalidateClass, invalidateObject, invalidateObject, invalidateObject, invalidateObject, invalidateObject, invalidateObject, invalidateObject, invalidateObject, invalidateObjects, invalidateObjects, invalidateObjects, isValid, isValid, isValid, isValid, primaryKeyFromVector, putInIdentityMap, putInIdentityMap, putInIdentityMap, putInIdentityMap, putInIdentityMap, putInIdentityMap, putInIdentityMap, putInIdentityMap, removeFromIdentityMap, removeFromIdentityMap, removeFromIdentityMap, updateWriteLockValue, updateWriteLockValue, validateCache
public IsolatedClientSessionIdentityMapAccessor(AbstractSession session)
public CacheKey acquireDeferredLock(java.lang.Object primaryKey, java.lang.Class javaClass, ClassDescriptor descriptor, boolean isCacheCheckComplete)
acquireDeferredLock
in class IdentityMapAccessor
public CacheKey acquireLock(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor, boolean isCacheCheckComplete)
acquireLock
in class IdentityMapAccessor
public CacheKey acquireLockNoWait(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor)
acquireLockNoWait
in class IdentityMapAccessor
public CacheKey acquireLockWithWait(java.lang.Object primaryKey, java.lang.Class domainClass, boolean forMerge, ClassDescriptor descriptor, int wait)
acquireLockWithWait
in class IdentityMapAccessor
public CacheKey acquireReadLockOnCacheKey(java.lang.Object primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)
acquireReadLockOnCacheKey
in class IdentityMapAccessor
public CacheKey acquireReadLockOnCacheKeyNoWait(java.lang.Object primaryKey, java.lang.Class domainClass, ClassDescriptor descriptor)
acquireReadLockOnCacheKeyNoWait
in class IdentityMapAccessor
public boolean acquireWriteLock()
acquireWriteLock
in class IdentityMapAccessor
public boolean containsObjectInIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)
containsObjectInIdentityMap
in class IdentityMapAccessor
public java.util.Vector getClassesRegistered()
getClassesRegistered
in class IdentityMapAccessor
public java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean shouldReturnInvalidatedObjects) throws QueryException
getAllFromIdentityMap
in interface IdentityMapAccessor
getAllFromIdentityMap
in class IdentityMapAccessor
selectionCriteria
- Expression selecting the Objects to be returnedtheClass
- Class to be consideredtranslationRow
- RecordvalueHolderPolicy
- see
InMemoryQueryIndirectionPolicy
shouldReturnInvalidatedObjects
- boolean - true if only invalid Objects should be returnedQueryException
public CacheKey getCacheKeyForObject(java.lang.Object primaryKey, java.lang.Class myClass, ClassDescriptor descriptor, boolean forMerge)
getCacheKeyForObject
in class IdentityMapAccessor
primaryKey
- the primary key of the cache key to be retrieved.myClass
- the class of the cache key to be retrieved.public CacheKey getCacheKeyForObjectForLock(java.lang.Object primaryKey, java.lang.Class myClass, ClassDescriptor descriptor)
getCacheKeyForObjectForLock
in class IdentityMapAccessor
primaryKey
- the primary key of the cache key to be retrieved.myClass
- the class of the cache key to be retrieved.public java.lang.Object getFromIdentityMap(java.lang.Object primaryKey, java.lang.Object object, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)
getFromIdentityMap
in class IdentityMapAccessor
public java.lang.Object getFromLocalIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)
getFromLocalIdentityMap
in class IdentityMapAccessor
public java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean conforming, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)
getFromIdentityMap
in class IdentityMapAccessor
public java.lang.Object getFromIdentityMapWithDeferredLock(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)
getFromIdentityMapWithDeferredLock
in class IdentityMapAccessor
public IdentityMapManager getIdentityMapManager()
getIdentityMapManager
in class IdentityMapAccessor
public IdentityMap getIdentityMap(ClassDescriptor descriptor, boolean returnNullIfMissing)
getIdentityMap
in class IdentityMapAccessor
public java.lang.Object getQueryResult(ReadQuery query, java.util.List parameters, boolean checkExpiry)
getQueryResult
in class IdentityMapAccessor
public AbstractSession getSession()
getSession
in class IdentityMapAccessor
public java.lang.Object getWrapper(java.lang.Object primaryKey, java.lang.Class theClass)
getWrapper
in class IdentityMapAccessor
public WriteLockManager getWriteLockManager()
getWriteLockManager
in class IdentityMapAccessor
public java.lang.Object getWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass, ClassDescriptor descriptor)
getWriteLockValue
in class IdentityMapAccessor
public 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 IdentityMapAccessor
initializeAllIdentityMaps
in class IdentityMapAccessor
public void initializeIdentityMap(java.lang.Class theClass)
initializeIdentityMap
in interface IdentityMapAccessor
initializeIdentityMap
in class IdentityMapAccessor
theClass
- Classpublic void invalidateQueryCache(java.lang.Class classThatChanged)
invalidateQueryCache
in interface IdentityMapAccessor
invalidateQueryCache
in class IdentityMapAccessor
public void initializeIdentityMaps()
initializeIdentityMaps
in interface IdentityMapAccessor
initializeIdentityMaps
in class IdentityMapAccessor
public void putQueryResult(ReadQuery query, java.util.List parameters, java.lang.Object results)
putQueryResult
in class IdentityMapAccessor
public void putCacheKeyByIndex(CacheIndex index, CacheId indexValues, CacheKey cacheKey, ClassDescriptor descriptor)
putCacheKeyByIndex
in class IdentityMapAccessor
public CacheKey getCacheKeyByIndex(CacheIndex index, CacheId indexValues, boolean shouldCheckExpiry, ClassDescriptor descriptor)
getCacheKeyByIndex
in class IdentityMapAccessor
public void printIdentityMap(java.lang.Class businessClass)
printIdentityMap
in interface IdentityMapAccessor
printIdentityMap
in class IdentityMapAccessor
public void printIdentityMaps()
printIdentityMaps
in interface IdentityMapAccessor
printIdentityMaps
in class IdentityMapAccessor
public void printIdentityMapLocks()
printIdentityMapLocks
in interface IdentityMapAccessor
printIdentityMapLocks
in class IdentityMapAccessor
public CacheKey internalPutInIdentityMap(java.lang.Object domainObject, java.lang.Object key, java.lang.Object writeLockValue, long readTime, ClassDescriptor descriptor)
internalPutInIdentityMap
in class IdentityMapAccessor
public void invalidateObjects(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, boolean shouldInvalidateOnException)
invalidateObjects
in interface IdentityMapAccessor
invalidateObjects
in class IdentityMapAccessor
selectionCriteria
- Expression selecting the Objects to be returnedtheClass
- Class to be consideredtranslationRow
- RecordshouldInvalidateOnException
- boolean indicates weather to invalidate the object if conform threw exception.public void releaseWriteLock()
releaseWriteLock
in class IdentityMapAccessor
public java.lang.Object removeFromIdentityMap(java.lang.Object key, java.lang.Class theClass, ClassDescriptor descriptor, java.lang.Object object)
removeFromIdentityMap
in class IdentityMapAccessor
public void setIdentityMapManager(IdentityMapManager identityMapManager)
setIdentityMapManager
in class IdentityMapAccessor
public void setWrapper(java.lang.Object primaryKey, java.lang.Class theClass, java.lang.Object wrapper)
setWrapper
in class IdentityMapAccessor
public void updateWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass, java.lang.Object writeLockValue)
updateWriteLockValue
in interface IdentityMapAccessor
updateWriteLockValue
in class IdentityMapAccessor
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference