Interface VersionConsistencyCache
-
- All Known Implementing Classes:
VersionConsistencyCacheImpl
public interface VersionConsistencyCache
A cache of "version consistent" StateManager instances. These instances are used so that we can avoid loading state from the database.- Author:
- Dave Bristor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPCType(Class pcType)
Informs the cache to expect that the given pcType will be used as a key for the outer map in subsequentputEntry
operations.StateManager
get(Class pcType, Object oid)
Returns an SM, if found, else null.StateManager
put(Class pcType, Object oid, StateManager sm)
Puts the given StateManager into a map that is keyed by the given OID.StateManager
remove(Class pcType, Object oid)
Removes entry based on pc and oid.void
removePCType(Class pcType)
Removes the map for the given pcType and all its elements.
-
-
-
Method Detail
-
put
StateManager put(Class pcType, Object oid, StateManager sm)
Puts the given StateManager into a map that is keyed by the given OID. We anticipate that implementations will want to use a two-level map, and so the pc's class can be used as a key into a map to access a second map, which would be that keyed by OID.- Parameters:
pcType
- class of instance, used as key in outer map.oid
- Object id, used as key in inner map.sm
- StateManager bound tooid
in inner map.
-
get
StateManager get(Class pcType, Object oid)
Returns an SM, if found, else null.- Parameters:
pcType
- class of instance, used as key in outer map.oid
- Object id, used as key in inner map.
-
remove
StateManager remove(Class pcType, Object oid)
Removes entry based on pc and oid. If map is empty after remove, removes it from its containint map.- Parameters:
pcType
- class of instance, used as key in outer map.oid
- Object id, used as key in inner map.
-
addPCType
void addPCType(Class pcType)
Informs the cache to expect that the given pcType will be used as a key for the outer map in subsequentputEntry
operations.- Parameters:
pcType
- class of instance, used as key in outer map.
-
removePCType
void removePCType(Class pcType)
Removes the map for the given pcType and all its elements.- Parameters:
pcType
- class of instance, used as key in outer map.
-
-