|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
org.eclipse.persistence.sessions.interceptors.CacheInterceptor
oracle.eclipselink.coherence.integrated.cache.CoherenceInterceptor
public class CoherenceInterceptor
Purpose: This Cache Interceptor should be set on the descriptor for any class that is cached within Coherence. Once this Interceptor is applied EclipseLink will ensure that all Entities read into EclipseLink or updated by EclipseLink will be put into the Coherence Cache. TopLink cache settings will not be used. Developers should set the Coherence Cache name that corresponds to this class in a descriptor property called "coherence.cache.name". Each class should have its own Cache unless the PK's of the instances are unique amoung all classes stored in a single cache This Interceptor can be set on the class descriptor through a Session or Descriptor customizer or annotations
org.eclipse.persistence.descriptors.ClassDescriptor.setCacheInterceptorClass, org.eclipse.persistence.annoations.CacheInterceptor| Nested Class Summary | |
|---|---|
class |
CoherenceInterceptor.CoherenceOnlyCacheKeyWrapper |
| Field Summary | |
|---|---|
protected ClassDescriptor |
descriptor |
protected org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy |
lockingPolicy |
protected com.tangosol.net.NamedCache |
namedCache |
protected boolean |
shouldTranslatePKs |
| Fields inherited from class org.eclipse.persistence.sessions.interceptors.CacheInterceptor |
|---|
interceptedSession, targetIdentityMap |
| Constructor Summary | |
|---|---|
CoherenceInterceptor(org.eclipse.persistence.internal.identitymaps.IdentityMap targetIdentityMap, org.eclipse.persistence.internal.sessions.AbstractSession interceptedSession)Instantiate an new Cache Interceptor passing in the identity map that will be intercepted and the session that holds that identity map. |
|
| Method Summary | |
|---|---|
org.eclipse.persistence.internal.identitymaps.CacheKey |
acquireDeferredLock(java.lang.Object primaryKey)Acquire a deferred lock on the object. |
org.eclipse.persistence.internal.identitymaps.CacheKey |
acquireLock(java.lang.Object primaryKey, boolean forMerge)Acquire an active lock on the object. |
org.eclipse.persistence.internal.identitymaps.CacheKey |
acquireLockNoWait(java.lang.Object primaryKey, boolean forMerge)Acquire an active lock on the object, if not already locked. |
org.eclipse.persistence.internal.identitymaps.CacheKey |
acquireLockWithWait(java.lang.Object primaryKey, boolean forMerge, int wait)Acquire an active lock on the object, if not already locked. |
java.lang.Object |
clone()Clone the map and all of the CacheKeys. |
protected CacheKeyInterceptor |
createCacheKeyInterceptor(org.eclipse.persistence.internal.identitymaps.CacheKey wrappedCacheKey) |
java.util.Map<java.lang.Object,java.lang.Object> |
getAllFromIdentityMapWithEntityPK(java.lang.Object[] pkList, ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.AbstractSession session)ADVANCED: Using a list of Entity PK this method will attempt to bulk load the entire list from the cache. |
org.eclipse.persistence.internal.identitymaps.CacheKey |
getCacheKey(java.lang.Object searchKey, boolean forMerge)Return the cache key (with object) matching the searchKey. |
org.eclipse.persistence.internal.identitymaps.CacheKey |
getCacheKeyForLock(java.lang.Object searchKey)Return the cache key (with object) matching the searchKey. |
void |
lazyRelationshipLoaded(java.lang.Object object, ForeignReferenceMapping mapping)Notify the cache that a lazy relationship has been triggered in the object and the cache may need to be updated |
org.eclipse.persistence.internal.identitymaps.CacheKey |
put(java.lang.Object primaryKey, java.lang.Object object, java.lang.Object writeLockValue, long readTime)Store the object in the cache at its primary key. |
void |
release()Used to release the reference to the named cache durring initialize all identity maps. |
java.lang.Object |
remove(org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey)Remove the CacheKey from the map. |
java.lang.Object |
remove(java.lang.Object primaryKey, java.lang.Object object)Remove the CacheKey with the primaryKey from the map. |
| Methods inherited from class org.eclipse.persistence.sessions.interceptors.CacheInterceptor |
|---|
acquireReadLockOnCacheKey, acquireReadLockOnCacheKeyNoWait, collectLocks, containsKey, elements, get, getDescriptor, getDescriptorClass, getMaxSize, getSize, getSize, getTargetIdenttyMap, getWrapper, getWriteLockValue, keys, keys, setDescriptor, setWrapper, setWriteLockValue, toString, updateMaxSize |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected com.tangosol.net.NamedCache namedCache
protected ClassDescriptor descriptor
protected org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy lockingPolicy
protected boolean shouldTranslatePKs
| Constructor Detail |
|---|
public CoherenceInterceptor(org.eclipse.persistence.internal.identitymaps.IdentityMap targetIdentityMap,
org.eclipse.persistence.internal.sessions.AbstractSession interceptedSession)
| Method Detail |
|---|
protected CacheKeyInterceptor createCacheKeyInterceptor(org.eclipse.persistence.internal.identitymaps.CacheKey wrappedCacheKey)
createCacheKeyInterceptor in class CacheInterceptorpublic java.lang.Object clone()
CacheInterceptorclone in interface org.eclipse.persistence.internal.identitymaps.IdentityMapclone in class CacheInterceptorpublic org.eclipse.persistence.internal.identitymaps.CacheKey acquireDeferredLock(java.lang.Object primaryKey)
acquireDeferredLock in interface org.eclipse.persistence.internal.identitymaps.IdentityMapacquireDeferredLock in class CacheInterceptor
public org.eclipse.persistence.internal.identitymaps.CacheKey acquireLock(java.lang.Object primaryKey,
boolean forMerge)
acquireLock in interface org.eclipse.persistence.internal.identitymaps.IdentityMapacquireLock in class CacheInterceptor
public org.eclipse.persistence.internal.identitymaps.CacheKey acquireLockNoWait(java.lang.Object primaryKey,
boolean forMerge)
acquireLockNoWait in interface org.eclipse.persistence.internal.identitymaps.IdentityMapacquireLockNoWait in class CacheInterceptor
public org.eclipse.persistence.internal.identitymaps.CacheKey acquireLockWithWait(java.lang.Object primaryKey,
boolean forMerge,
int wait)
acquireLockWithWait in interface org.eclipse.persistence.internal.identitymaps.IdentityMapacquireLockWithWait in class CacheInterceptor
public java.util.Map<java.lang.Object,java.lang.Object> getAllFromIdentityMapWithEntityPK(java.lang.Object[] pkList,
ClassDescriptor descriptor,
org.eclipse.persistence.internal.sessions.AbstractSession session)
getAllFromIdentityMapWithEntityPK in interface org.eclipse.persistence.internal.identitymaps.IdentityMapgetAllFromIdentityMapWithEntityPK in class CacheInterceptorpkList - List of Entity PKs to extract from the cacheClassDescriptor - Descriptor type to be retrieved.QueryException
public org.eclipse.persistence.internal.identitymaps.CacheKey getCacheKey(java.lang.Object searchKey,
boolean forMerge)
getCacheKey in interface org.eclipse.persistence.internal.identitymaps.IdentityMapgetCacheKey in class CacheInterceptorpublic org.eclipse.persistence.internal.identitymaps.CacheKey getCacheKeyForLock(java.lang.Object searchKey)
getCacheKeyForLock in interface org.eclipse.persistence.internal.identitymaps.IdentityMapgetCacheKeyForLock in class CacheInterceptor
public void lazyRelationshipLoaded(java.lang.Object object,
ForeignReferenceMapping mapping)
lazyRelationshipLoaded in interface org.eclipse.persistence.internal.identitymaps.IdentityMaplazyRelationshipLoaded in class CacheInterceptor
public org.eclipse.persistence.internal.identitymaps.CacheKey put(java.lang.Object primaryKey,
java.lang.Object object,
java.lang.Object writeLockValue,
long readTime)
put in interface org.eclipse.persistence.internal.identitymaps.IdentityMapput in class CacheInterceptorprimaryKey - is the primary key for the object.object - is the domain object to cache.writeLockValue - is the current write lock value of object, if null the version is ignored.public void release()
public java.lang.Object remove(java.lang.Object primaryKey,
java.lang.Object object)
remove in interface org.eclipse.persistence.internal.identitymaps.IdentityMapremove in class CacheInterceptorpublic java.lang.Object remove(org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey)
remove in interface org.eclipse.persistence.internal.identitymaps.IdentityMapremove in class CacheInterceptor
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||