Top Description Fields Constructors Methods
org.eclipse.persistence.sessions.interceptors

public Class CacheKeyInterceptor

extends CacheKey
Class Inheritance
Imports
org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap, .CacheKey, .IdentityMap, org.eclipse.persistence.sessions.DataRecord

The CacheKeyInterceptor allows a Cache Interceptor implementation to wrap the EclipseLink CacheKey. The CacheKey is an object that wraps the object and maintains cached based information about the object like primary key, write lock value and locking. The EclipseLink runtime will access the CacheKey and directly when releasing locks.
Author
Gordon Yorke

Field Summary

Modifier and TypeField and Description
protected CacheKey
Inherited from org.eclipse.persistence.internal.identitymaps.CacheKey:
CACHE_KEY_INVALIDCHECK_INVALIDATION_POLICYCREATION_THREAD_HASHCODECREATION_THREAD_IDCREATION_THREAD_NAMEdataRecordinvalidationStateisIsolatedisWrapperkeylastUpdatedQueryIdmapOwnerMAX_WAIT_TRIESobjectprotectedForeignKeysreadTimetransactionIdwrapperwriteLockValue

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
acquire()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquire.

Acquire the lock on the cache key object.
public void
acquire(boolean forMerge)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquire.

Acquire the lock on the cache key object.
public void
public boolean
public boolean
acquireNoWait()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireNoWait.

Acquire the lock on the cache key object.
public boolean
acquireNoWait(boolean forMerge)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireNoWait.

Acquire the lock on the cache key object.
public void
acquireReadLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireReadLock.

Acquire the read lock on the cache key object.
public boolean
public void
checkDeferredLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.checkDeferredLock.

Check the deferred lock on the cache key object.
public void
checkReadLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.checkReadLock.

Check the read lock on the cache key object.
public Object
public boolean
equals(CacheKey key)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.equals.

Determine if the receiver is equal to key.
public Thread
public int
getInvalidationState()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getInvalidationState.

INTERNAL: Return the value of the invalidationState Variable The return value will be a constant CHECK_INVALIDATION_POLICY - The Invalidation policy is must be checked for this cache key's sate CACHE_KEY_INVALID - This cache key has been labeled invalid.
public Object
public long
getLastUpdatedQueryId()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getLastUpdatedQueryId.

INTERNAL: This method returns the system time in millis seconds at which this object was last refreshed CR #4365 CR #2698903 ...
public Object
public IdentityMap
public long
getReadTime()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getReadTime.

INTERNAL: Return the current value of the Read Time variable
public DataRecord
public CacheKey
getWrappedCacheKey()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getWrappedCacheKey.

If a Wrapper subclasses this CacheKey this method will be used to unwrap the cache key.
public Object
public Object
public int
hashCode()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.hashCode.

Overrides hashCode() in Object to use the primaryKey's hashCode for storage in data structures.
public boolean
isAcquired()

Overrides org.eclipse.persistence.internal.helper.ConcurrencyManager.isAcquired.

Return if a thread has acquire this manager.
public void
release()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.release.

Release the lock on the cache key object.
public void
public void
releaseReadLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.releaseReadLock.

Release the read lock on the cache key object.
public Object
public void
setInvalidationState(int invalidationState)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setInvalidationState.

INTERNAL: Set the value of the invalidationState Variable The possible values are from an enumeration of constants CHECK_INVALIDATION_POLICY - The invalidation policy is must be checked for this cache key's sate CACHE_KEY_INVALID - This cache key has been labelled invalid.
public void
public void
setLastUpdatedQueryId(long id)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setLastUpdatedQueryId.

INTERNAL: This method sets the system time in millis seconds at which this object was last refreshed CR #4365 CR #2698903 ...
public void
public void
public void
setReadTime(long readTime)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setReadTime.

INTERNAL: Set the read time of this cache key
public void
public void
public void
public String
public void
updateAccess()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.updateAccess.

Notifies that cache key that it has been accessed.
Inherited from org.eclipse.persistence.internal.identitymaps.CacheKey:
acquireLockacquireWithWaitequalsgetProtectedForeignKeysgetTransactionIdhasProtectedForeignKeysisIsolatedisWrappersetIsolatedsetIsWrappersetOwningMapsetProtectedForeignKeyssetTransactionIdwaitForObject

Field Detail

wrappedKeyback to summary
protected CacheKey wrappedKey

Constructor Detail

CacheKeyInterceptorback to summary
public CacheKeyInterceptor(CacheKey cacheKey)

Method Detail

acquireback to summary
public void acquire()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquire.

Acquire the lock on the cache key object.

Annotations
@Override
acquireback to summary
public void acquire(boolean forMerge)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquire.

Acquire the lock on the cache key object. For the merge process called with true from the merge process, if true then the refresh will not refresh the object

Annotations
@Override
acquireDeferredLockback to summary
public void acquireDeferredLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireDeferredLock.

Acquire the deferred lock.

Annotations
@Override
acquireIfUnownedNoWaitback to summary
public boolean acquireIfUnownedNoWait()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireIfUnownedNoWait.

Acquire the lock on the cache key object. Only acquire a lock if the cache key's active thread is not set. Added for Bug 5840635

Annotations
@Override
acquireNoWaitback to summary
public boolean acquireNoWait()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireNoWait.

Acquire the lock on the cache key object. But only if the object has no lock on it Added for CR 2317

Annotations
@Override
acquireNoWaitback to summary
public boolean acquireNoWait(boolean forMerge)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireNoWait.

Acquire the lock on the cache key object. But only if the object has no lock on it Added for CR 2317 called with true from the merge process, if true then the refresh will not refresh the object

Annotations
@Override
acquireReadLockback to summary
public void acquireReadLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireReadLock.

Acquire the read lock on the cache key object.

Annotations
@Override
acquireReadLockNoWaitback to summary
public boolean acquireReadLockNoWait()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.acquireReadLockNoWait.

Acquire the read lock on the cache key object.

Annotations
@Override
checkDeferredLockback to summary
public void checkDeferredLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.checkDeferredLock.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.checkDeferredLock.

Check the deferred lock on the cache key object. This can be called to ensure the cache key has a valid built object. It does not hold a lock, so the object could be refreshed afterwards.

Annotations
@Override
checkReadLockback to summary
public void checkReadLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.checkReadLock.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.checkReadLock.

Check the read lock on the cache key object. This can be called to ensure the cache key has a valid built object. It does not hold a lock, so the object could be refreshed afterwards.

Annotations
@Override
cloneback to summary
public Object clone()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.clone.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.clone.

INTERNAL: Clones itself.

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
equalsback to summary
public boolean equals(CacheKey key)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.equals.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.equals.

Determine if the receiver is equal to key. Use an index compare, because it is much faster than enumerations.

Annotations
@Override
getActiveThreadback to summary
public Thread getActiveThread()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getActiveThread.

Return the active thread.

Annotations
@Override
getInvalidationStateback to summary
public int getInvalidationState()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getInvalidationState.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.getInvalidationState.

INTERNAL: Return the value of the invalidationState Variable The return value will be a constant CHECK_INVALIDATION_POLICY - The Invalidation policy is must be checked for this cache key's sate CACHE_KEY_INVALID - This cache key has been labeled invalid.

Annotations
@Override
getKeyback to summary
public Object getKey()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getKey.

Annotations
@Override
getLastUpdatedQueryIdback to summary
public long getLastUpdatedQueryId()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getLastUpdatedQueryId.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.getLastUpdatedQueryId.

INTERNAL: This method returns the system time in millis seconds at which this object was last refreshed CR #4365 CR #2698903 ... instead of using millis we will now use id's instead. Method renamed appropriately.

Annotations
@Override
getObjectback to summary
public Object getObject()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getObject.

Annotations
@Override
getOwningMapback to summary
public IdentityMap getOwningMap()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getOwningMap.

Annotations
@Override
getReadTimeback to summary
public long getReadTime()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getReadTime.

INTERNAL: Return the current value of the Read Time variable

Annotations
@Override
getRecordback to summary
public DataRecord getRecord()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getRecord.

Annotations
@Override
getWrappedCacheKeyback to summary
public CacheKey getWrappedCacheKey()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getWrappedCacheKey.

If a Wrapper subclasses this CacheKey this method will be used to unwrap the cache key.

Annotations
@Override
getWrapperback to summary
public Object getWrapper()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getWrapper.

Annotations
@Override
getWriteLockValueback to summary
public Object getWriteLockValue()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.getWriteLockValue.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.hashCode.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.hashCode.

Overrides hashCode() in Object to use the primaryKey's hashCode for storage in data structures.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
isAcquiredback to summary
public boolean isAcquired()

Overrides org.eclipse.persistence.internal.helper.ConcurrencyManager.isAcquired.

Doc from org.eclipse.persistence.internal.helper.ConcurrencyManager.isAcquired.

Return if a thread has acquire this manager.

Annotations
@Override
releaseback to summary
public void release()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.release.

Release the lock on the cache key object.

Annotations
@Override
releaseDeferredLockback to summary
public void releaseDeferredLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.releaseDeferredLock.

Release the deferred lock

Annotations
@Override
releaseReadLockback to summary
public void releaseReadLock()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.releaseReadLock.

Release the read lock on the cache key object.

Annotations
@Override
removeFromOwningMapback to summary
public Object removeFromOwningMap()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.removeFromOwningMap.

Removes this cacheKey from the owning map

Annotations
@Override
setInvalidationStateback to summary
public void setInvalidationState(int invalidationState)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setInvalidationState.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.setInvalidationState.

INTERNAL: Set the value of the invalidationState Variable The possible values are from an enumeration of constants CHECK_INVALIDATION_POLICY - The invalidation policy is must be checked for this cache key's sate CACHE_KEY_INVALID - This cache key has been labelled invalid.

Annotations
@Override
setKeyback to summary
public void setKey(Object key)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setKey.

Annotations
@Override
setLastUpdatedQueryIdback to summary
public void setLastUpdatedQueryId(long id)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setLastUpdatedQueryId.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.setLastUpdatedQueryId.

INTERNAL: This method sets the system time in millis seconds at which this object was last refreshed CR #4365 CR #2698903 ... instead of using millis we will now use ids instead. Method renamed appropriately.

Annotations
@Override
setObjectback to summary
public void setObject(Object object)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setObject.

Annotations
@Override
setOwningMapback to summary
public void setOwningMap(AbstractIdentityMap map)
setReadTimeback to summary
public void setReadTime(long readTime)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setReadTime.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.setReadTime.

INTERNAL: Set the read time of this cache key

Annotations
@Override
setRecordback to summary
public void setRecord(DataRecord newDataRecord)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setRecord.

Annotations
@Override
setWrapperback to summary
public void setWrapper(Object wrapper)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setWrapper.

Annotations
@Override
setWriteLockValueback to summary
public void setWriteLockValue(Object writeLockValue)

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.setWriteLockValue.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.toString.

Doc from org.eclipse.persistence.internal.helper.ConcurrencyManager.toString.

Print the nested depth.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override
updateAccessback to summary
public void updateAccess()

Overrides org.eclipse.persistence.internal.identitymaps.CacheKey.updateAccess.

Doc from org.eclipse.persistence.internal.identitymaps.CacheKey.updateAccess.

Notifies that cache key that it has been accessed. Allows the LRU sub-cache to be maintained.

Annotations
@Override