Class ConcurrentFixedCache
- java.lang.Object
-
- org.eclipse.persistence.internal.helper.ConcurrentFixedCache
-
- All Implemented Interfaces:
java.io.Serializable
public class ConcurrentFixedCache extends java.lang.Object implements java.io.SerializableProvide a concurrent fixed size caching mechanism. This is used for caching EJBQL parsed queries, Update calls, and other places a fixed size cache is needed. The default fixed size is 100.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConcurrentFixedCache()Create a new concurrent cache, with a fixed size of 100.ConcurrentFixedCache(int maxSize)Create a new concurrent cache, with the max size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()java.lang.Objectget(java.lang.Object key)Return the pre-parsed query that represents the EJBQL string.java.util.MapgetCache()Return the cache.intgetMaxSize()Return the fixed size of the parse cache.voidput(java.lang.Object key, java.lang.Object value)Add the value to the cache.voidremove(java.lang.Object key)Remove from cache.voidsetMaxSize(int maxSize)Set the fixed size of the parse cache.
-
-
-
Method Detail
-
getMaxSize
public int getMaxSize()
Return the fixed size of the parse cache.
-
setMaxSize
public void setMaxSize(int maxSize)
Set the fixed size of the parse cache. When the size is exceeded, subsequent EJBQL will not be cached. The default size is 100;
-
get
public java.lang.Object get(java.lang.Object key)
Return the pre-parsed query that represents the EJBQL string. If the EJBQL has not been cached, null is returned.
-
clear
public void clear()
-
put
public void put(java.lang.Object key, java.lang.Object value)Add the value to the cache. Remove the
-
remove
public void remove(java.lang.Object key)
Remove from cache.
-
getCache
public java.util.Map getCache()
Return the cache.
-
-