Class NoIdentityMap
- java.lang.Object
-
- org.eclipse.persistence.internal.identitymaps.AbstractIdentityMap
-
- org.eclipse.persistence.internal.identitymaps.NoIdentityMap
-
- All Implemented Interfaces:
Serializable
,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 Enumeration<CacheKey>
cloneKeys()
Return an empty enumerator.void
collectLocks(HashMap threadList)
NoIdentityMap has no locks.Enumeration
elements()
Return an empty enumerator.Object
get(Object primaryKey)
Return null as no objects are cached.CacheKey
getCacheKey(Object searchKey, boolean forMerge)
Return null as no objects are cached.int
getSize()
Return 0 as no objects are cached.int
getSize(Class myClass, boolean recurse)
Return 0 as no objects are cached.Object
getWriteLockValue(Object primaryKey)
Return null as no objects are cached.Enumeration<CacheKey>
keys()
Return an empty enumerator.Enumeration<CacheKey>
keys(boolean checkReadLocks)
Return an empty enumerator.void
lazyRelationshipLoaded(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 updatedCacheKey
put(Object primaryKey, Object object, Object writeLockValue, long readTime)
Do Nothing.protected CacheKey
putCacheKeyIfAbsent(CacheKey cacheKey)
Return null as no objects are cached.Object
remove(Object primaryKey, Object object)
Do Nothing.Object
remove(CacheKey searchKey)
Do Nothing.void
setWriteLockValue(Object primaryKey, 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(HashMap threadList)
NoIdentityMap has no locks.- Specified by:
collectLocks
in interfaceIdentityMap
- Specified by:
collectLocks
in classAbstractIdentityMap
-
elements
public Enumeration elements()
Return an empty enumerator.- Specified by:
elements
in interfaceIdentityMap
- Specified by:
elements
in classAbstractIdentityMap
-
get
public Object get(Object primaryKey)
Return null as no objects are cached.- Specified by:
get
in interfaceIdentityMap
- Overrides:
get
in classAbstractIdentityMap
-
getCacheKey
public CacheKey getCacheKey(Object searchKey, boolean forMerge)
Return null as no objects are cached.- Specified by:
getCacheKey
in interfaceIdentityMap
- Specified by:
getCacheKey
in classAbstractIdentityMap
-
putCacheKeyIfAbsent
protected CacheKey putCacheKeyIfAbsent(CacheKey cacheKey)
Return null as no objects are cached.- Specified by:
putCacheKeyIfAbsent
in classAbstractIdentityMap
-
getSize
public int getSize()
Return 0 as no objects are cached.- Specified by:
getSize
in interfaceIdentityMap
- Specified by:
getSize
in classAbstractIdentityMap
-
getSize
public int getSize(Class myClass, boolean recurse)
Return 0 as no objects are cached.- Specified by:
getSize
in interfaceIdentityMap
- Specified by:
getSize
in classAbstractIdentityMap
-
getWriteLockValue
public Object getWriteLockValue(Object primaryKey)
Return null as no objects are cached.- Specified by:
getWriteLockValue
in interfaceIdentityMap
- Overrides:
getWriteLockValue
in classAbstractIdentityMap
-
keys
public Enumeration<CacheKey> keys()
Return an empty enumerator.- Specified by:
keys
in interfaceIdentityMap
- Specified by:
keys
in classAbstractIdentityMap
-
cloneKeys
public Enumeration<CacheKey> cloneKeys()
Return an empty enumerator.- Returns:
- clone of the CacheKeys enumeration
-
keys
public Enumeration<CacheKey> keys(boolean checkReadLocks)
Return an empty enumerator.- Parameters:
checkReadLocks
- - true if readLocks should be checked, false otherwise.
-
lazyRelationshipLoaded
public void lazyRelationshipLoaded(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(Object primaryKey, Object object, Object writeLockValue, long readTime)
Do Nothing.- Specified by:
put
in interfaceIdentityMap
- Specified by:
put
in 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 Object remove(Object primaryKey, Object object)
Do Nothing. Return null, since no objects are cached.- Specified by:
remove
in interfaceIdentityMap
- Overrides:
remove
in classAbstractIdentityMap
-
remove
public Object remove(CacheKey searchKey)
Do Nothing. Return null, since no objects are cached.- Specified by:
remove
in interfaceIdentityMap
- Specified by:
remove
in classAbstractIdentityMap
-
setWriteLockValue
public void setWriteLockValue(Object primaryKey, Object writeLockValue)
Do Nothing.- Specified by:
setWriteLockValue
in interfaceIdentityMap
- Overrides:
setWriteLockValue
in classAbstractIdentityMap
-
-