Package org.datanucleus.cache.ehcache
Class EhcacheLevel2Cache
- java.lang.Object
-
- org.datanucleus.cache.AbstractLevel2Cache
-
- org.datanucleus.cache.ehcache.EhcacheLevel2Cache
-
- All Implemented Interfaces:
Serializable,org.datanucleus.cache.Level2Cache
public class EhcacheLevel2Cache extends org.datanucleus.cache.AbstractLevel2CacheSimple implementation of a plugin for use of Ehcache caching product with DataNucleus. Please refer to ehcache.sourceforge.net for full details of their product.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EhcacheLevel2Cache(org.datanucleus.NucleusContext nucleusCtx)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Method to close the cache when no longer needed.booleancontainsOid(Object oid)Accessor for whether the cache contains the specified id.voidevict(Object oid)Evict the parameter instance from the second-level cache.voidevictAll()Evict the parameter instances from the second-level cache.voidevictAll(Class pcClass, boolean subclasses)Evict the parameter instances from the second-level cache.voidevictAll(Object[] oids)Evict the parameter instances from the second-level cache.voidevictAll(Collection oids)Evict the parameter instances from the second-level cache.org.datanucleus.cache.CachedPCget(Object oid)Accessor for an object in the cache.intgetSize()Accessor for the size of the cache.org.datanucleus.cache.CachedPCput(Object oid, org.datanucleus.cache.CachedPC pc)Method to add an object to the cache under its id
-
-
-
Method Detail
-
close
public void close()
Method to close the cache when no longer needed. Provides a hook to release resources etc.
-
containsOid
public boolean containsOid(Object oid)
Accessor for whether the cache contains the specified id.- See Also:
Level2Cache.containsOid(java.lang.Object)
-
get
public org.datanucleus.cache.CachedPC get(Object oid)
Accessor for an object in the cache.- See Also:
Level2Cache.get(java.lang.Object)
-
getSize
public int getSize()
Accessor for the size of the cache.- See Also:
Level2Cache.getSize()
-
put
public org.datanucleus.cache.CachedPC put(Object oid, org.datanucleus.cache.CachedPC pc)
Method to add an object to the cache under its id- Parameters:
oid- The identitypc- The cacheable object
-
evict
public void evict(Object oid)
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
public void evictAll(Class pcClass, boolean subclasses)
Evict the parameter instances from the second-level cache.- Parameters:
pcClass- the class of instances to evictsubclasses- if true, evict instances of subclasses also
-
evictAll
public void evictAll(Collection oids)
Evict the parameter instances from the second-level cache.- Parameters:
oids- the object ids of the instance to evict.
-
evictAll
public void evictAll(Object[] oids)
Evict the parameter instances from the second-level cache.- Parameters:
oids- the object ids of the instance to evict.
-
-