Package org.datanucleus.cache
Class NullLevel2Cache
java.lang.Object
org.datanucleus.cache.AbstractLevel2Cache
org.datanucleus.cache.NullLevel2Cache
- All Implemented Interfaces:
Serializable
,Level2Cache
Null implementation of a Level 2 Cache.
Does nothing when its methods are invoked.
- See Also:
-
Field Summary
FieldsFields inherited from class org.datanucleus.cache.AbstractLevel2Cache
cacheName, clearAtClose, expiryMillis, maxSize, nucleusCtx
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Method to close the cache when no longer needed.boolean
containsOid
(Object oid) Accessor for whether an object with the specified id is in the cachevoid
Evict the parameter instance from the second-level cache.void
evictAll()
Evict the parameter instances from the second-level cache.void
Evict the parameter instances from the second-level cache.void
Evict the parameter instances from the second-level cache.void
evictAll
(Collection oids) Evict the parameter instances from the second-level cache.Accessor for an object from the cacheint
getSize()
Accessor for the total number of objects in the L2 cache.boolean
isEmpty()
Accessor for whether the cache is empty.Method to put an object in the L2 cacheMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.datanucleus.cache.Level2Cache
getAll, getNumberOfPinnedObjects, getNumberOfUnpinnedObjects, getUnique, pin, pinAll, pinAll, pinAll, putAll, putUnique, putUniqueAll, removeUnique, unpin, unpinAll, unpinAll, unpinAll
-
Field Details
-
NAME
- See Also:
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
NullLevel2Cache
-
-
Method Details
-
close
public void close()Method to close the cache when no longer needed. Provides a hook to release resources etc. -
evict
Evict the parameter instance from the second-level cache.- Parameters:
oid
- the object id of the instance to evict.
-
evictAll
public void evictAll()Evict the parameter instances from the second-level cache. All instances in the PersistenceManager's cache are evicted from the second-level cache. -
evictAll
Evict the parameter instances from the second-level cache.- Parameters:
pcClass
- the class to evictsubclasses
- Whether to evict all subclasses of this class also
-
evictAll
Evict the parameter instances from the second-level cache.- Parameters:
oids
- the object ids of the instance to evict.
-
evictAll
Evict the parameter instances from the second-level cache.- Parameters:
oids
- the object ids of the instances to evict
-
containsOid
Accessor for whether an object with the specified id is in the cache- Parameters:
oid
- The object id- Returns:
- Whether it is in the cache
-
get
Accessor for an object from the cache- Parameters:
oid
- The identity- Returns:
- The cacheable object
-
getSize
public int getSize()Description copied from interface:Level2Cache
Accessor for the total number of objects in the L2 cache.- Returns:
- Number of objects
- See Also:
-
isEmpty
public boolean isEmpty()Description copied from interface:Level2Cache
Accessor for whether the cache is empty.- Returns:
- Whether it is empty.
- See Also:
-
put
Method to put an object in the L2 cache- Parameters:
oid
- The identitypc
- Cacheable form of the PC- Returns:
- Previous value stored for this id
-