Purpose: A FullIdentityMap holds all objects stored within it for the life of the application.
Responsibilities:
| Modifier and Type | Field and Description |
|---|---|
| protected Map | cacheKeys
Map of CacheKeys stored using their key. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| cacheKeys | back to summary |
|---|---|
| protected Map<Object, CacheKey> cacheKeys Map of CacheKeys stored using their key. | |
| FullIdentityMap | back to summary |
|---|---|
| public FullIdentityMap() Used to allow subclasses to build different map type. | |
| FullIdentityMap | back to summary |
|---|---|
| public FullIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides org. Implements org. INTERNAL: Clones itself.
| |
| cloneKeys | back to summary |
|---|---|
| public Enumeration Implements org. Allow for the
| |
| collectLocks | back to summary |
|---|---|
| public void collectLocks(HashMap<K, V> threadList) Implements abstract org. Implements org. INTERNAL: Used to print all the Locks in every identity map in this session.
| |
| elements | back to summary |
|---|---|
| public Enumeration Implements abstract org. Implements org. Allow for the cache
| |
| getCacheKey | back to summary |
|---|---|
| public CacheKey getCacheKey(Object searchKey, boolean forMerge) Implements abstract org. Implements org. Return the cache key matching the primary key of the searchKey. If no object for the key exists, return null.
| |
| getCacheKeys | back to summary |
|---|---|
| public Map Return the cache keys. | |
| getSize | back to summary |
|---|---|
| public int getSize() Implements abstract org. Implements org. Return the number of CacheKeys in the IdentityMap. This may contain weak referenced objects that have been garbage collected.
| |
| getSize | back to summary |
|---|---|
| public int getSize(Class<?> myClass, boolean recurse) Implements abstract org. Implements org. Return the number of actual objects of type myClass in the IdentityMap. Recurse = true will include subclasses of myClass in the count.
| |
| keys | back to summary |
|---|---|
| public Enumeration Implements abstract org. Implements org. Allow for the cache keys to be iterated on. Read locks will be checked.
| |
| keys | back to summary |
|---|---|
| public Enumeration Implements org. Allow for the
| |
| lazyRelationshipLoaded | back to summary |
|---|---|
| public void lazyRelationshipLoaded(Object object, ValueHolderInterface<T> valueHolder, ForeignReferenceMapping mapping) Implements org. Notify the cache that a lazy relationship has been triggered in the object and the cache may need to be updated
| |
| put | back to summary |
|---|---|
| public CacheKey put(Object primaryKey, Object object, Object writeLockValue, long readTime) Implements abstract org. Implements org. Store the object in the cache at its primary key. This is used by InsertObjectQuery, typically into the UnitOfWork identity map. Merge and reads do not use put, but acquireLock. Also an advanced (very) user API. | |
| putCacheKeyIfAbsent | back to summary |
|---|---|
| protected CacheKey putCacheKeyIfAbsent(CacheKey searchKey) Implements abstract org. Return the CacheKey (with object) matching the searchKey. If the CacheKey is missing then put the searchKey in the map. The searchKey should have already been locked.
| |
| remove | back to summary |
|---|---|
| public Object remove(CacheKey cacheKey) Implements abstract org. Implements org. Removes the CacheKey from the map. | |
| resetCacheKey | back to summary |
|---|---|
| public void resetCacheKey(CacheKey key, Object object, Object writeLockValue, long readTime) Reset the cache key with new data. | |
| setCacheKeys | back to summary |
|---|---|
| protected void setCacheKeys(Map<Object, CacheKey> cacheKeys) | |