Class NoIdentityMap
- java.lang.Object
-
- org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
-
- org.eclipse.persistence.internal.identitymaps.NoIdentityMap
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,IdentityMap
public class NoIdentityMap extends AbstractIdentityMap
Purpose: Provide the capability to not cache objects at all.
Responsibilities:
- Do nothing when an object is cached.
- Since:
- TOPLink/Java 1.0
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
descriptor, isIsolated, maxSize, session
-
-
Constructor Summary
Constructors Constructor Description NoIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Enumeration<CacheKey>cloneKeys()Return an empty enumerator.voidcollectLocks(java.util.HashMap threadList)NoIdentityMap has no locks.java.util.Enumerationelements()Return an empty enumerator.java.lang.Objectget(java.lang.Object primaryKey)Return null as no objects are cached.CacheKeygetCacheKey(java.lang.Object searchKey, boolean forMerge)Return null as no objects are cached.intgetSize()Return 0 as no objects are cached.intgetSize(java.lang.Class myClass, boolean recurse)Return 0 as no objects are cached.java.lang.ObjectgetWriteLockValue(java.lang.Object primaryKey)Return null as no objects are cached.java.util.Enumeration<CacheKey>keys()Return an empty enumerator.java.util.Enumeration<CacheKey>keys(boolean checkReadLocks)Return an empty enumerator.voidlazyRelationshipLoaded(java.lang.Object object, ValueHolderInterface valueHolder, ForeignReferenceMapping mapping)Notify the cache that a lazy relationship has been triggered in the object and the cache may need to be updatedCacheKeyput(java.lang.Object primaryKey, java.lang.Object object, java.lang.Object writeLockValue, long readTime)Do Nothing.protected CacheKeyputCacheKeyIfAbsent(CacheKey cacheKey)Return null as no objects are cached.java.lang.Objectremove(java.lang.Object primaryKey, java.lang.Object object)Do Nothing.java.lang.Objectremove(CacheKey searchKey)Do Nothing.voidsetWriteLockValue(java.lang.Object primaryKey, java.lang.Object writeLockValue)Do Nothing.-
Methods inherited from class org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
acquireDeferredLock, acquireLock, acquireLockNoWait, acquireLockWithWait, acquireReadLockOnCacheKey, acquireReadLockOnCacheKeyNoWait, clone, containsKey, createCacheKey, getAllCacheKeysFromIdentityMapWithEntityPK, getAllFromIdentityMapWithEntityPK, getCacheKeyForLock, getCacheKeyWithReadLock, getDefaultIdentityMapClass, getDescriptor, getDescriptorClass, getMaxSize, getWrapper, release, setDescriptor, setMaxSize, setWrapper, toString, updateMaxSize
-
-
-
-
Constructor Detail
-
NoIdentityMap
public NoIdentityMap(int size, ClassDescriptor descriptor, AbstractSession session, boolean isolated)
-
-
Method Detail
-
collectLocks
public void collectLocks(java.util.HashMap threadList)
NoIdentityMap has no locks.- Specified by:
collectLocksin interfaceIdentityMap- Specified by:
collectLocksin classAbstractIdentityMap
-
elements
public java.util.Enumeration elements()
Return an empty enumerator.- Specified by:
elementsin interfaceIdentityMap- Specified by:
elementsin classAbstractIdentityMap
-
get
public java.lang.Object get(java.lang.Object primaryKey)
Return null as no objects are cached.- Specified by:
getin interfaceIdentityMap- Overrides:
getin classAbstractIdentityMap
-
getCacheKey
public CacheKey getCacheKey(java.lang.Object searchKey, boolean forMerge)
Return null as no objects are cached.- Specified by:
getCacheKeyin interfaceIdentityMap- Specified by:
getCacheKeyin classAbstractIdentityMap
-
putCacheKeyIfAbsent
protected CacheKey putCacheKeyIfAbsent(CacheKey cacheKey)
Return null as no objects are cached.- Specified by:
putCacheKeyIfAbsentin classAbstractIdentityMap
-
getSize
public int getSize()
Return 0 as no objects are cached.- Specified by:
getSizein interfaceIdentityMap- Specified by:
getSizein classAbstractIdentityMap
-
getSize
public int getSize(java.lang.Class myClass, boolean recurse)Return 0 as no objects are cached.- Specified by:
getSizein interfaceIdentityMap- Specified by:
getSizein classAbstractIdentityMap
-
getWriteLockValue
public java.lang.Object getWriteLockValue(java.lang.Object primaryKey)
Return null as no objects are cached.- Specified by:
getWriteLockValuein interfaceIdentityMap- Overrides:
getWriteLockValuein classAbstractIdentityMap
-
keys
public java.util.Enumeration<CacheKey> keys()
Return an empty enumerator.- Specified by:
keysin interfaceIdentityMap- Specified by:
keysin classAbstractIdentityMap
-
cloneKeys
public java.util.Enumeration<CacheKey> cloneKeys()
Return an empty enumerator.- Returns:
- clone of the CacheKeys enumeration
-
keys
public java.util.Enumeration<CacheKey> keys(boolean checkReadLocks)
Return an empty enumerator.- Parameters:
checkReadLocks- - true if readLocks should be checked, false otherwise.
-
lazyRelationshipLoaded
public void lazyRelationshipLoaded(java.lang.Object object, ValueHolderInterface valueHolder, ForeignReferenceMapping mapping)Notify the cache that a lazy relationship has been triggered in the object and the cache may need to be updated
-
put
public CacheKey put(java.lang.Object primaryKey, java.lang.Object object, java.lang.Object writeLockValue, long readTime)
Do Nothing.- Specified by:
putin interfaceIdentityMap- Specified by:
putin classAbstractIdentityMap- Parameters:
primaryKey- is the primary key for the object.object- is the domain object to cache.writeLockValue- is the current write lock value of object, if null the version is ignored.
-
remove
public java.lang.Object remove(java.lang.Object primaryKey, java.lang.Object object)Do Nothing. Return null, since no objects are cached.- Specified by:
removein interfaceIdentityMap- Overrides:
removein classAbstractIdentityMap
-
remove
public java.lang.Object remove(CacheKey searchKey)
Do Nothing. Return null, since no objects are cached.- Specified by:
removein interfaceIdentityMap- Specified by:
removein classAbstractIdentityMap
-
setWriteLockValue
public void setWriteLockValue(java.lang.Object primaryKey, java.lang.Object writeLockValue)Do Nothing.- Specified by:
setWriteLockValuein interfaceIdentityMap- Overrides:
setWriteLockValuein classAbstractIdentityMap
-
-