public class CacheKey extends ConcurrencyManager implements java.lang.Cloneable
Purpose: Container class for storing objects in an IdentityMap.
Responsibilities:
Modifier and Type | Field and Description |
---|---|
static int |
CACHE_KEY_INVALID |
static int |
CHECK_INVALIDATION_POLICY
The following constants are used for the invalidationState variable
|
static int |
MAX_WAIT_TRIES |
deferredLockManagers
Constructor and Description |
---|
CacheKey(java.lang.Object primaryKey) |
CacheKey(java.lang.Object primaryKey,
java.lang.Object object,
java.lang.Object lockValue) |
CacheKey(java.lang.Object primaryKey,
java.lang.Object object,
java.lang.Object lockValue,
long readTime,
boolean isIsolated) |
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquire the lock on the cache key object.
|
void |
acquire(boolean forMerge)
Acquire the lock on the cache key object.
|
void |
acquireDeferredLock()
Acquire the deferred lock.
|
boolean |
acquireIfUnownedNoWait()
Acquire the lock on the cache key object.
|
void |
acquireLock(ObjectBuildingQuery query) |
boolean |
acquireNoWait()
Acquire the lock on the cache key object.
|
boolean |
acquireNoWait(boolean forMerge)
Acquire the lock on the cache key object.
|
void |
acquireReadLock()
Acquire the read lock on the cache key object.
|
boolean |
acquireReadLockNoWait()
Acquire the read lock on the cache key object.
|
boolean |
acquireWithWait(boolean forMerge,
int wait)
Acquire the lock on the cache key object.
|
void |
checkDeferredLock()
Check the deferred lock on the cache key object.
|
void |
checkReadLock()
Check the read lock on the cache key object.
|
java.lang.Object |
clone()
INTERNAL:
Clones itself.
|
boolean |
equals(CacheKey key)
Determine if the receiver is equal to key.
|
boolean |
equals(java.lang.Object object)
Determine if the receiver is equal to anObject.
|
java.lang.Thread |
getActiveThread()
Return the active thread.
|
int |
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.
|
java.lang.Object |
getKey() |
long |
getLastUpdatedQueryId()
INTERNAL:
This method returns the system time in millis seconds at which this object was last refreshed
CR #4365
CR #2698903 ...
|
java.lang.Object |
getObject() |
IdentityMap |
getOwningMap() |
AbstractRecord |
getProtectedForeignKeys()
INTERNAL:
Return the FK cache
|
long |
getReadTime()
INTERNAL:
Return the current value of the Read Time variable
|
Record |
getRecord() |
java.lang.Object |
getTransactionId() |
CacheKey |
getWrappedCacheKey()
If a Wrapper subclasses this CacheKey this method will be used to unwrap the cache key.
|
java.lang.Object |
getWrapper() |
java.lang.Object |
getWriteLockValue() |
int |
hashCode()
Overrides hashCode() in Object to use the primaryKey's hashCode for storage in data structures.
|
boolean |
hasProtectedForeignKeys()
Returns true if the protectedForeignKeys record is non-null and non-empty, false otherwise.
|
boolean |
isIsolated()
Returns true if this CacheKey is from an IsolatedClientSession
|
boolean |
isWrapper()
Returns true if this Instance of CacheKey is a wrapper and should be unwrapped before passing
to IdentityMap APIs.
|
void |
release()
Release the lock on the cache key object.
|
void |
releaseDeferredLock()
Release the deferred lock
|
void |
releaseReadLock()
Release the read lock on the cache key object.
|
java.lang.Object |
removeFromOwningMap()
Removes this cacheKey from the owning map
|
void |
setInvalidationState(int invalidationState)
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.
|
void |
setIsolated(boolean isIsolated) |
void |
setIsWrapper(boolean isWrapper) |
void |
setKey(java.lang.Object key) |
void |
setLastUpdatedQueryId(long id)
INTERNAL:
This method sets the system time in millis seconds at which this object was last refreshed
CR #4365
CR #2698903 ...
|
void |
setObject(java.lang.Object object) |
void |
setOwningMap(IdentityMap map) |
void |
setProtectedForeignKeys(AbstractRecord protectedForeignKeys) |
void |
setReadTime(long readTime)
INTERNAL:
Set the read time of this cache key
|
void |
setRecord(Record newRecord) |
void |
setTransactionId(java.lang.Object transactionId) |
void |
setWrapper(java.lang.Object wrapper) |
void |
setWriteLockValue(java.lang.Object writeLockValue) |
java.lang.String |
toString()
Print the nested depth.
|
void |
updateAccess()
Notifies that cache key that it has been accessed.
|
java.lang.Object |
waitForObject() |
acquireIfUnownedNoWait, getDeferredLockManager, getDepth, getNumberOfReaders, getNumberOfWritersWaiting, getStack, isAcquired, isBuildObjectOnThreadComplete, isLockedByMergeManager, isNested, putDeferredLock, removeDeferredLockManager, setActiveThread, setIsLockedByMergeManager, setShouldTrackStack, setStack, shouldTrackStack, transitionToDeferredLock
public static final int CHECK_INVALIDATION_POLICY
public static final int CACHE_KEY_INVALID
public static final int MAX_WAIT_TRIES
public CacheKey(java.lang.Object primaryKey)
public CacheKey(java.lang.Object primaryKey, java.lang.Object object, java.lang.Object lockValue)
public CacheKey(java.lang.Object primaryKey, java.lang.Object object, java.lang.Object lockValue, long readTime, boolean isIsolated)
public void acquire()
acquire
in class ConcurrencyManager
public void acquire(boolean forMerge)
acquire
in class ConcurrencyManager
public boolean acquireNoWait()
acquireNoWait
in class ConcurrencyManager
public boolean acquireIfUnownedNoWait()
public boolean acquireNoWait(boolean forMerge)
acquireNoWait
in class ConcurrencyManager
public boolean acquireWithWait(boolean forMerge, int wait)
acquireWithWait
in class ConcurrencyManager
public void acquireDeferredLock()
acquireDeferredLock
in class ConcurrencyManager
public void acquireLock(ObjectBuildingQuery query)
public void checkReadLock()
checkReadLock
in class ConcurrencyManager
public void checkDeferredLock()
checkDeferredLock
in class ConcurrencyManager
public void acquireReadLock()
acquireReadLock
in class ConcurrencyManager
public boolean acquireReadLockNoWait()
acquireReadLockNoWait
in class ConcurrencyManager
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
equals(CacheKey)
public boolean equals(CacheKey key)
public long getLastUpdatedQueryId()
public java.lang.Object getKey()
public java.lang.Thread getActiveThread()
getActiveThread
in class ConcurrencyManager
public java.lang.Object getObject()
public IdentityMap getOwningMap()
public long getReadTime()
public Record getRecord()
public java.lang.Object getWrapper()
public CacheKey getWrappedCacheKey()
public java.lang.Object getWriteLockValue()
public int hashCode()
hashCode
in class java.lang.Object
public boolean hasProtectedForeignKeys()
public boolean isIsolated()
public boolean isWrapper()
public AbstractRecord getProtectedForeignKeys()
public int getInvalidationState()
public void release()
release
in class ConcurrencyManager
public void releaseDeferredLock()
releaseDeferredLock
in class ConcurrencyManager
public void releaseReadLock()
releaseReadLock
in class ConcurrencyManager
public java.lang.Object removeFromOwningMap()
public void setInvalidationState(int invalidationState)
public void setLastUpdatedQueryId(long id)
public void setKey(java.lang.Object key)
public void setObject(java.lang.Object object)
public void setOwningMap(IdentityMap map)
public void setProtectedForeignKeys(AbstractRecord protectedForeignKeys)
public void setReadTime(long readTime)
public void setRecord(Record newRecord)
public void setWrapper(java.lang.Object wrapper)
public void setWriteLockValue(java.lang.Object writeLockValue)
public java.lang.String toString()
ConcurrencyManager
toString
in class ConcurrencyManager
public void updateAccess()
public void setIsolated(boolean isIsolated)
public void setIsWrapper(boolean isWrapper)
public java.lang.Object getTransactionId()
public void setTransactionId(java.lang.Object transactionId)
public java.lang.Object waitForObject()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference