Class MemoryCacheLevel
java.lang.Object
com.ibatis.sqlmap.engine.cache.memory.MemoryCacheLevel
An enumeration for the values for the memory cache levels.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MemoryCacheLevel
Constant for soft caching.static final MemoryCacheLevel
Constant for strong caching.static final MemoryCacheLevel
Constant for weak caching This cache model is probably the best choice in most cases. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryCacheLevel
getByReferenceType
(String refType) Gets a MemoryCacheLevel by name.Getter for the reference type.
-
Field Details
-
WEAK
Constant for weak caching This cache model is probably the best choice in most cases. It will increase performance for popular results, but it will absolutely release the memory to be used in allocating other objects, assuming that the results are not currently in use. -
SOFT
Constant for soft caching. This cache model will reduce the likelihood of running out of memory in case the results are not currently in use and the memory is needed for other objects. However, this is not the most aggressive cache-model in that regard. Hence, memory still might be allocated and unavailable for more important objects. -
STRONG
Constant for strong caching. This cache model will guarantee that the results stay in memory until the cache is explicitly flushed. This is ideal for results that are:- very small
- absolutely static
- used very often
-
-
Method Details
-
getReferenceType
Getter for the reference type.- Returns:
- the type of reference type used
-
getByReferenceType
Gets a MemoryCacheLevel by name.- Parameters:
refType
- the name of the reference type- Returns:
- the MemoryCacheLevel that the name indicates
-