Package org.hibernate.testing.cache
Class MapStorageAccessImpl
- java.lang.Object
-
- org.hibernate.testing.cache.MapStorageAccessImpl
-
- All Implemented Interfaces:
DomainDataStorageAccess
,StorageAccess
public class MapStorageAccessImpl extends java.lang.Object implements DomainDataStorageAccess
StorageAccess impl wrapping a simple data Map (ConcurrentMap)
-
-
Constructor Summary
Constructors Constructor Description MapStorageAccessImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCache(SharedSessionContractImplementor session)
Clear data from the cacheboolean
contains(java.lang.Object key)
Does the cache contain this key?void
evictData()
Clear all data regardless of transaction/lockingvoid
evictData(java.lang.Object key)
Remove the entry regardless of transaction/lockingjava.lang.Object
getFromCache(java.lang.Object key, SharedSessionContractImplementor session)
Get an item from the cache.protected java.util.concurrent.ConcurrentMap
getOrMakeDataMap()
void
putIntoCache(java.lang.Object key, java.lang.Object value, SharedSessionContractImplementor session)
Put an item into the cachevoid
release()
Release any resources.void
removeFromCache(java.lang.Object key, SharedSessionContractImplementor session)
Remove an item from the cache by key-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.cache.spi.support.DomainDataStorageAccess
putFromLoad
-
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.Object key)
Description copied from interface:StorageAccess
Does the cache contain this key?- Specified by:
contains
in interfaceStorageAccess
-
getFromCache
public java.lang.Object getFromCache(java.lang.Object key, SharedSessionContractImplementor session)
Description copied from interface:StorageAccess
Get an item from the cache.- Specified by:
getFromCache
in interfaceStorageAccess
-
putIntoCache
public void putIntoCache(java.lang.Object key, java.lang.Object value, SharedSessionContractImplementor session)
Description copied from interface:StorageAccess
Put an item into the cache- Specified by:
putIntoCache
in interfaceStorageAccess
-
getOrMakeDataMap
protected java.util.concurrent.ConcurrentMap getOrMakeDataMap()
-
removeFromCache
public void removeFromCache(java.lang.Object key, SharedSessionContractImplementor session)
Description copied from interface:StorageAccess
Remove an item from the cache by key- Specified by:
removeFromCache
in interfaceStorageAccess
-
clearCache
public void clearCache(SharedSessionContractImplementor session)
Description copied from interface:StorageAccess
Clear data from the cache- Specified by:
clearCache
in interfaceStorageAccess
-
evictData
public void evictData()
Description copied from interface:StorageAccess
Clear all data regardless of transaction/locking- Specified by:
evictData
in interfaceStorageAccess
-
evictData
public void evictData(java.lang.Object key)
Description copied from interface:StorageAccess
Remove the entry regardless of transaction/locking- Specified by:
evictData
in interfaceStorageAccess
-
release
public void release()
Description copied from interface:StorageAccess
Release any resources. Called during cache shutdown- Specified by:
release
in interfaceStorageAccess
-
-