Purpose: Container class for storing objects in an IdentityMap.
Responsibilities:
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | CHECK_INVALIDATION_POLICY
The following constants are used for the invalidationState variable |
| public final long | |
| public final long | |
| public final String | |
| protected DataRecord | dataRecord
This is used for Document Preservation to cache the record that this object was built from |
| protected int | invalidationState
Invalidation State can be used to indicate whether this cache key is considered valid |
| protected boolean | isIsolated
Set to true if this CacheKey comes from an IsolatedClientSession, or DatabaseSessionImpl. |
| protected boolean | isWrapper
Stores if this CacheKey instance is a wrapper for the underlying CacheKey. |
| protected Object | key
The key holds the vector of primary key values for the object. |
| protected long | lastUpdatedQueryId
This attribute is the system time in milli seconds that the object was last refreshed on |
| protected IdentityMap | |
| public static final int | |
| protected Object | |
| protected AbstractRecord | protectedForeignKeys
Stores retrieved FK values for relationships that are not stored in the Entity |
| protected long | readTime
The read time stores the millisecond value of the last time the object help by this cache key was confirmed as up to date. |
| protected Object | transactionId
The ID of the database transaction that last wrote the object. |
| protected Object | wrapper
The cached wrapper for the object, used in EJB. |
| protected Object | writeLockValue
The writeLock value is being held as an object so that it might contain a number or timestamp. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | acquire()
Overrides org. |
| public void | acquire(boolean forMerge)
Overrides org. |
| public void | acquireDeferredLock()
Overrides org. |
| public boolean | |
| public void | |
| public boolean | acquireNoWait()
Overrides org. |
| public boolean | acquireNoWait(boolean forMerge)
Overrides org. |
| public void | acquireReadLock()
Overrides org. |
| public boolean | acquireReadLockNoWait()
Overrides org. |
| public boolean | acquireWithWait(boolean forMerge, int wait)
Overrides org. |
| public void | checkDeferredLock()
Overrides org. |
| public void | checkReadLock()
Overrides org. |
| public Object | |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides java. |
| public boolean | |
| public Thread | getActiveThread()
Overrides org. |
| public 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. |
| public Object | |
| public long | 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 AbstractRecord | |
| public long | |
| public DataRecord | |
| public Object | |
| public 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 java. |
| public boolean | hasProtectedForeignKeys()
Returns true if the protectedForeignKeys record is non-null and non-empty, false otherwise. |
| public boolean | |
| public boolean | isWrapper()
Returns true if this Instance of CacheKey is a wrapper and should be unwrapped before passing to IdentityMap APIs. |
| public void | release()
Overrides org. |
| public void | releaseDeferredLock()
Overrides org. |
| public void | releaseReadLock()
Overrides org. |
| public Object | |
| public 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. |
| public void | |
| public void | |
| public void | |
| public 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 ... |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String | toString()
Overrides org. |
| public void | |
| public synchronized Object |
| CACHE_KEY_INVALID | back to summary |
|---|---|
| public static final int CACHE_KEY_INVALID | |
| CHECK_INVALIDATION_POLICY | back to summary |
|---|---|
| public static final int CHECK_INVALIDATION_POLICY The following constants are used for the invalidationState variable | |
| CREATION_THREAD_HASHCODE | back to summary |
|---|---|
| public final long CREATION_THREAD_HASHCODE | |
| CREATION_THREAD_ID | back to summary |
|---|---|
| public final long CREATION_THREAD_ID | |
| CREATION_THREAD_NAME | back to summary |
|---|---|
| public final String CREATION_THREAD_NAME | |
| dataRecord | back to summary |
|---|---|
| protected DataRecord dataRecord This is used for Document Preservation to cache the record that this object was built from | |
| invalidationState | back to summary |
|---|---|
| protected int invalidationState Invalidation State can be used to indicate whether this cache key is considered valid | |
| isIsolated | back to summary |
|---|---|
| protected boolean isIsolated Set to true if this CacheKey comes from an IsolatedClientSession, or DatabaseSessionImpl. | |
| isWrapper | back to summary |
|---|---|
| protected boolean isWrapper Stores if this CacheKey instance is a wrapper for the underlying CacheKey. CacheKey wrappers may be used with cache interceptors. | |
| key | back to summary |
|---|---|
| protected Object key The key holds the vector of primary key values for the object. | |
| lastUpdatedQueryId | back to summary |
|---|---|
| protected long lastUpdatedQueryId This attribute is the system time in milli seconds that the object was last refreshed on | |
| mapOwner | back to summary |
|---|---|
| protected IdentityMap mapOwner | |
| MAX_WAIT_TRIES | back to summary |
|---|---|
| public static final int MAX_WAIT_TRIES | |
| object | back to summary |
|---|---|
| protected Object object | |
| protectedForeignKeys | back to summary |
|---|---|
| protected AbstractRecord protectedForeignKeys Stores retrieved FK values for relationships that are not stored in the Entity | |
| readTime | back to summary |
|---|---|
| protected long readTime The read time stores the millisecond value of the last time the object help by this cache key was confirmed as up to date. | |
| transactionId | back to summary |
|---|---|
| protected Object transactionId The ID of the database transaction that last wrote the object. This is used for database change notification. | |
| wrapper | back to summary |
|---|---|
| protected Object wrapper The cached wrapper for the object, used in EJB. | |
| writeLockValue | back to summary |
|---|---|
| protected Object writeLockValue The writeLock value is being held as an object so that it might contain a number or timestamp. | |
| CacheKey | back to summary |
|---|---|
| protected CacheKey() Internal: Only used by subclasses that may want to wrap the cache key. Could be replaced by switching to an interface. | |
| CacheKey | back to summary |
|---|---|
| public CacheKey(Object primaryKey) | |
| CacheKey | back to summary |
|---|---|
| public CacheKey(Object primaryKey, Object object, Object lockValue) | |
| CacheKey | back to summary |
|---|---|
| public CacheKey(Object primaryKey, Object object, Object lockValue, long readTime, boolean isIsolated) | |
| acquire | back to summary |
|---|---|
| public void acquire() Overrides org. Acquire the lock on the cache key object.
| |
| acquire | back to summary |
|---|---|
| public void acquire(boolean forMerge) Overrides org. 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
| |
| acquireDeferredLock | back to summary |
|---|---|
| public void acquireDeferredLock() Overrides org. Acquire the deferred lock.
| |
| acquireIfUnownedNoWait | back to summary |
|---|---|
| public boolean 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 | |
| acquireLock | back to summary |
|---|---|
| public void acquireLock(ObjectBuildingQuery query) | |
| acquireNoWait | back to summary |
|---|---|
| public boolean acquireNoWait() Overrides org. Acquire the lock on the cache key object. But only if the object has no lock on it Added for CR 2317
| |
| acquireNoWait | back to summary |
|---|---|
| public boolean acquireNoWait(boolean forMerge) Overrides org. 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
| |
| acquireReadLock | back to summary |
|---|---|
| public void acquireReadLock() Overrides org. Acquire the read lock on the cache key object.
| |
| acquireReadLockNoWait | back to summary |
|---|---|
| public boolean acquireReadLockNoWait() Overrides org. Acquire the read lock on the cache key object. Return true if acquired.
| |
| acquireWithWait | back to summary |
|---|---|
| public boolean acquireWithWait(boolean forMerge, int wait) Overrides org. 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
| |
| checkDeferredLock | back to summary |
|---|---|
| public void checkDeferredLock() Overrides org. 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.
| |
| checkReadLock | back to summary |
|---|---|
| public void checkReadLock() Overrides org. 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.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. INTERNAL: Clones itself.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Determine if the receiver is equal to anObject. If anObject is a CacheKey, do further comparison, otherwise, return false.
| |
| equals | back to summary |
|---|---|
| public boolean equals(CacheKey key) Determine if the receiver is equal to key. Use an index compare, because it is much faster than enumerations. | |
| getActiveThread | back to summary |
|---|---|
| public Thread getActiveThread() Overrides org. Return the active thread.
| |
| getInvalidationState | back to summary |
|---|---|
| public 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. | |
| getKey | back to summary |
|---|---|
| public Object getKey() | |
| getLastUpdatedQueryId | back to summary |
|---|---|
| public long 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. | |
| getObject | back to summary |
|---|---|
| public Object getObject() | |
| getOwningMap | back to summary |
|---|---|
| public IdentityMap getOwningMap() | |
| getProtectedForeignKeys | back to summary |
|---|---|
| public AbstractRecord getProtectedForeignKeys() INTERNAL: Return the FK cache | |
| getReadTime | back to summary |
|---|---|
| public long getReadTime() INTERNAL: Return the current value of the Read Time variable | |
| getRecord | back to summary |
|---|---|
| public DataRecord getRecord() | |
| getTransactionId | back to summary |
|---|---|
| public Object getTransactionId() | |
| getWrappedCacheKey | back to summary |
|---|---|
| public CacheKey getWrappedCacheKey() If a Wrapper subclasses this CacheKey this method will be used to unwrap the cache key. | |
| getWrapper | back to summary |
|---|---|
| public Object getWrapper() | |
| getWriteLockValue | back to summary |
|---|---|
| public Object getWriteLockValue() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Overrides hashCode() in Object to use the primaryKey's hashCode for storage in data structures.
| |
| hasProtectedForeignKeys | back to summary |
|---|---|
| public boolean hasProtectedForeignKeys() Returns true if the protectedForeignKeys record is non-null and non-empty, false otherwise. | |
| isIsolated | back to summary |
|---|---|
| public boolean isIsolated() Returns true if this CacheKey is from an IsolatedClientSession | |
| isWrapper | back to summary |
|---|---|
| public boolean isWrapper() Returns true if this Instance of CacheKey is a wrapper and should be unwrapped before passing to IdentityMap APIs. Wrapped CacheKeys may be used in the Cache Interceptors. | |
| release | back to summary |
|---|---|
| public void release() Overrides org. Release the lock on the cache key object.
| |
| releaseDeferredLock | back to summary |
|---|---|
| public void releaseDeferredLock() Overrides org. Release the deferred lock
| |
| releaseReadLock | back to summary |
|---|---|
| public void releaseReadLock() Overrides org. Release the read lock on the cache key object.
| |
| removeFromOwningMap | back to summary |
|---|---|
| public Object removeFromOwningMap() Removes this cacheKey from the owning map | |
| setInvalidationState | back to summary |
|---|---|
| public 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. | |
| setIsolated | back to summary |
|---|---|
| public void setIsolated(boolean isIsolated) | |
| setIsWrapper | back to summary |
|---|---|
| public void setIsWrapper(boolean isWrapper) | |
| setKey | back to summary |
|---|---|
| public void setKey(Object key) | |
| setLastUpdatedQueryId | back to summary |
|---|---|
| public 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 ... instead of using millis we will now use ids instead. Method renamed appropriately. | |
| setObject | back to summary |
|---|---|
| public void setObject(Object object) | |
| setOwningMap | back to summary |
|---|---|
| public void setOwningMap(IdentityMap map) | |
| setProtectedForeignKeys | back to summary |
|---|---|
| public void setProtectedForeignKeys(AbstractRecord protectedForeignKeys) | |
| setReadTime | back to summary |
|---|---|
| public void setReadTime(long readTime) INTERNAL: Set the read time of this cache key | |
| setRecord | back to summary |
|---|---|
| public void setRecord(DataRecord newDataRecord) | |
| setTransactionId | back to summary |
|---|---|
| public void setTransactionId(Object transactionId) | |
| setWrapper | back to summary |
|---|---|
| public void setWrapper(Object wrapper) | |
| setWriteLockValue | back to summary |
|---|---|
| public void setWriteLockValue(Object writeLockValue) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from org. Print the nested depth.
| |
| updateAccess | back to summary |
|---|---|
| public void updateAccess() Notifies that cache key that it has been accessed. Allows the LRU sub-cache to be maintained. | |
| waitForObject | back to summary |
|---|---|
| public synchronized Object waitForObject() | |