/** * PUBLIC: * Returns true if the descriptor represents an isolated class */ public boolean isSharedIsolation() { return getCachePolicy().isSharedIsolation(); }
/** * PUBLIC: * Returns true if the descriptor represents an isolated class */ public boolean isSharedIsolation() { return getCachePolicy().isSharedIsolation(); }
/** * Return the cache key for the cache index or null if not found. */ @Override public CacheKey getCacheKeyByIndex(CacheIndex index, CacheId indexValues, boolean shouldCheckExpiry, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().getCacheKeyByIndex(index, indexValues, shouldCheckExpiry, descriptor); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().getCacheKeyByIndex(index, indexValues, shouldCheckExpiry, descriptor); } }
/** * ADVANCED: * Extract the write lock value from the identity map. */ @Override public Object getWriteLockValue(Object primaryKey, Class theClass, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().getWriteLockValue(primaryKey, theClass, descriptor); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, theClass, descriptor); } }
/** * INTERNAL: * Get the identity map for the given class from the IdentityMapManager */ @Override public IdentityMap getIdentityMap(ClassDescriptor descriptor, boolean returnNullIfMissing) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().getIdentityMap(descriptor, returnNullIfMissing); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().getIdentityMap(descriptor, returnNullIfMissing); } }
/** * Index the cache key by the index values. */ @Override public void putCacheKeyByIndex(CacheIndex index, CacheId indexValues, CacheKey cacheKey, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { getIdentityMapManager().putCacheKeyByIndex(index, indexValues, cacheKey, descriptor); } else { ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().putCacheKeyByIndex(index, indexValues, cacheKey, descriptor); } }
/** * Index the cache key by the index values. */ @Override public void putCacheKeyByIndex(CacheIndex index, CacheId indexValues, CacheKey cacheKey, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { getIdentityMapManager().putCacheKeyByIndex(index, indexValues, cacheKey, descriptor); } else { ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().putCacheKeyByIndex(index, indexValues, cacheKey, descriptor); } }
/** * ADVANCED: * Extract the write lock value from the identity map. */ @Override public Object getWriteLockValue(Object primaryKey, Class theClass, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().getWriteLockValue(primaryKey, theClass, descriptor); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, theClass, descriptor); } }
/** * Return the cache key for the cache index or null if not found. */ @Override public CacheKey getCacheKeyByIndex(CacheIndex index, CacheId indexValues, boolean shouldCheckExpiry, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().getCacheKeyByIndex(index, indexValues, shouldCheckExpiry, descriptor); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().getCacheKeyByIndex(index, indexValues, shouldCheckExpiry, descriptor); } }
/** * INTERNAL: * Get the identity map for the given class from the IdentityMapManager */ @Override public IdentityMap getIdentityMap(ClassDescriptor descriptor, boolean returnNullIfMissing) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().getIdentityMap(descriptor, returnNullIfMissing); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().getIdentityMap(descriptor, returnNullIfMissing); } }
/** * 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 */ @Override public CacheKey acquireDeferredLock(Object primaryKey, Class javaClass, ClassDescriptor descriptor, boolean isCacheCheckComplete) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().acquireDeferredLock(primaryKey, javaClass, descriptor, isCacheCheckComplete); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().acquireDeferredLock(primaryKey, javaClass, descriptor, isCacheCheckComplete); } }
/** * INTERNAL: * Provides access for setting a concurrency lock on an object in the IdentityMap. * called with true from the merge process, if true then the refresh will not refresh the object. */ @Override public CacheKey acquireLock(Object primaryKey, Class domainClass, boolean forMerge, ClassDescriptor descriptor, boolean isCacheCheckComplete) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().acquireLock(primaryKey, domainClass, forMerge, descriptor, isCacheCheckComplete); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().acquireLock(primaryKey, domainClass, forMerge, descriptor, isCacheCheckComplete); } }
/** * INTERNAL: * Provides access for setting a concurrency lock on an object in the IdentityMap. * called with true from the merge process, if true then the refresh will not refresh the object. */ @Override public CacheKey acquireLockNoWait(Object primaryKey, Class domainClass, boolean forMerge, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().acquireLockNoWait(primaryKey, domainClass, forMerge, descriptor); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().acquireLockNoWait(primaryKey, domainClass, forMerge, 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 */ @Override public CacheKey acquireDeferredLock(Object primaryKey, Class javaClass, ClassDescriptor descriptor, boolean isCacheCheckComplete) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().acquireDeferredLock(primaryKey, javaClass, descriptor, isCacheCheckComplete); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().acquireDeferredLock(primaryKey, javaClass, descriptor, isCacheCheckComplete); } }
/** * INTERNAL: * Provides access for setting a concurrency lock on an object in the IdentityMap. * called with true from the merge process, if true then the refresh will not refresh the object. */ @Override public CacheKey acquireLockNoWait(Object primaryKey, Class domainClass, boolean forMerge, ClassDescriptor descriptor) { if (!descriptor.getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().acquireLockNoWait(primaryKey, domainClass, forMerge, descriptor); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().acquireLockNoWait(primaryKey, domainClass, forMerge, descriptor); } }
/** * Invalidate/remove any results for the class from the query cache. * This is used to invalidate the query cache on any change. */ @Override public void invalidateQueryCache(Class classThatChanged) { if (!session.getDescriptor(classThatChanged).getCachePolicy().isSharedIsolation()) { getIdentityMapManager().invalidateQueryCache(classThatChanged); } else { ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().invalidateQueryCache(classThatChanged); } }
/** * Invalidate/remove any results for the class from the query cache. * This is used to invalidate the query cache on any change. */ @Override public void invalidateQueryCache(Class classThatChanged) { if (!session.getDescriptor(classThatChanged).getCachePolicy().isSharedIsolation()) { getIdentityMapManager().invalidateQueryCache(classThatChanged); } else { ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().invalidateQueryCache(classThatChanged); } }
/** * INTERNAL: * Get the wrapper object from the cache key associated with the given primary key, * this is used for EJB. */ @Override public Object getWrapper(Object primaryKey, Class theClass) { if (!session.getDescriptor(theClass).getCachePolicy().isSharedIsolation()) { return getIdentityMapManager().getWrapper(primaryKey, theClass); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().getWrapper(primaryKey, theClass); } }
/** * INTERNAL: * Update the wrapper object the cache key associated with the given primary key, * this is used for EJB. */ @Override public void setWrapper(Object primaryKey, Class theClass, Object wrapper) { if (!getSession().getDescriptor(theClass).getCachePolicy().isSharedIsolation()) { getIdentityMapManager().setWrapper(primaryKey, theClass, wrapper); } else { ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().setWrapper(primaryKey, theClass, wrapper); } }
/** * ADVANCED: * Update the write lock value in the identity map. */ @Override public void updateWriteLockValue(Object primaryKey, Class theClass, Object writeLockValue) { if (!getSession().getDescriptor(theClass).getCachePolicy().isSharedIsolation()) { getIdentityMapManager().setWriteLockValue(primaryKey, theClass, writeLockValue); } else { ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().updateWriteLockValue(primaryKey, theClass, writeLockValue); } } }