Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ibatis.sqlmap.engine.cache.memory
Class MemoryCacheLevel  view MemoryCacheLevel download MemoryCacheLevel.java

java.lang.Object
  extended bycom.ibatis.sqlmap.engine.cache.memory.MemoryCacheLevel

public final class MemoryCacheLevel
extends java.lang.Object

An enumeration for the values for the memory cache levels


Field Summary
private static java.util.Map cacheLevelMap
           
private  java.lang.String referenceType
           
static MemoryCacheLevel SOFT
          Constant for soft caching.
static MemoryCacheLevel STRONG
          Constant for strong caching.
static MemoryCacheLevel WEAK
          Constant for weak caching This cache model is probably the best choice in most cases.
 
Constructor Summary
private MemoryCacheLevel(java.lang.String type)
          Creates a new instance of CacheLevel
 
Method Summary
static MemoryCacheLevel getByReferenceType(java.lang.String refType)
          Gets a MemoryCacheLevel by name
 java.lang.String getReferenceType()
          Getter for the reference type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheLevelMap

private static java.util.Map cacheLevelMap

WEAK

public static final MemoryCacheLevel 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

public static final MemoryCacheLevel 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

public static final MemoryCacheLevel 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:
  1. very small
  2. absolutely static
  3. used very often
The advantage is that performance will be very good for this particular query. The disadvantage is that if the memory used by these results is needed, then it will not be released to make room for other objects (possibly more important objects).


referenceType

private java.lang.String referenceType
Constructor Detail

MemoryCacheLevel

private MemoryCacheLevel(java.lang.String type)
Creates a new instance of CacheLevel

Method Detail

getReferenceType

public java.lang.String getReferenceType()
Getter for the reference type


getByReferenceType

public static MemoryCacheLevel getByReferenceType(java.lang.String refType)
Gets a MemoryCacheLevel by name