public class CacheKey extends Object implements Serializable, 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
|
protected int |
hash
Calculated hash value for CacheKey from primary key values.
|
protected int |
invalidationState
Invalidation State can be used to indicate whether this cache key is considered valid
|
protected Vector |
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 |
mapOwner |
protected ConcurrencyManager |
mutex
The cache key hold a reference to the concurrency manager to perform the cache key level locking.
|
protected Object |
object |
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 Record |
record
This is used for Document Preservation to cache the record that this object was built from
|
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.
|
Constructor and Description |
---|
CacheKey(Vector primaryKeys) |
CacheKey(Vector primaryKey,
Object object,
Object lockValue) |
CacheKey(Vector primaryKey,
Object object,
Object lockValue,
long readTime) |
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquire the lock on the cachek key object.
|
void |
acquire(boolean forMerge)
Acquire the lock on the cachek key object.
|
void |
acquireDeferredLock()
Acquire the deferred lcok.
|
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 cachek key object.
|
boolean |
acquireReadLockNoWait()
Acquire the read lock on the cache key object.
|
void |
checkReadLock()
Check the read lock on the cachek key object.
|
Object |
clone()
INTERNAL:
Clones itself.
|
protected int |
computeHash(Vector primaryKey)
Compute a hash value for the CacheKey dependent upon the values of the primary key
instead of the identity of the receiver.
|
boolean |
equals(CacheKey key)
Determine if the receiver is equal to key.
|
boolean |
equals(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.
|
Vector |
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.
|
Object |
getObject() |
IdentityMap |
getOwningMap() |
long |
getReadTime()
INTERNAL:
Return the current value of the Read Time variable
|
Record |
getRecord() |
Object |
getWrapper() |
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
|
void |
release()
Release the lock on the cachek key object.
|
void |
releaseDeferredLock()
Release the deferred lock
|
void |
releaseReadLock()
Release the read lock on the cachek key object.
|
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 labeled invalid.
|
void |
setKey(Vector 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(Object object) |
void |
setOwningMap(IdentityMap map) |
void |
setReadTime(long readTime)
INTERNAL:
Set the read time of this cache key
|
void |
setRecord(Record newRecord) |
void |
setWrapper(Object wrapper) |
void |
setWriteLockValue(Object writeLockValue) |
String |
toString() |
void |
updateAccess()
Notifies that cache key that it has been accessed.
|
protected Vector key
protected int hash
protected Object object
protected IdentityMap mapOwner
protected Object writeLockValue
protected Object wrapper
protected ConcurrencyManager mutex
protected Record record
protected long lastUpdatedQueryId
protected int invalidationState
public static final int CHECK_INVALIDATION_POLICY
public static final int CACHE_KEY_INVALID
protected long readTime
public CacheKey(Vector primaryKeys)
public void acquire()
public void acquire(boolean forMerge)
public boolean acquireNoWait()
public boolean acquireNoWait(boolean forMerge)
public void acquireDeferredLock()
public void checkReadLock()
public void acquireReadLock()
public boolean acquireReadLockNoWait()
protected int computeHash(Vector primaryKey)
public boolean equals(Object object)
equals
in class Object
equals(CacheKey)
public boolean equals(CacheKey key)
public long getLastUpdatedQueryId()
public Vector getKey()
public ConcurrencyManager getMutex()
public Object getObject()
public IdentityMap getOwningMap()
public long getReadTime()
public Record getRecord()
public Object getWrapper()
public Object getWriteLockValue()
public int hashCode()
public boolean isAcquired()
public int getInvalidationState()
public void release()
public void releaseDeferredLock()
public void releaseReadLock()
public void setInvalidationState(int invalidationState)
public void setLastUpdatedQueryId(long id)
public void setKey(Vector key)
public void setMutex(ConcurrencyManager mutex)
public void setObject(Object object)
public void setOwningMap(IdentityMap map)
public void setReadTime(long readTime)
public void setRecord(Record newRecord)
public void setWrapper(Object wrapper)
public void setWriteLockValue(Object writeLockValue)
public void updateAccess()
Copyright © 2021. All rights reserved.