public class CacheKey
extends java.lang.Object
implements java.io.Serializable, 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 |
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.
|
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 ...
|
ConcurrencyManager |
getMutex()
Return the concurrency manager.
|
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 |
isAcquired()
Return if the lock is acquired
|
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 |
setMutex(ConcurrencyManager mutex)
Set the concurrency manager.
|
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() |
void |
transitionToDeferredLock() |
void |
updateAccess()
Notifies that cache key that it has been accessed.
|
java.lang.Object |
waitForObject() |
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()
public void acquire(boolean forMerge)
public boolean acquireNoWait()
public boolean acquireIfUnownedNoWait()
public boolean acquireNoWait(boolean forMerge)
public boolean acquireWithWait(boolean forMerge, int wait)
public void acquireDeferredLock()
public void acquireLock(ObjectBuildingQuery query)
public void checkReadLock()
public void checkDeferredLock()
public void acquireReadLock()
public boolean acquireReadLockNoWait()
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 ConcurrencyManager getMutex()
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 isAcquired()
public boolean isIsolated()
public boolean isWrapper()
public AbstractRecord getProtectedForeignKeys()
public int getInvalidationState()
public void release()
public void releaseDeferredLock()
public void releaseReadLock()
public java.lang.Object removeFromOwningMap()
public void setInvalidationState(int invalidationState)
public void setLastUpdatedQueryId(long id)
public void setKey(java.lang.Object key)
public void setMutex(ConcurrencyManager mutex)
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()
toString
in class java.lang.Object
public void transitionToDeferredLock()
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.4.2, "build v20130514-5956486" API Reference