Package org.apache.openjpa.persistence
Class StoreCacheImpl
- java.lang.Object
-
- org.apache.openjpa.persistence.StoreCacheImpl
-
- All Implemented Interfaces:
jakarta.persistence.Cache
,StoreCache
public class StoreCacheImpl extends java.lang.Object implements StoreCache
Implements the L2 cache over the data store via delegation to DataCache.- Since:
- 0.4.1
- Author:
- Abe White
-
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.persistence.StoreCache
NAME_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description StoreCacheImpl(EntityManagerFactoryImpl emf, DataCache cache)
Constructor; supply delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.Class cls, java.lang.Object oid)
Whether the cache contains data for the given oid.boolean
containsAll(java.lang.Class cls, java.lang.Object... oids)
Whether the cache contains data for the given oids.boolean
containsAll(java.lang.Class cls, java.util.Collection oids)
Whether the cache contains data for the given oids.boolean
equals(java.lang.Object other)
void
evict(java.lang.Class cls)
void
evict(java.lang.Class cls, java.lang.Object oid)
Remove data for the given oid from the cache.void
evictAll()
Clear the cache.void
evictAll(java.lang.Class cls, java.lang.Object... oids)
Remove data for the given oids from the cache.void
evictAll(java.lang.Class cls, java.util.Collection oids)
Remove data for the given oids from the cache.DataCache
getDelegate()
Delegate.CacheStatistics
getStatistics()
Gets the number of read/write/hit on this receiver in total and per class basis.int
hashCode()
void
pin(java.lang.Class cls, java.lang.Object oid)
Pin the data for the given oid to the cache.void
pinAll(java.lang.Class cls, java.lang.Object... oids)
Pin the data for the given oids to the cache.void
pinAll(java.lang.Class cls, java.util.Collection oids)
Pin the data for the given oids to the cache.void
unpin(java.lang.Class cls, java.lang.Object oid)
Unpin the data for the given oid from the cache.void
unpinAll(java.lang.Class cls, java.lang.Object... oids)
Unpin the data for the given oids from the cache.void
unpinAll(java.lang.Class cls, java.util.Collection oids)
Unpin the data for the given oids from the cache.<T> T
unwrap(java.lang.Class<T> cls)
-
-
-
Constructor Detail
-
StoreCacheImpl
public StoreCacheImpl(EntityManagerFactoryImpl emf, DataCache cache)
Constructor; supply delegate.
-
-
Method Detail
-
getDelegate
public DataCache getDelegate()
Delegate.- Specified by:
getDelegate
in interfaceStoreCache
-
contains
public boolean contains(java.lang.Class cls, java.lang.Object oid)
Description copied from interface:StoreCache
Whether the cache contains data for the given oid.- Specified by:
contains
in interfacejakarta.persistence.Cache
- Specified by:
contains
in interfaceStoreCache
-
containsAll
public boolean containsAll(java.lang.Class cls, java.lang.Object... oids)
Description copied from interface:StoreCache
Whether the cache contains data for the given oids.- Specified by:
containsAll
in interfaceStoreCache
-
containsAll
public boolean containsAll(java.lang.Class cls, java.util.Collection oids)
Description copied from interface:StoreCache
Whether the cache contains data for the given oids.- Specified by:
containsAll
in interfaceStoreCache
-
pin
public void pin(java.lang.Class cls, java.lang.Object oid)
Description copied from interface:StoreCache
Pin the data for the given oid to the cache.- Specified by:
pin
in interfaceStoreCache
-
pinAll
public void pinAll(java.lang.Class cls, java.lang.Object... oids)
Description copied from interface:StoreCache
Pin the data for the given oids to the cache.- Specified by:
pinAll
in interfaceStoreCache
-
pinAll
public void pinAll(java.lang.Class cls, java.util.Collection oids)
Description copied from interface:StoreCache
Pin the data for the given oids to the cache.- Specified by:
pinAll
in interfaceStoreCache
-
unpin
public void unpin(java.lang.Class cls, java.lang.Object oid)
Description copied from interface:StoreCache
Unpin the data for the given oid from the cache.- Specified by:
unpin
in interfaceStoreCache
-
unpinAll
public void unpinAll(java.lang.Class cls, java.lang.Object... oids)
Description copied from interface:StoreCache
Unpin the data for the given oids from the cache.- Specified by:
unpinAll
in interfaceStoreCache
-
unpinAll
public void unpinAll(java.lang.Class cls, java.util.Collection oids)
Description copied from interface:StoreCache
Unpin the data for the given oids from the cache.- Specified by:
unpinAll
in interfaceStoreCache
-
evict
public void evict(java.lang.Class cls, java.lang.Object oid)
Description copied from interface:StoreCache
Remove data for the given oid from the cache.- Specified by:
evict
in interfacejakarta.persistence.Cache
- Specified by:
evict
in interfaceStoreCache
-
evictAll
public void evictAll(java.lang.Class cls, java.lang.Object... oids)
Description copied from interface:StoreCache
Remove data for the given oids from the cache.- Specified by:
evictAll
in interfaceStoreCache
-
evictAll
public void evictAll(java.lang.Class cls, java.util.Collection oids)
Description copied from interface:StoreCache
Remove data for the given oids from the cache.- Specified by:
evictAll
in interfaceStoreCache
-
evictAll
public void evictAll()
Description copied from interface:StoreCache
Clear the cache.- Specified by:
evictAll
in interfacejakarta.persistence.Cache
- Specified by:
evictAll
in interfaceStoreCache
-
unwrap
public <T> T unwrap(java.lang.Class<T> cls)
- Specified by:
unwrap
in interfacejakarta.persistence.Cache
-
getStatistics
public CacheStatistics getStatistics()
Description copied from interface:StoreCache
Gets the number of read/write/hit on this receiver in total and per class basis.- Specified by:
getStatistics
in interfaceStoreCache
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
evict
public void evict(java.lang.Class cls)
- Specified by:
evict
in interfacejakarta.persistence.Cache
-
-